moymo,Docs
Skip to content
Components

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
componentsThe buttons or the menu

Button ​

type: 2.

FieldTypeDescription
styleinteger1 primary, 2 secondary, 3 success, 4 danger, 5 link
labelstringUp to 80 characters. A label or an emoji is required
emojiobject{ "name": "🎲" }
custom_idstring1 to 100 characters, unique in the message. Required on styles 1 to 4, not allowed on a link
urlstringhttps, up to 512 characters. Required on a link, not allowed on the others
disabledbooleanDefault false

Interaction: type 3, data = { custom_id, component_type: 2 }.

String select ​

type: 3. In a message and in a modal.

FieldTypeDescription
custom_idstring1 to 100 characters
optionsarray1 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
placeholderstringUp to 150 characters
min_valuesinteger0 to 25, default 1
max_valuesinteger1 to 25, default 1, and not more than the number of options
requiredbooleanIn a modal only, default true
disabledbooleanIn 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.

FieldTypeDescription
custom_id, placeholder, min_values, max_values, disabledAs for a string select
default_valuesarrayUp to max_values of { id, type } with type user, role or channel
channel_typesarrayChannel 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.

FieldTypeDescription
custom_idstring1 to 100 characters, unique in the form
styleinteger1 short, 2 paragraph
labelstringUp to 45 characters (row layout)
min_length, max_lengthinteger0 to 4000 and 1 to 4000
requiredbooleanDefault true
valuestringPrefilled text
placeholderstringUp to 100 characters

Label ​

type: 18. Modals only.

Field
labelUp to 45 characters
descriptionUp to 100 characters
componentA 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 messageText
text
components[0].components[1].custom_id is used by another component of the message.

The wiki is for Moymo's members and developers. Something wrong or missing? Use "Suggest a change" on any page.