您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 

12 行
431 B

import { emojis as compressed } from './emojis.generated';
import { decompressFromBase64LZString } from './system/string';
const emojiRegex = /:([-+_a-z0-9]+):/g;
let emojis: Record<string, string> | undefined = undefined;
export function emojify(message: string) {
if (emojis == null) {
emojis = JSON.parse(decompressFromBase64LZString(compressed));
}
return message.replace(emojiRegex, (s, code) => emojis![code] || s);
}