async def disconnect(self):
        """
        Shuts down and disconnects the websocket.
        """
        self._is_shutdown = True
        self.ready.clear()

        self.update_state(NodeState.DISCONNECTING)

        await self.player_manager.disconnect()

        if self._ws is not None and self._ws.open:
            await self._ws.close()

        if self._listener_task is not None and not self.loop.is_closed():
            self._listener_task.cancel()

        self._state_handlers = []

        _nodes.remove(self)
        log.debug("Shutdown Lavalink WS.")
async def disconnect ( self ) : self . _is_shutdown = True self . ready . clear ( ) self . update_state ( NodeState . DISCONNECTING ) await self . player_manager . disconnect ( ) if self . _ws is not None and self . _ws . open : await self . _ws . close ( ) if self . _listener_task is not None and not self . loop . is_closed ( ) : self . _listener_task . cancel ( ) self . _state_handlers = [ ] _nodes . remove ( self ) log . debug ( "Shutdown Lavalink WS." )
Shuts down and disconnects the websocket.