Update sweebridge.py

This commit is contained in:
Nova Cat 2025-01-01 14:28:54 -08:00
parent e9bbbaa194
commit 61d7e8c61b

View file

@ -201,6 +201,16 @@ def ircsession(platform:str, sock:bot_irc):
else:
sock.send_irc(channel_irc, "Error: Discord isn't set up in this community!")
if guilded_enable: hook(gilwebhook, json={"content": "Error: Discord isn't set up in this community!", "username": "SweeBridge Discord", "avatar_url": "https://git.swee.codes/swee/SweeBridge/raw/branch/main/logos/sweebridge-discord.png"})
if content.split(" ")[0] == "b$pull":
updater = subprocess.run(["git", "pull"], stdout=subprocess.PIPE)
if updater.stdout.decode().strip() == "Already up to date.":
sock.send_irc(channel_irc, "[WARN] SweeBridge is already up-to-date.")
else:
sock.send_irc(channel_irc, "[OK] SweeBridge updated, restarting now!")
global alive
alive = False
time.sleep(2)
sys.exit()
elif "QUIT" in text:
if guilded_enable: hook(gilwebhook, json={"content": nick + " Has quit for reason \"" + " ".join(text.split(" ")[2:])[1:] + "\"", "username": "SweeBridge IRC", "avatar_url": "https://git.swee.codes/swee/SweeBridge/raw/branch/main/logos/sweebridge-" + platform + ".png"})
if discord_enable: hook(discwebhook, json={"content": nick + " Has quit for reason \"" + " ".join(text.split(" ")[2:])[1:] + "\"", "username": "SweeBridge IRC", "avatar_url": "https://git.swee.codes/swee/SweeBridge/raw/branch/main/logos/sweebridge-" + platform + ".png"})