Skip to content

Structures

Objects that appear inside components.

Represents an image, video or file. Used by Thumbnail, Media Gallery and File.

You only send url. Discord fills in the rest when it returns the message.

Field Type Description
url string required An https:// URL or attachment://file-name.
proxy_url string URL through Discord’s media proxy.
height integer or null Height (images and videos).
width integer or null Width (images and videos).
placeholder string Blurry preview (Thumbhash) to show while loading.
placeholder_version integer Placeholder version.
content_type string File type (for example image/png).
flags integer Info bits. IS_ANIMATED = 1 << 0.
content_scan_metadata object Result of Discord’s content scan (explicit, gore or self-harm content).
attachment_id snowflake Only if the file is an uploaded attachment.
What you send
{ "url": "attachment://photo.png" }

Used by buttons and menu options.

Field Type Description
name string The Unicode emoji ("🎉") or the custom emoji’s name.
id snowflake optional Custom emojis only.
animated boolean optional Whether the custom emoji is animated.
{ "name": "🎉" }
{ "name": "happy_pepe", "id": "123456789012345678", "animated": false }
Field Type Description
label string required Max 100 characters.
value string required Max 100 characters.
description string optional Max 100 characters.
emoji partial emoji optional
default boolean optional Selected at first.
Field Type Description
value string required Max 100 characters.
label string required Max 100 characters.
description string optional Max 100 characters.
default boolean optional Checked at first.

For User, Role, Mentionable and Channel Select.

Field Type Description
id snowflake User, role or channel ID.
type string "user", "role" or "channel".
Flag Value Purpose
SUPPRESS_EMBEDS 4 (1 << 2) Don’t show link previews.
EPHEMERAL 64 (1 << 6) Only the interaction user sees it.
SUPPRESS_NOTIFICATIONS 4096 (1 << 12) Silent message.
IS_COMPONENTS_V2 32768 (1 << 15) Enables Components V2.

Flags are added together (or combined with |): V2 + ephemeral = 32768 + 64 = 32832.

Name Value
PING 1
APPLICATION_COMMAND 2
MESSAGE_COMPONENT 3
APPLICATION_COMMAND_AUTOCOMPLETE 4
MODAL_SUBMIT 5
Name Value
PONG 1
CHANNEL_MESSAGE_WITH_SOURCE 4
DEFERRED_CHANNEL_MESSAGE_WITH_SOURCE 5
DEFERRED_UPDATE_MESSAGE 6
UPDATE_MESSAGE 7
APPLICATION_COMMAND_AUTOCOMPLETE_RESULT 8
MODAL 9
LAUNCH_ACTIVITY 12