From 9621dc7bb39087a752910eab170701fb6b4be585 Mon Sep 17 00:00:00 2001 From: axiand Date: Tue, 14 May 2024 03:16:49 +0200 Subject: [PATCH] EmoteCloner: allow cloning from reactions (#2458) --- src/plugins/emoteCloner/index.tsx | 5 +++-- src/utils/constants.ts | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/plugins/emoteCloner/index.tsx b/src/plugins/emoteCloner/index.tsx index cd9890a80..8c3ded6a7 100644 --- a/src/plugins/emoteCloner/index.tsx +++ b/src/plugins/emoteCloner/index.tsx @@ -322,8 +322,9 @@ const messageContextMenuPatch: NavContextMenuPatchCallback = (children, props) = switch (favoriteableType) { case "emoji": const match = props.message.content.match(RegExp(`|https://cdn\\.discordapp\\.com/emojis/${favoriteableId}\\.`)); - if (!match) return; - const name = match[1] ?? "FakeNitroEmoji"; + const reaction = props.message.reactions.find(reaction => reaction.emoji.id === favoriteableId); + if (!match && !reaction) return; + const name = (match && match[1]) ?? reaction?.emoji.name ?? "FakeNitroEmoji"; return buildMenuItem("Emoji", () => ({ id: favoriteableId, diff --git a/src/utils/constants.ts b/src/utils/constants.ts index c1e2cea2c..e446a27b6 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -473,6 +473,10 @@ export const Devs = /* #__PURE__*/ Object.freeze({ ImBanana: { name: "Im_Banana", id: 635250116688871425n + }, + xocherry: { + name: "xocherry", + id: 221288171013406720n } } satisfies Record);