From 5c6bf371969f5743c76f6a3d169603db4ab5f7ca Mon Sep 17 00:00:00 2001 From: kimpure Date: Thu, 21 May 2026 15:30:22 +0000 Subject: [PATCH] add hardcoded gif map --- packages/utils/saferKorean.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/utils/saferKorean.ts b/packages/utils/saferKorean.ts index e85f943..d170942 100644 --- a/packages/utils/saferKorean.ts +++ b/packages/utils/saferKorean.ts @@ -138,6 +138,15 @@ export const MeterPrefix = { "k": "킬로", }; +export const GIFMap = { + "https://tenor.com/view/majo-no-tabitabi-the-journey-of-elaina-elaina-windy-hair-gif-19187698": "화난 일레이나", + "https://tenor.com/view/majo-no-tabitabi-the-journey-of-elaina-elaina-sparkle-amazed-gif-18827847": "일레이나 반짝반짝", + "https://images-ext-1.discordapp.net/external/C3xPFuUxs16jY25AR3NvsIDezaOtib9wozhLBWejZk4/https/media.tenor.com/bUd8mk4ufwsAAAPo/anime-disappointment.mp4": "일레이나 절래절래", + "https://images-ext-1.discordapp.net/external/SXv4qgpy2r1Gx-dNxhcfJle6AXDaH_SToRjEBYYaup0/https/media.tenor.com/nDDxJc4FDwEAAAPo/cute.mp4": "일레이나 끄덕", + "https://tenor.com/view/majo-no-tabitabi-the-journey-of-elaina-elaina-what-gif-19011602": "당황한 일레이나", + "https://images-ext-1.discordapp.net/external/2R41WcvNJwYMD69UKls2cDa_hEL-rzCRCFvOi2DDOVo/https/media.tenor.com/sU3RCOixDbgAAAPo/majo-no-tabitabi-the-journey-of-elaina.mp4": "일레이나 손짓", +}; + export function processDots(input: string): string { return input.replace(/[\.,]+$/, "") .replace(/[\.,]{2,}/g, "") @@ -170,8 +179,11 @@ export function saferKorean(input: string): string { // Process link .replace(/[hH][tT]{2}[pP][sS]?:\/\/(\S+)/g, (_, url: string) => { + const mapped = GIFMap[url as keyof typeof GIFMap] as (string | undefined); + if (mapped) return mapped; + if (url.startsWith("tenor.com/view")) { - return "움짤"; + return "움짤!"; } return "링크"; })