diff --git a/commands.py b/commands.py index 16bcdca..f2f2784 100644 --- a/commands.py +++ b/commands.py @@ -292,13 +292,21 @@ def check(bot: bare.bot, chan: str, name: str, message: str) -> None: host = msg.split("@", 1)[1] cache = host in bot.dns dnsbl, raws = conf.dnsblHandler(bot, nick, host, chan) - bot.msg(f"Blacklist check: {'(Cached) ' if cache else ''}{dnsbl if dnsbl else 'Safe.'} ({raws})", chan) + bot.msg( + f"Blacklist check: {'(Cached) ' if cache else ''}{dnsbl if dnsbl else 'Safe.'} ({raws})", + chan, + ) except IndexError: try: host = message.split(" ", 1)[1] cache = host in bot.dns - dnsbl, raws = conf.dnsblHandler(bot, "thisusernameshouldbetoolongtoeveractuallybeinuse", host, chan) - bot.msg(f"Blacklist check: {'(Cached) ' if cache else ''}{dnsbl if dnsbl else 'Safe.'} ({raws})", chan) + dnsbl, raws = conf.dnsblHandler( + bot, "thisusernameshouldbetoolongtoeveractuallybeinuse", host, chan + ) + bot.msg( + f"Blacklist check: {'(Cached) ' if cache else ''}{dnsbl if dnsbl else 'Safe.'} ({raws})", + chan, + ) except Exception as E: bot.msg("Blacklist Lookup Failed. Error recorded to bot logs.", chan) bot.log(str(E), "FATAL") diff --git a/config.py b/config.py index 9501042..55c5901 100644 --- a/config.py +++ b/config.py @@ -198,7 +198,11 @@ def dnsblHandler( dnsblStatus = "Not enabled" dnsblResps = {} if bot.dnsblMode != "none": - dnsblStatus, dnsblResps = dnsbl(hostname) if not hostname in bot.dns else (bot.dns[hostname]["status"], bot.dns[hostname]["resps"]) + dnsblStatus, dnsblResps = ( + dnsbl(hostname) + if not hostname in bot.dns + else (bot.dns[hostname]["status"], bot.dns[hostname]["resps"]) + ) bot.dns[hostname] = {"status": dnsblStatus, "resps": dnsblResps} if dnsblStatus: match bot.dnsblMode: