Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.2.3][Audio] Fix a bug where [p]audioset dc has no effect #3350

Merged
merged 1 commit into from Jan 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/audio/3349.bugfix.1.rst
@@ -0,0 +1 @@
Fixed a bug where ``[p]audioset dc`` didn't disconnect the bot.
23 changes: 12 additions & 11 deletions redbot/cogs/audio/audio.py
Expand Up @@ -530,17 +530,18 @@ async def event_handler(
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,
Expand Down