GitHub

DiscordWsService

API reference for DiscordWsService.

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.

ParameterTypeDescription
urlstr
on_connectingEffect[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."""
    ...