Update sweebridge.py

This commit is contained in:
Nova Cat 2025-01-01 14:39:46 -08:00
parent 0aeb09c2c6
commit 61bd60b654

View file

@ -452,7 +452,7 @@ class MyClient(discord.Client):
libera_channel = None libera_channel = None
libera_enable = False libera_enable = False
print(f'Message from {message.author} ({message.author.id}) on {message.channel.id}: {message.content}') 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 != None and message.content != "":
if message.content[:3] == "/me" or message.content[:4] == "b$me": if message.content[:3] == "/me" or message.content[:4] == "b$me":
await message.delete() await message.delete()
@ -496,6 +496,16 @@ class MyClient(discord.Client):
if libera_enable: libera.send_irc(libera_channel, liste[:-2]) if libera_enable: libera.send_irc(libera_channel, liste[:-2])
hook(discwebhook, json={"content": 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 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: if len(message.attachments) > 0:
liste = "" liste = ""
guild_liste = "" guild_liste = ""