From 1dc55eaff2daa9638faf4ea6a4bcc466850fc58d Mon Sep 17 00:00:00 2001 From: licyb200 Date: Tue, 1 Mar 2022 12:37:23 -0800 Subject: [PATCH 1/3] Added UWUify Command --- exts/fun.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/exts/fun.py b/exts/fun.py index 94dcead..cd0e221 100644 --- a/exts/fun.py +++ b/exts/fun.py @@ -69,6 +69,24 @@ async def _funetics_lookup(self, ctx: commands.Context, *, msg: str): embed.colour = cmn.colours.good await ctx.send(embed=embed) + @commands.command(name="uwuify", aliases=["uwu"], category=cmn.Cats.FUN) + async def _uwuify(self, ctx: commands.Context, *, msg: str): + uwuified_text = '' + for i, c in enumerate(msg): + previous_char = msg[i - 1] if i > 0 else '' + if c == 'L' or c == 'R': + uwuified_text += 'W' + elif c == 'l' or c == 'r': + uwuified_text += 'w' + elif c == 'O' or c == 'o': + if previous_char == 'N' or previous_char == 'n' or previous_char == 'M' or previous_char == 'm': + uwuified_text += "yo" + else: + uwuified_text += c + + else: + uwuified_text += c + await ctx.send(uwuified_text) def setup(bot: commands.Bot): bot.add_cog(FunCog(bot)) From 2453d207571f52a7891185e8a28b17c6f6364134 Mon Sep 17 00:00:00 2001 From: licyb200 Date: Tue, 1 Mar 2022 20:31:41 -0800 Subject: [PATCH 2/3] Cleaned up UWUify command & Updated Changelog --- CHANGELOG.md | 3 +++ exts/fun.py | 20 +++++--------------- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2bbb2bf..9ec18c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] +## [2.7.5] - 2022-03-01 +### Added +- UwUify command ## [2.7.4] - 2021-10-07 ### Added diff --git a/exts/fun.py b/exts/fun.py index cd0e221..a1793cc 100644 --- a/exts/fun.py +++ b/exts/fun.py @@ -71,22 +71,12 @@ async def _funetics_lookup(self, ctx: commands.Context, *, msg: str): @commands.command(name="uwuify", aliases=["uwu"], category=cmn.Cats.FUN) async def _uwuify(self, ctx: commands.Context, *, msg: str): - uwuified_text = '' - for i, c in enumerate(msg): - previous_char = msg[i - 1] if i > 0 else '' - if c == 'L' or c == 'R': - uwuified_text += 'W' - elif c == 'l' or c == 'r': - uwuified_text += 'w' - elif c == 'O' or c == 'o': - if previous_char == 'N' or previous_char == 'n' or previous_char == 'M' or previous_char == 'm': - uwuified_text += "yo" - else: - uwuified_text += c - - else: - uwuified_text += c + uwuified_text = msg + uwuified_text = uwuified_text.replace('na', 'nya') + uwuified_text = uwuified_text.translate({108: 119, 114: 119, 76: 87, 82: 87}) + uwuified_text = uwuified_text.replace('no', 'yo').replace('mo', 'yo') await ctx.send(uwuified_text) + def setup(bot: commands.Bot): bot.add_cog(FunCog(bot)) From 5aefcabb3cad243486266fe0f48e0cfc97d36137 Mon Sep 17 00:00:00 2001 From: licyb200 Date: Tue, 1 Mar 2022 21:17:19 -0800 Subject: [PATCH 3/3] Implemented requested changes to UwUify Command & Changelog --- CHANGELOG.md | 3 +-- exts/fun.py | 7 +++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ec18c3..458d2a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,11 +5,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] - -## [2.7.5] - 2022-03-01 ### Added - UwUify command + ## [2.7.4] - 2021-10-07 ### Added - a new way to support qrm's development. diff --git a/exts/fun.py b/exts/fun.py index a1793cc..9cc1da2 100644 --- a/exts/fun.py +++ b/exts/fun.py @@ -71,10 +71,9 @@ async def _funetics_lookup(self, ctx: commands.Context, *, msg: str): @commands.command(name="uwuify", aliases=["uwu"], category=cmn.Cats.FUN) async def _uwuify(self, ctx: commands.Context, *, msg: str): - uwuified_text = msg - uwuified_text = uwuified_text.replace('na', 'nya') - uwuified_text = uwuified_text.translate({108: 119, 114: 119, 76: 87, 82: 87}) - uwuified_text = uwuified_text.replace('no', 'yo').replace('mo', 'yo') + """UwUify your text""" + trans_table = msg.maketrans({"l": "w", "L": "W", "r": "w", "R": "W"}) + uwuified_text = msg.replace('na', 'nya').translate(trans_table).replace("no", "yo").replace("mo", "yo") await ctx.send(uwuified_text)