diff --git a/newbot.py b/newbot.py index dda24bc..82bd64b 100644 --- a/newbot.py +++ b/newbot.py @@ -311,7 +311,10 @@ async def getqueue(inter: disnake.AppCmdInter): await inter.edit_original_response("There are no items in queue") return message = f"Now Playing: <{queue[0]}>\n" - message = message + f"Up Next: <{queue[1]}>\n" + try: + message = message + f"Up Next: <{queue[1]}>\n" + except IndexError: + pass message = message + f"Shuffle is currently " + ("off\n" if not shuffle else "on!\n") res = cur.execute(f"SELECT link FROM queue WHERE hasplayed = false") links = [x[0] for x in res.fetchall()] @@ -339,7 +342,10 @@ async def button_listener(inter: disnake.MessageInteraction): page = page[-1].split(" of ") if inter.component.custom_id == "Forward": message = f"Now Playing: <{queue[0]}>\n" - message = message + f"Up Next: <{queue[1]}>\n" + try: + message = message + f"Up Next: <{queue[1]}>\n" + except IndexError: + pass message = message + f"Shuffle is currently " + ("off\n" if not shuffle else "on!\n") res = cur.execute(f"SELECT link FROM queue WHERE hasplayed = false") links = [x[0] for x in res.fetchall()] @@ -361,7 +367,10 @@ async def button_listener(inter: disnake.MessageInteraction): return if inter.component.custom_id == "Backward": message = f"Now Playing: <{queue[0]}>\n" - message = message + f"Up Next: <{queue[1]}>\n" + try: + message = message + f"Up Next: <{queue[1]}>\n" + except IndexError: + pass message = message + f"Shuffle is currently " + ("off\n" if not shuffle else "on!\n") res = cur.execute(f"SELECT link FROM queue WHERE hasplayed = false") links = [x[0] for x in res.fetchall()]