简体   繁体   中英

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM