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

被刻印的时光 ゝ 提交于 2021-01-05 09:14:05

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/59512455/how-do-you-have-a-discord-bot-remove-a-user-reaction-to-a-message-in-discord-py

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!