【发布时间】:2020-01-17 23:46:12
【问题描述】:
所以这就是我目前拥有的,只是它不起作用。它给了我以下错误:
Ignoring exception in command suggestion:
Traceback (most recent call last):
File "C:\Users\user\AppData\Local\Programs\Python\Python38-32\lib\site-
packages\discord\ext\commands\core.py", line 79, in wrapped
ret = await coro(*args, **kwargs)
File "c:/Users/user/OneDrive/Documents/Discord bot/main.py", line 57, in suggestion
await bot.add_reaction(message, ":yes:614465426788843551")
AttributeError: 'Bot' object has no attribute 'add_reaction'
然后我得到另一个错误,同样的事情,但对于:no:。你们能帮忙吗?
代码:
@bot.command(pass_context=True)
async def suggestion(message):
await bot.add_reaction(message, ":yes:614465426788843551")
await bot.add_reaction(message, ":no:614465426381996033")
print('test done')
【问题讨论】:
-
您必须拥有
read_message_history权限才能使用它。如果没有其他人使用此表情符号对消息做出反应,则需要add_reactions权限。 -
我已经做到了。它仍然给出错误
-
有一个
AttributeError因为Bot方法不再存在。该问题与权限无关。
标签: python discord discord.py discord.py-rewrite