diff --git a/jarvis/cogs/util.py b/jarvis/cogs/util.py index a0e2314..989ebd4 100644 --- a/jarvis/cogs/util.py +++ b/jarvis/cogs/util.py @@ -1,3 +1,5 @@ +import re + from discord.ext import commands from discord_slash import SlashContext, cog_ext from discord_slash.utils.manage_commands import create_option @@ -68,12 +70,26 @@ class UtilCog(commands.Cog): ], ) async def _rcauto(self, ctx: SlashContext, text: str): + lookup = { + "-": ":rcDash:", + "(": ":rcPL:", + ")": ":rc:", + "$": ":rcDS:", + "@": ":rcAt:", + "!": ":rcEx:", + "?": ":rcQm:", + "^": ":rcThis:", + "'": ":rcApost:", + "#": ":rcHash:", + } to_send = "" for letter in text.upper(): if letter == " ": to_send += " " - else: + elif re.match(r"^[A-Z0-9]$"): to_send += f":rc{letter}:" + elif re.match(r"^[-()$@!?^'#]$"): + to_send += lookup[letter] await ctx.send(to_send)