This Section will explain how setup a Modal, and show that to the User and also fetch what the User Inputed into the Modal.
- To be able to receive a Modal, a normal Prefix Command is not working, you will need some kind of Interaction.
- This can be a Slash command, Button or Select Menu.
Interaction [Event]Block we will use the
Create Modal Input FieldBlock to create Text Inputs for the Modal, you can customize these to your liking.
After that, add each Input Field Object to a List that you create using the
Create ListBlock and add them using the
Add Item to ListBlock.
After all that you use the
Create and Show ModalBlock to finish the Modal and show it to the User.
(Defering or Replying to the Interaction is not needed right now, but later...)
Reacting to the Modal¶
You just use the
Interaction [Event]again, set it to Modal, and enter CustomID of the Modal.
Then use the
Get Modal Argument by Nameto get both Field Inputs, and use them as you like. In this Example we will add them together using
Merge Texts (Advanced).
After that Reply to the Interaction to tell the User that we received the Input!