Skip to content

Commit

Permalink
Ensure player is destroyed when disconnecting.
Browse files Browse the repository at this point in the history
  • Loading branch information
EvieePy committed Mar 21, 2022
1 parent 3acb9b8 commit 6e0c408
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions wavelink/player.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,9 @@ async def disconnect(self, *, force: bool = False) -> None:
with contextlib.suppress(ValueError):
self.node._players.remove(self)

payload = {"op": "destroy", "guildId": str(self.guild.id)}
await self.node._websocket.send(**payload)

self.cleanup()

async def move_to(self, channel: discord.VoiceChannel) -> None:
Expand Down

0 comments on commit 6e0c408

Please sign in to comment.