From 4a45689c052de04613053d6e039ffb4190267421 Mon Sep 17 00:00:00 2001 From: Swee Date: Sun, 22 Sep 2024 13:59:28 -0700 Subject: [PATCH] Update sweebot.py --- sweebot.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sweebot.py b/sweebot.py index 35164e6..d73fe09 100644 --- a/sweebot.py +++ b/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: