API reference
Objects
The shapes a bot puts in a message or a command: embeds, buttons, menus and polls.
Embed
Discord's rich embed, as a bot sends it in embeds (up to 10 per message, 6000 characters of text in all). Pictures are http(s) addresses or attachment://<file name> of the same message. Clients never contact your address: they get a signed link on tether's picture proxy (the proxy can be switched off by the server, then pictures are not shown). Keys tether does not know are dropped, null counts as absent.
Fields
type"rich"titlestring · 1 to 256 charactersdescriptionstring · 1 to 4096 charactersurlstring · max 2048 characterscolorinteger · 0 to 16777215timestampstringfieldsarray of object · max 25 itemsfields[].namestring · 1 to 256 charactersrequiredfields[].valuestring · 1 to 1024 charactersrequiredfields[].inlinebooleanauthorobjectauthor.namestring · 1 to 256 charactersrequiredauthor.urlstring · max 2048 charactersauthor.icon_urlstring · max 2048 charactersthumbnailobject- https address or attachment://name
imageobject- https address or attachment://name
footerobjectfooter.textstring · 1 to 2048 charactersrequiredfooter.icon_urlstring · max 2048 characters
Example
{
"title": "Now playing",
"description": "Harder Better Faster",
"color": 3447003,
"fields": [
{
"name": "Artist",
"value": "Daft Punk",
"inline": true
}
],
"footer": {
"text": "Requested by josh"
}
}
Components
Buttons and menus, in components: up to 5 action rows, a row holds up to 5 buttons (styles 1 to 4, or a link button, style 5, with a url) or one string menu or picker, and every custom_id in a message is different. tether_toggle on a button makes an On/Off switch. A press reaches you as INTERACTION_CREATE type 3. With the flag IS_COMPONENTS_V2 the components are a rich post instead.
Example
[
{
"type": 1,
"components": [
{
"type": 2,
"style": 1,
"label": "Skip",
"custom_id": "skip"
},
{
"type": 2,
"style": 4,
"label": "Stop",
"custom_id": "stop"
}
]
}
]
Action row
One row of Components.
Fields
type1requiredcomponentsarray of object · 1 to 5 itemsrequired
Example
{
"type": 1,
"components": [
{
"type": 2,
"style": 2,
"label": "More",
"custom_id": "more"
}
]
}
Picker
Discord's user (5), role (6), mentionable (7) and channel (8) select menus, in an action row, a setting field or a form's Label. The app lists only what the person pressing can see; the server checks every id and the bot gets data.values and data.resolved. default_values ({id, type}, type user, role or channel) are what it starts with; channel_types limits a channel picker. Up to 25 values.
Fields
idintegertype5 | 6 | 7 | 8requiredcustom_idstring · 1 to 100 charactersrequiredplaceholderstring · max 150 charactersmin_valuesinteger · 0 to 25max_valuesinteger · 1 to 25default_valuesarray of object · max 25 itemsdefault_values[].idstringrequireddefault_values[].type"user" | "role" | "channel"requiredchannel_typesarray of integer · max 20 itemsdisabledboolean
Example
{
"type": 8,
"custom_id": "set:panel",
"channel_types": [
0
],
"default_values": [
{
"id": "123456789012345678",
"type": "channel"
}
]
}
Rich post
The components of a message with the flag IS_COMPONENTS_V2 (32768): Discord's components v2 (Container 17, Section 9, Text Display 10, Thumbnail 11, Media Gallery 12, Separator 14, Action Row 1) and tether's Row 1001, Author 1002 and setting field 1003. A Section's accessory may be a button or an action row of buttons; tether_toggle on a button makes an On/Off switch. tether's limits: 250 pieces (a gallery's pictures count), 100 pieces in one card, 30 pictures from web addresses, 16,000 characters of text, nesting 6 deep, 10 buttons a row, 100 menu options. No content or embeds beside it.
Example
[
{
"type": 17,
"accent_color": 9141494,
"components": [
{
"type": 10,
"content": "## Tickets dashboard"
},
{
"type": 14
},
{
"type": 9,
"components": [
{
"type": 10,
"content": "**Support** · 2 questions"
}
],
"accessory": {
"type": 1,
"components": [
{
"type": 2,
"style": 2,
"label": "Edit",
"custom_id": "type:edit:1"
},
{
"type": 2,
"style": 2,
"label": "On",
"custom_id": "type:on:1",
"tether_toggle": true
}
]
}
}
]
}
]
Setting field
Tether-only (type 1003): a settings row in a rich post: a label, the current value and a chevron. Its component is a string menu (the value is its default option), a picker (the value is its default_values as chips) or a button (usually an On/Off switch, tether_toggle). Pressing it opens its list right under it.
Fields
idintegertype1003requiredlabelstring · 1 to 80 charactersrequireddescriptionstring · 1 to 200 characterscomponentobjectrequired
Example
{
"type": 1003,
"label": "Staff roles",
"component": {
"type": 6,
"custom_id": "set:staff",
"min_values": 0,
"max_values": 5
}
}
Application command option
An option of a slash command, Discord's type numbers: 1 sub command, 2 group, 3 string, 4 integer, 5 boolean, 6 user, 7 channel, 8 role, 9 mentionable, 10 number, 11 attachment. Required options come before optional ones; up to 25 options and 25 choices (not together with autocomplete).
Fields
typeinteger · 1 to 11requirednamestringrequiredname_localizationsobject | nulldescriptionstring · 1 to 100 charactersrequireddescription_localizationsobject | nullrequiredboolean | nullchoicesarray of object | null · max 25 itemsoptionsarray of any | null · max 25 itemschannel_typesarray of integer | null · max 32 itemsmin_valuenumber | nullmax_valuenumber | nullmin_lengthinteger | null · 0 to 6000max_lengthinteger | null · 1 to 6000autocompleteboolean | null
Example
{
"type": 3,
"name": "song",
"description": "What to play",
"required": true,
"autocomplete": true
}
Poll
The poll of Create Message (Discord's poll create request). The message needs no text.
Fields
questionobjectrequiredquestion.textstring · 1 to 300 charactersrequiredanswersarray of object · 1 to 10 itemsrequiredanswers[].poll_mediaobjectrequiredanswers[].poll_media.textstring · 1 to 55 charactersrequiredanswers[].poll_media.emojiobjectdurationinteger · 1 to 768 · default 24allow_multiselectboolean · default falselayout_type1 · default 1
Example
{
"question": {
"text": "Pizza or pasta?"
},
"answers": [
{
"poll_media": {
"text": "Pizza"
}
},
{
"poll_media": {
"text": "Pasta"
}
}
],
"duration": 24
}