import copy import json # Unicode hexes that will have Mutant Modifier (mm) applied to mm_emojis = [0x1f446, 0x1f447, 0x1f448, 0x1f449, 0x1f44a, 0x1f44b, 0x1f44c, 0x1f44d, 0x1f44e, 0x1f44f, 0x1f450, 0x1f485, 0x1f4aa, 0x1f590, 0x1f595, 0x1f596, 0x1f64c, 0x1f64f, 0x1f918, 0x1f919, 0x1f91a, 0x1f91b, 0x1f91c, 0x1f91d, 0x1f91e, 0x1f933, 0x261d, 0x270a, 0x270b, 0x270c, 0x270d] # Mutant Modifier names and their modifiers mm_types = {"paw": "๔™", "claw": "๔™‘"} # Custom emojis that will be inserted to the end of an emoji category custom_emojis = {"symbols": {"๐Ÿ’ฏ๐ŸŒˆ": ["queer_100"], "๔šš": ["dont_at", "no_at", "no_mention", "dont_mention"], "โšฒ": ["neuter_symbol"], "โšจ": ["androgyne_symbol"], "โšง": ["transgender_symbol"], "โšฅ": ["male_female_symbol"], "โšค": ["male_and_female_symbol"], "โšฃ": ["two_male_symbols"], "โšข": ["two_female_symbols"], "โ™‚": ["male_symbol"], "โ™€": ["female_symbol"], "๐Ÿงก": ["orange_heart"], "๔š…": ["labrys_symbol"], "๔š„": ["bisexual_triangles"], "๔šƒ": ["black_triangle"], "๔š‚": ["pink_triangle"]}, "objects": {"๐Ÿงป": ["toilet_paper"], "๐Ÿงฑ": ["brick"], "๐Ÿงจ": ["firecracker"], "๐Ÿฆด": ["bone"], "๔š–": ["d20"], "๔š•": ["d12"], "๔š”": ["d10"], "๔š“": ["d8"], "๔š’": ["d4"]}, "nature": {"๔š›๐ŸŒˆ": ["furry_pride", "rainbow_paw"], "๔š›": ["paw"], "๔š˜": ["awoo"], "๔š™": ["dont_awoo", "no_awoo"], "๐Ÿง": ["elf"], "๐Ÿฆ": ["raccoon"], "๐Ÿฆœ": ["parrot"], "๐Ÿฆš": ["peacock"], "๔™ฆ": ["demon"]}, "people": {"๐Ÿง‘โœˆ": ["pilot"], "๐Ÿง‘โš•": ["health_worker"], "๐Ÿง‘๐Ÿš€": ["astronaut"], "๐Ÿง‘๐Ÿ”ฌ": ["scientist"], "๐Ÿง‘๐Ÿ”ง": ["mechanic"], "๐Ÿง‘๐Ÿ’ป": ["technologist"], "๐Ÿง‘๐Ÿณ": ["chef"], "๐Ÿง": ["monocle"], "๐Ÿฅบ": ["pleading"], "๐Ÿฅถ": ["cold"], "๐Ÿฅต": ["hot"], "๐Ÿฅด": ["woozy"], "๐Ÿฅณ": ["party_face"], "๐Ÿฅฐ": ["smile_hearts"], "๐Ÿคฏ": ["mind_blown"], "๐Ÿคฎ": ["vomiting"], "๐Ÿคญ": ["hand_over_mouth"], "๐Ÿคฌ": ["swearing"], "๐Ÿคซ": ["shush"], "๐Ÿคช": ["crazy"], "๐Ÿคฉ": ["starry_eyes"], "๐Ÿคจ": ["raised_eyebrow"], "๐Ÿ•ต๔˜ซ": ["detective"], "๐Ÿ’†๔˜ซ": ["massage"], "๐Ÿ’๔˜ซ": ["tipping_hand"], "๔š": ["hot_shit"], "๔š—": ["headpats"], "๐Ÿงœ": ["merperson"]}, "flags": {"๔š": ["transgender_flag"], "๔š€": ["polysexual_flag"], "๔™ฟ": ["polyamory_flag"], "๔™พ": ["pansexual_flag"], "๔™ฝ": ["nonbinary_flag"], "๔™ผ": ["neutrois_flag"], "๔™ป": ["intersex_flag"], "๔™บ": ["genderqueer_flag"], "๔™น": ["genderfluid_flag"], "๔™ธ": ["deminonbinary_flag"], "๔™ท": ["demigirl_flag"], "๔™ถ": ["demiguy_flag"], "๔™ต": ["bisexual_flag"], "๔™ด": ["bigender_flag"], "๔™ณ": ["bear_flag"], "๔™ฒ": ["asexual_flag"], "๔™ฑ": ["aromantic_flag"], "๔™ฐ": ["agender_flag"], "๔š†": ["lesbian_flag"], "๔™": ["paw-modifier"], "๔™‘": ["claw-modifier"]}, "food": {"๔š‘": ["cannabis_leaf"]} } emoji_post = {} # Convert aforementioned unicode addresses to actual emojis mm_emojis = [chr(mm_emoji) for mm_emoji in mm_emojis] # Load a file called "emojis.json" from same directory. # On discord android, this file is on "/assets/data/emojis.json" with open('emojis.json', 'r') as f: emoji_j_pre = json.load(f) # Add skin tone modifiers as emojis # so that mobile clients can send emojis with diversity unicodecolorbase = 0x1f3fb mutantcolorbase = 0x101600 for st_count in range(1, 6): character = chr(unicodecolorbase) custom_emojis["flags"][character] = [f"skin-tone-{st_count}"] unicodecolorbase += 1 for st_count in range(6, 51): character = chr(mutantcolorbase) custom_emojis["flags"][character] = [f"skin-tone-{st_count}"] mutantcolorbase += 1 # Iterate through every emoji in emojis.json for category in emoji_j_pre: emoji_post[category] = [] for emoji in emoji_j_pre[category]: emoji_post[category].append(emoji) # If this is MM emoji, create variants if emoji["surrogates"] in mm_emojis: names = emoji["names"] # Add a variant for each MM type for mm_type in mm_types: # Ignore paw version of hand_splayed, because it's missing if mm_type == "paw" and emoji["surrogates"] == chr(0x1f590): continue # Copy the variant's entry bc of pointers variant = copy.deepcopy(emoji) # Append variant info to the emoji entry variant["names"] = [f"{name}_{mm_type}" for name in names] variant["surrogates"] += mm_types[mm_type] variant["unicodeVersion"] = 11 # and add it to the result file emoji_post[category].append(variant) # Add custom emojis if category in custom_emojis: for custom_emoji in custom_emojis[category]: entry = {"names": custom_emojis[category][custom_emoji], "surrogates": custom_emoji} emoji_post[category].append(entry) # When finally done, dump the result as "emojispost.json" with open('emojispost.json', 'w') as f: json.dump(emoji_post, f, indent=2)