matteridge.websocket¶
Attributes¶
Exceptions¶
Common base class for all non-exit exceptions. |
Classes¶
Module Contents¶
- exception matteridge.websocket.WebsocketRequestError[source]¶
Bases:
Exception
Common base class for all non-exit exceptions.
Initialize self. See help(type(self)) for accurate signature.
- class matteridge.websocket.Websocket(url, token, client)[source]¶
- Parameters:
client (aiohttp.ClientSession)
- async connect(event_handler)[source]¶
Connect to the websocket and authenticate it. When the authentication has finished, start the loop listening for messages, sending a ping to the server to keep the connection alive. :param event_handler: Every websocket event will be passed there. Takes one argument. :type event_handler: Function(message)