首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >斜杠命令与斜杠命令组共享名称?

斜杠命令与斜杠命令组共享名称?
EN

Stack Overflow用户
提问于 2022-05-15 04:12:17
回答 1查看 638关注 0票数 1

有没有办法让斜杠命令与斜杠命令组共享名称?我希望能够有一个命令/settings,它将列出当前的设置,但也有像/settings offset/settings channel这样的命令来更改这些设置。

我现在有一个齿轮

代码语言:javascript
复制
    @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"""

但是试图用这个齿轮运行机器人会导致错误。

代码语言:javascript
复制
discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In 4: Application command names must be unique

有办法用Pycord来解决这个问题吗?谢谢!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-05-16 22:11:13

这是一个不和谐的限制

目前,由于不和谐的限制,无法在Slash命令组中调用基本命令。因此,这也将转化为糟糕的请求错误。

使用子命令或子命令组将使基本命令不可用。如果您还将/permissions添加为子命令或子命令组,则不能将基本的/permissions命令作为有效命令发送

文档

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72245464

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档