Fix voice websocket not being closed before being replaced

This commit is contained in:
Imayhaveborkedit
2023-08-04 19:12:59 -04:00
committed by GitHub
parent 0ab68440ee
commit cdc220fa4c

View File

@ -421,6 +421,11 @@ class VoiceClient(VoiceProtocol):
self.finish_handshake()
self._potentially_reconnecting = False
if self.ws:
_log.debug("Closing existing voice websocket")
await self.ws.close()
try:
self.ws = await self.connect_websocket()
except (ConnectionClosed, asyncio.TimeoutError):