diff --git a/pocketbot.py b/pocketbot.py index 74f7155..b216e97 100644 --- a/pocketbot.py +++ b/pocketbot.py @@ -77,8 +77,16 @@ def on_message(message): #Posts help info elif message.content.lower().startswith('!help'): - helpfile = open(cwd + "/helpcommand.txt","r") - yield from client.send_message(message.channel, helpfile.read()) + args = message.content.partition(' ')[2] + command = args.partition(' ')[0] + 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): + commandhelp = open(cwd + "/helptext/" + command,"r") + yield from client.send_message(message.channel, commandhelp.read()) + else: + yield from client.send_message(message.channel, 'Either that command does not exist, or it is too simple to deserve extra context <:tohrusmug:292110413129318401>') #Sleeps for 5 seconds. Don't know why I still have this tbh elif message.content.lower().startswith('!sleep'):