Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
This commit is contained in:
Draper 2020-01-12 22:42:17 +00:00 committed by Michael H
parent 54711b2054
commit ed76454ddb
2 changed files with 13 additions and 11 deletions

View File

@ -0,0 +1 @@
Fixed a bug where ``[p]audioset dc`` didn't disconnect the bot.

View File

@ -535,17 +535,18 @@ class Audio(commands.Cog):
player_check = await self._players_check() player_check = await self._players_check()
await self._status_check(*player_check) await self._status_check(*player_check)
if not autoplay and event_type == lavalink.LavalinkEvents.QUEUE_END and notify: if event_type == lavalink.LavalinkEvents.QUEUE_END:
notify_channel = player.fetch("channel") if not autoplay:
if notify_channel: notify_channel = player.fetch("channel")
notify_channel = self.bot.get_channel(notify_channel) if notify_channel and notify:
await self._embed_msg(notify_channel, title=_("Queue Ended.")) notify_channel = self.bot.get_channel(notify_channel)
elif not autoplay and event_type == lavalink.LavalinkEvents.QUEUE_END and disconnect: await self._embed_msg(notify_channel, title=_("Queue Ended."))
self.bot.dispatch("red_audio_audio_disconnect", guild) if disconnect:
await player.disconnect() self.bot.dispatch("red_audio_audio_disconnect", guild)
if event_type == lavalink.LavalinkEvents.QUEUE_END and status: await player.disconnect()
player_check = await self._players_check() if status:
await self._status_check(*player_check) player_check = await self._players_check()
await self._status_check(*player_check)
if event_type in [ if event_type in [
lavalink.LavalinkEvents.TRACK_EXCEPTION, lavalink.LavalinkEvents.TRACK_EXCEPTION,