diff options
author | Parker <contact@pkrm.dev> | 2024-05-13 15:35:43 -0500 |
---|---|---|
committer | Parker <contact@pkrm.dev> | 2024-05-13 15:35:43 -0500 |
commit | b374b5ee785ce4e93d5d251a1f705d946f4d9c72 (patch) | |
tree | 58841e57668c294a0b759528e9153d02b170ce30 /code | |
parent | e76d4442ebfe22bf5da9a55358cbd7c7037fab82 (diff) |
Fix skipping when song is final in queue
Diffstat (limited to 'code')
-rw-r--r-- | code/cogs/skip.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/code/cogs/skip.py b/code/cogs/skip.py index a262854..3a186e3 100644 --- a/code/cogs/skip.py +++ b/code/cogs/skip.py @@ -36,14 +36,15 @@ class Skip(commands.Cog): return await interaction.response.send_message( embed=embed, ephemeral=True ) - # If the number is just 1, pass so that it can be skipped normally - elif number == 1: - pass else: for i in range(number - 2, -1, -1): player.queue.pop(i) - next_song = player.queue[0] + # If there is a next song, get it + try: + next_song = player.queue[0] + except IndexError: + 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. |