dico.ws.websocket module

class dico.ws.websocket.WebSocketClient(http, ws, base_url, intents, event_handler, try_reconnect, compress=None, large_threshold=None, shard=None, presence=None)

Bases: object

ZLIB_SUFFIX = b'\x00\x00\xff\xff'
RECONNECT_CODES = [1000, 1001, 1006, 4000, 4001, 4002, 4003, 4005, 4007, 4009]
INPUT_WARN = [4001, 4002, 4003, 4005]
WS_KWARGS = {'autoclose': False, 'autoping': False, 'timeout': 60}
async close(code=1000)
async run()
async receive_once()
async request(*args, **kwargs)
to_gateway_response(resp)
async receive(resp)
async process(resp)
async reconnect(fresh=False)
async resume()
async run_heartbeat()
async cancel_heartbeat()
async identify()
async request_guild_members(guild_id, *, query=None, limit=None, presences=None, user_ids=None, nonce=None)
async update_voice_state(guild_id, channel_id, self_mute, self_deaf)
async update_presence(since, activities, status, afk)
property closed
async classmethod connect(http, intents, event_handler, try_reconnect, compress, large_threshold=None, shard=None, presence=None)
async classmethod connect_without_request(gw_response, http, intents, event_handler, try_reconnect, compress, large_threshold=None, shard=None, presence=None)
exception dico.ws.websocket.WSClosing(code)

Bases: Exception

Internal exception class for controlling WS close event. You should not see this exception in normal situation.

exception dico.ws.websocket.Ignore

Bases: Exception

Internal exception class for just ignoring the response. Used for ignoring unsupported response.