discordaio.websocket

Classes

  • DiscordWebsocket: Class used for handling the websocket connection with the discord gateway
class discordaio.websocket.DiscordWebsocket(http: discordaio.http.HTTPHandler = None, session_id: str = None, shards: list = [])[source]

Class used for handling the websocket connection with the discord gateway

New in version 0.2.0.

heartbeat_interval

float – The interval to send pings

_trace

str – Used for debugging

seq

str – Used in pings

session_id

str – Used for resuming

http

HTTPHandler – Used for sending http requests and session handling.

gateway_url

str – The gateway url

shards

list of int – Used for opening multiple connections

ws (

class:aiohttp.ClientWebSocketResponse``): The websocket

Inheritance

Inheritance diagram of DiscordWebsocket
await close() → bool[source]

Closes the websocket

New in version 0.2.0.

Returns:True if succeded closing. False if the websocket was already closed
Return type:bool
await start()[source]

Starts the websocket

New in version 0.2.0.