Liking cljdoc? Tell your friends :D

discljord.connections.impl

Implementation namespace for discljord.connections.

Implementation namespace for `discljord.connections`.
raw docstring

connect-shard!clj

(connect-shard! url
                token
                shard-id
                shard-count
                out-ch
                comm-ch
                &
                {:keys [buffer-size]})

Takes a gateway URL and a bot token, creates a websocket connected to Discord's servers, and returns a function of no arguments which disconnects it

Takes a gateway URL and a bot token, creates a websocket connected to
Discord's servers, and returns a function of no arguments which disconnects it
sourceraw docstring

connect-shards!clj

(connect-shards! url token shard-count out-ch comm-ch & {:keys [buffer-size]})

Calls connect-shard! once per shard in shard-count, and returns a sequence of promises of the return results.

Calls connect-shard! once per shard in shard-count, and returns a sequence
of promises of the return results.
sourceraw docstring

get-shard-from-guildclj

(get-shard-from-guild guild-id guild-count)
source

get-websocket-gateway!clj

(get-websocket-gateway! url token)

Gets the shard count and websocket endpoint from Discord's API.

Gets the shard count and websocket endpoint from Discord's API.
sourceraw docstring

handle-command!cljmultimethod

Handles commands from the outside world.

Takes an atom of a vector of promises containing atoms of shard connections, the channel used to send events out of the process, a keyword command type, and any number of command data arguments.

Handles commands from the outside world.

Takes an atom of a vector of promises containing atoms of shard connections,
the channel used to send events out of the process, a keyword command type,
and any number of command data arguments.
sourceraw docstring

handle-disconnect!cljmultimethod

Handles the disconnection process for different stop codes.

Takes an integer stop code, the message, a function to reconnect the shard, and a function to reconnect the shard with resume.

Handles the disconnection process for different stop codes.

Takes an integer stop code, the message, a function to reconnect
the shard, and a function to reconnect the shard with resume.
sourceraw docstring

handle-eventcljmultimethod

Handles event payloads sent from Discord in the context of the connection, before it gets to the regular event handlers.

Takes a keyword event type, event data from Discord, an atom containing the shard's state, and the channel for sending events out of the process.

Handles event payloads sent from Discord in the context of the connection,
before it gets to the regular event handlers.

Takes a keyword event type, event data from Discord, an atom containing the shard's
state, and the channel for sending events out of the process.
sourceraw docstring

handle-payload!cljmultimethod

Handles a command payload sent from Discord.

Takes an integer op code, the data sent from Discord, a function to reconnect the shard to Discord, a function to reconnect to Discord with a resume, a function to send a heartbeat to Discord, an atom containing the ack state from the last heartbeat, an atom containing whether the current shard is connected, and an atom containing the shard state, including the seq and session-id.

Handles a command payload sent from Discord.

Takes an integer op code, the data sent from Discord, a function to reconnect
the shard to Discord, a function to reconnect to Discord with a resume,
a function to send a heartbeat to Discord, an atom containing the ack state
from the last heartbeat, an atom containing whether the current shard is connected,
and an atom containing the shard state, including the seq and session-id.
sourceraw docstring

handle-websocket-event!cljmultimethod

Handles events sent from discord over the websocket.

Takes the channel to send events out of the process, a keyword event type, and any number of event data arguments.

Handles events sent from discord over the websocket.

Takes the channel to send events out of the process, a
keyword event type, and any number of event data arguments.
sourceraw docstring

reconnect-websocket!clj

(reconnect-websocket! url
                      token
                      conn
                      ch
                      shard
                      out-ch
                      &
                      {:keys [init-shard-state buffer-size]})

Takes a websocket connection atom and additional connection information, and reconnects a websocket, with options for resume or not.

Takes a websocket connection atom and additional connection information,
and reconnects a websocket, with options for resume or not.
sourceraw docstring

start-communication-loop!clj

(start-communication-loop! shards token ch out-ch comm-ch)

Takes a vector of promises representing the atoms of websocket connections of the shards.

Takes a vector of promises representing the atoms of websocket connections of the shards.
sourceraw docstring

start-event-loop!clj

(start-event-loop! conn ch out-ch comm-ch)

Starts a go loop which takes events from the channel and dispatches them via multimethod.

Starts a go loop which takes events from the channel and dispatches them
via multimethod.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close