add hardcoded gif map
This commit is contained in:
parent
5cfc7de0f7
commit
5c6bf37196
1 changed files with 13 additions and 1 deletions
|
|
@ -138,6 +138,15 @@ export const MeterPrefix = {
|
||||||
"k": "킬로",
|
"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 {
|
export function processDots(input: string): string {
|
||||||
return input.replace(/[\.,]+$/, "")
|
return input.replace(/[\.,]+$/, "")
|
||||||
.replace(/[\.,]{2,}/g, "")
|
.replace(/[\.,]{2,}/g, "")
|
||||||
|
|
@ -170,8 +179,11 @@ export function saferKorean(input: string): string {
|
||||||
|
|
||||||
// Process link
|
// Process link
|
||||||
.replace(/[hH][tT]{2}[pP][sS]?:\/\/(\S+)/g, (_, url: string) => {
|
.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")) {
|
if (url.startsWith("tenor.com/view")) {
|
||||||
return "움짤";
|
return "움짤!";
|
||||||
}
|
}
|
||||||
return "링크";
|
return "링크";
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue