This implements the Discord Gateway protocol
This implements the Discord Gateway protocol
(build-gateway gateway-response)
(build-message message-map gateway)
Builds a Message record based on the incoming Message from the Discord Gateway. The Gateway record that received the message is passed as the second argument to this function.
Builds a Message record based on the incoming Message from the Discord Gateway. The Gateway record that received the message is passed as the second argument to this function.
(connect-to-gateway auth receive-channel)
Attempts to connect to the discord Gateway using some supplied authentication source
Arguments: auth : Authenticated -- An implementation of the Authenticated protcol to authenticate with the Discord APIs. receive-channel : Channel -- An asynchronous channel (core.async) that messages from the server will be pushed onto.
Attempts to connect to the discord Gateway using some supplied authentication source Arguments: auth : Authenticated -- An implementation of the Authenticated protcol to authenticate with the Discord APIs. receive-channel : Channel -- An asynchronous channel (core.async) that messages from the server will be pushed onto.
(format-gateway-message op data)
Builds the correct map structure with the correct op-codes. If the op-code supplied is not found, an (ex-info) Exception will be raised
Builds the correct map structure with the correct op-codes. If the op-code supplied is not found, an (ex-info) Exception will be raised
(send-message this message)
Handling server control events. Control events are control messages sent by the Gateway to a connected client to inform the client about disconnects, reconnects, rate limits, etc.
Handling server control events. Control events are control messages sent by the Gateway to a connected client to inform the client about disconnects, reconnects, rate limits, etc.
Handling messages sent by the Discord API gateway
These are messages that are received from the gateway and include text messages sent by users/clients as well as various control messages sent by the Discord gateway.
Handling messages sent by the Discord API gateway These are messages that are received from the gateway and include text messages sent by users/clients as well as various control messages sent by the Discord gateway.
(reconnect-gateway gateway)
In the event that we are disconnected from the Discord gateway, we will attempt to reconnect by establishing a new websocket connection with the gateway. After this is complete, we will update our current socket reference and then send a 'resume' message to the Discord gateway that we have resumed our session.
In the event that we are disconnected from the Discord gateway, we will attempt to reconnect by establishing a new websocket connection with the gateway. After this is complete, we will update our current socket reference and then send a 'resume' message to the Discord gateway that we have resumed our session.
(send-heartbeat gateway seq-num)
(send-identify gateway)
Sends an identification message to the supplied Gateway. This tells the Discord gateway information about ourselves.
Sends an identification message to the supplied Gateway. This tells the Discord gateway information about ourselves.
(send-resume gateway)
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close