【发布时间】:2020-08-25 15:40:31
【问题描述】:
@bot.command()
async def vote(reaction, ctx) :
vote = ctx.message.content[4:].split(" / ")
await ctx.send(ctx.channel, "[Vote] - " + vote[0])
for i in range(1, len(vote)) :
choose = await ctx.send(ctx.channel, "```" + vote[i] + "```")
await ctx.add_reaction(choose, "⭕")
await ctx.add_reaction(choose, "❌")
我得到错误:
Command raised an exception: AttributeError: 'str' object has no attribute 'message'
执行代码时出现以下错误。
它是在我输入这些代码之前执行的。
最后,add_reaction 功能不会在 discord 中运行。
我该如何解决这个错误?
【问题讨论】:
标签: python discord discord.py