Liking cljdoc? Tell your friends :D

discord.http

Functions and Records used to interact directly with the Discord API. Any actions performed on Discord eventually boil down to some form of API request. The API endpoints are represented as human-readable keywords and implemented using the discord-request helper function. Exposed externally are functions such as get-channel, which perform the API requests and handle the transformation of the response into a more usable Clojure record.

Functions and Records used to interact directly with the Discord API. Any actions performed
on Discord eventually boil down to some form of API request. The API endpoints are represented as
human-readable keywords and implemented using the discord-request helper function. Exposed
externally are functions such as get-channel, which perform the API requests and handle the
transformation of the response into a more usable Clojure record.
raw docstring

add-reactionclj

(add-reaction auth channel message emoji)

banclj

(ban auth guild user)

build-channelclj

(build-channel channel-map)

build-serverclj

(build-server server-map)

build-userclj

(build-user user-map)
(build-user user-map roles)

Channelclj


channel-type-mapclj


clear-reactionsclj

(clear-reactions auth channel message)

create-channelclj

(create-channel auth guild channel-name & {:keys [type bitrate] :as params})

create-dm-channelclj

(create-dm-channel auth user)

create-serverclj

(create-server auth server-name icon region)

delete-channelclj

(delete-channel auth channel)

delete-messageclj

(delete-message auth channel message)

delete-messagesclj

(delete-messages auth channel messages)

delete-serverclj

(delete-server auth guild)

discord-requestclj

(discord-request
  endpoint-key
  auth
  &
  {:keys [json params args constructor] :or {constructor identity} :as opts})

General wrapper function for sending a request to one of the pre-defined Discord API endpoints. This function calls other helper functions to handle the following:

  • Retrieving the API endpoint to call
  • Formatting the request
  • Sending the API call
  • Deferred retries of API calls in the event of a 429 Rate Limit response

Arguments: endpoint-key: A keyword that maps to a defined endpoint in endpoint-mapping auth: Something that implements the Authenticated protocol to auth with the Discord APIs

Options are passed :key val ... Supported options:

:json map - An optional JSON body to pass along with post/put/patch/delete request :params map - Optional query parameters to pass along with a get request :args list - In order (format) arguments to correctly format the endpoint from endpoint-mapping :constructor f - A function which is mapped over API responses to create appropriate Records.

General wrapper function for sending a request to one of the pre-defined Discord API endpoints.
This function calls other helper functions to handle the following:
 - Retrieving the API endpoint to call
 - Formatting the request
 - Sending the API call
 - Deferred retries of API calls in the event of a 429 Rate Limit response

Arguments:
endpoint-key: A keyword that maps to a defined endpoint in endpoint-mapping
auth: Something that implements the Authenticated protocol to auth with the Discord APIs

Options are passed :key val ... Supported options:

:json map - An optional JSON body to pass along with post/put/patch/delete request
:params map - Optional query parameters to pass along with a get request
:args list - In order (format) arguments to correctly format the endpoint from endpoint-mapping
:constructor f - A function which is mapped over API responses to create appropriate Records.
raw docstring

discord-urlclj


edit-channelclj

(edit-channel auth channel & {:keys [name topic bitrate position] :as params})

edit-memberclj

(edit-member auth
             guild
             user
             &
             {:keys [nick roles mute deaf channel_id] :as params})

edit-messageclj

(edit-message auth channel message content & {:keys [embed]})

edit-profileclj

(edit-profile auth & {:keys [username avatar] :as params})

endpoint-mappingclj


estimate-prune-membersclj

(estimate-prune-members auth guild days)

find-channelclj

(find-channel auth guild channel-name)

find-memberclj

(find-member auth guild member-name)

find-serverclj

(find-server auth server-name)

get-bot-gatewayclj

(get-bot-gateway auth)

get-channelclj

(get-channel auth channel)

get-current-userclj

(get-current-user auth)

get-endpointclj

(get-endpoint endpoint-key endpoint-args)

get-gatewayclj

(get-gateway auth)

get-guildclj

(get-guild auth guild)

get-guild-channelsclj

(get-guild-channels auth guild)

get-guild-memberclj

(get-guild-member auth guild user)

get-memberclj

(get-member auth guild user)

get-messageclj

(get-message auth channel message)

get-rolesclj

(get-roles auth guild)

get-serversclj

(get-servers auth)

get-text-channelsclj

(get-text-channels auth guild)

get-voice-channelsclj

(get-voice-channels auth guild)

kickclj

(kick auth guild user)

list-membersclj

(list-members auth guild & {:keys [limit after] :as params})

logs-fromclj

(logs-from auth channel limit & {:keys [before after around] :as params})

modify-serverclj

(modify-server auth guild & {:keys [name region] :as params})

move-channelclj

(move-channel auth channel new-position)

pin-messageclj

(pin-message auth channel message)

pins-fromclj

(pins-from auth channel)

prune-membersclj

(prune-members auth guild days)

rate-limit-poolclj


reaction-usersclj

(reaction-users auth channel message emoji & {:keys [limit after] :as params})

remove-reactionclj

(remove-reaction auth channel message emoji user)

Routeclj


send-messageclj

(send-message auth channel content & {:keys [tts embed]})

send-typingclj

(send-typing auth channel)

Serverclj


unbanclj

(unban auth guild user)

unpin-messageclj

(unpin-message auth channel message)

update-nicknameclj

(update-nickname auth guild nickname)

Userclj


user-agentclj

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

× close