tether developers
Contents

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 characters
descriptionstring · 1 to 4096 characters
urlstring · max 2048 characters
colorinteger · 0 to 16777215
timestampstring
fieldsarray of object · max 25 items
fields[].namestring · 1 to 256 charactersrequired
fields[].valuestring · 1 to 1024 charactersrequired
fields[].inlineboolean
authorobject
author.namestring · 1 to 256 charactersrequired
author.urlstring · max 2048 characters
author.icon_urlstring · max 2048 characters
thumbnailobject
https address or attachment://name
imageobject
https address or attachment://name
footerobject
footer.textstring · 1 to 2048 charactersrequired
footer.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

type1required
componentsarray 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

idinteger
type5 | 6 | 7 | 8required
custom_idstring · 1 to 100 charactersrequired
placeholderstring · max 150 characters
min_valuesinteger · 0 to 25
max_valuesinteger · 1 to 25
default_valuesarray of object · max 25 items
default_values[].idstringrequired
default_values[].type"user" | "role" | "channel"required
channel_typesarray of integer · max 20 items
disabledboolean

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

idinteger
type1003required
labelstring · 1 to 80 charactersrequired
descriptionstring · 1 to 200 characters
componentobjectrequired

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 11required
namestringrequired
name_localizationsobject | null
descriptionstring · 1 to 100 charactersrequired
description_localizationsobject | null
requiredboolean | null
choicesarray of object | null · max 25 items
optionsarray of any | null · max 25 items
channel_typesarray of integer | null · max 32 items
min_valuenumber | null
max_valuenumber | null
min_lengthinteger | null · 0 to 6000
max_lengthinteger | null · 1 to 6000
autocompleteboolean | 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

questionobjectrequired
question.textstring · 1 to 300 charactersrequired
answersarray of object · 1 to 10 itemsrequired
answers[].poll_mediaobjectrequired
answers[].poll_media.textstring · 1 to 55 charactersrequired
answers[].poll_media.emojiobject
durationinteger · 1 to 768 · default 24
allow_multiselectboolean · default false
layout_type1 · default 1

Example

{
  "question": {
    "text": "Pizza or pasta?"
  },
  "answers": [
    {
      "poll_media": {
        "text": "Pizza"
      }
    },
    {
      "poll_media": {
        "text": "Pasta"
      }
    }
  ],
  "duration": 24
}