def receive(self, mode: DataMode = None):
        """Receive data from the websocket.

        Args:
            mode: The data mode to use.
        """
        mode = mode or self.mode
        if self.websocket:
            response = self.websocket.recv()
            if mode == DataMode.JSON:
                response = json.loads(response)
            elif mode == DataMode.TEXT:
                response = str(response)
            elif mode == DataMode.BYTES:
                response = response.decode("utf-8")
            return response
Receive data from the websocket.

        Args:
            mode: The data mode to use.
        
lanarky/clients.py