Components
Modals
Modals
Modals in Seyfert allow you to request structured user input through a popup interface. Seyfert extends the traditional Discord modal system by supporting new component types and a more flexible builder structure.
A modal can contain multiple types of interactive components:
- TextInput
- StringSelectMenu
- RoleSelectMenu
- ChannelSelectMenu
- UserSelectMenu
- MentionableSelectMenu
- FileUpload
- TextDisplay (static text)
All interactive components are placed in a modal by wrapping them inside a Label.
Creating a Modal
A modal is created with the Modal class:
Each component must be wrapped in a Label:
1. Text Input Modals
This is the traditional Discord-style modal.
Example
Sending the modal
2. Static Text Modal (TextDisplay)
TextDisplay allows you to show static text inside a modal.
Example
3. String Select Menu Modal
A select menu with predefined string options.
Example
4. Role Select Menu Modal
Example
5. Channel Select Menu Modal
Example
6. User Select Menu Modal
Example
7. Mentionable Select Menu Modal
Example
8. File Upload Modal
Example
Handling Modals
Modals are handled using the ModalCommand class.
Example
Triggering Modals From Component Collectors
This method works for all modal types.