From ad85f884b4fb0f709b555bf31630f17e002ad24f Mon Sep 17 00:00:00 2001 From: TomatoCake <60300461+DEVTomatoCake@users.noreply.github.com> Date: Sun, 12 Nov 2023 21:27:52 +0100 Subject: [PATCH 1/4] Document 512 url length limit for Link buttons --- docs/interactions/Message_Components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/interactions/Message_Components.md b/docs/interactions/Message_Components.md index a213562288..1e49f0dc43 100644 --- a/docs/interactions/Message_Components.md +++ b/docs/interactions/Message_Components.md @@ -97,7 +97,7 @@ Buttons are interactive components that render in messages. They can be clicked | label? | string | Text that appears on the button; max 80 characters | | emoji? | partial [emoji](#DOCS_RESOURCES_EMOJI/emoji-object) | `name`, `id`, and `animated` | | custom_id? | string | Developer-defined identifier for the button; max 100 characters | -| url? | string | URL for link-style buttons | +| url? | string | URL for link-style buttons; max 512 characters | | disabled? | boolean | Whether the button is disabled (defaults to `false`) | Buttons come in a variety of styles to convey different types of actions. These styles also define what fields are valid for a button. From e61f0fd787247715468f1c0f12a231b3355a9f0c Mon Sep 17 00:00:00 2001 From: TomatoCake <60300461+DEVTomatoCake@users.noreply.github.com> Date: Sun, 12 Nov 2023 21:28:45 +0100 Subject: [PATCH 2/4] Document 2048 url length limit in embed objects --- docs/resources/Channel.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/resources/Channel.md b/docs/resources/Channel.md index 7869a7a554..2675413cb3 100644 --- a/docs/resources/Channel.md +++ b/docs/resources/Channel.md @@ -758,6 +758,7 @@ All of the following limits are measured inclusively. Leading and trailing white |----------------------------------------------------------------------------|--------------------------------------------------------------------------------------| | title | 256 characters | | description | 4096 characters | +| url, [author.url](#DOCS_RESOURCES_CHANNEL/embed-object-embed-author-structure), [author.icon_url](#DOCS_RESOURCES_CHANNEL/embed-object-embed-author-structure), [footer.icon_url](#DOCS_RESOURCES_CHANNEL/embed-object-embed-footer-structure), [image.url](#DOCS_RESOURCES_CHANNEL/embed-object-embed-image-structure), [thumbnail.url](#DOCS_RESOURCES_CHANNEL/embed-object-embed-thumbnail-structure) | 2048 characters | | fields | Up to 25 [field](#DOCS_RESOURCES_CHANNEL/embed-object-embed-field-structure) objects | | [field.name](#DOCS_RESOURCES_CHANNEL/embed-object-embed-field-structure) | 256 characters | | [field.value](#DOCS_RESOURCES_CHANNEL/embed-object-embed-field-structure) | 1024 characters | From 2ad9e1678566945eb089901fc9ab8fdb99ad5c87 Mon Sep 17 00:00:00 2001 From: TomatoCake <60300461+DEVTomatoCake@users.noreply.github.com> Date: Mon, 13 Nov 2023 06:13:07 +0100 Subject: [PATCH 3/4] Fix Channel.md tables --- docs/resources/Channel.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/resources/Channel.md b/docs/resources/Channel.md index 2675413cb3..daf7c660cb 100644 --- a/docs/resources/Channel.md +++ b/docs/resources/Channel.md @@ -754,16 +754,16 @@ To facilitate showing rich content, rich embeds do not follow the traditional li All of the following limits are measured inclusively. Leading and trailing whitespace characters are not included (they are trimmed automatically). -| Field | Limit | -|----------------------------------------------------------------------------|--------------------------------------------------------------------------------------| -| title | 256 characters | -| description | 4096 characters | +| Field | Limit | +|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------| +| title | 256 characters | +| description | 4096 characters | | url, [author.url](#DOCS_RESOURCES_CHANNEL/embed-object-embed-author-structure), [author.icon_url](#DOCS_RESOURCES_CHANNEL/embed-object-embed-author-structure), [footer.icon_url](#DOCS_RESOURCES_CHANNEL/embed-object-embed-footer-structure), [image.url](#DOCS_RESOURCES_CHANNEL/embed-object-embed-image-structure), [thumbnail.url](#DOCS_RESOURCES_CHANNEL/embed-object-embed-thumbnail-structure) | 2048 characters | -| fields | Up to 25 [field](#DOCS_RESOURCES_CHANNEL/embed-object-embed-field-structure) objects | -| [field.name](#DOCS_RESOURCES_CHANNEL/embed-object-embed-field-structure) | 256 characters | -| [field.value](#DOCS_RESOURCES_CHANNEL/embed-object-embed-field-structure) | 1024 characters | -| [footer.text](#DOCS_RESOURCES_CHANNEL/embed-object-embed-footer-structure) | 2048 characters | -| [author.name](#DOCS_RESOURCES_CHANNEL/embed-object-embed-author-structure) | 256 characters | +| fields | Up to 25 [field](#DOCS_RESOURCES_CHANNEL/embed-object-embed-field-structure) objects | +| [field.name](#DOCS_RESOURCES_CHANNEL/embed-object-embed-field-structure) | 256 characters | +| [field.value](#DOCS_RESOURCES_CHANNEL/embed-object-embed-field-structure) | 1024 characters | +| [footer.text](#DOCS_RESOURCES_CHANNEL/embed-object-embed-footer-structure) | 2048 characters | +| [author.name](#DOCS_RESOURCES_CHANNEL/embed-object-embed-author-structure) | 256 characters | Additionally, the combined sum of characters in all `title`, `description`, `field.name`, `field.value`, `footer.text`, and `author.name` fields across all embeds attached to a message must not exceed 6000 characters. Violating any of these constraints will result in a `Bad Request` response. From ae6df1908c9fcfd9139c1a0ee97973e67cdf100f Mon Sep 17 00:00:00 2001 From: TomatoCake <60300461+DEVTomatoCake@users.noreply.github.com> Date: Mon, 15 Apr 2024 18:20:27 +0200 Subject: [PATCH 4/4] Document activity limits: name, state, url --- docs/topics/Gateway_Events.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/topics/Gateway_Events.md b/docs/topics/Gateway_Events.md index d508d7226c..5dcd19b0e3 100644 --- a/docs/topics/Gateway_Events.md +++ b/docs/topics/Gateway_Events.md @@ -1010,14 +1010,14 @@ Active sessions are indicated with an "online", "idle", or "dnd" string per plat | Field | Type | Description | |-----------------|--------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------| -| name | string | Activity's name | +| name | string | Activity's name (max 128 characters) | | type | integer | [Activity type](#DOCS_TOPICS_GATEWAY_EVENTS/activity-object-activity-types) | -| url? | ?string | Stream URL, is validated when type is 1 | +| url? | ?string | Stream URL, is validated when type is 1 (max 512 characters) | | created_at | integer | Unix timestamp (in milliseconds) of when the activity was added to the user's session | | timestamps? | [timestamps](#DOCS_TOPICS_GATEWAY_EVENTS/activity-object-activity-timestamps) object | Unix timestamps for start and/or end of the game | | application_id? | snowflake | Application ID for the game | | details? | ?string | What the player is currently doing | -| state? | ?string | User's current party status, or text used for a custom status | +| state? | ?string | User's current party status, or text used for a custom status (max 128 characters) | | emoji? | ?[emoji](#DOCS_TOPICS_GATEWAY_EVENTS/activity-object-activity-emoji) object | Emoji used for a custom status | | party? | [party](#DOCS_TOPICS_GATEWAY_EVENTS/activity-object-activity-party) object | Information for the current party of the player | | assets? | [assets](#DOCS_TOPICS_GATEWAY_EVENTS/activity-object-activity-assets) object | Images for the presence and their hover texts | @@ -1111,10 +1111,10 @@ To use an external image via media proxy, specify the URL as the field's value w When received over the gateway, the `buttons` field is an array of strings, which are the button labels. Bots cannot access a user's activity button URLs. When sending, the `buttons` field must be an array of the below object: -| Field | Type | Description | -|-------|--------|--------------------------------------------------------| -| label | string | Text shown on the button (1-32 characters) | -| url | string | URL opened when clicking the button (1-512 characters) | +| Field | Type | Description | +|-------|--------|----------------------------------------------------------| +| label | string | Text shown on the button (max 32 characters) | +| url | string | URL opened when clicking the button (max 512 characters) | ###### Example Activity