From e7acda43b46ddaee851feb6816d8d979e57dca7b Mon Sep 17 00:00:00 2001 From: Firepup Sixfifty Date: Mon, 20 Nov 2023 20:18:48 -0600 Subject: [PATCH] Formatting --- checks.py | 9 ++++++++- handlers.py | 18 ++++++++++++------ overrides.py | 1 + 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/checks.py b/checks.py index c936977..e325a74 100644 --- a/checks.py +++ b/checks.py @@ -4,7 +4,14 @@ import random as r from typing import Any, Callable, Optional import bare, re -def admin(bot: bare.bot, name: str, host: Optional[str] = "nul", chan: Optional[str] = "nul", cmd: Optional[str] = "nul") -> bool: + +def admin( + bot: bare.bot, + name: str, + host: Optional[str] = "nul", + chan: Optional[str] = "nul", + cmd: Optional[str] = "nul", +) -> bool: if ( name.lower() in conf.servers[bot.server]["admins"] or host in conf.admin_hosts diff --git a/handlers.py b/handlers.py index 57792a3..5b6730d 100644 --- a/handlers.py +++ b/handlers.py @@ -50,7 +50,10 @@ def PRIVMSG(bot: bare.bot, msg: str) -> Union[tuple[None, None], tuple[str, str] if ( (name.startswith("saxjax") and bot.server == "efnet") or (name == "ReplIRC" and bot.server == "replirc") - or (name in ["FirePyLink_", "FirePyLink"] and bot.server in ["ircnow", "backupbox"]) + or ( + name in ["FirePyLink_", "FirePyLink"] + and bot.server in ["ircnow", "backupbox"] + ) ): if "<" in msg and ">" in msg: bridge = True @@ -101,9 +104,7 @@ def PRIVMSG(bot: bare.bot, msg: str) -> Union[tuple[None, None], tuple[str, str] triggers, cmds.data[cmd]["prefix"], ): - if ( - "check" in cmds.data[cmd] and cmds.data[cmd]["check"] - ): + if "check" in cmds.data[cmd] and cmds.data[cmd]["check"]: if cmds.data[cmd]["check"](bot, name, host, chan, cmd): cmds.call[cmd](bot, chan, name, message) else: @@ -138,7 +139,10 @@ def PRIVMSG(bot: bare.bot, msg: str) -> Union[tuple[None, None], tuple[str, str] bot.channels[chan] = 0 with open("mastermessages.txt", "r") as mm: sel = conf.decode_escapes( - str(r.sample(mm.readlines(), 1)).strip("[]'").replace("\\n", "").strip('"') + str(r.sample(mm.readlines(), 1)) + .strip("[]'") + .replace("\\n", "") + .strip('"') ) bot.msg(f"[QUOTE] {sel}", chan) return None, None @@ -168,7 +172,9 @@ def PART(bot: bare.bot, msg: str) -> tuple[None, None]: return None, None -handles: dict[str, Callable[[bare.bot, str], Union[tuple[None, None], tuple[str, str]]]] = { +handles: dict[ + str, Callable[[bare.bot, str], Union[tuple[None, None], tuple[str, str]]] +] = { "PRIVMSG": PRIVMSG, "NICK": NICK, "KICK": KICK, diff --git a/overrides.py b/overrides.py index 2f8c810..b463c01 100644 --- a/overrides.py +++ b/overrides.py @@ -6,6 +6,7 @@ _T = TypeVar("_T") bbytes = bbytes + class bytes(bbytes): """Local override of builtin bytes class to add "lazy_decode"