[SOLVED] How Do I Show A Modal On Reaction Discord.js


This Content is from Stack Overflow. Question asked by IcyPickle

I Was Wondering How Do I Show A Discord.js Modal To A User That Reacted To A Message, My Use Is: Someone Posts Something, If A Mod Reacts With A Warning Sign, It Will Show A Mod A Modal To Type The Reason For The Warning, I Know How To Do That Stuff, But What I Am Looking For How To Do Is Only Showing The Modal On Reaction, So Please Someone Tell Me If It’s Possible Or Not, If It Is Show Me How, Thank You.


Modals can only be triggered through responses to interactions started by users. This is to prevent bots from opening modals at will and spamming users with stuff on their screens. Currently, emoji reactions to messages are not considered Interactions, and therefore you cannot trigger modals from them.

For the use case you described, in which you want moderators to be able to trigger actions from a user’s message, you might want to experiment with Message Commands, which can be triggered by right-clicking any message and selecting the command. These will fire an Interaction that you can reply to with a modal.

Here’s an example of how Message Commands look like: enter image description here

This Question was asked in StackOverflow by IcyPickle and Answered by Pedro Fracassi It is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?