Update sweebot.py

This commit is contained in:
Swee 2024-09-22 13:52:02 -07:00
parent ed5e0e93f3
commit 52ddc0c7ac

View file

@ -1,6 +1,4 @@
#0.0.1p4 __version__ = "0.0.1 patch 5"
version_unpretty = "0.0.1p4"
__version__ = "0.0.1 patch 4"
import socket import socket
import subprocess import subprocess
from time import sleep, time, ctime from time import sleep, time, ctime
@ -294,6 +292,19 @@ while True:
run-=1 run-=1
update() 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": elif command[0] == "$join":
if perms == "full" or "join" in perms.split(","): if perms == "full" or "join" in perms.split(","):
if len(command) == 2: if len(command) == 2: