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.
(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:
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.
(edit-member auth
guild
user
&
{:keys [nick roles mute deaf channel_id] :as params})
(reaction-users auth channel message emoji & {:keys [limit after] :as params})
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close