Modals
Modals are popup forms that can be used to collect user input.
Modals are popup forms that can be used to collect user input. They are created by extending the Modal
class, and adding a title
and components
property. All the components must be TextInput
classes.
Modals are automatically registered when they are shown to a user. The registration happens when you call showModal
on an interaction.
Custom ID System
Modals use the same custom ID system as components, allowing you to pass data along with the modal. The format is:
For example, if you have a modal that needs to know which user to edit, you could do:
The custom ID parser will automatically convert:
true
andfalse
to booleans- Numbers to numbers
- Everything else to strings
You can also override the customIdParser
method if you want to use a different format for your custom IDs.
Last updated on