【发布时间】:2020-08-14 05:04:58
【问题描述】:
我目前正在为我的服务器开发自定义不和谐机器人。我正在(尝试)创建一个投票系统。所以用户做-poll yn poll question。 yn 部分描述了问题的类型,例如是/否。这是我目前所拥有的:
@client.command()
async def poll(ctx, typee, *, msgg):
if typee=='yn':
msg = await ctx.channel.send("@everyone " + msgg)
reactions = ['a']
for emoji in reactions:
await client.add_reaction(msg, emoji)
await ctx.message.delete()
运行时出现错误:
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Bot' object has no attribute 'add_reaction'
我正在使用 rewrite 和 python 3.8.1
【问题讨论】:
标签: python discord discord.py discord.py-rewrite python-3.8