From b356bfb19b18680323b304624751f3ff726c6f13 Mon Sep 17 00:00:00 2001 From: Firepup Sixfifty Date: Tue, 9 Apr 2024 12:46:43 -0500 Subject: [PATCH] Actually pay attention if the song isn't playing --- commands.py | 2 +- config.py | 2 +- timers.py | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) 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"):