Disallow special characters in command names
This commit is contained in:
parent
70cbb85402
commit
95747dbd36
1 changed files with 4 additions and 0 deletions
4
bot.py
4
bot.py
|
@ -73,6 +73,10 @@ class Bot(commands.Bot):
|
||||||
command_name = args[1]
|
command_name = args[1]
|
||||||
command_text = args[2]
|
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 \
|
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:
|
or self.get_command(command_name) is not None:
|
||||||
await ctx.send("lmao that command already exists")
|
await ctx.send("lmao that command already exists")
|
||||||
|
|
Loading…
Add table
Reference in a new issue