Update sweebridge.py
This commit is contained in:
parent
e9bbbaa194
commit
61d7e8c61b
1 changed files with 10 additions and 0 deletions
|
@ -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"})
|
||||
|
|
Loading…
Reference in a new issue