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 = ""