I have a slash command that produces a response then adds reactions to that response. When a user reacts to the response I want to be able to refer back to the options used in the slash command while handling the on_reaction_add event. With the reaction object that is returned from the event I am able to get some info from the response message from the command but I am not able to get data about the command it is responding to.
My current work around is to save the command options and message id externally. Then during the handling of a on_reaction_add event I check if the message id matches to an id that was used to issue a command and pull up the options I have saved. I would like help to know if my work around is an efficient way to handle my case or am I missing something when it comes to fetching submitted values from options in a slash_command.
#Get submitted slash command options from message id
1 messages · Page 1 of 1 (latest)
Let me get this straight
I send a / command which has options
The bot responds and adds reactions to its own message
Amd the user reacts
And you want to do X thing depending on the reaction and the user options
not based on the reaction but based on the options used in the / command
Is there a reason that you are using reactions instead of buttons?
What you are trying to do would probably be much easier with views/buttons
Unless the user might not press the reaction for a very long time
it should be within an hour
So unless you make the views persistent, when the bot restarts the button will no longer work (until they run the command again)