Don't deadlock if the bot gets banned

This commit is contained in:
Firepup Sixfifty 2024-02-15 21:25:42 -06:00
parent 85c81d3c6c
commit 799176cf81
Signed by: Firepup650
GPG key ID: 7C92E2ABBBFAB9BA
2 changed files with 6 additions and 1 deletions

5
bot.py
View file

@ -125,6 +125,11 @@ class bot(bare.bot):
if origin != "null":
self.msg(f"{chan} is +i, and I'm not invited.", origin)
break
elif code == 474:
self.log(f"Joining {chan} failed (+b)", "WARN")
if origin != "null":
self.msg(f"I'm banned from {chan}.", origin)
break
elif code == 520:
self.log(f"Joining {chan} failed (+O)", "WARN")
if origin != "null":

View file

@ -6,7 +6,7 @@ from typing import Optional, Any
import bare
load_dotenv()
__version__ = "v2.0.9"
__version__ = "v2.0.10"
npbase: str = "\[\x0303last\.fm\x03\] [A-Za-z0-9_[\]{}\\|\-^]{1,$MAX} (is listening|last listened) to: \x02.+ - .*\x02( \([0-9]+ plays\)( \[.*\])?)?" # pyright: ignore [reportInvalidStringEscapeSequence]
su = "^(su|sudo|(su .*|sudo .*))$"
servers: dict[str, dict[str, Any]] = {