I'm using Discord.py Rewrite and I want to check if the message that a user reacts to is the same message that my bot sends by using reaction.message == msg
in my check function. For some reason, this returns "False" despite having identical results when printing each individually. I can get the check to return True by typecasting each into a string, but I would like to understand why reaction.message
is different to msg
before typecasting.
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)