From ed76454ddb0ea3e1d0451111f7f5d20164511632 Mon Sep 17 00:00:00 2001 From: Draper <27962761+Drapersniper@users.noreply.github.com> Date: Sun, 12 Jan 2020 22:42:17 +0000 Subject: [PATCH] ... (#3350) Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com> --- changelog.d/audio/3349.bugfix.1.rst | 1 + redbot/cogs/audio/audio.py | 23 ++++++++++++----------- 2 files changed, 13 insertions(+), 11 deletions(-) create mode 100644 changelog.d/audio/3349.bugfix.1.rst diff --git a/changelog.d/audio/3349.bugfix.1.rst b/changelog.d/audio/3349.bugfix.1.rst new file mode 100644 index 000000000..193d44958 --- /dev/null +++ b/changelog.d/audio/3349.bugfix.1.rst @@ -0,0 +1 @@ +Fixed a bug where ``[p]audioset dc`` didn't disconnect the bot. \ No newline at end of file diff --git a/redbot/cogs/audio/audio.py b/redbot/cogs/audio/audio.py index 356d23924..afd34253e 100644 --- a/redbot/cogs/audio/audio.py +++ b/redbot/cogs/audio/audio.py @@ -535,17 +535,18 @@ class Audio(commands.Cog): player_check = await self._players_check() await self._status_check(*player_check) - if not autoplay and event_type == lavalink.LavalinkEvents.QUEUE_END and notify: - notify_channel = player.fetch("channel") - if notify_channel: - notify_channel = self.bot.get_channel(notify_channel) - await self._embed_msg(notify_channel, title=_("Queue Ended.")) - elif not autoplay and event_type == lavalink.LavalinkEvents.QUEUE_END and disconnect: - self.bot.dispatch("red_audio_audio_disconnect", guild) - await player.disconnect() - if event_type == lavalink.LavalinkEvents.QUEUE_END and status: - player_check = await self._players_check() - await self._status_check(*player_check) + if event_type == lavalink.LavalinkEvents.QUEUE_END: + if not autoplay: + notify_channel = player.fetch("channel") + if notify_channel and notify: + notify_channel = self.bot.get_channel(notify_channel) + await self._embed_msg(notify_channel, title=_("Queue Ended.")) + if disconnect: + self.bot.dispatch("red_audio_audio_disconnect", guild) + await player.disconnect() + if status: + player_check = await self._players_check() + await self._status_check(*player_check) if event_type in [ lavalink.LavalinkEvents.TRACK_EXCEPTION,