How to fix websockets.exceptions.InvalidState: WebSocket is not connected in Python | DevErrors