Modified help command to give read per command help files.
parent
6784e9424f
commit
371fbe3db9
12
pocketbot.py
12
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'):
|
||||
|
|
Loading…
Reference in New Issue