From ae64ae0a867f9451a139dd45967706fb40d47b5d Mon Sep 17 00:00:00 2001 From: Ave Ozkal Date: Fri, 18 Jan 2019 23:12:09 +0300 Subject: [PATCH] Add experimental patches for new emojis on discord --- README.md | 2 +- emojireplace.py | 13 +++++++++++++ patches/mutant/831.patch | 19 +++++++++++++++++++ 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 patches/mutant/831.patch diff --git a/README.md b/README.md index 4413df3f7..4c519e09e 100644 --- a/README.md +++ b/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 diff --git a/emojireplace.py b/emojireplace.py index 8d99a7f91..d57961f11 100644 --- a/emojireplace.py +++ b/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)) diff --git a/patches/mutant/831.patch b/patches/mutant/831.patch new file mode 100644 index 000000000..ffe39ca1b --- /dev/null +++ b/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