From 1aa2426213aa5352a5082fe4235640f9b8c71f07 Mon Sep 17 00:00:00 2001 From: insert Date: Sat, 3 Aug 2024 17:44:53 -0400 Subject: [PATCH] indicate the status of shuffle in the queue --- bot.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bot.py b/bot.py index 20e8f1b..1d135e7 100644 --- a/bot.py +++ b/bot.py @@ -110,7 +110,9 @@ async def getqueue(inter: disnake.AppCmdInter): await inter.response.defer(ephemeral=True) if not queue: await inter.edit_original_response("There are no items in queue") + return message = f"Now Playing: <{queue[0]}>\n" + message = message + f"Shuffle is currently " + ("off\n" if not shuffle else "on!\n") for i in range(11): if i == 0: continue @@ -126,11 +128,15 @@ async def getqueue(inter: disnake.AppCmdInter): @bot.listen("on_button_click") async def button_listener(inter: disnake.MessageInteraction): + if not queue: + await inter.response.edit_message("There are no items in queue") + return ogmsg = inter.message.content page = ogmsg.split("\n") page = page[-1].split(" of ") if inter.component.custom_id == "Forward": message = f"Now Playing: <{queue[0]}>\n" + message = message + f"Shuffle is currently " + ("off\n" if not shuffle else "on!\n") offset = int(int(page[0]) * 10) for i in range(11): if i == 0: @@ -148,6 +154,7 @@ async def button_listener(inter: disnake.MessageInteraction): return if inter.component.custom_id == "Backward": message = f"Now Playing: <{queue[0]}>\n" + message = message + f"Shuffle is currently " + ("off\n" if not shuffle else "on!\n") offset = int((int(page[0]) - 2) * 10) for i in range(11): if i == 0: