Components overview
Components are the interactive parts of your messages and forms: buttons and select menus on a message, text inputs and menus in a modal. A member uses one, and your application receives an interaction carrying the custom_id you gave it.
What exists
| Component | Type | Where | |
|---|---|---|---|
| Action row | 1 | Message | Holds up to 5 buttons, or one menu |
| Button | 2 | Message | Primary, secondary, success, danger or a link |
| String select | 3 | Message, modal | A menu of up to 25 options you define |
| Text input | 4 | Modal | One line or a paragraph |
| User select | 5 | Message | Choose members of the server |
| Role select | 6 | Message | Choose roles |
| Mentionable select | 7 | Message | Choose members or roles |
| Channel select | 8 | Message | Choose channels |
| Label | 18 | Modal | Wraps one input or menu with a label and a description |
Each page of this guide goes deeper:
- Using message components: buttons and menus on messages.
- Using modal components: forms.
- Component reference: every field and limit.
How a press reaches you
- Your bot writes a message with
components(Create message, or in an interaction response). - A member presses a button. Their program tells Moymo; Moymo checks that the component is on that message, is not disabled, and (for a menu) that the choice is one of the options, then sends you an interaction of type 3.
- You answer: a new message, an update of the message, a form, or an acknowledgement.
Only your application hears of presses on your messages. A press on a component that is not on the message, or one a member's program made up, never reaches you.
Custom IDs
A custom_id is up to 100 characters that you choose; it comes back to you unchanged when the component is used. It has to be unique in its message. A good custom_id carries what you need to continue, because your program may have been restarted since the message was written: vote:poll-17:yes rather than yes.
Limits
| Rows on a message | 5 |
| Buttons in a row | 5 |
| Menus in a row | 1 (and nothing else in that row) |
| Options in a string menu | 25 |
| Values chosen in a menu | up to 25 |
custom_id | 100 characters |
Where members can use them
Buttons and menus are shown by Moymo for Windows, in the Servers add-on 1.19.0 or newer. A message with components still shows its text (and embeds) to everyone; a member on an older version simply does not see the controls. Layout components (containers, sections, galleries) are not supported yet.