From 81d5fcfb8faa283f77e868691490e25ad52e5535 Mon Sep 17 00:00:00 2001 From: mtuszowski Date: Fri, 2 Aug 2024 12:10:55 +0200 Subject: [PATCH] Now playing --- bot.py | 2 +- communication_subroutine.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bot.py b/bot.py index 5b61a5f..09bbc29 100644 --- a/bot.py +++ b/bot.py @@ -2543,7 +2543,7 @@ async def co_na_plejliscie_wariacie(ctx): async with ctx.typing(): logger.info("plejlista") logger.info(PREPPED_TRACKS) - await ctx.send(f"Didżej Hammer i jego sztuczna inteligencja (||he he||) prezentują: \n- na liście priorytetowej {(PREPPED_TRACKS['priority']).rstrip()} \n- na liście hitów obecnie czeka kawałek {(PREPPED_TRACKS['hit']).rstrip()} \n- na liście wszystkich kawałków {(PREPPED_TRACKS['all']).rstrip()} \n- najświeższym zamówieniem od słuchaczy jest {(PREPPED_TRACKS['requests']).rstrip()} \nZ kolei jingiel to: {(PREPPED_TRACKS['jingles']).rstrip()}") + await ctx.send(f"Didżej Hammer i jego sztuczna inteligencja (||he he||) prezentują: \n- obecnie grany jest {(PREPPED_TRACKS["now_playing"]).rstrip()} \n- na liście priorytetowej {(PREPPED_TRACKS['priority']).rstrip()} \n- na liście hitów obecnie czeka kawałek {(PREPPED_TRACKS['hit']).rstrip()} \n- na liście wszystkich kawałków {(PREPPED_TRACKS['all']).rstrip()} \n- najświeższym zamówieniem od słuchaczy jest {(PREPPED_TRACKS['requests']).rstrip()} \nZ kolei jingiel to: {(PREPPED_TRACKS['jingles']).rstrip()}") # *================================== Run if __name__ == "__main__": diff --git a/communication_subroutine.py b/communication_subroutine.py index e353ef7..eb212db 100644 --- a/communication_subroutine.py +++ b/communication_subroutine.py @@ -18,7 +18,8 @@ PREPPED_TRACKS = { "hit" : "", "all": "", "priority":"", - "jingles":"" + "jingles":"", + "now_playing":"" } logger = logging.getLogger("discord") @@ -46,6 +47,7 @@ def log_radio_tracks(): logger.info(request) record = json.loads(request.data) logger.info(record) + PREPPED_TRACKS["now_playing"] = PREPPED_TRACKS[record[0]] PREPPED_TRACKS[record[0]] = record[1] logger.info("DATA RECEIVED") return jsonify("SUCCESS")