EmoteCloner: allow cloning from reactions (#2458)

main
axiand 4 months ago committed by GitHub
parent 59ee9c501d
commit 9621dc7bb3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -322,8 +322,9 @@ const messageContextMenuPatch: NavContextMenuPatchCallback = (children, props) =
switch (favoriteableType) { switch (favoriteableType) {
case "emoji": case "emoji":
const match = props.message.content.match(RegExp(`<a?:(\\w+)(?:~\\d+)?:${favoriteableId}>|https://cdn\\.discordapp\\.com/emojis/${favoriteableId}\\.`)); const match = props.message.content.match(RegExp(`<a?:(\\w+)(?:~\\d+)?:${favoriteableId}>|https://cdn\\.discordapp\\.com/emojis/${favoriteableId}\\.`));
if (!match) return; const reaction = props.message.reactions.find(reaction => reaction.emoji.id === favoriteableId);
const name = match[1] ?? "FakeNitroEmoji"; if (!match && !reaction) return;
const name = (match && match[1]) ?? reaction?.emoji.name ?? "FakeNitroEmoji";
return buildMenuItem("Emoji", () => ({ return buildMenuItem("Emoji", () => ({
id: favoriteableId, id: favoriteableId,

@ -473,6 +473,10 @@ export const Devs = /* #__PURE__*/ Object.freeze({
ImBanana: { ImBanana: {
name: "Im_Banana", name: "Im_Banana",
id: 635250116688871425n id: 635250116688871425n
},
xocherry: {
name: "xocherry",
id: 221288171013406720n
} }
} satisfies Record<string, Dev>); } satisfies Record<string, Dev>);

Loading…
Cancel
Save