(add-guild-member-role guild-id user-id role-id)Assigns a role to a guild member. guild-id, user-id, and role-id are string snowflakes. Returns :ok on success.
Assigns a role to a guild member. guild-id, user-id, and role-id are string snowflakes. Returns :ok on success.
(bulk-delete-messages channel-id message-ids)Deletes multiple messages from a channel. channel-id is a string snowflake. message-ids is a sequence of string snowflakes (2-100 messages, not older than 14 days). Returns :ok on success.
Deletes multiple messages from a channel. channel-id is a string snowflake. message-ids is a sequence of string snowflakes (2-100 messages, not older than 14 days). Returns :ok on success.
(bulk-overwrite-global-commands app-id commands)Replaces all global application commands with the provided list. app-id is a string snowflake. commands is a vector of command data maps. Returns a vector of the new command maps.
Replaces all global application commands with the provided list. app-id is a string snowflake. commands is a vector of command data maps. Returns a vector of the new command maps.
(bulk-overwrite-guild-commands app-id guild-id commands)Replaces all application commands for a specific guild. app-id and guild-id are string snowflakes. commands is a vector of command data maps. Returns a vector of the new command maps.
Replaces all application commands for a specific guild. app-id and guild-id are string snowflakes. commands is a vector of command data maps. Returns a vector of the new command maps.
(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.
(create-channel guild-id params)Creates a new channel in a guild. guild-id is a string snowflake. params is a map with at minimum {:name "channel-name"} and optionally :type, :topic, :parent_id, etc. Returns the created channel map.
Creates a new channel in a guild. guild-id is a string snowflake. params
is a map with at minimum {:name "channel-name"} and optionally :type,
:topic, :parent_id, etc. Returns the created channel map.(create-followup-message app-id interaction-token message-data)Sends a followup message to an interaction. app-id is a string snowflake. interaction-token is a string. message-data is a map with :content and/or :embeds. Returns the created message map.
Sends a followup message to an interaction. app-id is a string snowflake. interaction-token is a string. message-data is a map with :content and/or :embeds. Returns the created message map.
(create-guild-role guild-id params)Creates a new role in a guild. guild-id is a string snowflake. params is a map (e.g. {:name "Mod" :color 0x00FF00 :permissions "8"}). Returns the created role map.
Creates a new role in a guild. guild-id is a string snowflake. params is
a map (e.g. {:name "Mod" :color 0x00FF00 :permissions "8"}).
Returns the created role map.(create-reaction channel-id message-id emoji)Adds a reaction to a message as the bot user. channel-id and message-id are string snowflakes. emoji is a URL-encoded string (e.g. "%F0%9F%94%A5" or "custom_emoji:123456"). Returns :ok on success.
Adds a reaction to a message as the bot user. channel-id and message-id are string snowflakes. emoji is a URL-encoded string (e.g. "%F0%9F%94%A5" or "custom_emoji:123456"). Returns :ok on success.
(delete-channel channel-id)Deletes a channel. channel-id is a string snowflake. Returns the deleted channel map.
Deletes a channel. channel-id is a string snowflake. Returns the deleted channel map.
(delete-global-command app-id command-id)Deletes a global application command. app-id and command-id are string snowflakes. Returns :ok on success.
Deletes a global application command. app-id and command-id are string snowflakes. Returns :ok on success.
(delete-guild-command app-id guild-id command-id)Deletes a guild-specific application command. app-id, guild-id, and command-id are string snowflakes. Returns :ok on success.
Deletes a guild-specific application command. app-id, guild-id, and command-id are string snowflakes. Returns :ok on success.
(delete-guild-role guild-id role-id)Deletes a role from a guild. guild-id and role-id are string snowflakes. Returns :ok on success.
Deletes a role from a guild. guild-id and role-id are string snowflakes. Returns :ok on success.
(delete-message channel-id message-id)Deletes a message from a channel. channel-id and message-id are string snowflakes. Returns :ok on success.
Deletes a message from a channel. channel-id and message-id are string snowflakes. Returns :ok on success.
(delete-original-response app-id interaction-token)Deletes the original interaction response. app-id is a string snowflake. interaction-token is a string. Returns :ok on success.
Deletes the original interaction response. app-id is a string snowflake. interaction-token is a string. Returns :ok on success.
(delete-own-reaction channel-id message-id emoji)Removes the bot's own reaction from a message. channel-id and message-id are string snowflakes. emoji is a URL-encoded string. Returns :ok on success.
Removes the bot's own reaction from a message. channel-id and message-id are string snowflakes. emoji is a URL-encoded string. Returns :ok on success.
(delete-user-reaction channel-id message-id emoji user-id)Removes another user's reaction from a message. channel-id, message-id, and user-id are string snowflakes. emoji is a URL-encoded string. Returns :ok on success.
Removes another user's reaction from a message. channel-id, message-id, and user-id are string snowflakes. emoji is a URL-encoded string. Returns :ok on success.
(edit-message channel-id message-id params)Edits an existing message. channel-id and message-id are string snowflakes. params is a map of fields to update (e.g. {:content "edited"}). Returns the updated message map.
Edits an existing message. channel-id and message-id are string snowflakes.
params is a map of fields to update (e.g. {:content "edited"}).
Returns the updated message map.(edit-original-response app-id interaction-token message-data)Edits the original interaction response. app-id is a string snowflake. interaction-token is a string. message-data is a map of fields to update. Returns the updated message map.
Edits the original interaction response. app-id is a string snowflake. interaction-token is a string. message-data is a map of fields to update. Returns the updated message map.
(get-channel channel-id)Fetches a channel by ID. channel-id is a string snowflake. Returns a channel map with :id, :name, :type, :guild_id, etc.
Fetches a channel by ID. channel-id is a string snowflake. Returns a channel map with :id, :name, :type, :guild_id, etc.
(get-channel-message channel-id message-id)Fetches a single message from a channel. channel-id and message-id are string snowflakes. Returns a message map with :id, :content, :author, etc.
Fetches a single message from a channel. channel-id and message-id are string snowflakes. Returns a message map with :id, :content, :author, etc.
(get-channel-messages channel-id & [query-params])Fetches messages from a channel. channel-id is a string snowflake. query-params is an optional map for pagination, e.g. {:limit 50 :before id}. Returns a vector of message maps.
Fetches messages from a channel. channel-id is a string snowflake.
query-params is an optional map for pagination, e.g. {:limit 50 :before id}.
Returns a vector of message maps.(get-channels server-id)Fetches all channels for a guild and groups them by type. server-id is a string snowflake. Returns a map: {:text [channel-maps ...] :voice [channel-maps ...] :parents [channel-maps ...]} where each channel map has :name, :id, and :type.
Fetches all channels for a guild and groups them by type.
server-id is a string snowflake. Returns a map:
{:text [channel-maps ...]
:voice [channel-maps ...]
:parents [channel-maps ...]}
where each channel map has :name, :id, and :type.(get-guild guild-id)Fetches a guild by ID. guild-id is a string snowflake. Returns a guild map with :id, :name, :icon, :owner_id, :roles, etc.
Fetches a guild by ID. guild-id is a string snowflake. Returns a guild map with :id, :name, :icon, :owner_id, :roles, etc.
(get-guild-member guild-id user-id)Fetches a guild member. guild-id and user-id are string snowflakes. Returns a member map with :user, :nick, :roles, :joined_at, etc.
Fetches a guild member. guild-id and user-id are string snowflakes. Returns a member map with :user, :nick, :roles, :joined_at, etc.
(get-guild-roles guild-id)Lists all roles in a guild. guild-id is a string snowflake. Returns a vector of role maps with :id, :name, :color, :permissions, etc.
Lists all roles in a guild. guild-id is a string snowflake. Returns a vector of role maps with :id, :name, :color, :permissions, etc.
(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-reactions channel-id message-id emoji & [query-params])Fetches users who reacted with a given emoji on a message. channel-id and message-id are string snowflakes. emoji is a URL-encoded string. query-params is an optional map (e.g. {:limit 25 :after user-id}). Returns a vector of user maps.
Fetches users who reacted with a given emoji on a message. channel-id and
message-id are string snowflakes. emoji is a URL-encoded string.
query-params is an optional map (e.g. {:limit 25 :after user-id}).
Returns a vector of user maps.(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.
(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.
(list-global-commands app-id)Lists all global application commands. app-id is a string snowflake. Returns a vector of command maps.
Lists all global application commands. app-id is a string snowflake. Returns a vector of command maps.
(list-guild-commands app-id guild-id)Lists all application commands for a specific guild. app-id and guild-id are string snowflakes. Returns a vector of command maps.
Lists all application commands for a specific guild. app-id and guild-id are string snowflakes. Returns a vector of command maps.
(list-guild-members guild-id & [query-params])Lists members of a guild. guild-id is a string snowflake. query-params is an optional map (e.g. {:limit 100 :after user-id}). Returns a vector of member maps.
Lists members of a guild. guild-id is a string snowflake. query-params is
an optional map (e.g. {:limit 100 :after user-id}). Returns a vector of
member maps.(modify-channel channel-id params)Updates a channel's settings. channel-id is a string snowflake. params is a map of fields to change (e.g. {:name "new-name" :topic "new topic"}). Returns the updated channel map.
Updates a channel's settings. channel-id is a string snowflake. params is
a map of fields to change (e.g. {:name "new-name" :topic "new topic"}).
Returns the updated channel map.(modify-guild guild-id params)Updates a guild's settings. guild-id is a string snowflake. params is a map of fields to change (e.g. {:name "new name"}). Returns the updated guild map.
Updates a guild's settings. guild-id is a string snowflake. params is a map
of fields to change (e.g. {:name "new name"}). Returns the updated guild map.(modify-guild-member guild-id user-id params)Updates a guild member's attributes. guild-id and user-id are string snowflakes. params is a map of fields to change (e.g. {:nick "new nick"}). Returns the updated member map.
Updates a guild member's attributes. guild-id and user-id are string
snowflakes. params is a map of fields to change (e.g. {:nick "new nick"}).
Returns the updated member map.(modify-guild-role guild-id role-id params)Updates a role's attributes. guild-id and role-id are string snowflakes. params is a map of fields to change. Returns the updated role map.
Updates a role's attributes. guild-id and role-id are string snowflakes. params is a map of fields to change. Returns the updated role map.
(register-global-command app-id command-data)Registers an application command globally (available in all guilds). app-id is a string snowflake. command-data is a map with :name, :description, and optionally :options (vector of option maps). Returns the created command map.
Registers an application command globally (available in all guilds). app-id is a string snowflake. command-data is a map with :name, :description, and optionally :options (vector of option maps). Returns the created command map.
(register-guild-command app-id guild-id command-data)Registers an application command for a specific guild. app-id and guild-id are string snowflakes. command-data is a map with :name, :description, and optionally :options. Returns the created command map.
Registers an application command for a specific guild. app-id and guild-id are string snowflakes. command-data is a map with :name, :description, and optionally :options. Returns the created command map.
(remove-guild-member guild-id user-id)Kicks a member from a guild. guild-id and user-id are string snowflakes. Returns :ok on success.
Kicks a member from a guild. guild-id and user-id are string snowflakes. Returns :ok on success.
(remove-guild-member-role guild-id user-id role-id)Removes a role from a guild member. guild-id, user-id, and role-id are string snowflakes. Returns :ok on success.
Removes a role from a guild member. guild-id, user-id, and role-id are string snowflakes. Returns :ok on success.
(respond-to-interaction interaction-id interaction-token callback-type & [data])Sends a response to an interaction. interaction-id is a string snowflake. interaction-token is a string. callback-type is either a keyword (:channel-message-with-source, :deferred-channel-message-with-source, :update-message, :deferred-update-message, :autocomplete-result, :modal, :pong) or a raw integer. data is an optional map (e.g. {:content "hi"}). Returns the API response map.
Sends a response to an interaction. interaction-id is a string snowflake.
interaction-token is a string. callback-type is either a keyword
(:channel-message-with-source, :deferred-channel-message-with-source,
:update-message, :deferred-update-message, :autocomplete-result, :modal,
:pong) or a raw integer. data is an optional map (e.g. {:content "hi"}).
Returns the API response map.(send-channel-message channel-id params)Sends a message to a channel. channel-id is a string snowflake. params is a map with :content (string) and/or :embeds (vector of embed maps). Returns the created message map.
Sends a message to a channel. channel-id is a string snowflake. params is a map with :content (string) and/or :embeds (vector of embed maps). Returns the created message map.
Atom holding the current guild state. Deref to get the guild map containing :members, :channels, :presences, etc.
Atom holding the current guild state. Deref to get the guild map containing :members, :channels, :presences, etc.
(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.
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 |