Modal (Form) Interaction
Basic Information
This trigger type will trigger when a user submits a modal.
Syntax
the value is the modal id, for example:
modal_1
-> will trigger only when a user submits a modal with id modal_1
modal_1|modal_2
-> will trigger only when a user submits a modal with id modal_1
or modal_2
Example
$button
let's first send a button (with id apply-form) using$modal
let's make a command to send a modal (with id mymodal) when user click the button usingAnd that's what will happen when user click on the button
now let's make a new command to respond to the modal submit
Trigger type to be Modal
, Trigger value to be the modal id, in this case mymodal
To get what user input in the modal, we will use $modalAnswer
now save and test by submitting the modal
that's it! 🎉
Some functions related to Modal Trigger
$modalID: Return the modal's id that triggered the command
$modalAnswer: Return a data user input in submitting the modal
DANGER
You need to send a modal with $modal within 1 second of button/menu/slash execution