From 9f769c319eed0cb3d26d5a5c0cb06f8f4a78c071 Mon Sep 17 00:00:00 2001 From: advaith Date: Mon, 21 Apr 2025 14:52:14 -0700 Subject: [PATCH] feat!: components v2 (#1190) --- .gitattributes | 1 + .vscode/settings.json | 7 +- .../payloads/v10/_interactions/modalSubmit.ts | 4 +- deno/payloads/v10/_interactions/responses.ts | 4 +- deno/payloads/v10/channel.ts | 140 ++++++++++++- deno/payloads/v9/_interactions/modalSubmit.ts | 4 +- deno/payloads/v9/_interactions/responses.ts | 4 +- deno/payloads/v9/channel.ts | 184 ++++++++++++++++-- deno/rest/v10/channel.ts | 7 +- deno/rest/v10/webhook.ts | 10 +- deno/rest/v9/channel.ts | 7 +- deno/rest/v9/webhook.ts | 10 +- payloads/v10/_interactions/modalSubmit.ts | 4 +- payloads/v10/_interactions/responses.ts | 4 +- payloads/v10/channel.ts | 140 ++++++++++++- payloads/v9/_interactions/modalSubmit.ts | 4 +- payloads/v9/_interactions/responses.ts | 4 +- payloads/v9/channel.ts | 184 ++++++++++++++++-- rest/v10/channel.ts | 7 +- rest/v10/webhook.ts | 10 +- rest/v9/channel.ts | 7 +- rest/v9/webhook.ts | 10 +- 22 files changed, 663 insertions(+), 93 deletions(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..9460b5d7 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +deno/** linguist-generated diff --git a/.vscode/settings.json b/.vscode/settings.json index dfcf6135..00875f97 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -6,5 +6,10 @@ "source.fixAll": "explicit", "source.fixAll.eslint": "explicit" }, - "cSpell.enableFiletypes": ["mdx"] + "cSpell.enableFiletypes": ["mdx"], + "search.exclude": { + "**/v6": true, + "**/v8": true, + "deno": true + } } diff --git a/deno/payloads/v10/_interactions/modalSubmit.ts b/deno/payloads/v10/_interactions/modalSubmit.ts index c77a4fec..cdadcfba 100644 --- a/deno/payloads/v10/_interactions/modalSubmit.ts +++ b/deno/payloads/v10/_interactions/modalSubmit.ts @@ -1,4 +1,4 @@ -import type { APIActionRowComponent, APIModalActionRowComponent } from '../channel.ts'; +import type { APIActionRowComponent, APIComponentInModalActionRow } from '../channel.ts'; import type { APIBaseInteraction, APIDMInteractionWrapper, @@ -14,7 +14,7 @@ export interface ModalSubmitComponent { } export interface ModalSubmitActionRowComponent - extends Omit, 'components'> { + extends Omit, 'components'> { components: ModalSubmitComponent[]; } diff --git a/deno/payloads/v10/_interactions/responses.ts b/deno/payloads/v10/_interactions/responses.ts index f686c3c8..a56736ce 100644 --- a/deno/payloads/v10/_interactions/responses.ts +++ b/deno/payloads/v10/_interactions/responses.ts @@ -1,5 +1,5 @@ import type { RESTPostAPIWebhookWithTokenJSONBody } from '../../../v10.ts'; -import type { APIActionRowComponent, APIModalActionRowComponent } from '../channel.ts'; +import type { APIActionRowComponent, APIComponentInModalActionRow } from '../channel.ts'; import type { APIApplicationCommandOptionChoice } from './applicationCommands.ts'; /** @@ -141,5 +141,5 @@ export interface APIModalInteractionResponseCallbackData { /** * Between 1 and 5 (inclusive) components that make up the modal */ - components: APIActionRowComponent[]; + components: APIActionRowComponent[]; } diff --git a/deno/payloads/v10/channel.ts b/deno/payloads/v10/channel.ts index 8762f15e..66a0a518 100644 --- a/deno/payloads/v10/channel.ts +++ b/deno/payloads/v10/channel.ts @@ -687,7 +687,7 @@ export interface APIMessage { * * @see {@link https://support-dev.discord.com/hc/articles/4404772028055} */ - components?: APIActionRowComponent[]; + components?: APIMessageTopLevelComponent[]; /** * Sent if the message contains stickers * @@ -909,6 +909,10 @@ export enum MessageFlags { * This message has a snapshot (via Message Forwarding) */ HasSnapshot = 1 << 14, + /** + * This flag is required to use new components + */ + IsComponentsV2 = 1 << 15, } /** @@ -1559,6 +1563,10 @@ export interface APIBaseComponent { * The type of the component */ type: T; + /** + * int32, auto generated via increment if not provided + */ + id?: number; } /** @@ -1597,6 +1605,14 @@ export enum ComponentType { * Select menu for channels */ ChannelSelect, + Section, + TextDisplay, + Thumbnail, + MediaGallery, + File, + Separator, + ContentInventoryEntry = 16, + Container, // EVERYTHING BELOW THIS LINE SHOULD BE OLD NAMES FOR RENAMED ENUM MEMBERS // @@ -1611,7 +1627,7 @@ export enum ComponentType { /** * @see {@link https://discord.com/developers/docs/interactions/message-components#action-rows} */ -export interface APIActionRowComponent +export interface APIActionRowComponent extends APIBaseComponent { /** * The components in the ActionRow @@ -1901,6 +1917,77 @@ export interface APITextInputComponent extends APIBaseComponent references + */ + url: string; + proxy_url?: string; + width?: number | null; + height?: number | null; + placeholder?: string | null; + placeholder_version?: number | null; + content_type?: string | null; + loading_state?: UnfurledMediaItemLoadingState; + flags?: number; +} + +export interface APISectionComponent extends APIBaseComponent { + components: APITextDisplayComponent[]; + accessory: APISectionAccessoryComponent; +} + +export interface APITextDisplayComponent extends APIBaseComponent { + content: string; +} + +export interface APIThumbnailComponent extends APIBaseComponent { + media: APIUnfurledMediaItem; + description?: string | null; + spoiler?: boolean; +} + +export interface APIMediaGalleryItem { + media: APIUnfurledMediaItem; + description?: string | null; + spoiler?: boolean; +} + +export interface APIMediaGalleryComponent extends APIBaseComponent { + items: APIMediaGalleryItem[]; +} + +export enum SeparatorSpacingSize { + Small = 1, + Large, +} + +export interface APISeparatorComponent extends APIBaseComponent { + divider?: boolean; + spacing?: SeparatorSpacingSize; +} + +export interface APIFileComponent extends APIBaseComponent { + /** + * The APIUnfurledMediaItem ONLY supports attachment:// references + */ + file: APIUnfurledMediaItem; + spoiler?: boolean; +} + +export interface APIContainerComponent extends APIBaseComponent { + accent_color?: number | null; + spoiler?: boolean; + components: APIComponentInContainer[]; +} + /** * @see {@link https://discord.com/developers/docs/resources/channel#message-snapshot-object} */ @@ -1966,20 +2053,57 @@ export enum ChannelFlags { } /** + * All components that can appear in messages. + * + * For more specific sets, see {@link APIMessageTopLevelComponent}, {@link APIComponentInMessageActionRow}, {@link APIComponentInContainer}, and {@link APISectionAccessoryComponent} + * * @see {@link https://discord.com/developers/docs/interactions/message-components#message-components} */ -export type APIMessageComponent = APIActionRowComponent | APIMessageActionRowComponent; -export type APIModalComponent = APIActionRowComponent | APIModalActionRowComponent; - -export type APIActionRowComponentTypes = APIMessageActionRowComponent | APIModalActionRowComponent; +export type APIMessageComponent = + | APIActionRowComponent + | APIButtonComponent + | APIContainerComponent + | APIFileComponent + | APIMediaGalleryComponent + | APISectionComponent + | APISelectMenuComponent + | APISeparatorComponent + | APITextDisplayComponent + | APIThumbnailComponent; /** * @see {@link https://discord.com/developers/docs/interactions/message-components#message-components} */ -export type APIMessageActionRowComponent = APIButtonComponent | APISelectMenuComponent; +export type APIMessageTopLevelComponent = + | APIActionRowComponent + | APIContainerComponent + | APIFileComponent + | APIMediaGalleryComponent + | APISectionComponent + | APISeparatorComponent + | APITextDisplayComponent; + +export type APIModalComponent = APIActionRowComponent | APIComponentInModalActionRow; + +export type APIComponentInActionRow = APIComponentInMessageActionRow | APIComponentInModalActionRow; + +/** + * @see {@link https://discord.com/developers/docs/interactions/message-components#message-components} + */ +export type APIComponentInMessageActionRow = APIButtonComponent | APISelectMenuComponent; // Modal components -export type APIModalActionRowComponent = APITextInputComponent; +export type APIComponentInModalActionRow = APITextInputComponent; + +export type APISectionAccessoryComponent = APIButtonComponent | APIThumbnailComponent; + +export type APIComponentInContainer = + | APIActionRowComponent + | APIFileComponent + | APIMediaGalleryComponent + | APISectionComponent + | APISeparatorComponent + | APITextDisplayComponent; export type APIMessageSnapshotFields = Pick< APIMessage, diff --git a/deno/payloads/v9/_interactions/modalSubmit.ts b/deno/payloads/v9/_interactions/modalSubmit.ts index c77a4fec..cdadcfba 100644 --- a/deno/payloads/v9/_interactions/modalSubmit.ts +++ b/deno/payloads/v9/_interactions/modalSubmit.ts @@ -1,4 +1,4 @@ -import type { APIActionRowComponent, APIModalActionRowComponent } from '../channel.ts'; +import type { APIActionRowComponent, APIComponentInModalActionRow } from '../channel.ts'; import type { APIBaseInteraction, APIDMInteractionWrapper, @@ -14,7 +14,7 @@ export interface ModalSubmitComponent { } export interface ModalSubmitActionRowComponent - extends Omit, 'components'> { + extends Omit, 'components'> { components: ModalSubmitComponent[]; } diff --git a/deno/payloads/v9/_interactions/responses.ts b/deno/payloads/v9/_interactions/responses.ts index 76872f54..136e3fd5 100644 --- a/deno/payloads/v9/_interactions/responses.ts +++ b/deno/payloads/v9/_interactions/responses.ts @@ -1,5 +1,5 @@ import type { RESTPostAPIWebhookWithTokenJSONBody } from '../../../v9.ts'; -import type { APIActionRowComponent, APIModalActionRowComponent } from '../channel.ts'; +import type { APIActionRowComponent, APIComponentInModalActionRow } from '../channel.ts'; import type { APIApplicationCommandOptionChoice } from './applicationCommands.ts'; /** @@ -141,5 +141,5 @@ export interface APIModalInteractionResponseCallbackData { /** * Between 1 and 5 (inclusive) components that make up the modal */ - components: APIActionRowComponent[]; + components: APIActionRowComponent[]; } diff --git a/deno/payloads/v9/channel.ts b/deno/payloads/v9/channel.ts index dd7e1002..6162f7ba 100644 --- a/deno/payloads/v9/channel.ts +++ b/deno/payloads/v9/channel.ts @@ -195,6 +195,10 @@ export interface APIGroupDMChannel extends Omit Privileged Gateway Intents** * @@ -568,7 +573,7 @@ export interface APIMessage { * * @see {@link https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure} * - * The `MESSAGE_CONTENT` privileged gateway intent will become required after **August 31, 2022** for verified applications to receive a non-empty value from this field + * The `MESSAGE_CONTENT` privileged gateway intent is required for verified applications to receive a non-empty value from this field * * In the Discord Developers Portal, you need to enable the toggle of this intent of your application in **Bot \> Privileged Gateway Intents** * @see {@link https://support-dev.discord.com/hc/articles/4404772028055} @@ -579,7 +584,7 @@ export interface APIMessage { * * @see {@link https://discord.com/developers/docs/resources/channel#embed-object} * - * The `MESSAGE_CONTENT` privileged gateway intent will become required after **August 31, 2022** for verified applications to receive a non-empty value from this field + * The `MESSAGE_CONTENT` privileged gateway intent is required for verified applications to receive a non-empty value from this field * * In the Discord Developers Portal, you need to enable the toggle of this intent of your application in **Bot \> Privileged Gateway Intents** * @see {@link https://support-dev.discord.com/hc/articles/4404772028055} @@ -661,6 +666,8 @@ export interface APIMessage { interaction_metadata?: APIMessageInteractionMetadata; /** * Sent if the message is a response to an Interaction + * + * @deprecated In favor of `interaction_metadata` */ interaction?: APIMessageInteraction; /** @@ -670,13 +677,13 @@ export interface APIMessage { /** * Sent if the message contains components like buttons, action rows, or other interactive components * - * The `MESSAGE_CONTENT` privileged gateway intent will become required after **August 31, 2022** for verified applications to receive a non-empty value from this field + * The `MESSAGE_CONTENT` privileged gateway intent is required for verified applications to receive a non-empty value from this field * * In the Discord Developers Portal, you need to enable the toggle of this intent of your application in **Bot \> Privileged Gateway Intents** * * @see {@link https://support-dev.discord.com/hc/articles/4404772028055} */ - components?: APIActionRowComponent[]; + components?: APIMessageTopLevelComponent[]; /** * Sent if the message contains stickers * @@ -696,6 +703,10 @@ export interface APIMessage { * It can be used to estimate the relative position of the message in a thread in company with `total_message_sent` on parent thread */ position?: number; + /** + * Data of the role subscription purchase or renewal that prompted this `ROLE_SUBSCRIPTION_PURCHASE` message + */ + role_subscription_data?: APIMessageRoleSubscriptionData; /** * Data for users, members, channels, and roles in the message's auto-populated select menus * @@ -708,7 +719,6 @@ export interface APIMessage { * The `MESSAGE_CONTENT` privileged gateway intent is required for verified applications to receive a non-empty value from this field * * In the Discord Developers Portal, you need to enable the toggle of this intent of your application in **Bot \> Privileged Gateway Intents**. - * You also need to specify the intent bit value (`1 << 15`) if you are connecting to the gateway * * @see {@link https://support-dev.discord.com/hc/articles/4404772028055} */ @@ -894,6 +904,10 @@ export enum MessageFlags { * This message has a snapshot (via Message Forwarding) */ HasSnapshot = 1 << 14, + /** + * This flag is required to use new components + */ + IsComponentsV2 = 1 << 15, } /** @@ -910,6 +924,28 @@ export interface APIMessageCall { ended_timestamp?: string | null; } +/** + * @see {@link https://discord.com/developers/docs/resources/channel#role-subscription-data-object-role-subscription-data-object-structure} + */ +export interface APIMessageRoleSubscriptionData { + /** + * The id of the SKU and listing the user is subscribed to + */ + role_subscription_listing_id: Snowflake; + /** + * The name of the tier the user is subscribed to + */ + tier_name: string; + /** + * The number of months the user has been subscribed for + */ + total_months_subscribed: number; + /** + * Whether this notification is for a renewal + */ + is_renewal: boolean; +} + /** * @see {@link https://discord.com/developers/docs/resources/channel#followed-channel-object} */ @@ -1526,6 +1562,10 @@ export interface APIBaseComponent { * The type of the component */ type: T; + /** + * int32, auto generated via increment if not provided + */ + id?: number; } /** @@ -1564,6 +1604,14 @@ export enum ComponentType { * Select menu for channels */ ChannelSelect, + Section, + TextDisplay, + Thumbnail, + MediaGallery, + File, + Separator, + ContentInventoryEntry = 16, + Container, // EVERYTHING BELOW THIS LINE SHOULD BE OLD NAMES FOR RENAMED ENUM MEMBERS // @@ -1578,7 +1626,7 @@ export enum ComponentType { /** * @see {@link https://discord.com/developers/docs/interactions/message-components#action-rows} */ -export interface APIActionRowComponent +export interface APIActionRowComponent extends APIBaseComponent { /** * The components in the ActionRow @@ -1868,6 +1916,77 @@ export interface APITextInputComponent extends APIBaseComponent references + */ + url: string; + proxy_url?: string; + width?: number | null; + height?: number | null; + placeholder?: string | null; + placeholder_version?: number | null; + content_type?: string | null; + loading_state?: UnfurledMediaItemLoadingState; + flags?: number; +} + +export interface APISectionComponent extends APIBaseComponent { + components: APITextDisplayComponent[]; + accessory: APISectionAccessoryComponent; +} + +export interface APITextDisplayComponent extends APIBaseComponent { + content: string; +} + +export interface APIThumbnailComponent extends APIBaseComponent { + media: APIUnfurledMediaItem; + description?: string | null; + spoiler?: boolean; +} + +export interface APIMediaGalleryItem { + media: APIUnfurledMediaItem; + description?: string | null; + spoiler?: boolean; +} + +export interface APIMediaGalleryComponent extends APIBaseComponent { + items: APIMediaGalleryItem[]; +} + +export enum SeparatorSpacingSize { + Small = 1, + Large, +} + +export interface APISeparatorComponent extends APIBaseComponent { + divider?: boolean; + spacing?: SeparatorSpacingSize; +} + +export interface APIFileComponent extends APIBaseComponent { + /** + * The APIUnfurledMediaItem ONLY supports attachment:// references + */ + file: APIUnfurledMediaItem; + spoiler?: boolean; +} + +export interface APIContainerComponent extends APIBaseComponent { + accent_color?: number | null; + spoiler?: boolean; + components: APIComponentInContainer[]; +} + /** * @see {@link https://discord.com/developers/docs/resources/channel#message-snapshot-object} */ @@ -1933,20 +2052,57 @@ export enum ChannelFlags { } /** + * All components that can appear in messages. + * + * For more specific sets, see {@link APIMessageTopLevelComponent}, {@link APIComponentInMessageActionRow}, {@link APIComponentInContainer}, and {@link APISectionAccessoryComponent} + * * @see {@link https://discord.com/developers/docs/interactions/message-components#message-components} */ -export type APIMessageComponent = APIActionRowComponent | APIMessageActionRowComponent; -export type APIModalComponent = APIActionRowComponent | APIModalActionRowComponent; - -export type APIActionRowComponentTypes = APIMessageActionRowComponent | APIModalActionRowComponent; +export type APIMessageComponent = + | APIActionRowComponent + | APIButtonComponent + | APIContainerComponent + | APIFileComponent + | APIMediaGalleryComponent + | APISectionComponent + | APISelectMenuComponent + | APISeparatorComponent + | APITextDisplayComponent + | APIThumbnailComponent; /** * @see {@link https://discord.com/developers/docs/interactions/message-components#message-components} */ -export type APIMessageActionRowComponent = APIButtonComponent | APISelectMenuComponent; +export type APIMessageTopLevelComponent = + | APIActionRowComponent + | APIContainerComponent + | APIFileComponent + | APIMediaGalleryComponent + | APISectionComponent + | APISeparatorComponent + | APITextDisplayComponent; + +export type APIModalComponent = APIActionRowComponent | APIComponentInModalActionRow; + +export type APIComponentInActionRow = APIComponentInMessageActionRow | APIComponentInModalActionRow; + +/** + * @see {@link https://discord.com/developers/docs/interactions/message-components#message-components} + */ +export type APIComponentInMessageActionRow = APIButtonComponent | APISelectMenuComponent; // Modal components -export type APIModalActionRowComponent = APITextInputComponent; +export type APIComponentInModalActionRow = APITextInputComponent; + +export type APISectionAccessoryComponent = APIButtonComponent | APIThumbnailComponent; + +export type APIComponentInContainer = + | APIActionRowComponent + | APIFileComponent + | APIMediaGalleryComponent + | APISectionComponent + | APISeparatorComponent + | APITextDisplayComponent; export type APIMessageSnapshotFields = Pick< APIMessage, diff --git a/deno/rest/v10/channel.ts b/deno/rest/v10/channel.ts index 9312abab..9ea39b95 100644 --- a/deno/rest/v10/channel.ts +++ b/deno/rest/v10/channel.ts @@ -1,13 +1,11 @@ import type { Permissions, Snowflake } from '../../globals.ts'; import type { - APIActionRowComponent, APIAllowedMentions, APIChannel, APIEmbed, APIExtendedInvite, APIFollowedChannel, APIMessage, - APIMessageActionRowComponent, APIMessageReference, APIThreadList, APIThreadMember, @@ -25,6 +23,7 @@ import type { ForumLayoutType, ChannelFlags, APIAttachment, + APIMessageTopLevelComponent, } from '../../payloads/v10/mod.ts'; import type { _AddUndefinedToPossiblyUndefinedPropertiesOfInterface, _StrictPartial } from '../../utils/internals.ts'; import type { RESTAPIPoll } from './poll.ts'; @@ -311,7 +310,7 @@ export interface RESTPostAPIChannelMessageJSONBody { * * @see {@link https://discord.com/developers/docs/interactions/message-components#component-object} */ - components?: APIActionRowComponent[] | undefined; + components?: APIMessageTopLevelComponent[] | undefined; /** * IDs of up to 3 stickers in the server to send in the message * @@ -464,7 +463,7 @@ export interface RESTPatchAPIChannelMessageJSONBody { * * @see {@link https://discord.com/developers/docs/interactions/message-components#component-object} */ - components?: APIActionRowComponent[] | null | undefined; + components?: APIMessageTopLevelComponent[] | null | undefined; } /** diff --git a/deno/rest/v10/webhook.ts b/deno/rest/v10/webhook.ts index 7017760b..bba2a571 100644 --- a/deno/rest/v10/webhook.ts +++ b/deno/rest/v10/webhook.ts @@ -1,12 +1,11 @@ import type { Snowflake } from '../../globals.ts'; import type { APIAllowedMentions, - APIActionRowComponent, APIEmbed, APIMessage, APIWebhook, MessageFlags, - APIMessageActionRowComponent, + APIMessageTopLevelComponent, } from '../../payloads/v10/mod.ts'; import type { _AddUndefinedToPossiblyUndefinedPropertiesOfInterface, _Nullable } from '../../utils/internals.ts'; import type { RESTAPIAttachment } from './channel.ts'; @@ -136,7 +135,7 @@ export interface RESTPostAPIWebhookWithTokenJSONBody { * * @see {@link https://discord.com/developers/docs/interactions/message-components#component-object} */ - components?: APIActionRowComponent[] | undefined; + components?: APIMessageTopLevelComponent[] | undefined; /** * Attachment objects with filename and description */ @@ -298,7 +297,10 @@ export type RESTPatchAPIWebhookWithTokenMessageFormDataBody = /** * @see {@link https://discord.com/developers/docs/resources/webhook#edit-webhook-message-query-string-params} */ -export type RESTPatchAPIWebhookWithTokenQuery = Pick; +export type RESTPatchAPIWebhookWithTokenMessageQuery = Pick< + RESTPostAPIWebhookWithTokenQuery, + 'thread_id' | 'with_components' +>; /** * @see {@link https://discord.com/developers/docs/resources/webhook#edit-webhook-message} diff --git a/deno/rest/v9/channel.ts b/deno/rest/v9/channel.ts index 740a214f..03974698 100644 --- a/deno/rest/v9/channel.ts +++ b/deno/rest/v9/channel.ts @@ -1,13 +1,11 @@ import type { Permissions, Snowflake } from '../../globals.ts'; import type { - APIActionRowComponent, APIAllowedMentions, APIChannel, APIEmbed, APIExtendedInvite, APIFollowedChannel, APIMessage, - APIMessageActionRowComponent, APIMessageReference, APIThreadList, APIThreadMember, @@ -25,6 +23,7 @@ import type { ForumLayoutType, ChannelFlags, APIAttachment, + APIMessageTopLevelComponent, } from '../../payloads/v9/mod.ts'; import type { _AddUndefinedToPossiblyUndefinedPropertiesOfInterface, _StrictPartial } from '../../utils/internals.ts'; import type { RESTAPIPoll } from './poll.ts'; @@ -318,7 +317,7 @@ export interface RESTPostAPIChannelMessageJSONBody { * * @see {@link https://discord.com/developers/docs/interactions/message-components#component-object} */ - components?: APIActionRowComponent[] | undefined; + components?: APIMessageTopLevelComponent[] | undefined; /** * IDs of up to 3 stickers in the server to send in the message * @@ -478,7 +477,7 @@ export interface RESTPatchAPIChannelMessageJSONBody { * * @see {@link https://discord.com/developers/docs/interactions/message-components#component-object} */ - components?: APIActionRowComponent[] | null | undefined; + components?: APIMessageTopLevelComponent[] | null | undefined; } /** diff --git a/deno/rest/v9/webhook.ts b/deno/rest/v9/webhook.ts index 1393ab3e..5b4480a2 100644 --- a/deno/rest/v9/webhook.ts +++ b/deno/rest/v9/webhook.ts @@ -1,12 +1,11 @@ import type { Snowflake } from '../../globals.ts'; import type { APIAllowedMentions, - APIActionRowComponent, APIEmbed, APIMessage, APIWebhook, MessageFlags, - APIMessageActionRowComponent, + APIMessageTopLevelComponent, } from '../../payloads/v9/mod.ts'; import type { _AddUndefinedToPossiblyUndefinedPropertiesOfInterface, _Nullable } from '../../utils/internals.ts'; import type { RESTAPIAttachment } from './channel.ts'; @@ -136,7 +135,7 @@ export interface RESTPostAPIWebhookWithTokenJSONBody { * * @see {@link https://discord.com/developers/docs/interactions/message-components#component-object} */ - components?: APIActionRowComponent[] | undefined; + components?: APIMessageTopLevelComponent[] | undefined; /** * Attachment objects with filename and description */ @@ -298,7 +297,10 @@ export type RESTPatchAPIWebhookWithTokenMessageFormDataBody = /** * @see {@link https://discord.com/developers/docs/resources/webhook#edit-webhook-message-query-string-params} */ -export type RESTPatchAPIWebhookWithTokenQuery = Pick; +export type RESTPatchAPIWebhookWithTokenMessageQuery = Pick< + RESTPostAPIWebhookWithTokenQuery, + 'thread_id' | 'with_components' +>; /** * @see {@link https://discord.com/developers/docs/resources/webhook#edit-webhook-message} diff --git a/payloads/v10/_interactions/modalSubmit.ts b/payloads/v10/_interactions/modalSubmit.ts index fb953174..9a481e1d 100644 --- a/payloads/v10/_interactions/modalSubmit.ts +++ b/payloads/v10/_interactions/modalSubmit.ts @@ -1,4 +1,4 @@ -import type { APIActionRowComponent, APIModalActionRowComponent } from '../channel'; +import type { APIActionRowComponent, APIComponentInModalActionRow } from '../channel'; import type { APIBaseInteraction, APIDMInteractionWrapper, @@ -14,7 +14,7 @@ export interface ModalSubmitComponent { } export interface ModalSubmitActionRowComponent - extends Omit, 'components'> { + extends Omit, 'components'> { components: ModalSubmitComponent[]; } diff --git a/payloads/v10/_interactions/responses.ts b/payloads/v10/_interactions/responses.ts index 84872746..d5775bde 100644 --- a/payloads/v10/_interactions/responses.ts +++ b/payloads/v10/_interactions/responses.ts @@ -1,5 +1,5 @@ import type { RESTPostAPIWebhookWithTokenJSONBody } from '../../../v10'; -import type { APIActionRowComponent, APIModalActionRowComponent } from '../channel'; +import type { APIActionRowComponent, APIComponentInModalActionRow } from '../channel'; import type { APIApplicationCommandOptionChoice } from './applicationCommands'; /** @@ -141,5 +141,5 @@ export interface APIModalInteractionResponseCallbackData { /** * Between 1 and 5 (inclusive) components that make up the modal */ - components: APIActionRowComponent[]; + components: APIActionRowComponent[]; } diff --git a/payloads/v10/channel.ts b/payloads/v10/channel.ts index 719d4caf..6a3929cd 100644 --- a/payloads/v10/channel.ts +++ b/payloads/v10/channel.ts @@ -687,7 +687,7 @@ export interface APIMessage { * * @see {@link https://support-dev.discord.com/hc/articles/4404772028055} */ - components?: APIActionRowComponent[]; + components?: APIMessageTopLevelComponent[]; /** * Sent if the message contains stickers * @@ -909,6 +909,10 @@ export enum MessageFlags { * This message has a snapshot (via Message Forwarding) */ HasSnapshot = 1 << 14, + /** + * This flag is required to use new components + */ + IsComponentsV2 = 1 << 15, } /** @@ -1559,6 +1563,10 @@ export interface APIBaseComponent { * The type of the component */ type: T; + /** + * int32, auto generated via increment if not provided + */ + id?: number; } /** @@ -1597,6 +1605,14 @@ export enum ComponentType { * Select menu for channels */ ChannelSelect, + Section, + TextDisplay, + Thumbnail, + MediaGallery, + File, + Separator, + ContentInventoryEntry = 16, + Container, // EVERYTHING BELOW THIS LINE SHOULD BE OLD NAMES FOR RENAMED ENUM MEMBERS // @@ -1611,7 +1627,7 @@ export enum ComponentType { /** * @see {@link https://discord.com/developers/docs/interactions/message-components#action-rows} */ -export interface APIActionRowComponent +export interface APIActionRowComponent extends APIBaseComponent { /** * The components in the ActionRow @@ -1901,6 +1917,77 @@ export interface APITextInputComponent extends APIBaseComponent references + */ + url: string; + proxy_url?: string; + width?: number | null; + height?: number | null; + placeholder?: string | null; + placeholder_version?: number | null; + content_type?: string | null; + loading_state?: UnfurledMediaItemLoadingState; + flags?: number; +} + +export interface APISectionComponent extends APIBaseComponent { + components: APITextDisplayComponent[]; + accessory: APISectionAccessoryComponent; +} + +export interface APITextDisplayComponent extends APIBaseComponent { + content: string; +} + +export interface APIThumbnailComponent extends APIBaseComponent { + media: APIUnfurledMediaItem; + description?: string | null; + spoiler?: boolean; +} + +export interface APIMediaGalleryItem { + media: APIUnfurledMediaItem; + description?: string | null; + spoiler?: boolean; +} + +export interface APIMediaGalleryComponent extends APIBaseComponent { + items: APIMediaGalleryItem[]; +} + +export enum SeparatorSpacingSize { + Small = 1, + Large, +} + +export interface APISeparatorComponent extends APIBaseComponent { + divider?: boolean; + spacing?: SeparatorSpacingSize; +} + +export interface APIFileComponent extends APIBaseComponent { + /** + * The APIUnfurledMediaItem ONLY supports attachment:// references + */ + file: APIUnfurledMediaItem; + spoiler?: boolean; +} + +export interface APIContainerComponent extends APIBaseComponent { + accent_color?: number | null; + spoiler?: boolean; + components: APIComponentInContainer[]; +} + /** * @see {@link https://discord.com/developers/docs/resources/channel#message-snapshot-object} */ @@ -1966,20 +2053,57 @@ export enum ChannelFlags { } /** + * All components that can appear in messages. + * + * For more specific sets, see {@link APIMessageTopLevelComponent}, {@link APIComponentInMessageActionRow}, {@link APIComponentInContainer}, and {@link APISectionAccessoryComponent} + * * @see {@link https://discord.com/developers/docs/interactions/message-components#message-components} */ -export type APIMessageComponent = APIActionRowComponent | APIMessageActionRowComponent; -export type APIModalComponent = APIActionRowComponent | APIModalActionRowComponent; - -export type APIActionRowComponentTypes = APIMessageActionRowComponent | APIModalActionRowComponent; +export type APIMessageComponent = + | APIActionRowComponent + | APIButtonComponent + | APIContainerComponent + | APIFileComponent + | APIMediaGalleryComponent + | APISectionComponent + | APISelectMenuComponent + | APISeparatorComponent + | APITextDisplayComponent + | APIThumbnailComponent; /** * @see {@link https://discord.com/developers/docs/interactions/message-components#message-components} */ -export type APIMessageActionRowComponent = APIButtonComponent | APISelectMenuComponent; +export type APIMessageTopLevelComponent = + | APIActionRowComponent + | APIContainerComponent + | APIFileComponent + | APIMediaGalleryComponent + | APISectionComponent + | APISeparatorComponent + | APITextDisplayComponent; + +export type APIModalComponent = APIActionRowComponent | APIComponentInModalActionRow; + +export type APIComponentInActionRow = APIComponentInMessageActionRow | APIComponentInModalActionRow; + +/** + * @see {@link https://discord.com/developers/docs/interactions/message-components#message-components} + */ +export type APIComponentInMessageActionRow = APIButtonComponent | APISelectMenuComponent; // Modal components -export type APIModalActionRowComponent = APITextInputComponent; +export type APIComponentInModalActionRow = APITextInputComponent; + +export type APISectionAccessoryComponent = APIButtonComponent | APIThumbnailComponent; + +export type APIComponentInContainer = + | APIActionRowComponent + | APIFileComponent + | APIMediaGalleryComponent + | APISectionComponent + | APISeparatorComponent + | APITextDisplayComponent; export type APIMessageSnapshotFields = Pick< APIMessage, diff --git a/payloads/v9/_interactions/modalSubmit.ts b/payloads/v9/_interactions/modalSubmit.ts index fb953174..9a481e1d 100644 --- a/payloads/v9/_interactions/modalSubmit.ts +++ b/payloads/v9/_interactions/modalSubmit.ts @@ -1,4 +1,4 @@ -import type { APIActionRowComponent, APIModalActionRowComponent } from '../channel'; +import type { APIActionRowComponent, APIComponentInModalActionRow } from '../channel'; import type { APIBaseInteraction, APIDMInteractionWrapper, @@ -14,7 +14,7 @@ export interface ModalSubmitComponent { } export interface ModalSubmitActionRowComponent - extends Omit, 'components'> { + extends Omit, 'components'> { components: ModalSubmitComponent[]; } diff --git a/payloads/v9/_interactions/responses.ts b/payloads/v9/_interactions/responses.ts index eef4d23a..2a4c9463 100644 --- a/payloads/v9/_interactions/responses.ts +++ b/payloads/v9/_interactions/responses.ts @@ -1,5 +1,5 @@ import type { RESTPostAPIWebhookWithTokenJSONBody } from '../../../v9'; -import type { APIActionRowComponent, APIModalActionRowComponent } from '../channel'; +import type { APIActionRowComponent, APIComponentInModalActionRow } from '../channel'; import type { APIApplicationCommandOptionChoice } from './applicationCommands'; /** @@ -141,5 +141,5 @@ export interface APIModalInteractionResponseCallbackData { /** * Between 1 and 5 (inclusive) components that make up the modal */ - components: APIActionRowComponent[]; + components: APIActionRowComponent[]; } diff --git a/payloads/v9/channel.ts b/payloads/v9/channel.ts index 2f7b21c8..2396bcf4 100644 --- a/payloads/v9/channel.ts +++ b/payloads/v9/channel.ts @@ -195,6 +195,10 @@ export interface APIGroupDMChannel extends Omit Privileged Gateway Intents** * @@ -568,7 +573,7 @@ export interface APIMessage { * * @see {@link https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure} * - * The `MESSAGE_CONTENT` privileged gateway intent will become required after **August 31, 2022** for verified applications to receive a non-empty value from this field + * The `MESSAGE_CONTENT` privileged gateway intent is required for verified applications to receive a non-empty value from this field * * In the Discord Developers Portal, you need to enable the toggle of this intent of your application in **Bot \> Privileged Gateway Intents** * @see {@link https://support-dev.discord.com/hc/articles/4404772028055} @@ -579,7 +584,7 @@ export interface APIMessage { * * @see {@link https://discord.com/developers/docs/resources/channel#embed-object} * - * The `MESSAGE_CONTENT` privileged gateway intent will become required after **August 31, 2022** for verified applications to receive a non-empty value from this field + * The `MESSAGE_CONTENT` privileged gateway intent is required for verified applications to receive a non-empty value from this field * * In the Discord Developers Portal, you need to enable the toggle of this intent of your application in **Bot \> Privileged Gateway Intents** * @see {@link https://support-dev.discord.com/hc/articles/4404772028055} @@ -661,6 +666,8 @@ export interface APIMessage { interaction_metadata?: APIMessageInteractionMetadata; /** * Sent if the message is a response to an Interaction + * + * @deprecated In favor of `interaction_metadata` */ interaction?: APIMessageInteraction; /** @@ -670,13 +677,13 @@ export interface APIMessage { /** * Sent if the message contains components like buttons, action rows, or other interactive components * - * The `MESSAGE_CONTENT` privileged gateway intent will become required after **August 31, 2022** for verified applications to receive a non-empty value from this field + * The `MESSAGE_CONTENT` privileged gateway intent is required for verified applications to receive a non-empty value from this field * * In the Discord Developers Portal, you need to enable the toggle of this intent of your application in **Bot \> Privileged Gateway Intents** * * @see {@link https://support-dev.discord.com/hc/articles/4404772028055} */ - components?: APIActionRowComponent[]; + components?: APIMessageTopLevelComponent[]; /** * Sent if the message contains stickers * @@ -696,6 +703,10 @@ export interface APIMessage { * It can be used to estimate the relative position of the message in a thread in company with `total_message_sent` on parent thread */ position?: number; + /** + * Data of the role subscription purchase or renewal that prompted this `ROLE_SUBSCRIPTION_PURCHASE` message + */ + role_subscription_data?: APIMessageRoleSubscriptionData; /** * Data for users, members, channels, and roles in the message's auto-populated select menus * @@ -708,7 +719,6 @@ export interface APIMessage { * The `MESSAGE_CONTENT` privileged gateway intent is required for verified applications to receive a non-empty value from this field * * In the Discord Developers Portal, you need to enable the toggle of this intent of your application in **Bot \> Privileged Gateway Intents**. - * You also need to specify the intent bit value (`1 << 15`) if you are connecting to the gateway * * @see {@link https://support-dev.discord.com/hc/articles/4404772028055} */ @@ -894,6 +904,10 @@ export enum MessageFlags { * This message has a snapshot (via Message Forwarding) */ HasSnapshot = 1 << 14, + /** + * This flag is required to use new components + */ + IsComponentsV2 = 1 << 15, } /** @@ -910,6 +924,28 @@ export interface APIMessageCall { ended_timestamp?: string | null; } +/** + * @see {@link https://discord.com/developers/docs/resources/channel#role-subscription-data-object-role-subscription-data-object-structure} + */ +export interface APIMessageRoleSubscriptionData { + /** + * The id of the SKU and listing the user is subscribed to + */ + role_subscription_listing_id: Snowflake; + /** + * The name of the tier the user is subscribed to + */ + tier_name: string; + /** + * The number of months the user has been subscribed for + */ + total_months_subscribed: number; + /** + * Whether this notification is for a renewal + */ + is_renewal: boolean; +} + /** * @see {@link https://discord.com/developers/docs/resources/channel#followed-channel-object} */ @@ -1526,6 +1562,10 @@ export interface APIBaseComponent { * The type of the component */ type: T; + /** + * int32, auto generated via increment if not provided + */ + id?: number; } /** @@ -1564,6 +1604,14 @@ export enum ComponentType { * Select menu for channels */ ChannelSelect, + Section, + TextDisplay, + Thumbnail, + MediaGallery, + File, + Separator, + ContentInventoryEntry = 16, + Container, // EVERYTHING BELOW THIS LINE SHOULD BE OLD NAMES FOR RENAMED ENUM MEMBERS // @@ -1578,7 +1626,7 @@ export enum ComponentType { /** * @see {@link https://discord.com/developers/docs/interactions/message-components#action-rows} */ -export interface APIActionRowComponent +export interface APIActionRowComponent extends APIBaseComponent { /** * The components in the ActionRow @@ -1868,6 +1916,77 @@ export interface APITextInputComponent extends APIBaseComponent references + */ + url: string; + proxy_url?: string; + width?: number | null; + height?: number | null; + placeholder?: string | null; + placeholder_version?: number | null; + content_type?: string | null; + loading_state?: UnfurledMediaItemLoadingState; + flags?: number; +} + +export interface APISectionComponent extends APIBaseComponent { + components: APITextDisplayComponent[]; + accessory: APISectionAccessoryComponent; +} + +export interface APITextDisplayComponent extends APIBaseComponent { + content: string; +} + +export interface APIThumbnailComponent extends APIBaseComponent { + media: APIUnfurledMediaItem; + description?: string | null; + spoiler?: boolean; +} + +export interface APIMediaGalleryItem { + media: APIUnfurledMediaItem; + description?: string | null; + spoiler?: boolean; +} + +export interface APIMediaGalleryComponent extends APIBaseComponent { + items: APIMediaGalleryItem[]; +} + +export enum SeparatorSpacingSize { + Small = 1, + Large, +} + +export interface APISeparatorComponent extends APIBaseComponent { + divider?: boolean; + spacing?: SeparatorSpacingSize; +} + +export interface APIFileComponent extends APIBaseComponent { + /** + * The APIUnfurledMediaItem ONLY supports attachment:// references + */ + file: APIUnfurledMediaItem; + spoiler?: boolean; +} + +export interface APIContainerComponent extends APIBaseComponent { + accent_color?: number | null; + spoiler?: boolean; + components: APIComponentInContainer[]; +} + /** * @see {@link https://discord.com/developers/docs/resources/channel#message-snapshot-object} */ @@ -1933,20 +2052,57 @@ export enum ChannelFlags { } /** + * All components that can appear in messages. + * + * For more specific sets, see {@link APIMessageTopLevelComponent}, {@link APIComponentInMessageActionRow}, {@link APIComponentInContainer}, and {@link APISectionAccessoryComponent} + * * @see {@link https://discord.com/developers/docs/interactions/message-components#message-components} */ -export type APIMessageComponent = APIActionRowComponent | APIMessageActionRowComponent; -export type APIModalComponent = APIActionRowComponent | APIModalActionRowComponent; - -export type APIActionRowComponentTypes = APIMessageActionRowComponent | APIModalActionRowComponent; +export type APIMessageComponent = + | APIActionRowComponent + | APIButtonComponent + | APIContainerComponent + | APIFileComponent + | APIMediaGalleryComponent + | APISectionComponent + | APISelectMenuComponent + | APISeparatorComponent + | APITextDisplayComponent + | APIThumbnailComponent; /** * @see {@link https://discord.com/developers/docs/interactions/message-components#message-components} */ -export type APIMessageActionRowComponent = APIButtonComponent | APISelectMenuComponent; +export type APIMessageTopLevelComponent = + | APIActionRowComponent + | APIContainerComponent + | APIFileComponent + | APIMediaGalleryComponent + | APISectionComponent + | APISeparatorComponent + | APITextDisplayComponent; + +export type APIModalComponent = APIActionRowComponent | APIComponentInModalActionRow; + +export type APIComponentInActionRow = APIComponentInMessageActionRow | APIComponentInModalActionRow; + +/** + * @see {@link https://discord.com/developers/docs/interactions/message-components#message-components} + */ +export type APIComponentInMessageActionRow = APIButtonComponent | APISelectMenuComponent; // Modal components -export type APIModalActionRowComponent = APITextInputComponent; +export type APIComponentInModalActionRow = APITextInputComponent; + +export type APISectionAccessoryComponent = APIButtonComponent | APIThumbnailComponent; + +export type APIComponentInContainer = + | APIActionRowComponent + | APIFileComponent + | APIMediaGalleryComponent + | APISectionComponent + | APISeparatorComponent + | APITextDisplayComponent; export type APIMessageSnapshotFields = Pick< APIMessage, diff --git a/rest/v10/channel.ts b/rest/v10/channel.ts index cb803711..be26984d 100644 --- a/rest/v10/channel.ts +++ b/rest/v10/channel.ts @@ -1,13 +1,11 @@ import type { Permissions, Snowflake } from '../../globals'; import type { - APIActionRowComponent, APIAllowedMentions, APIChannel, APIEmbed, APIExtendedInvite, APIFollowedChannel, APIMessage, - APIMessageActionRowComponent, APIMessageReference, APIThreadList, APIThreadMember, @@ -25,6 +23,7 @@ import type { ForumLayoutType, ChannelFlags, APIAttachment, + APIMessageTopLevelComponent, } from '../../payloads/v10/index'; import type { _AddUndefinedToPossiblyUndefinedPropertiesOfInterface, _StrictPartial } from '../../utils/internals'; import type { RESTAPIPoll } from './poll'; @@ -311,7 +310,7 @@ export interface RESTPostAPIChannelMessageJSONBody { * * @see {@link https://discord.com/developers/docs/interactions/message-components#component-object} */ - components?: APIActionRowComponent[] | undefined; + components?: APIMessageTopLevelComponent[] | undefined; /** * IDs of up to 3 stickers in the server to send in the message * @@ -464,7 +463,7 @@ export interface RESTPatchAPIChannelMessageJSONBody { * * @see {@link https://discord.com/developers/docs/interactions/message-components#component-object} */ - components?: APIActionRowComponent[] | null | undefined; + components?: APIMessageTopLevelComponent[] | null | undefined; } /** diff --git a/rest/v10/webhook.ts b/rest/v10/webhook.ts index 0da27c96..449f7dfc 100644 --- a/rest/v10/webhook.ts +++ b/rest/v10/webhook.ts @@ -1,12 +1,11 @@ import type { Snowflake } from '../../globals'; import type { APIAllowedMentions, - APIActionRowComponent, APIEmbed, APIMessage, APIWebhook, MessageFlags, - APIMessageActionRowComponent, + APIMessageTopLevelComponent, } from '../../payloads/v10/index'; import type { _AddUndefinedToPossiblyUndefinedPropertiesOfInterface, _Nullable } from '../../utils/internals'; import type { RESTAPIAttachment } from './channel'; @@ -136,7 +135,7 @@ export interface RESTPostAPIWebhookWithTokenJSONBody { * * @see {@link https://discord.com/developers/docs/interactions/message-components#component-object} */ - components?: APIActionRowComponent[] | undefined; + components?: APIMessageTopLevelComponent[] | undefined; /** * Attachment objects with filename and description */ @@ -298,7 +297,10 @@ export type RESTPatchAPIWebhookWithTokenMessageFormDataBody = /** * @see {@link https://discord.com/developers/docs/resources/webhook#edit-webhook-message-query-string-params} */ -export type RESTPatchAPIWebhookWithTokenQuery = Pick; +export type RESTPatchAPIWebhookWithTokenMessageQuery = Pick< + RESTPostAPIWebhookWithTokenQuery, + 'thread_id' | 'with_components' +>; /** * @see {@link https://discord.com/developers/docs/resources/webhook#edit-webhook-message} diff --git a/rest/v9/channel.ts b/rest/v9/channel.ts index 17f5ef6c..10571fc1 100644 --- a/rest/v9/channel.ts +++ b/rest/v9/channel.ts @@ -1,13 +1,11 @@ import type { Permissions, Snowflake } from '../../globals'; import type { - APIActionRowComponent, APIAllowedMentions, APIChannel, APIEmbed, APIExtendedInvite, APIFollowedChannel, APIMessage, - APIMessageActionRowComponent, APIMessageReference, APIThreadList, APIThreadMember, @@ -25,6 +23,7 @@ import type { ForumLayoutType, ChannelFlags, APIAttachment, + APIMessageTopLevelComponent, } from '../../payloads/v9/index'; import type { _AddUndefinedToPossiblyUndefinedPropertiesOfInterface, _StrictPartial } from '../../utils/internals'; import type { RESTAPIPoll } from './poll'; @@ -318,7 +317,7 @@ export interface RESTPostAPIChannelMessageJSONBody { * * @see {@link https://discord.com/developers/docs/interactions/message-components#component-object} */ - components?: APIActionRowComponent[] | undefined; + components?: APIMessageTopLevelComponent[] | undefined; /** * IDs of up to 3 stickers in the server to send in the message * @@ -478,7 +477,7 @@ export interface RESTPatchAPIChannelMessageJSONBody { * * @see {@link https://discord.com/developers/docs/interactions/message-components#component-object} */ - components?: APIActionRowComponent[] | null | undefined; + components?: APIMessageTopLevelComponent[] | null | undefined; } /** diff --git a/rest/v9/webhook.ts b/rest/v9/webhook.ts index e55a8c3b..b494e415 100644 --- a/rest/v9/webhook.ts +++ b/rest/v9/webhook.ts @@ -1,12 +1,11 @@ import type { Snowflake } from '../../globals'; import type { APIAllowedMentions, - APIActionRowComponent, APIEmbed, APIMessage, APIWebhook, MessageFlags, - APIMessageActionRowComponent, + APIMessageTopLevelComponent, } from '../../payloads/v9/index'; import type { _AddUndefinedToPossiblyUndefinedPropertiesOfInterface, _Nullable } from '../../utils/internals'; import type { RESTAPIAttachment } from './channel'; @@ -136,7 +135,7 @@ export interface RESTPostAPIWebhookWithTokenJSONBody { * * @see {@link https://discord.com/developers/docs/interactions/message-components#component-object} */ - components?: APIActionRowComponent[] | undefined; + components?: APIMessageTopLevelComponent[] | undefined; /** * Attachment objects with filename and description */ @@ -298,7 +297,10 @@ export type RESTPatchAPIWebhookWithTokenMessageFormDataBody = /** * @see {@link https://discord.com/developers/docs/resources/webhook#edit-webhook-message-query-string-params} */ -export type RESTPatchAPIWebhookWithTokenQuery = Pick; +export type RESTPatchAPIWebhookWithTokenMessageQuery = Pick< + RESTPostAPIWebhookWithTokenQuery, + 'thread_id' | 'with_components' +>; /** * @see {@link https://discord.com/developers/docs/resources/webhook#edit-webhook-message}