Correctly parse Revolt emojis
This commit is contained in:
parent
bd05736c73
commit
38d58069c8
1 changed files with 5 additions and 1 deletions
|
@ -13,7 +13,11 @@ async function fetchEmojiList(): Promise<Record<string, string>> {
|
||||||
const start = file.indexOf('...{') + 3;
|
const start = file.indexOf('...{') + 3;
|
||||||
const end = file.indexOf('},') + 1;
|
const end = file.indexOf('},') + 1;
|
||||||
|
|
||||||
return JSON5.parse(file.substring(start, end).trim());
|
return JSON5.parse(
|
||||||
|
file.substring(start, end)
|
||||||
|
.replace(/^\s*[0-9]+:/gm, (match) => `"${match.replace(/(^\s+)|(:$)/g, '')}":`)
|
||||||
|
.trim()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const emojiUpdate = async () => {
|
const emojiUpdate = async () => {
|
||||||
|
|
Loading…
Reference in a new issue