From cab9376bc29e7c949a080dda02a6bb2d11d459dc Mon Sep 17 00:00:00 2001 From: swee Date: Wed, 1 Jan 2025 14:34:27 -0800 Subject: [PATCH] Update sweebridge.py --- sweebridge.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/sweebridge.py b/sweebridge.py index 7030821..c212807 100644 --- a/sweebridge.py +++ b/sweebridge.py @@ -204,9 +204,9 @@ def ircsession(platform:str, sock:bot_irc): 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.") + sock.send_irc(channel_irc, "[⚠️] SweeBridge is already up-to-date.") else: - sock.send_irc(channel_irc, "[OK] SweeBridge updated, restarting now!") + sock.send_irc(channel_irc, "[✅] SweeBridge updated, restarting now!") global alive alive = False time.sleep(2) @@ -417,6 +417,16 @@ async def on_message(message): else: if libera_enable: libera.send_irc(libera_channel, "Error: Discord is not set up in this community!") await message.reply("Error: Discord is not set up in this community!") + if message.content.split(" ")[0] == "b$pull": + updater = subprocess.run(["git", "pull"], stdout=subprocess.PIPE) + if updater.stdout.decode().strip() == "Already up to date.": + await message.reply("[⚠️] SweeBridge is already up-to-date.") + else: + await message.reply("[✅] SweeBridge updated, restarting now!") + global alive + alive = False + time.sleep(2) + sys.exit() if message.content[:13] == "b$chandetails" and not message.author.bot: await message.reply("* Server ID: " + message.server.id + "\n* Channel ID: " + message.channel.id) class MyClient(discord.Client):