From 95747dbd364032f354f40cf0415e5c91a0fdc4ac Mon Sep 17 00:00:00 2001 From: Terry Hearst Date: Sun, 18 Sep 2022 22:20:37 -0400 Subject: [PATCH] Disallow special characters in command names --- bot.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bot.py b/bot.py index b8565e5..d5ce749 100644 --- a/bot.py +++ b/bot.py @@ -73,6 +73,10 @@ class Bot(commands.Bot): command_name = args[1] command_text = args[2] + if not command_name.isalnum(): + await ctx.send("lmao that command name is too funky") + return + if self.db_cur.execute("SELECT * FROM custom_commands WHERE command=?", [command_name]).fetchone() is not None \ or self.get_command(command_name) is not None: await ctx.send("lmao that command already exists")