diff --git a/lava/classes/player.py b/lava/classes/player.py index d7dd2b2c..027f675f 100644 --- a/lava/classes/player.py +++ b/lava/classes/player.py @@ -349,7 +349,7 @@ def cleanup(self): if self.timeout_task: self.timeout_task.cancel() - async def disconnect_timeout(self): + def enter_disconnect_timeout(self): """ Disconnect the player if it has been inactive for 5 minutes. """ diff --git a/lava/cogs/commands.py b/lava/cogs/commands.py index 8620ef5b..2a18a4e6 100644 --- a/lava/cogs/commands.py +++ b/lava/cogs/commands.py @@ -526,6 +526,8 @@ async def connect(self, interaction: ApplicationCommandInteraction): ) finally: + player.enter_disconnect_timeout() + await player.update_display( new_message=await interaction.original_response(), delay=5, diff --git a/lava/cogs/events.py b/lava/cogs/events.py index a5d63fd7..485192bc 100644 --- a/lava/cogs/events.py +++ b/lava/cogs/events.py @@ -43,8 +43,7 @@ async def on_queue_end(self, event: QueueEndEvent): self.bot.logger.info("Received queue end event for guild %s", player.guild) - if player.guild.voice_client: - await player.guild.voice_client.disconnect(force=False) + player.enter_disconnect_timeout() try: await player.update_display()