From 79e767e3ef479b35aabef9e3651f22a8b62bc87d Mon Sep 17 00:00:00 2001 From: Saratii Date: Fri, 23 Aug 2024 23:42:35 -0500 Subject: [PATCH] better emojis replacement --- bot/exts/fun/uwu.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/bot/exts/fun/uwu.py b/bot/exts/fun/uwu.py index f548d24b77..72db99edec 100644 --- a/bot/exts/fun/uwu.py +++ b/bot/exts/fun/uwu.py @@ -44,6 +44,19 @@ "^^;;", ] +EMOJI_REPLACE = { + ":neutral_face:": ":cat:", + ":cry:": ":crying_cat_face:", + ":heart_eyes:": ":heart_eyes_cat:", + ":joy:": ":joy_cat:", + ":kissing:": ":kissing_cat:", + ":angry:": ":pouting_cat:", + ":scream:": ":scream_cat:", + ":laughing:": ":smile_cat:", + ":grinning:": ":smiley_cat:", + ":smirk:": ":smirk_cat:", + ":pleading_face:": ":pleading_face::point_right::point_left:" +} REGEX_WORD_REPLACE = re.compile(r"(? str: # Return original if no replacement return input_string + def _uwu_emojis(self, input_string: str) -> str: + """Replaces certain emojis with better emojis.""" + for old, new in EMOJI_REPLACE.items(): + input_string = input_string.replace(old, new) + return input_string + def _uwuify(self, input_string: str, *, stutter_strength: float = 0.2, emoji_strength: float = 0.1) -> str: """Takes a string and returns an uwuified version of it.""" input_string = input_string.lower() @@ -152,6 +171,7 @@ def _uwuify(self, input_string: str, *, stutter_strength: float = 0.2, emoji_str input_string = self._stutter(stutter_strength, input_string) input_string = self._emoji(emoji_strength, input_string) input_string = self._ext_emoji_replace(input_string) + input_string = self._emoji_replace(input_string) return input_string @commands.command(name="uwu", aliases=("uwuwize", "uwuify",))