Update sweebot.py
This commit is contained in:
parent
4243df401b
commit
4a45689c05
1 changed files with 7 additions and 7 deletions
14
sweebot.py
14
sweebot.py
|
@ -250,13 +250,13 @@ while True:
|
|||
run-=1
|
||||
update()
|
||||
else:
|
||||
if path.isfile("/home/swee/helps/" + " ".join(command[1:])):
|
||||
output = open("/home/swee/helps/" + " ".join(command[1:])).read()
|
||||
if path.isfile(cwd + "/helps/" + " ".join(command[1:])):
|
||||
output = open(cwd + "/helps/" + " ".join(command[1:])).read()
|
||||
multiline(output)
|
||||
else:
|
||||
irc.send_irc(channel, "Either the command isn't documented yet or it doesn't exist lol")
|
||||
else:
|
||||
irc.send_irc(channel, "tip, ping, whoami, perms, version, figlet, tdfiglet, cowsay, uptime, cc, joke. (restart, join, part, shell, config.) Use '$help (command)' for explanation.")
|
||||
irc.send_irc(channel, "tip, ping, whoami, perms, version, figlet, tdfiglet, cowsay, uptime, cc, joke, botsnack. (restart, join, part, shell, config, pull.) Use '$help (command)' for explanation.")
|
||||
|
||||
elif command[0] == "$tip":
|
||||
result = subprocess.run(['fortune'], stdout=subprocess.PIPE)
|
||||
|
@ -500,11 +500,11 @@ while True:
|
|||
run-=1
|
||||
update()
|
||||
else:
|
||||
if path.isfile("/home/swee/cc/" + command[0][1:]):
|
||||
if path.isfile(cwd + "/cc/" + command[0][1:]):
|
||||
try:
|
||||
com = ['python3']
|
||||
comm = command
|
||||
com.append("/home/swee/cc/" + comm[0][1:])
|
||||
com.append(cwd + "/cc/" + comm[0][1:])
|
||||
com.append(nick)
|
||||
com.append(username)
|
||||
comm.pop(0)
|
||||
|
@ -513,9 +513,9 @@ while True:
|
|||
system(com, channel)
|
||||
except Exception as ex:
|
||||
irc.send_irc(channel, nick + ": " + ex.__class__.__name__)
|
||||
elif path.isdir("/home/swee/cc/" + command[0][1:]):
|
||||
elif path.isdir(cwd + "/cc/" + command[0][1:]):
|
||||
irc.send_irc(channel, nick + ": Command list under cc/debug:")
|
||||
irc.send_irc(channel, ", ".join(listdir("/home/swee/cc/" + command[0][1:])) + ".")
|
||||
irc.send_irc(channel, ", ".join(listdir(cwd + "/cc/" + command[0][1:])) + ".")
|
||||
|
||||
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue