Skip song if voice_client is None
This commit is contained in:
parent
abe268391f
commit
94d018246c
|
@ -60,6 +60,13 @@ class Music(commands.Cog):
|
||||||
try:
|
try:
|
||||||
await self._queue_lock.acquire()
|
await self._queue_lock.acquire()
|
||||||
ctx, song = await self._queue.get()
|
ctx, song = await self._queue.get()
|
||||||
|
if ctx.voice_client is None:
|
||||||
|
# Bot is no longer in a voice channel.
|
||||||
|
# This could be the case because a stop command was issued.
|
||||||
|
# We will skip this (and possibly all remaining songs) in the queue
|
||||||
|
self._queue.task_done()
|
||||||
|
self._queue_lock.release()
|
||||||
|
continue
|
||||||
audio = discord.FFmpegPCMAudio(song.audio_url, **self._ffmpeg_options)
|
audio = discord.FFmpegPCMAudio(song.audio_url, **self._ffmpeg_options)
|
||||||
|
|
||||||
def after(err):
|
def after(err):
|
||||||
|
|
Loading…
Reference in New Issue