update emoji list to be more like the old one but still good

This commit is contained in:
notfire 2025-06-25 22:21:24 -04:00
commit 295f3907e6
No known key found for this signature in database
3 changed files with 5806 additions and 1766 deletions

View file

@ -28,9 +28,8 @@
- option to disable title showing unreads
- update the list of emojis:
- switched weird unicode ones to proper emojis
- emojis are sourced from discord's list of emojis
- emojis are now sorted by category (like on every other emoji picker) instead of alphabetically
- all emojis go by their unicode names instead of the shortened ones, eg :100: is now :hundred_points:
- this wasn't intentional, but keeping the old names would require way more work
- script to get new emojis is included for future unicode versions
- add toggle for showing post edit notifications
- add support for accepted follow request notifications

File diff suppressed because it is too large Load diff

View file

@ -1,13 +1,20 @@
# python in a js project? lunacy
import json, requests
import requests, json, re
emojiListSrc = requests.get("https://github.com/muan/unicode-emoji-json/raw/refs/heads/main/data-by-emoji.json")
emojiList = json.loads(emojiListSrc.content)
newEmojiList = {}
emojilistraw = requests.get("https://github.com/xCykrix/discord_emoji/raw/refs/heads/main/mod.ts")
emojilistraw = emojilistraw.text
for emoji in emojiList:
newEmojiList[emojiList[emoji]["slug"]] = emoji
patt1 = re.compile("// deno.*\n.*\n.*\n.*\n.*\n\n.*\n.*= ")
patt2 = re.compile("}\n\n.*\n.*= {\n")
patt3 = re.compile("}\n\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n")
output = open("../static/emoji.json", "w+")
output.write(json.dumps(newEmojiList, indent=4, ensure_ascii=False))
patterns = [patt1, patt2, patt3]
for pattern in patterns:
emojilistraw = re.sub(pattern, "", emojilistraw)
emojilistparsed = json.loads(emojilistraw.rpartition(",")[0] + "}")
out = open("../static/emoji.json", "w+")
out.write(json.dumps(emojilistparsed, ensure_ascii=False, indent=4))