diff --git a/sweebot.py b/sweebot.py index 329d470..f6c3143 100644 --- a/sweebot.py +++ b/sweebot.py @@ -1,6 +1,4 @@ -#0.0.1p4 -version_unpretty = "0.0.1p4" -__version__ = "0.0.1 patch 4" +__version__ = "0.0.1 patch 5" import socket import subprocess from time import sleep, time, ctime @@ -293,6 +291,19 @@ while True: block+=1 run-=1 update() + + elif command[0] == "$pull": + if perms == "full" or "reboot" in perms.split(",") or "restart" in perms.split(","): + ossystem("git fetch") + ossystem("git pull") + irc.send_irc(channel, nick + ": Pulled from Git, restarting bot...") + sleep(1) + ossystem("sudo systemctl restart sweebot") + else: + irc.send_irc(channel, nick + ": Permission denied.") + block+=1 + run-=1 + update() elif command[0] == "$join": if perms == "full" or "join" in perms.split(","):