Component reference ​
The shapes, numbers and limits are Discord's, so components written for Discord work unchanged. Layout components (containers, sections, text displays, galleries, separators, thumbnails, files) and file uploads are not supported yet: a message that has one is refused with a sentence that says so.
Action row ​
type: 1. A row holds up to 5 buttons, or one select menu and nothing else. A message has up to 5 rows.
| Field | |
|---|---|
components | The buttons or the menu |
Button ​
type: 2.
| Field | Type | Description |
|---|---|---|
style | integer | 1 primary, 2 secondary, 3 success, 4 danger, 5 link |
label | string | Up to 80 characters. A label or an emoji is required |
emoji | object | { "name": "🎲" } |
custom_id | string | 1 to 100 characters, unique in the message. Required on styles 1 to 4, not allowed on a link |
url | string | https, up to 512 characters. Required on a link, not allowed on the others |
disabled | boolean | Default false |
Interaction: type 3, data = { custom_id, component_type: 2 }.
String select ​
type: 3. In a message and in a modal.
| Field | Type | Description |
|---|---|---|
custom_id | string | 1 to 100 characters |
options | array | 1 to 25 of { label, value, description?, emoji?, default? }. label and value are 1 to 100 characters, description up to 100. Values are unique in the menu |
placeholder | string | Up to 150 characters |
min_values | integer | 0 to 25, default 1 |
max_values | integer | 1 to 25, default 1, and not more than the number of options |
required | boolean | In a modal only, default true |
disabled | boolean | In a message only |
Interaction: data = { custom_id, component_type: 3, values: [ … ] }.
User, role, mentionable and channel selects ​
type: 5 (user), 6 (role), 7 (mentionable), 8 (channel). Messages only.
| Field | Type | Description |
|---|---|---|
custom_id, placeholder, min_values, max_values, disabled | As for a string select | |
default_values | array | Up to max_values of { id, type } with type user, role or channel |
channel_types | array | Channel menus only: TEXT, VOICE, FORUM, TODO, DOC, CALENDAR, PARTY, GALLERY, CATEGORY |
Interaction: data = { custom_id, component_type, values: [ids…], resolved }, where resolved has users, roles or channels keyed by id.
Text input ​
type: 4. Modals only. See Using modals.
| Field | Type | Description |
|---|---|---|
custom_id | string | 1 to 100 characters, unique in the form |
style | integer | 1 short, 2 paragraph |
label | string | Up to 45 characters (row layout) |
min_length, max_length | integer | 0 to 4000 and 1 to 4000 |
required | boolean | Default true |
value | string | Prefilled text |
placeholder | string | Up to 100 characters |
Label ​
type: 18. Modals only.
| Field | |
|---|---|
label | Up to 45 characters |
description | Up to 100 characters |
component | A text input or a string select |
Errors ​
A component that breaks a rule is refused as a whole, with a sentence that names it, for example:
The sentence in the error's
messageTexttext
components[0].components[1].custom_id is used by another component of the message.