在等待对机器人之前发送给用户 dms 的消息做出反应时出现此错误
reaction = await client.wait_for("reaction_add")
if str(reaction.emoji) == "1️⃣":
await player.user.send("you have selected %s lol"%(members[0]))
Error:
'tuple' object has no attribute 'emoji'
答案 0 :(得分:1)
等待响应时,wait_for
方法返回两个值 - discord.Reaction
和 discord.User
实例。要修复您的代码:
reaction, user = await client.wait_for("reaction_add")