diff --git a/commands.py b/commands.py index ce1596a..56e52d9 100644 --- a/commands.py +++ b/commands.py @@ -200,7 +200,7 @@ data: dict[str, dict[str, Any]] = { "bugs bugs bugs": {"prefix": False, "aliases": []}, "hi $BOTNICK": {"prefix": False, "aliases": ["hello $BOTNICK"]}, # [npbase, su] - "restart": {"prefix": True, "aliases": ["reboot", "stop"], "check": checks.admin}, + "restart": {"prefix": True, "aliases": ["reboot", "stop", "hardreload"], "check": checks.admin}, "uptime": {"prefix": True, "aliases": []}, "raw ": {"prefix": True, "aliases": ["cmd "], "check": checks.admin}, "debug": {"prefix": True, "aliases": ["dbg", "d"], "check": checks.admin}, diff --git a/config.py b/config.py index 2f77757..44567d6 100644 --- a/config.py +++ b/config.py @@ -6,7 +6,7 @@ from typing import Optional, Any import bare, pylast load_dotenv() -__version__ = "v3.0.2-dev" +__version__ = "v3.0.3" npbase: str = ( "\[\x0303last\.fm\x03\] [A-Za-z0-9_[\]{}\\|\-^]{1,$MAX} (is listening|last listened) to: \x02.+ - .*\x02( \([0-9]+ plays\)( \[.*\])?)?" # pyright: ignore [reportInvalidStringEscapeSequence] ) diff --git a/timers.py b/timers.py index ce13120..4fc2ea7 100644 --- a/timers.py +++ b/timers.py @@ -77,10 +77,12 @@ def threadManager( def radio(instance: bare.bot) -> NoReturn: lastTrack = "" + complained = False while 1: try: newTrack = instance.lastfmLink.get_user("Firepup650").get_now_playing() if newTrack: + complained = False thisTrack = newTrack.__str__() if thisTrack != lastTrack: lastTrack = thisTrack @@ -88,6 +90,10 @@ def radio(instance: bare.bot) -> NoReturn: instance.sendraw( f"TOPIC #fp-radio :Firepup radio ({thisTrack}) - https://open.spotify.com/playlist/4ctNy3O0rOwhhXIKyLvUZM" ) + elif not complained: + instance.msg("Firepup seems to have stopped the music by mistake :/", "#fp-radio") + instance.sendraw("TOPIC #fp-radio :Firepup radio (Offline) - https://open.spotify.com/playlist/4ctNy3O0rOwhhXIKyLvUZM") + complained = True except Exception: Err = format_exc() for line in Err.split("\n"):