From c3b331d80a1c4b97b260584f4c9afb5f81871ba9 Mon Sep 17 00:00:00 2001 From: kshitijanurag Date: Thu, 19 Mar 2026 13:10:28 +0530 Subject: [PATCH] feat(message): shared client themes (#1565) --- deno/payloads/v10/message.ts | 36 ++++++++++++++++++++++++++++++++++++ deno/payloads/v9/message.ts | 36 ++++++++++++++++++++++++++++++++++++ deno/rest/v10/channel.ts | 5 +++++ deno/rest/v9/channel.ts | 5 +++++ payloads/v10/message.ts | 36 ++++++++++++++++++++++++++++++++++++ payloads/v9/message.ts | 36 ++++++++++++++++++++++++++++++++++++ rest/v10/channel.ts | 5 +++++ rest/v9/channel.ts | 5 +++++ 8 files changed, 164 insertions(+) diff --git a/deno/payloads/v10/message.ts b/deno/payloads/v10/message.ts index 6e87ac30..64dc80f1 100644 --- a/deno/payloads/v10/message.ts +++ b/deno/payloads/v10/message.ts @@ -253,6 +253,10 @@ export interface APIBaseMessageNoChannel { * The call associated with the message */ call?: APIMessageCall; + /** + * The custom client-side theme shared via the message + */ + shared_client_theme?: APIMessageSharedClientTheme; } /** @@ -463,6 +467,38 @@ export interface APIMessageCall { ended_timestamp?: string | null; } +/** + * @see https://docs.discord.com/developers/resources/message#base-theme-types + */ +export enum BaseThemeType { + Dark = 1, + Light, + Darker, + Midnight, +} + +/** + * @see https://docs.discord.com/developers/resources/message#shared-client-theme-object + */ +export interface APIMessageSharedClientTheme { + /** + * The hexadecimal-encoded colors of the theme (max of 5) + */ + colors: string[]; + /** + * The direction of the theme's colors (max of 360) + */ + gradient_angle: number; + /** + * The intensity of the theme's colors (max of 100) + */ + base_mix: number; + /** + * The mode of the theme + */ + base_theme?: BaseThemeType | null; +} + /** * @see {@link https://discord.com/developers/docs/resources/message#role-subscription-data-object-role-subscription-data-object-structure} */ diff --git a/deno/payloads/v9/message.ts b/deno/payloads/v9/message.ts index 300bd75f..49da4ad0 100644 --- a/deno/payloads/v9/message.ts +++ b/deno/payloads/v9/message.ts @@ -248,6 +248,10 @@ export interface APIBaseMessageNoChannel { * The call associated with the message */ call?: APIMessageCall; + /** + * The custom client-side theme shared via the message + */ + shared_client_theme?: APIMessageSharedClientTheme; } /** @@ -458,6 +462,38 @@ export interface APIMessageCall { ended_timestamp?: string | null; } +/** + * @see https://docs.discord.com/developers/resources/message#base-theme-types + */ +export enum BaseThemeType { + Dark = 1, + Light, + Darker, + Midnight, +} + +/** + * @see https://docs.discord.com/developers/resources/message#shared-client-theme-object + */ +export interface APIMessageSharedClientTheme { + /** + * The hexadecimal-encoded colors of the theme (max of 5) + */ + colors: string[]; + /** + * The direction of the theme's colors (max of 360) + */ + gradient_angle: number; + /** + * The intensity of the theme's colors (max of 100) + */ + base_mix: number; + /** + * The mode of the theme + */ + base_theme?: BaseThemeType | null; +} + /** * @see {@link https://discord.com/developers/docs/resources/message#role-subscription-data-object-role-subscription-data-object-structure} */ diff --git a/deno/rest/v10/channel.ts b/deno/rest/v10/channel.ts index 1586fd06..2b40e978 100644 --- a/deno/rest/v10/channel.ts +++ b/deno/rest/v10/channel.ts @@ -7,6 +7,7 @@ import type { APIFollowedChannel, APIMessage, APIMessageReference, + APIMessageSharedClientTheme, APIThreadList, APIThreadMember, APIUser, @@ -337,6 +338,10 @@ export interface RESTPostAPIChannelMessageJSONBody { * A poll! */ poll?: RESTAPIPoll | undefined; + /** + * The custom client-side theme to share via the message + */ + shared_client_theme?: APIMessageSharedClientTheme | undefined; } /** diff --git a/deno/rest/v9/channel.ts b/deno/rest/v9/channel.ts index 09e75edf..12fa0f61 100644 --- a/deno/rest/v9/channel.ts +++ b/deno/rest/v9/channel.ts @@ -7,6 +7,7 @@ import type { APIFollowedChannel, APIMessage, APIMessageReference, + APIMessageSharedClientTheme, APIThreadList, APIThreadMember, APIUser, @@ -344,6 +345,10 @@ export interface RESTPostAPIChannelMessageJSONBody { * A poll! */ poll?: RESTAPIPoll | undefined; + /** + * The custom client-side theme to share via the message + */ + shared_client_theme?: APIMessageSharedClientTheme | undefined; } /** diff --git a/payloads/v10/message.ts b/payloads/v10/message.ts index 06949f4e..c11c9ce5 100644 --- a/payloads/v10/message.ts +++ b/payloads/v10/message.ts @@ -253,6 +253,10 @@ export interface APIBaseMessageNoChannel { * The call associated with the message */ call?: APIMessageCall; + /** + * The custom client-side theme shared via the message + */ + shared_client_theme?: APIMessageSharedClientTheme; } /** @@ -463,6 +467,38 @@ export interface APIMessageCall { ended_timestamp?: string | null; } +/** + * @see https://docs.discord.com/developers/resources/message#base-theme-types + */ +export enum BaseThemeType { + Dark = 1, + Light, + Darker, + Midnight, +} + +/** + * @see https://docs.discord.com/developers/resources/message#shared-client-theme-object + */ +export interface APIMessageSharedClientTheme { + /** + * The hexadecimal-encoded colors of the theme (max of 5) + */ + colors: string[]; + /** + * The direction of the theme's colors (max of 360) + */ + gradient_angle: number; + /** + * The intensity of the theme's colors (max of 100) + */ + base_mix: number; + /** + * The mode of the theme + */ + base_theme?: BaseThemeType | null; +} + /** * @see {@link https://discord.com/developers/docs/resources/message#role-subscription-data-object-role-subscription-data-object-structure} */ diff --git a/payloads/v9/message.ts b/payloads/v9/message.ts index abbd8857..65f442c6 100644 --- a/payloads/v9/message.ts +++ b/payloads/v9/message.ts @@ -248,6 +248,10 @@ export interface APIBaseMessageNoChannel { * The call associated with the message */ call?: APIMessageCall; + /** + * The custom client-side theme shared via the message + */ + shared_client_theme?: APIMessageSharedClientTheme; } /** @@ -458,6 +462,38 @@ export interface APIMessageCall { ended_timestamp?: string | null; } +/** + * @see https://docs.discord.com/developers/resources/message#base-theme-types + */ +export enum BaseThemeType { + Dark = 1, + Light, + Darker, + Midnight, +} + +/** + * @see https://docs.discord.com/developers/resources/message#shared-client-theme-object + */ +export interface APIMessageSharedClientTheme { + /** + * The hexadecimal-encoded colors of the theme (max of 5) + */ + colors: string[]; + /** + * The direction of the theme's colors (max of 360) + */ + gradient_angle: number; + /** + * The intensity of the theme's colors (max of 100) + */ + base_mix: number; + /** + * The mode of the theme + */ + base_theme?: BaseThemeType | null; +} + /** * @see {@link https://discord.com/developers/docs/resources/message#role-subscription-data-object-role-subscription-data-object-structure} */ diff --git a/rest/v10/channel.ts b/rest/v10/channel.ts index 0002d44f..9345d626 100644 --- a/rest/v10/channel.ts +++ b/rest/v10/channel.ts @@ -7,6 +7,7 @@ import type { APIFollowedChannel, APIMessage, APIMessageReference, + APIMessageSharedClientTheme, APIThreadList, APIThreadMember, APIUser, @@ -337,6 +338,10 @@ export interface RESTPostAPIChannelMessageJSONBody { * A poll! */ poll?: RESTAPIPoll | undefined; + /** + * The custom client-side theme to share via the message + */ + shared_client_theme?: APIMessageSharedClientTheme | undefined; } /** diff --git a/rest/v9/channel.ts b/rest/v9/channel.ts index b65daea3..141e3a13 100644 --- a/rest/v9/channel.ts +++ b/rest/v9/channel.ts @@ -7,6 +7,7 @@ import type { APIFollowedChannel, APIMessage, APIMessageReference, + APIMessageSharedClientTheme, APIThreadList, APIThreadMember, APIUser, @@ -344,6 +345,10 @@ export interface RESTPostAPIChannelMessageJSONBody { * A poll! */ poll?: RESTAPIPoll | undefined; + /** + * The custom client-side theme to share via the message + */ + shared_client_theme?: APIMessageSharedClientTheme | undefined; } /**