feat: super reactions

#9336 backport
This commit is contained in:
Elysia
2024-09-17 19:18:21 +07:00
parent d6d768488b
commit 8dfa37fbd9
7 changed files with 78 additions and 33 deletions

View File

@@ -9,6 +9,7 @@ const { PartialTypes } = require('../../util/Constants');
message_id: 'id',
emoji: { name: '<27>', id: null },
channel_id: 'id',
burst: boolean
// If originating from a guild
guild_id: 'id',
member: { ..., user: { ... } } }
@@ -38,16 +39,23 @@ class MessageReactionAdd extends Action {
me: user.id === this.client.user.id,
...data,
});
console.log(reaction);
if (!reaction) return false;
reaction._add(user);
reaction._add(user, data.burst);
if (fromStructure) return { message, reaction, user };
/**
* Provides additional information about altered reaction
* @typedef {Object} MessageReactionEventDetails
* @property {boolean} burst Determines whether a super reaction was used
*/
/**
* Emitted whenever a reaction is added to a cached message.
* @event Client#messageReactionAdd
* @param {MessageReaction} messageReaction The reaction object
* @param {User} user The user that applied the guild or reaction emoji
* @param {MessageReactionEventDetails} details Details of adding the reaction
*/
this.client.emit(Events.MESSAGE_REACTION_ADD, reaction, user);
this.client.emit(Events.MESSAGE_REACTION_ADD, reaction, user, { burst: data.burst });
return { message, reaction, user };
}