Formatting

This commit is contained in:
Firepup Sixfifty 2023-11-04 23:17:08 -05:00
parent d74def3acf
commit 1f8877f0c8
Signed by: Firepup650
GPG key ID: 7C92E2ABBBFAB9BA

View file

@ -38,6 +38,7 @@ servers = {
} }
server = args[1] if args else "UNSTABLE BOT MODE" server = args[1] if args else "UNSTABLE BOT MODE"
def exit(message: object) -> None: def exit(message: object) -> None:
log(message, server, "EXIT") log(message, server, "EXIT")
xit(1) xit(1)
@ -127,8 +128,11 @@ def notice(msg, target, silent: bool = False):
if not silent: if not silent:
log(f"Sending {bytes(msg).lazy_decode()} to {target} (NOTICE)", server) log(f"Sending {bytes(msg).lazy_decode()} to {target} (NOTICE)", server)
send(f"NOTICE {target} :{msg}\n") send(f"NOTICE {target} :{msg}\n")
"{fg" "{fg"
def CTCPHandler(msg: str, sender: str = "", isRaw: bool = False): def CTCPHandler(msg: str, sender: str = "", isRaw: bool = False):
if isRaw: if isRaw:
sender = msg.split("!", 1)[0][1:] sender = msg.split("!", 1)[0][1:]
@ -304,7 +308,7 @@ def main():
chan = ircmsg.split("PRIVMSG", 1)[1].split(":", 1)[0].strip() chan = ircmsg.split("PRIVMSG", 1)[1].split(":", 1)[0].strip()
log( log(
f'Got "{bytes(message).lazy_decode()}" from "{name}" in "{chan}"', f'Got "{bytes(message).lazy_decode()}" from "{name}" in "{chan}"',
server server,
) )
if "goat" in name.lower() and gmode == True: if "goat" in name.lower() and gmode == True:
log("GOAT DETECTED", server) log("GOAT DETECTED", server)
@ -316,7 +320,10 @@ def main():
elif chan == botnick: elif chan == botnick:
pass # TODO: Somehow combine into other checks pass # TODO: Somehow combine into other checks
elif chan not in channels: elif chan not in channels:
log(f"Channel not in channels ({chan} not in {channels})", server) log(
f"Channel not in channels ({chan} not in {channels})",
server,
)
continue continue
else: else:
channels[chan] += 1 channels[chan] += 1
@ -325,13 +332,19 @@ def main():
["!botlist"], ["!botlist"],
False, False,
): ):
sendmsg(f"Hi! I'm FireBot (https://git.amcforum.wiki/Firepup650/fire-ircbot)! My admins on this server are {adminnames}.", chan) sendmsg(
f"Hi! I'm FireBot (https://git.amcforum.wiki/Firepup650/fire-ircbot)! My admins on this server are {adminnames}.",
chan,
)
if mfind( if mfind(
message.lower(), message.lower(),
["bugs bugs bugs"], ["bugs bugs bugs"],
False, False,
): ):
sendmsg(f"\x01ACTION realizes {name} looks like a bug, and squashes {name}\x01", chan) sendmsg(
f"\x01ACTION realizes {name} looks like a bug, and squashes {name}\x01",
chan,
)
if mfind( if mfind(
message.lower(), message.lower(),
[f"hi {botnick.lower()}", f"hello {botnick.lower()}"], [f"hi {botnick.lower()}", f"hello {botnick.lower()}"],