Skip to content

CV2: Add missing limits for alt texts, ID clarifications #7537

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 20, 2025
Merged
Changes from all 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: 5 additions & 3 deletions docs/components/reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ All components have the following fields:
| type | integer | The [type](/docs/components/reference#component-object-component-types) of the component |
| id? | integer | 32 bit integer used as an optional identifier for component |

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.
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.

###### Custom ID

Expand Down Expand Up @@ -924,7 +924,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 +954,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 Expand Up @@ -1172,6 +1172,8 @@ To upload a file with your message, you'll need to send your payload as `multipa

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`.

Additionally, components of messages preceding components V2 will contain an `id` of `0`.

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.

:::info
Expand Down