mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 19:43:29 +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
|
* Provides additional information about altered reaction
|
||||||
* @typedef {Object} MessageReactionEventDetails
|
* @typedef {Object} MessageReactionEventDetails
|
||||||
|
* @property {ReactionType} type The type of the reaction
|
||||||
* @property {boolean} burst Determines whether a super reaction was used
|
* @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 {User} user The user that applied the guild or reaction emoji
|
||||||
* @param {MessageReactionEventDetails} details Details of adding the reaction
|
* @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 };
|
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 {User} user The user whose emoji or reaction emoji was removed
|
||||||
* @param {MessageReactionEventDetails} details Details of removing the reaction
|
* @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 };
|
return { message, reaction, user };
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -510,6 +510,11 @@
|
|||||||
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/PollLayoutType}
|
* @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
|
* @external RoleFlags
|
||||||
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/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
@@ -2490,6 +2490,7 @@ export class MessageReaction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface MessageReactionEventDetails {
|
export interface MessageReactionEventDetails {
|
||||||
|
type: ReactionType;
|
||||||
burst: boolean;
|
burst: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user