@bot.command()
async def voto(ctx, id, num_people):
msg = ctx.fetch_message(id)
winners = []
total_users = []
reactions = msg.reactions
for reaction in reactions:
users = await reaction.users().flatten()
for user in users:
total_users.append(user)
for i in range(num_people):
winners.append(i.name)
winners_msg = '\n'.join(winners)
await ctx.send(f"{winners_msg}\nHas won")
我在上面的代码中得到以下错误
File ".\Testing.py", line 24, in voto
reactions = msg.reactions
AttributeError: 'coroutine' object has no attribute 'reactions'
The above exception was the direct cause of the following exception:
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
我想修复但我收到错误请帮助我
我用了翻译器