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

The interval to send pings

Type:float
_trace

Used for debugging

Type:str
seq

Used in pings

Type:str
session_id

Used for resuming

Type:str
http

Used for sending http requests and session handling.

Type:HTTPHandler
gateway_url

The gateway url

Type:str
shards

Used for opening multiple connections

Type:list of int
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 succeeded closing. False if the websocket was already closed
Return type:bool
await start()[source]

Starts the websocket

New in version 0.2.0.