Opens the websocket a Discord gateway shard talks over, reconnecting as needed.
Functions#
connect#
connect(url, on_connecting) -> Effect[WsConnection, Never, Scope]Connects to url until the scope closes, running on_connecting
before each connection, the first and every reconnection.
| Parameter | Type | Description |
|---|---|---|
url | str | |
on_connecting | Effect[None] |
Returns Effect[WsConnection, Never, Scope]
def connect(self, url: str, on_connecting: Effect[None]) -> Effect[WsConnection, Never, Scope]:
"""Connects to ``url`` until the scope closes, running ``on_connecting``
before each connection, the first and every reconnection."""
...