Skip to content
Advertisement

Retrieving a message from on_raw_reaction_add discord.py

I’ve been trying to make it so the bot removes the reaction using discord.Message.remove_reaction(), but I can’t find a way to actually retrieve and store the message in a variable. Does anybody know how to do this?

Here is the code I have so far:

JavaScript

Advertisement

Answer

on_raw_reaction_add returns a RawReactionActionEvent which has a message_id attribute. You can pass it to discord.abc.Messageable.fetch_message to retreive the message :

JavaScript

Reference : discord.py documentation

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement