From 19ff5ee010c120010de145b49b44191a8b654380 Mon Sep 17 00:00:00 2001 From: Firepup Sixfifty Date: Mon, 10 Jun 2024 03:50:46 -0500 Subject: [PATCH] Assume the user gave a valid hostname if it's not the proper format. (v3.0.18) --- commands.py | 7 +++++++ config.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/commands.py b/commands.py index e2c6afe..27f4e42 100644 --- a/commands.py +++ b/commands.py @@ -292,6 +292,13 @@ def check(bot: bare.bot, chan: str, name: str, message: str) -> None: host = msg.split("@", 1)[1] dnsbl, raws = conf.dnsblHandler(bot, nick, host, chan) bot.msg(f"Blacklist check: {dnsbl if dnsbl else 'Safe.'} ({raws})", chan) + except IndexError: + try: + dnsbl, raws = conf.dnsblHandler(bot, "thisusernameshouldbetoolongtoeveractuallybeinuse", message.split(" ", 1)[1], chan) + bot.msg(f"Blacklist check: {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") 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 b55a146..d6fa586 100644 --- a/config.py +++ b/config.py @@ -32,7 +32,7 @@ ipbl = DNSBLIpChecker(providers=providers) hsbl = DNSBLDomainChecker(providers=providers) load_dotenv() -__version__ = "v3.0.17" +__version__ = "v3.0.18" npbase: str = ( "\[\x0303last\.fm\x03\] [A-Za-z0-9_[\]{}\\|\-^]{1,$MAX} (is listening|last listened) to: \x02.+ - .*\x02( \([0-9]+ plays\)( \[.*\])?)?" # pyright: ignore [reportInvalidStringEscapeSequence] )