Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you have a Discord bot remove a user reaction to a message in discord.py?

I'm using an @client.event and using async def on_raw_reaction_add(payload): to read Discord reaction events. I need to be able to delete a user reaction when they fail one of the flags in my code. I saw in the documentation that there is await remove(user) but I don't think I'm using it right. Any suggestions?

like image 347
Charlie Watson Avatar asked Dec 08 '25 01:12

Charlie Watson


1 Answers

You can use either Message.remove_reaction or Reaction.remove.

A Reaction object represents a specific emoji reaction to a Message, so if the Reaction object you have is not for the emoji reaction that you want to remove, using Reaction.remove will attempt to remove the wrong emoji reaction.

like image 124
Harmon758 Avatar answered Dec 10 '25 13:12

Harmon758



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!