From b243fb63ab5f4fafbc02c1ba84948b2abe2d2eb9 Mon Sep 17 00:00:00 2001 From: Firepup Sixfifty Date: Wed, 1 Nov 2023 20:37:37 -0500 Subject: [PATCH] Fix issue with #main on join --- ircbot.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ircbot.py b/ircbot.py index a5d5bab..0a9b6f8 100644 --- a/ircbot.py +++ b/ircbot.py @@ -61,8 +61,7 @@ server = "" def log(message: str, origin: str = "serv", time: dt = dt.now(), level: str = "LOG") -> None: if origin == "serv": - global server - origin = server + origin = args[1] print(f"[{level}][{origin}][{time}] {message}") def exit(message: object) -> None: @@ -234,7 +233,7 @@ def joinchan(chan: str, origin: str, chanList: dict, lock: bool = True): for subchan in chans: chanList = joinchan(subchan, origin, chanList) return chanList - if chan.startswith("0") or chan == "#main": + if chan.startswith("0") or (chan == "#main" and lock): if origin != "null": sendmsg("Refusing to join channel 0", origin) return chanList