diff --git a/pocketbot.py b/pocketbot.py index cefbf04..0831e13 100644 --- a/pocketbot.py +++ b/pocketbot.py @@ -83,7 +83,7 @@ def on_message(message): if (command is '' ): helpfile = open(cwd + "/helpcommand.txt","r") yield from client.send_message(message.channel, helpfile.read()) - elif os.path.isfile(cwd + "/helptext/" + command): + elif re.match("^[A-Za-z0-9_-]*$", command) and os.path.isfile(cwd + "/helptext/" + command): commandhelp = open(cwd + "/helptext/" + command,"r") yield from client.send_message(message.channel, commandhelp.read()) else: