From e2ea8f43b87829ef01690ef1747ecc1107901365 Mon Sep 17 00:00:00 2001 From: big nutty <3515180-bignutty@users.noreply.gitlab.com> Date: Mon, 11 Nov 2024 00:16:31 +0000 Subject: [PATCH] resolves issue (ref p3oekndq) --- commands/interaction/slash/utils/emoji.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/commands/interaction/slash/utils/emoji.js b/commands/interaction/slash/utils/emoji.js index d8ea9b9..4f6c5b4 100644 --- a/commands/interaction/slash/utils/emoji.js +++ b/commands/interaction/slash/utils/emoji.js @@ -133,11 +133,14 @@ module.exports = { if(Object.keys(res.data.platforms).length === 0) return await editOrReply(context, createEmbed("error", context, "No images available for this emoji.")); - let currentPlatform = "discord"; - - if(!res.data.platforms[currentPlatform]) currentPlatform = Object.keys(res.data.platforms)[0] + let currentPlatform; + + if(!res.data.platforms["twitter"]) currentPlatform = Object.keys(res.data.platforms)[0] else currentPlatform = "twitter" + // This handles selecting the correct "default" platform for enlarge. + if(res.data.platforms["discord"]) currentPlatform = "discord" + // Use the high-res emojipedia icon, if available let ico = `https://raw.githubusercontent.com/jdecked/twemoji/main/assets/72x72/${toCodePoint(emoji[0])}.png` if(res.data.platforms["twitter"]) ico = res.data.platforms["twitter"].images[0].src @@ -145,7 +148,6 @@ module.exports = { const DEFAULT_PLATFORM = currentPlatform - let currentView; let currentRevision = "";