【发布时间】:2021-02-20 07:24:48
【问题描述】:
我正在尝试使用 discord.py 命令扩展中的内置帮助命令,但我似乎无法加载 cog,因此我可以对命令进行排序。这是我当前的代码:
bot = commands.Bot(command_prefix='fd!', description=description, intents=intents)
class Testing(commands.Cog):
def __init__(self, bot):
self.bot = bot
self._last_member = None
@commands.command(description = "Sends a test message")
async def test(ctx):
await message.channel.send("Test")
#extra code for other un-grouped commands here
def setup(bot):
bot.add_cog(Testing(bot))
#bot.run stuff here
我错过了什么吗?当我运行命令 (fd!test) 时,它说该命令不存在,而当我运行 fd!help 时,它没有列出,cog 也没有。
帮助表示赞赏!
【问题讨论】:
标签: python python-3.x discord discord.py