aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorParker <contact@pkrm.dev>2024-04-09 01:28:47 -0500
committerParker <contact@pkrm.dev>2024-04-09 01:28:47 -0500
commitf063a84769ce8390a13d8519a61348925815fe52 (patch)
treeaca5c56dcc5e5dc1ee97c134c20e0ef4a99a0001
parent8c53a7398a8c88ec0e758c44aaa57076e65cc832 (diff)
Catch `LoadError` when skipping tracks
-rw-r--r--code/cogs/skip.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/code/cogs/skip.py b/code/cogs/skip.py
index eca27b5..5a57554 100644
--- a/code/cogs/skip.py
+++ b/code/cogs/skip.py
@@ -6,6 +6,7 @@ from cogs.music import Music
import asyncio
from global_variables import BOT_COLOR
+from custom_source import LoadError
class Skip(commands.Cog):
@@ -38,8 +39,13 @@ class Skip(commands.Cog):
else:
for i in range(number - 2, -1, -1):
player.queue.pop(i)
-
- await player.skip()
+ # 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.
+ try:
+ await player.skip()
+ except LoadError:
+ pass
+ await player.skip()
if not player.current:
embed = discord.Embed(