(build-identify-payload intents)(call-heartbeat & [override])(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.
(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.
(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.
(get-ws-connection)(handle-channel-create data & [callback])(handle-channel-delete data & [callback])(handle-default data & [callback])(handle-message msg opts)(handle-message-create data & [callback])(handle-message-update data & [callback])(handle-presence-update data & [callback])(handle-session-resumed data)(handle-typing-start data & [callback])(identify intents)(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.
(on-connect resume? {:keys [intents]} & _)(on-error e)(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? close-code)(reset-state!)(resume-session)(start-heartbeat interval)(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.
(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.
(ws-send payload)cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |