mirror of
https://github.com/janderedev/automod.git
synced 2024-12-22 02:35:27 +00:00
Correctly parse Revolt emojis
This commit is contained in:
parent
bd05736c73
commit
38d58069c8
|
@ -13,7 +13,11 @@ async function fetchEmojiList(): Promise<Record<string, string>> {
|
|||
const start = file.indexOf('...{') + 3;
|
||||
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 () => {
|
||||
|
|
Loading…
Reference in a new issue