diff --git a/bot/exts/fun/fun.py b/bot/exts/fun/fun.py index e99fd7b362..2c80f322f0 100644 --- a/bot/exts/fun/fun.py +++ b/bot/exts/fun/fun.py @@ -122,7 +122,7 @@ def conversion_func(text: str) -> str: converted_text = f">>> {converted_text.lstrip('> ')}" await ctx.send(content=converted_text, embed=embed) - @commands.command(name="screamingsnakecase", aliases=("screamsnake", "ssnake","screamingsnake",)) + @commands.command(name="screamingsnakecase", aliases=("screamsnake", "ssnake", "screamingsnake",)) async def screamingsnakecase_command(self, ctx: Context, *, text: str | None) -> None: """Attempts to convert the provided string to SCREAMING_SNAKE_CASE.""" text = helpers.neutralise_string(text) diff --git a/bot/utils/helpers.py b/bot/utils/helpers.py index 708fbe721d..6ca0b79f05 100644 --- a/bot/utils/helpers.py +++ b/bot/utils/helpers.py @@ -1,6 +1,6 @@ -# imports import re + def suppress_links(message: str) -> str: """Accepts a message that may contain links, suppresses them, and returns them.""" for link in set(re.findall(r"https?://[^\s]+", message, re.IGNORECASE)): @@ -8,9 +8,9 @@ def suppress_links(message: str) -> str: return message def neutralise_string(txt: str) -> str: - """Attempts to neutralise all punctuation and cases and returns a string of lowercase words""" + """Attempts to neutralise all punctuation and cases and returns a string of lowercase words.""" # take out punctuation - txt = re.sub(r'([^\w\s]|_)',' ',txt) + txt = re.sub(r"([^\w\s]|_)", " ", txt) # full caps words but leaves CamelCase / pascalCase words = [word.lower() if word.isupper() else word for word in txt.split()]