Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions docs/components/reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ All components have the following fields:

The `id` field is optional and is used to identify components in the response from an interaction that aren't interactive components. The `id` must be unique within the message and is generated sequentially if left empty. Generation of `id`s won't use another `id` that exists in the message if you have one defined for another component.

::: info
Messages preceding components V2 will contain an `id` of `0`, sending `0` is allowed but will be incremented to `1` then follow the numbering rule mentioned above.
:::

###### Custom ID

Additionally, interactive components like buttons and selects must have a `custom_id` field. The developer defines this field when sending the component payload, and it is returned in the interaction payload sent when a user interacts with the component. For example, if you set `custom_id: click_me` on a button, you'll receive an interaction containing `custom_id: click_me` when a user clicks that button.
Expand Down Expand Up @@ -924,7 +928,7 @@ To use this component, you need to send the [message flag](/docs/resources/messa
| type | integer | `11` for thumbnail component |
| id? | integer | Optional identifier for component |
| media | [unfurled media item](/docs/components/reference#unfurled-media-item-structure) | A url or attachment |
| description? | string | Alt text for the media |
| description? | string | Alt text for the media, max 1024 characters |
| spoiler? | boolean | Whether the thumbnail should be a spoiler (or blurred out). Defaults to `false` |

###### Example
Expand Down Expand Up @@ -954,7 +958,7 @@ To use this component, you need to send the [message flag](/docs/resources/messa
| Field | Type | Description |
|--------------|---------------------------------------------------------------------------------|-----------------------------------------------------------------------------|
| media | [unfurled media item](/docs/components/reference#unfurled-media-item-structure) | A url or attachment |
| description? | string | Alt text for the media |
| description? | string | Alt text for the media, max 1024 characters |
| spoiler? | boolean | Whether the media should be a spoiler (or blurred out). Defaults to `false` |

###### Example
Expand Down