0
votes

I'm trying to make an 'accept/decline' embed with reactions, but I cannot get with which emoji the user reacted.

message = await guild.owner.send(embed=embed)

await message.add_reaction('✔')
await message.add_reaction('❌')

def check(reaction, user):
    print(f"reacted")
    return guild.owner == message.author and str(reaction.emoji) in ["✔", "❌"] and isinstance(message.channel, discord.DMChannel)

reaction, user = await bot.wait_for('reaction_add', timeout=1000.0, check=check)

if reaction.emoji == "✔":
    print("tick")
elif reaction.emoji == "❌":
    print("cross")

I get the

reacted

but I don't get anything in what refers to the cross and tick. Is there any way to get it?

Thanks in advance

1
It seems like return statement of the check function is not going off. I would try printing out the result of itGraygood
@Graygood I tried but it only worked if I reacted with cross. With tick it stayed the same. I tried making a print("code continued running") after the function, but it only ran when I reacted with crossRafael Bradley
Try switching elif part to just if, cause right now it goes into this if statement only onceGraygood
Could you share the function it's in? which I assume also would include the embedLemon.py

1 Answers

1
votes

Simply do the same you did in the check func, also discord by default doesn't have this reaction ✔ you're looking for ✅.

if str(reaction) == '❌': # or str(reaction.emoji)
    print('cross')
elif str(reaction) == '✅':
    print('tick')