有没有办法让斜杠命令与斜杠命令组共享名称?我希望能够有一个命令/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"""但是试图用这个齿轮运行机器人会导致错误。
discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In 4: Application command names must be unique有办法用Pycord来解决这个问题吗?谢谢!
发布于 2022-05-16 22:11:13
这是一个不和谐的限制
目前,由于不和谐的限制,无法在Slash命令组中调用基本命令。因此,这也将转化为糟糕的请求错误。
使用子命令或子命令组将使基本命令不可用。如果您还将/permissions添加为子命令或子命令组,则不能将基本的/permissions命令作为有效命令发送
https://stackoverflow.com/questions/72245464
复制相似问题