Browse Source

Add experimental patches for new emojis on discord

master
ave 3 years ago
parent
commit
ae64ae0a86
No known key found for this signature in database GPG Key ID: 9356ABAA42C842B
  1. 2
      README.md
  2. 13
      emojireplace.py
  3. 19
      patches/mutant/831.patch

2
README.md

@ -26,7 +26,7 @@ Automatically patched binaries are available on [distok.a3.pm/cutthecord](https:
## Building patches
`diff -crB -x "dist" Folder1 Folder2 > atmpatch.patch`
`diff -crB -x "dist" -x "res" -x "build" CleanFolder PatchedFolder > patchname.patch`
## Disclaimer about emojos

13
emojireplace.py

@ -6,6 +6,11 @@ import shutil
extracted_discord_path = "/tmp/cutthecord/discord"
extracted_mutstd_path = "/var/www/mutant/72x72"
# Add your custom emojis here
# with "mutstd filename": "discord filename".
# You'll need to write a patch for `assets/data/emojis.json` too.
custom_emojis = {"101666.png": "emoji_101666.png"}
def clean_emoji_name(name):
name = name.lower().replace("_", "-")\
@ -42,4 +47,12 @@ for emoji in discord_emojis:
print("Replaced {} emoji.".format(emoji))
replace_counter += 1
for custom_emoji in custom_emojis:
discord_emoji_name = custom_emojis[custom_emoji]
full_mutstd_path = os.path.join(extracted_mutstd_path, custom_emoji)
full_discord_path = os.path.join(discord_emoji_path, discord_emoji_name)
shutil.copyfile(full_mutstd_path, full_discord_path)
print("Added custom {} emoji.".format(emoji))
replace_counter += 1
print("Done, {} emojis replaced.".format(replace_counter))

19
patches/mutant/831.patch

@ -0,0 +1,19 @@
diff -crB -x dist -x res -x build com.discord-831/assets/data/emojis.json com.discord-831-patched/assets/data/emojis.json
*** com.discord-831/assets/data/emojis.json 2019-01-18 23:05:36.726178666 +0300
--- com.discord-831-patched/assets/data/emojis.json 2019-01-18 23:05:53.066252466 +0300
***************
*** 8633,8638 ****
--- 8633,8644 ----
"rainbow_flag"
],
"surrogates": "🏳️‍🌈"
+ },
+ {
+ "names": [
+ "demon"
+ ],
+ "surrogates": "􁙦"
}
]
}
\ No newline at end of file
Loading…
Cancel
Save