Skip to content

Commit

Permalink
refactor: check application emojis first
Browse files Browse the repository at this point in the history
  • Loading branch information
Moebits committed Sep 5, 2024
1 parent 6f25ce8 commit 7f24d38
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions packages/discord.js/src/structures/MessageReaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,18 +121,17 @@ class MessageReaction {
if (this._emoji instanceof ApplicationEmoji) return this._emoji;
// Check to see if the emoji has become known to the client
if (this._emoji.id) {
const applicationEmojis = this.message.client.application.emojis.cache;
if (applicationEmojis.has(this._emoji.id)) {
const emoji = applicationEmojis.get(this._emoji.id);
this._emoji = emoji;
return emoji;
}
const emojis = this.message.client.emojis.cache;
if (emojis.has(this._emoji.id)) {
const emoji = emojis.get(this._emoji.id);
this._emoji = emoji;
return emoji;
} else {
const applicationEmojis = this.message.client.application.emojis.cache;
if (applicationEmojis.has(this._emoji.id)) {
const emoji = applicationEmojis.get(this._emoji.id);
this._emoji = emoji;
return emoji;
}
}
}
return this._emoji;
Expand Down

0 comments on commit 7f24d38

Please sign in to comment.