diff --git a/src/bot.py b/src/bot.py index 0d2cde4..df7e1d2 100644 --- a/src/bot.py +++ b/src/bot.py @@ -60,6 +60,13 @@ class Music(commands.Cog): try: await self._queue_lock.acquire() 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) def after(err):