我正在使用Discord.py Rewrite,我想检查用户作出反应的消息是否与我的机器人通过在我的检查功能中使用reaction.message == msg
发送的消息相同。由于某些原因,尽管单独打印每个结果都相同,但返回“ False”。我可以通过将每个类型强制转换为字符串来获取返回True的检查,但是我想了解为什么reaction.message
与msg
不同在类型强制转换之前。
def check(reaction,user):
print("Reaction message: ",reaction.message)
print("Original Message: ",msg)
print(msg == reaction.message)
return user != client.user and msg == reaction.message
msg = await ctx.send("test")
await msg.add_reaction('\u2705')
await msg.add_reaction('\u274C')
reaction,user = await client.wait_for('reaction_add',check = check)