Skip to content

Commit

Permalink
fix(lava/classes/player.py, lava/cogs/commands.py, lava/cogs/events.p…
Browse files Browse the repository at this point in the history
…y): update method name to enter_disconnect_timeout
  • Loading branch information
Nat1anWasTaken committed May 12, 2024
1 parent 338b1fa commit 5aa9b91
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lava/classes/player.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
Expand Down
2 changes: 2 additions & 0 deletions lava/cogs/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 1 addition & 2 deletions lava/cogs/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 5aa9b91

Please sign in to comment.