From 07c9d4aab2b644b085a49a90f2474b35cddbf1c6 Mon Sep 17 00:00:00 2001 From: advaith Date: Wed, 7 May 2025 09:23:40 -0700 Subject: [PATCH] docs: components v2 (#1224) Co-authored-by: Danial Raza --- deno/payloads/v10/channel.ts | 330 +++++++++++++++++++++++++++++++---- deno/payloads/v9/channel.ts | 328 ++++++++++++++++++++++++++++++---- deno/rest/v10/channel.ts | 4 +- deno/rest/v10/webhook.ts | 4 +- deno/rest/v9/channel.ts | 4 +- deno/rest/v9/webhook.ts | 4 +- payloads/v10/channel.ts | 330 +++++++++++++++++++++++++++++++---- payloads/v9/channel.ts | 328 ++++++++++++++++++++++++++++++---- rest/v10/channel.ts | 4 +- rest/v10/webhook.ts | 4 +- rest/v9/channel.ts | 4 +- rest/v9/webhook.ts | 4 +- 12 files changed, 1200 insertions(+), 148 deletions(-) diff --git a/deno/payloads/v10/channel.ts b/deno/payloads/v10/channel.ts index 192d1e0c..20b99c7e 100644 --- a/deno/payloads/v10/channel.ts +++ b/deno/payloads/v10/channel.ts @@ -910,7 +910,9 @@ export enum MessageFlags { */ HasSnapshot = 1 << 14, /** - * This flag is required to use new components + * Allows you to create fully component-driven messages + * + * @see {@link https://discord.com/developers/docs/components/overview} */ IsComponentsV2 = 1 << 15, } @@ -1556,7 +1558,7 @@ export interface APIAllowedMentions { } /** - * @see {@link https://discord.com/developers/docs/interactions/message-components#component-object} + * @see {@link https://discord.com/developers/docs/components/reference#anatomy-of-a-component} */ export interface APIBaseComponent { /** @@ -1564,17 +1566,19 @@ export interface APIBaseComponent { */ type: T; /** - * int32, auto generated via increment if not provided + * 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 ids won't use another id that exists in the message if you have one defined for another component. */ id?: number; } /** - * @see {@link https://discord.com/developers/docs/interactions/message-components#component-object-component-types} + * @see {@link https://discord.com/developers/docs/components/reference#component-object-component-types} */ export enum ComponentType { /** - * Action Row component + * Container to display a row of interactive components */ ActionRow = 1, /** @@ -1605,13 +1609,37 @@ export enum ComponentType { * Select menu for channels */ ChannelSelect, + /** + * Container to display text alongside an accessory component + */ Section, + /** + * Markdown text + */ TextDisplay, + /** + * Small image that can be used as an accessory + */ Thumbnail, + /** + * Display images and other media + */ MediaGallery, + /** + * Displays an attached file + */ File, + /** + * Component to add vertical padding between other components + */ Separator, + /** + * @unstable This component type is currently not documented by Discord but has a known value which we will try to keep up to date. + */ ContentInventoryEntry = 16, + /** + * Container that visually groups a set of components + */ Container, // EVERYTHING BELOW THIS LINE SHOULD BE OLD NAMES FOR RENAMED ENUM MEMBERS // @@ -1625,7 +1653,9 @@ export enum ComponentType { } /** - * @see {@link https://discord.com/developers/docs/interactions/message-components#action-rows} + * An Action Row is a top-level layout component used in messages and modals. + * + * @see {@link https://discord.com/developers/docs/components/reference#action-row} */ export interface APIActionRowComponent extends APIBaseComponent { @@ -1636,7 +1666,7 @@ export interface APIActionRowComponent } /** - * @see {@link https://discord.com/developers/docs/interactions/message-components#buttons} + * @see {@link https://discord.com/developers/docs/components/reference#button} */ export interface APIButtonComponentBase