简体   繁体   中英

How Do I Show A Modal On Reaction Discord.js

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: 在此处输入图像描述

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