From 4b2b0718a3d3b1a56af80109d5ccb1fb0d755615 Mon Sep 17 00:00:00 2001 From: Elysia <71698422+aiko-chan-ai@users.noreply.github.com> Date: Tue, 2 May 2023 23:34:57 +0700 Subject: [PATCH] feat: Super Reaction #9336 djs --- src/structures/MessageReaction.js | 24 +++++++++++++++++++++--- typings/index.d.ts | 6 ++++++ 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/src/structures/MessageReaction.js b/src/structures/MessageReaction.js index 7b6bd60..a202800 100644 --- a/src/structures/MessageReaction.js +++ b/src/structures/MessageReaction.js @@ -66,10 +66,28 @@ class MessageReaction { if ('burst_colors' in data) { /** - * Burst colors of the reaction - * @type {?string[]} + * HEX colors used for super reaction + * @type {string[]} */ - this.burstColors ??= data.burst_colors; + this.burstColors = data.burst_colors; + } + + if ('count_details' in data) { + /** + * The reaction count details object contains information about super and normal reaction counts. + * @typedef {Object} ReactionCountDetailsData + * @property {number} burst Count of super reaction + * @property {number} normal Count of normal reaction + */ + + /** + * The reaction count details object contains information about super and normal reaction counts. + * @type {?ReactionCountDetailsData} + */ + this.countDetails = { + burst: data.count_details.burst, + normal: data.count_details.normal, + }; } } diff --git a/typings/index.d.ts b/typings/index.d.ts index a6381d7..281843c 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -2412,6 +2412,7 @@ export class MessageReaction { public isBurst: boolean; public readonly emoji: GuildEmoji | ReactionEmoji; public me: boolean; + public countDetails: ReactionCountDetailsData; public message: Message | PartialMessage; public readonly partial: false; public users: ReactionUserManager; @@ -2420,6 +2421,11 @@ export class MessageReaction { public toJSON(): unknown; } +export interface ReactionCountDetailsData { + burst: number; + normal: number; +} + export class MessageSelectMenu extends BaseMessageComponent { public constructor(data?: MessageSelectMenu | MessageSelectMenuOptions | APISelectMenuComponent); public channelTypes: ChannelTypes[];