From 150dc46b8739ca9cf10a46bb48d390f70c679b6e Mon Sep 17 00:00:00 2001 From: MateoDeveloper <79017590+Mateo-tem@users.noreply.github.com> Date: Thu, 22 Feb 2024 19:16:59 -0500 Subject: [PATCH] feat: add initial support for super reactions (#744) Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com> --- deno/payloads/v10/channel.ts | 28 +++++++++++++++++++++++++++- deno/payloads/v9/channel.ts | 28 +++++++++++++++++++++++++++- deno/rest/common.ts | 1 + payloads/v10/channel.ts | 28 +++++++++++++++++++++++++++- payloads/v9/channel.ts | 28 +++++++++++++++++++++++++++- rest/common.ts | 1 + 6 files changed, 110 insertions(+), 4 deletions(-) diff --git a/deno/payloads/v10/channel.ts b/deno/payloads/v10/channel.ts index bc3f2c57..4cb5ad2b 100644 --- a/deno/payloads/v10/channel.ts +++ b/deno/payloads/v10/channel.ts @@ -900,19 +900,45 @@ export interface APIFollowedChannel { */ export interface APIReaction { /** - * Times this emoji has been used to react + * Total number of times this emoji has been used to react (including super reacts) */ count: number; + /** + * An object detailing the individual reaction counts for different types of reactions + */ + count_details: APIReactionCountDetails; /** * Whether the current user reacted using this emoji */ me: boolean; + /** + * Whether the current user super-reacted using this emoji + */ + me_burst: boolean; /** * Emoji information * * See https://discord.com/developers/docs/resources/emoji#emoji-object */ emoji: APIPartialEmoji; + /** + * Hexadecimal colors used for this super reaction + */ + burst_colors: string[]; +} + +/** + * https://discord.com/developers/docs/resources/channel#reaction-count-details-object-reaction-count-details-structure + */ +export interface APIReactionCountDetails { + /** + * Count of super reactions + */ + burst: number; + /** + * Count of normal reactions + */ + normal: number; } /** diff --git a/deno/payloads/v9/channel.ts b/deno/payloads/v9/channel.ts index 7f885576..5a555e28 100644 --- a/deno/payloads/v9/channel.ts +++ b/deno/payloads/v9/channel.ts @@ -865,19 +865,45 @@ export interface APIFollowedChannel { */ export interface APIReaction { /** - * Times this emoji has been used to react + * Total number of times this emoji has been used to react (including super reacts) */ count: number; + /** + * An object detailing the individual reaction counts for different types of reactions + */ + count_details: APIReactionCountDetails; /** * Whether the current user reacted using this emoji */ me: boolean; + /** + * Whether the current user super-reacted using this emoji + */ + me_burst: boolean; /** * Emoji information * * See https://discord.com/developers/docs/resources/emoji#emoji-object */ emoji: APIPartialEmoji; + /** + * Hexadecimal colors used for this super reaction + */ + burst_colors: string[]; +} + +/** + * https://discord.com/developers/docs/resources/channel#reaction-count-details-object-reaction-count-details-structure + */ +export interface APIReactionCountDetails { + /** + * Count of super reactions + */ + burst: number; + /** + * Count of normal reactions + */ + normal: number; } /** diff --git a/deno/rest/common.ts b/deno/rest/common.ts index b6739830..7cbc7592 100644 --- a/deno/rest/common.ts +++ b/deno/rest/common.ts @@ -254,6 +254,7 @@ export enum RESTJSONErrorCodes { NoUsersWithDiscordTagExist = 80_004, ReactionWasBlocked = 90_001, + UserCannotUseBurstReactions, ApplicationNotYetAvailable = 110_001, diff --git a/payloads/v10/channel.ts b/payloads/v10/channel.ts index af2828b5..42f575ed 100644 --- a/payloads/v10/channel.ts +++ b/payloads/v10/channel.ts @@ -900,19 +900,45 @@ export interface APIFollowedChannel { */ export interface APIReaction { /** - * Times this emoji has been used to react + * Total number of times this emoji has been used to react (including super reacts) */ count: number; + /** + * An object detailing the individual reaction counts for different types of reactions + */ + count_details: APIReactionCountDetails; /** * Whether the current user reacted using this emoji */ me: boolean; + /** + * Whether the current user super-reacted using this emoji + */ + me_burst: boolean; /** * Emoji information * * See https://discord.com/developers/docs/resources/emoji#emoji-object */ emoji: APIPartialEmoji; + /** + * Hexadecimal colors used for this super reaction + */ + burst_colors: string[]; +} + +/** + * https://discord.com/developers/docs/resources/channel#reaction-count-details-object-reaction-count-details-structure + */ +export interface APIReactionCountDetails { + /** + * Count of super reactions + */ + burst: number; + /** + * Count of normal reactions + */ + normal: number; } /** diff --git a/payloads/v9/channel.ts b/payloads/v9/channel.ts index feffe585..e8ba0dd7 100644 --- a/payloads/v9/channel.ts +++ b/payloads/v9/channel.ts @@ -865,19 +865,45 @@ export interface APIFollowedChannel { */ export interface APIReaction { /** - * Times this emoji has been used to react + * Total number of times this emoji has been used to react (including super reacts) */ count: number; + /** + * An object detailing the individual reaction counts for different types of reactions + */ + count_details: APIReactionCountDetails; /** * Whether the current user reacted using this emoji */ me: boolean; + /** + * Whether the current user super-reacted using this emoji + */ + me_burst: boolean; /** * Emoji information * * See https://discord.com/developers/docs/resources/emoji#emoji-object */ emoji: APIPartialEmoji; + /** + * Hexadecimal colors used for this super reaction + */ + burst_colors: string[]; +} + +/** + * https://discord.com/developers/docs/resources/channel#reaction-count-details-object-reaction-count-details-structure + */ +export interface APIReactionCountDetails { + /** + * Count of super reactions + */ + burst: number; + /** + * Count of normal reactions + */ + normal: number; } /** diff --git a/rest/common.ts b/rest/common.ts index b6739830..7cbc7592 100644 --- a/rest/common.ts +++ b/rest/common.ts @@ -254,6 +254,7 @@ export enum RESTJSONErrorCodes { NoUsersWithDiscordTagExist = 80_004, ReactionWasBlocked = 90_001, + UserCannotUseBurstReactions, ApplicationNotYetAvailable = 110_001,