你好,我正在用Python制作一个Discord机器人,代码如下:
embed = discord.Embed(title=f'Topic: {tema.capitalize()}',
description='The word has ' + str(len(secretWord)) + ' letters',
color=discord.Color.yellow())
msg = await interaction.response.send_message(embed=embed)
await msg.add_reaction('regional_indicator_1:')
它给了我以下我无法理解的错误:
discord.app_commands.errors.CommandInvokeError:命令“hm”引发异常:AttributeError:“NoneType”对象没有属性“add_reaction”
代码的目的是将表情符号发送到嵌入,但错误表明没有这样的属性。嵌入发送成功,但表情符号出现错误。
我阅读了文档,但它不起作用。我已经尝试将其保存在变量中,但它不起作用。
文档:https://discordpy.readthedocs.io/en/stable/interactions/api.html?highlight=add_reaction#interaction