From f4c855b2de7efdcc84605298fa1d37a87cc7782d Mon Sep 17 00:00:00 2001 From: Parker Date: Wed, 30 Oct 2024 21:37:45 -0500 Subject: [PATCH] Catch issue if song on repeat is skipped w/ nothing in queue --- code/cogs/skip.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/code/cogs/skip.py b/code/cogs/skip.py index e833bfa..2402510 100644 --- a/code/cogs/skip.py +++ b/code/cogs/skip.py @@ -44,7 +44,17 @@ class Skip(commands.Cog): try: next_song = player.queue[0] except IndexError: - pass + # If the song is on repeat, catch the IndexError and get the current song + # Otherwise, pass + if player.repeat: + embed = discord.Embed( + title="Song on Repeat", + description="There is nothing in queue, but the current song is on repeat. Use to stop playing music.", + color=BOT_COLOR, + ) + return await interaction.response.send_message(embed=embed, ephemeral=True) + else: + pass # Sometimes when a playlist/album of custom source tracks are loaded, one is not able to be found # so, when a user attempts to skip to that track, we get a LoadError. In this case, just pass it.