【发布时间】:2022-12-03 13:22:34
【问题描述】:
我想在我的机器人中创建一个上下文菜单。例如,他拿了文档code。
@app_commands.context_menu(name='react')
async def react_(self, interaction: discord.Interaction, message: discord.Message):
await interaction.response.send_message('Very cool message!', ephemeral=True)
但是在控制台启动代码时,出现如下错误:TypeError: context menus cannot be defined inside a class。我怎样才能解决这个问题?
【问题讨论】:
标签: discord.py