mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 09:33:32 +01:00
fix(MessageReaction): fetching a removed partial custom emoji (#3955)
* fix: handling GuildEmoji within fetch() * refactor: remove unused "private" methods * refactor: make use of Message#fetch() to patch
This commit is contained in:
@@ -101,8 +101,12 @@ class MessageReaction {
|
||||
* Fetch this reaction.
|
||||
* @returns {Promise<MessageReaction>}
|
||||
*/
|
||||
fetch() {
|
||||
return this.message.reactions._fetchReaction(this.emoji, true);
|
||||
async fetch() {
|
||||
const message = await this.message.fetch();
|
||||
const existing = message.reactions.cache.get(this.emoji.id || this.emoji.name);
|
||||
// The reaction won't get set when it has been completely removed
|
||||
this._patch(existing || { count: 0 });
|
||||
return this;
|
||||
}
|
||||
|
||||
toJSON() {
|
||||
|
||||
Reference in New Issue
Block a user