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:
Almeida
2023-02-17 19:51:08 +00:00
committed by GitHub
parent 1ba22f4c9e
commit f268e1d979
2 changed files with 5 additions and 0 deletions

View File

@@ -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);

View File

@@ -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 {