mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
feat: Emit reaction type on gateway events (#10598)
feat: emit reaction type Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
@@ -51,6 +51,7 @@ class MessageReactionAdd extends Action {
|
||||
/**
|
||||
* Provides additional information about altered reaction
|
||||
* @typedef {Object} MessageReactionEventDetails
|
||||
* @property {ReactionType} type The type of the reaction
|
||||
* @property {boolean} burst Determines whether a super reaction was used
|
||||
*/
|
||||
/**
|
||||
@@ -60,7 +61,7 @@ class MessageReactionAdd extends Action {
|
||||
* @param {User} user The user that applied the guild or reaction emoji
|
||||
* @param {MessageReactionEventDetails} details Details of adding the reaction
|
||||
*/
|
||||
this.client.emit(Events.MessageReactionAdd, reaction, user, { burst: data.burst });
|
||||
this.client.emit(Events.MessageReactionAdd, reaction, user, { type: data.type, burst: data.burst });
|
||||
|
||||
return { message, reaction, user };
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ class MessageReactionRemove extends Action {
|
||||
* @param {User} user The user whose emoji or reaction emoji was removed
|
||||
* @param {MessageReactionEventDetails} details Details of removing the reaction
|
||||
*/
|
||||
this.client.emit(Events.MessageReactionRemove, reaction, user, { burst: data.burst });
|
||||
this.client.emit(Events.MessageReactionRemove, reaction, user, { type: data.type, burst: data.burst });
|
||||
|
||||
return { message, reaction, user };
|
||||
}
|
||||
|
||||
@@ -514,6 +514,11 @@
|
||||
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/PollLayoutType}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @external ReactionType
|
||||
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/ReactionType}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @external RoleFlags
|
||||
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/RoleFlags}
|
||||
|
||||
1
packages/discord.js/typings/index.d.ts
vendored
1
packages/discord.js/typings/index.d.ts
vendored
@@ -2447,6 +2447,7 @@ export class MessageReaction {
|
||||
}
|
||||
|
||||
export interface MessageReactionEventDetails {
|
||||
type: ReactionType;
|
||||
burst: boolean;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user