Liking cljdoc? Tell your friends :D

discord-bot.clients.discord.ws


build-identify-payloadclj

(build-identify-payload intents)

call-heartbeatclj

(call-heartbeat & [override])

close-connectionclj

(close-connection)

Closes the WebSocket connection to Discord. Takes no arguments. May trigger auto-reconnect via the on-close handler unless intentionally-disconnected is set.

Closes the WebSocket connection to Discord. Takes no arguments. May trigger
auto-reconnect via the on-close handler unless intentionally-disconnected is set.
raw docstring

get-presencesclj

(get-presences)

Returns the presences for the connected guild as a vector of presence maps, each containing :user, :status, :activities, etc. Returns nil if no guild data has been received yet.

Returns the presences for the connected guild as a vector of presence maps,
each containing :user, :status, :activities, etc. Returns nil if no guild
data has been received yet.
raw docstring

get-user-by-idclj

(get-user-by-id user-id)

Looks up a guild member by their user ID. user-id is a string snowflake. Returns the member map (containing :user, :roles, :nick, etc.) or nil if not found.

Looks up a guild member by their user ID. user-id is a string snowflake.
Returns the member map (containing :user, :roles, :nick, etc.) or nil if
not found.
raw docstring

get-ws-connectionclj

(get-ws-connection)

handle-channel-createclj

(handle-channel-create data & [callback])

handle-channel-deleteclj

(handle-channel-delete data & [callback])

handle-defaultclj

(handle-default data & [callback])

handle-messageclj

(handle-message msg opts)

handle-message-createclj

(handle-message-create data & [callback])

handle-message-updateclj

(handle-message-update data & [callback])

handle-presence-updateclj

(handle-presence-update data & [callback])

handle-session-resumedclj

(handle-session-resumed data)

handle-typing-startclj

(handle-typing-start data & [callback])

heartbeat-semaforclj


heartbeat-timerclj


identifyclj

(identify intents)

initclj

(init & [opts resume?])

Opens a WebSocket connection to Discord and begins handling gateway events. Both arguments are optional.

opts - a map of event callback functions, keyed by: :on-message-create, :on-presence-update, :on-typing-start, :on-channel-create, :on-channel-delete, :on-voice-state-update, :on-message-update, :on-message-reaction-add, :on-guild-member-update, :on-guild-member-remove, :on-guild-role-delete, :on-interaction-create Each callback receives the event data map as its sole argument. Also accepts :intents (integer bitfield for gateway intents).

resume? - boolean, when true resumes an existing session instead of sending a fresh Identify.

Returns the WebSocket connection object.

Opens a WebSocket connection to Discord and begins handling gateway events.
Both arguments are optional.

opts - a map of event callback functions, keyed by:
  :on-message-create, :on-presence-update, :on-typing-start,
  :on-channel-create, :on-channel-delete, :on-voice-state-update,
  :on-message-update, :on-message-reaction-add, :on-guild-member-update,
  :on-guild-member-remove, :on-guild-role-delete, :on-interaction-create
  Each callback receives the event data map as its sole argument.
  Also accepts :intents (integer bitfield for gateway intents).

resume? - boolean, when true resumes an existing session instead of
  sending a fresh Identify.

Returns the WebSocket connection object.
raw docstring

intentionally-disconnectedclj


on-connectclj

(on-connect resume? {:keys [intents]} & _)

on-errorclj

(on-error e)

receive-eventclj

(receive-event {data :d event-name :t event-index :s}
               {:keys [on-message-create on-presence-update on-typing-start
                       on-channel-create on-channel-delete on-voice-state-update
                       on-message-update on-message-reaction-add
                       on-guild-member-update on-guild-member-remove
                       on-guild-role-delete on-interaction-create]})

reconnect?clj

(reconnect? close-code)

reset-state!clj

(reset-state!)

resume-sessionclj

(resume-session)

server-stateclj


sessionclj


start-heartbeatclj

(start-heartbeat interval)

started-new-game?clj

(started-new-game? current-game new-game)

Returns true if the game changed between two presence activity entries. current-game and new-game are maps with a :name key (or nil). Returns boolean.

Returns true if the game changed between two presence activity entries.
current-game and new-game are maps with a :name key (or nil). Returns boolean.
raw docstring

stopclj

(stop)

Gracefully disconnects from Discord without triggering auto-reconnect. Takes no arguments. Returns nil.

Gracefully disconnects from Discord without triggering auto-reconnect.
Takes no arguments. Returns nil.
raw docstring

the-optsclj


ws-connectionclj


ws-sendclj

(ws-send payload)

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close