From 7f24d3887af228337f3d85e07151ef000315fe55 Mon Sep 17 00:00:00 2001 From: Tenpi Date: Wed, 4 Sep 2024 21:25:41 -0400 Subject: [PATCH] refactor: check application emojis first --- .../discord.js/src/structures/MessageReaction.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/packages/discord.js/src/structures/MessageReaction.js b/packages/discord.js/src/structures/MessageReaction.js index 2295859c6087..283156465df3 100644 --- a/packages/discord.js/src/structures/MessageReaction.js +++ b/packages/discord.js/src/structures/MessageReaction.js @@ -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;