Pycord:斜杠命令与斜杠命令组共享一个名称?
Pycord: Slash command sharing a name with a slash command group?
有没有办法让斜线命令与斜线命令组共享一个名称?我希望能够有一个命令 /settings
来列出当前设置,但也有像 /settings offset
和 /settings channel
这样的命令来改变这些设置。
我目前有一个齿轮
@commands.slash_command()
async def settings(self, ctx: discord.ApplicationContext):
"""See the settings for this server"""
settings_group = discord.commands.SlashCommandGroup("settings", "Change the settings for this server")
@settings_group.command()
async def offset(self, ctx: discord.ApplicationContext, offset: int):
"""Set the UTC offset for this server"""
@settings_group.command()
async def channel(self, ctx: discord.ApplicationContext, channel):
"""Set the reminder channel for this server"""
但尝试 运行 带有此 cog 的机器人给出错误
discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In 4: Application command names must be unique
有没有办法使用 Pycord 解决这个问题?谢谢!
这是 Discord 限制
目前,由于 Discord 限制,无法调用 Slash 命令组中的基本命令。因此,这也会转化为错误请求错误。
Using subcommands or subcommand groups will make your base command unusable. You can't send the base /permissions command as a valid command if you also have /permissions add | remove as subcommands or subcommand groups
有没有办法让斜线命令与斜线命令组共享一个名称?我希望能够有一个命令 /settings
来列出当前设置,但也有像 /settings offset
和 /settings channel
这样的命令来改变这些设置。
我目前有一个齿轮
@commands.slash_command()
async def settings(self, ctx: discord.ApplicationContext):
"""See the settings for this server"""
settings_group = discord.commands.SlashCommandGroup("settings", "Change the settings for this server")
@settings_group.command()
async def offset(self, ctx: discord.ApplicationContext, offset: int):
"""Set the UTC offset for this server"""
@settings_group.command()
async def channel(self, ctx: discord.ApplicationContext, channel):
"""Set the reminder channel for this server"""
但尝试 运行 带有此 cog 的机器人给出错误
discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In 4: Application command names must be unique
有没有办法使用 Pycord 解决这个问题?谢谢!
这是 Discord 限制
目前,由于 Discord 限制,无法调用 Slash 命令组中的基本命令。因此,这也会转化为错误请求错误。
Using subcommands or subcommand groups will make your base command unusable. You can't send the base /permissions command as a valid command if you also have /permissions add | remove as subcommands or subcommand groups