From f97a77a5e9677e8a0c55a9164fc331b8224c26fb Mon Sep 17 00:00:00 2001 From: Nuno Duque Nunes Date: Fri, 12 Jun 2026 16:55:25 +0100 Subject: [PATCH] attempt #1 to fix Emoji.resolveTokens() --- src/systems/emojis.ts | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/systems/emojis.ts b/src/systems/emojis.ts index 7092497..88f1cf3 100644 --- a/src/systems/emojis.ts +++ b/src/systems/emojis.ts @@ -87,15 +87,20 @@ _map = null; }, + // resolveTokens(text: string): string { + // return text + // // Handle <:key:> or <:key:123456> format + // .replace(/<:([^:]+):(?:\d*)?>/g, (_, key) => Emoji.get(key) || `<:${key}:>`) + // // Handle :key: format (simpler notation in update JSONs) + // .replace(/:([a-z0-9_]+):/g, (match, key) => { + // const emoji = Emoji.get(key); + // return emoji || match; // leave as-is if not found + // }); + // }, + resolveTokens(text: string): string { - return text - // Handle <:key:> or <:key:123456> format - .replace(/<:([^:]+):(?:\d*)?>/g, (_, key) => Emoji.get(key) || `<:${key}:>`) - // Handle :key: format (simpler notation in update JSONs) - .replace(/:([a-z0-9_]+):/g, (match, key) => { - const emoji = Emoji.get(key); - return emoji || match; // leave as-is if not found - }); + // Only replace <:key:> pattern (no ID) — leave real Discord emojis untouched + return text.replace(/<:([^:]+):>/g, (_, key) => Emoji.get(key) || `<:${key}:>`); }, // resolveTokens(text: string): string {