mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 20:13:30 +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' });
|
return flatten(this, { emoji: 'emojiId', message: 'messageId' });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
valueOf() {
|
||||||
|
return this._emoji.id ?? this._emoji.name;
|
||||||
|
}
|
||||||
|
|
||||||
_add(user) {
|
_add(user) {
|
||||||
if (this.partial) return;
|
if (this.partial) return;
|
||||||
this.users.cache.set(user.id, user);
|
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 remove(): Promise<MessageReaction>;
|
||||||
public fetch(): Promise<MessageReaction>;
|
public fetch(): Promise<MessageReaction>;
|
||||||
public toJSON(): unknown;
|
public toJSON(): unknown;
|
||||||
|
public valueOf(): Snowflake | string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ModalComponentData {
|
export interface ModalComponentData {
|
||||||
|
|||||||
Reference in New Issue
Block a user