Update sweebridge.py

This commit is contained in:
Nova Cat 2025-01-01 17:21:14 -08:00
parent ade4a3a92b
commit c96de59e44

View file

@ -215,6 +215,10 @@ def ircsession(platform:str, sock:bot_irc):
for key, value in userlist.items(): for key, value in userlist.items():
if nick in value: if nick in value:
target = targets[platform][key] target = targets[platform][key]
guilded_enable = "guilded" in config[target]
discord_enable = "discord" in config[target]
gilwebhook = config[target]["guilded"]["webhook"] if guilded_enable else None
discwebhook = config[target]["discord"]["webhook"] if discord_enable else None
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 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"}) 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"})
update(channel_irc, sock) update(channel_irc, sock)