Catch LoadError
when skipping tracks
This commit is contained in:
parent
8c53a7398a
commit
f063a84769
@ -6,6 +6,7 @@ from cogs.music import Music
|
|||||||
import asyncio
|
import asyncio
|
||||||
|
|
||||||
from global_variables import BOT_COLOR
|
from global_variables import BOT_COLOR
|
||||||
|
from custom_source import LoadError
|
||||||
|
|
||||||
|
|
||||||
class Skip(commands.Cog):
|
class Skip(commands.Cog):
|
||||||
@ -38,7 +39,12 @@ class Skip(commands.Cog):
|
|||||||
else:
|
else:
|
||||||
for i in range(number - 2, -1, -1):
|
for i in range(number - 2, -1, -1):
|
||||||
player.queue.pop(i)
|
player.queue.pop(i)
|
||||||
|
# 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()
|
await player.skip()
|
||||||
|
|
||||||
if not player.current:
|
if not player.current:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user