Fix emote-only crash with rcauto, closes #33

This commit is contained in:
Zeva Rose 2021-07-06 20:23:36 -06:00
parent 6875acde72
commit 27f5730a90

View file

@ -72,6 +72,9 @@ class UtilCog(commands.Cog):
) )
async def _rcauto(self, ctx: SlashContext, text: str): async def _rcauto(self, ctx: SlashContext, text: str):
to_send = "" to_send = ""
if len(text) == 1 and not re.match(r"^[A-Z0-9-()$@!?^'#. ]$", text):
await ctx.send("Please use ASCII characters.")
return
for letter in text.upper(): for letter in text.upper():
if letter == " ": if letter == " ":
to_send += " " to_send += " "