From 19e8e60a4dcb0c1676939123ce712478a5b87a60 Mon Sep 17 00:00:00 2001 From: jack1142 <6032823+jack1142@users.noreply.github.com> Date: Thu, 14 Nov 2019 19:05:48 +0100 Subject: [PATCH] [Audio] Stop player before destroying on emptydisconnect (#3119) * fix(audio): stop player before disconnect in emptydisconnect * chore(changelog): add towncrier entry --- changelog.d/audio/3050.bugfix.rst | 1 + redbot/cogs/audio/audio.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 changelog.d/audio/3050.bugfix.rst diff --git a/changelog.d/audio/3050.bugfix.rst b/changelog.d/audio/3050.bugfix.rst new file mode 100644 index 000000000..79a5b8e67 --- /dev/null +++ b/changelog.d/audio/3050.bugfix.rst @@ -0,0 +1 @@ +Bot's status is now properly cleared on emptydisconnect. \ No newline at end of file diff --git a/redbot/cogs/audio/audio.py b/redbot/cogs/audio/audio.py index 970de7653..bdeb6eb59 100644 --- a/redbot/cogs/audio/audio.py +++ b/redbot/cogs/audio/audio.py @@ -6740,7 +6740,9 @@ class Audio(commands.Cog): if (time.time() - stop_times[sid]) >= emptydc_timer: stop_times.pop(sid) try: - await lavalink.get_player(sid).disconnect() + player = lavalink.get_player(sid) + await player.stop() + await player.disconnect() except Exception: log.error("Exception raised in Audio's emptydc_timer.", exc_info=True) pass