From 08bbf8f6dbdeea9f9c4393cf78c24a6e4e0326af Mon Sep 17 00:00:00 2001 From: Red-GitHubBot <88117545+Red-GitHubBot@users.noreply.github.com> Date: Wed, 8 Sep 2021 21:21:44 +0200 Subject: [PATCH] [3.4] [Audio] Add a wait time before auto disconnect (#5188) (#5259) * Update lavalink.py * Add comment (cherry picked from commit 43071e3fa280c367d1ae5168da538b28a5151462) Co-authored-by: aikaterna <20862007+aikaterna@users.noreply.github.com> Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com> Co-authored-by: aikaterna <20862007+aikaterna@users.noreply.github.com> Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com> --- redbot/cogs/audio/core/events/lavalink.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/redbot/cogs/audio/core/events/lavalink.py b/redbot/cogs/audio/core/events/lavalink.py index 4eff43c9e..907514ebf 100644 --- a/redbot/cogs/audio/core/events/lavalink.py +++ b/redbot/cogs/audio/core/events/lavalink.py @@ -215,6 +215,8 @@ class LavalinkEvents(MixinMeta, metaclass=CompositeMetaClass): await self.config.guild_from_id( guild_id=guild_id ).currently_auto_playing_in.set([]) + # let audio buffer run out on slower machines (GH-5158) + await asyncio.sleep(2) await player.disconnect() self._ll_guild_updates.discard(guild.id) if status: