Skip to content

Commit ea24b32

Browse files
authored
CV2: Add missing limits for alt texts, ID clarifications (#7537)
* Add limits to alt texts * Clarify pre-CV2 component IDs, 0 ->1 behavior * Move pre-CV2 notes to "Legacy Message Component Behavior" * Document sending 0 IDs in 'Anatomy of a Component' Also Reworded legacy section
1 parent 1b98f16 commit ea24b32

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

docs/components/reference.mdx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ All components have the following fields:
6464
| type | integer | The [type](/docs/components/reference#component-object-component-types) of the component |
6565
| id? | integer | 32 bit integer used as an optional identifier for component |
6666

67-
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.
67+
The `id` field is optional and is used to identify components in the response from an interaction. 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. Sending components with an `id` of `0` is allowed but will be treated as empty and replaced by the API.
6868

6969
###### Custom ID
7070

@@ -949,7 +949,7 @@ To use this component, you need to send the [message flag](/docs/resources/messa
949949
| type | integer | `11` for thumbnail component |
950950
| id? | integer | Optional identifier for component |
951951
| media | [unfurled media item](/docs/components/reference#unfurled-media-item-structure) | A url or attachment |
952-
| description? | string | Alt text for the media |
952+
| description? | string | Alt text for the media, max 1024 characters |
953953
| spoiler? | boolean | Whether the thumbnail should be a spoiler (or blurred out). Defaults to `false` |
954954

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

985985
###### Example
@@ -1209,6 +1209,8 @@ To upload a file with your message, you'll need to send your payload as `multipa
12091209

12101210
Before the introduction of the `IS_COMPONENTS_V2` flag ([see changelog](/docs/change-log/2025-04-22-components-v2)), message components were sent in conjunction with message content. This means that you could send a message using a subset of the available components without setting the `IS_COMPONENTS_V2` flag, and the components would be included in the message content along with `content` and `embeds`.
12111211

1212+
Additionally, components of messages preceding components V2 will contain an `id` of `0`.
1213+
12121214
Apps using this Legacy Message Component behavior will continue to work as expected, but it is recommended to use the new `IS_COMPONENTS_V2` flag for new apps or features as they offer more options for layout and customization.
12131215

12141216
:::info

0 commit comments

Comments
 (0)