From 6b725560f603c4a43ab43c4481acaaf9227c2877 Mon Sep 17 00:00:00 2001 From: Twentysix Date: Tue, 18 Apr 2017 12:20:14 +0200 Subject: [PATCH] [Audio] Disconnect from all VCs on cog unload --- cogs/audio.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cogs/audio.py b/cogs/audio.py index b55ab1b8e..0e5b3fa66 100644 --- a/cogs/audio.py +++ b/cogs/audio.py @@ -2160,6 +2160,10 @@ class Audio: log.debug("just got unmuted, resuming") vc.audio_player.resume() + def __unload(self): + for vc in self.bot.voice_clients: + self.bot.loop.create_task(vc.disconnect()) + def check_folders(): folders = ("data/audio", "data/audio/cache", "data/audio/playlists",