mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
fix(MessageReaction): toJSON() infinite recursion (#9070)
* fix(MessageReaction): `toJSON()` infinite recursion * fix: return type Co-authored-by: Jaworek <jaworekwiadomosci@gmail.com> --------- Co-authored-by: Jaworek <jaworekwiadomosci@gmail.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
@@ -117,6 +117,10 @@ class MessageReaction {
|
||||
return flatten(this, { emoji: 'emojiId', message: 'messageId' });
|
||||
}
|
||||
|
||||
valueOf() {
|
||||
return this._emoji.id ?? this._emoji.name;
|
||||
}
|
||||
|
||||
_add(user) {
|
||||
if (this.partial) return;
|
||||
this.users.cache.set(user.id, user);
|
||||
|
||||
1
packages/discord.js/typings/index.d.ts
vendored
1
packages/discord.js/typings/index.d.ts
vendored
@@ -2156,6 +2156,7 @@ export class MessageReaction {
|
||||
public remove(): Promise<MessageReaction>;
|
||||
public fetch(): Promise<MessageReaction>;
|
||||
public toJSON(): unknown;
|
||||
public valueOf(): Snowflake | string;
|
||||
}
|
||||
|
||||
export interface ModalComponentData {
|
||||
|
||||
Reference in New Issue
Block a user