From 61bd60b6543810a82ff355016a70bccdf39e1725 Mon Sep 17 00:00:00 2001 From: swee Date: Wed, 1 Jan 2025 14:39:46 -0800 Subject: [PATCH] Update sweebridge.py --- sweebridge.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/sweebridge.py b/sweebridge.py index c1b6b39..cbc9774 100644 --- a/sweebridge.py +++ b/sweebridge.py @@ -452,7 +452,7 @@ class MyClient(discord.Client): libera_channel = None libera_enable = False print(f'Message from {message.author} ({message.author.id}) on {message.channel.id}: {message.content}') - if not message.author.bot: + if message.author[-5:] != "#0000": if message.content != None and message.content != "": if message.content[:3] == "/me" or message.content[:4] == "b$me": await message.delete() @@ -496,6 +496,16 @@ class MyClient(discord.Client): if libera_enable: libera.send_irc(libera_channel, liste[:-2]) hook(discwebhook, json={"content": liste[:-2]}) if guilded_enable: hook(gilwebhook, json={"content": "[Everyone here should already know who's in this server lmao]"}) + 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 len(message.attachments) > 0: liste = "" guild_liste = ""