D++ (DPP)
C++ Discord API Bot Library
dpp::cluster Class Reference

The cluster class represents a group of shards and a command queue for sending and receiving commands from discord via HTTP. You should usually instantiate a cluster object at the very least to make use of the library. More...

#include <cluster.h>

+ Collaboration diagram for dpp::cluster:

Public Member Functions

 cluster (const std::string &token, uint32_t intents=i_default_intents, uint32_t shards=0, uint32_t cluster_id=0, uint32_t maxclusters=1, bool compressed=true, cache_policy_t policy={cp_aggressive, cp_aggressive, cp_aggressive}, uint32_t request_threads=12, uint32_t request_threads_raw=1)
 Constructor for creating a cluster. All but the token are optional. More...
 
 cluster (const cluster &)=delete
 dpp::cluster is non-copyable More...
 
 cluster (const cluster &&)=delete
 dpp::cluster is non-moveable More...
 
virtual ~cluster ()
 Destroy the cluster object. More...
 
request_queueget_rest ()
 Get the rest_queue object which handles HTTPS requests to Discord. More...
 
request_queueget_raw_rest ()
 Get the raw rest_queue object which handles all HTTP(S) requests that are not directed at Discord. More...
 
clusterset_websocket_protocol (websocket_protocol_t mode)
 Set the websocket protocol for all shards on this cluster. You should call this method before cluster::start. Generally ws_etf is faster, but provides less facilities for debugging should something go wrong. It is recommended to use ETF in production and JSON in development. More...
 
clusterset_audit_reason (const std::string &reason)
 Set the audit log reason for the next REST call to be made. This is set per-thread, so you must ensure that if you call this method, your request that is associated with the reason happens on the same thread where you set the reason. Once the next call is made, the audit log reason is cleared for this thread automatically. More...
 
clusterclear_audit_reason ()
 Clear the audit log reason for the next REST call to be made. This is set per-thread, so you must ensure that if you call this method, your request that is associated with the reason happens on the same thread where you set the reason. Once the next call is made, the audit log reason is cleared for this thread automatically. More...
 
std::string get_audit_reason ()
 Get the audit reason set for the next REST call to be made on this thread. This is set per-thread, so you must ensure that if you call this method, your request that is associated with the reason happens on the same thread where you set the reason. Once the next call is made, the audit log reason is cleared for this thread automatically. More...
 
void log (dpp::loglevel severity, const std::string &msg) const
 Log a message to whatever log the user is using. The logged message is passed up the chain to the on_log event in user code which can then do whatever it wants to do with it. More...
 
timer start_timer (timer_callback_t on_tick, uint64_t frequency, timer_callback_t on_stop={})
 Start a timer. Every frequency seconds, the callback is called. More...
 
bool stop_timer (timer t)
 Stop a ticking timer. More...
 
snowflake get_dm_channel (snowflake user_id)
 Get the dm channel for a user id. More...
 
void set_dm_channel (snowflake user_id, snowflake channel_id)
 Set the dm channel id for a user id. More...
 
dpp::utility::uptime uptime ()
 Returns the uptime of the cluster. More...
 
void start (bool return_after=true)
 Start the cluster, connecting all its shards. More...
 
void set_presence (const class dpp::presence &p)
 Set the presence for all shards on the cluster. More...
 
discord_clientget_shard (uint32_t id)
 Get a shard by id, returning the discord_client. More...
 
const shard_listget_shards ()
 Get the list of shards. More...
 
void post_rest (const std::string &endpoint, const std::string &major_parameters, const std::string &parameters, http_method method, const std::string &postdata, json_encode_t callback, const std::string &filename="", const std::string &filecontent="")
 Post a REST request. Where possible use a helper method instead like message_create. More...
 
void post_rest_multipart (const std::string &endpoint, const std::string &major_parameters, const std::string &parameters, http_method method, const std::string &postdata, json_encode_t callback, const std::vector< std::string > &filename={}, const std::vector< std::string > &filecontent={})
 Post a multipart REST request. Where possible use a helper method instead like message_create. More...
 
void request (const std::string &url, http_method method, http_completion_event callback, const std::string &postdata="", const std::string &mimetype="text/plain", const std::multimap< std::string, std::string > &headers={})
 Make a HTTP(S) request. For use when wanting asynchronous access to HTTP APIs outside of Discord. More...
 
void interaction_response_create (snowflake interaction_id, const std::string &token, const interaction_response &r, command_completion_event_t callback=utility::log_error())
 Respond to a slash command. More...
 
void interaction_response_edit (const std::string &token, const message &m, command_completion_event_t callback=utility::log_error())
 Edit response to a slash command. More...
 
void interaction_followup_create (const std::string &token, const message &m, command_completion_event_t callback)
 Create a followup message to a slash command. More...
 
void interaction_followup_edit_original (const std::string &token, const message &m, command_completion_event_t callback=utility::log_error())
 Edit original followup message to a slash command This is an alias for cluster::interaction_response_edit. More...
 
void interaction_followup_delete (const std::string &token, command_completion_event_t callback=utility::log_error())
 
void interaction_followup_edit (const std::string &token, const message &m, command_completion_event_t callback=utility::log_error())
 Edit followup message to a slash command The message ID in the message you pass should be correctly set to that of a followup message you previously sent. More...
 
void interaction_followup_get (const std::string &token, snowflake message_id, command_completion_event_t callback)
 Get the followup message to a slash command. More...
 
void global_command_create (const slashcommand &s, command_completion_event_t callback=utility::log_error())
 Create a global slash command (a bot can have a maximum of 100 of these). More...
 
void global_command_get (snowflake id, command_completion_event_t callback=utility::log_error())
 Get a global slash command. More...
 
void guild_auditlog_get (snowflake guild_id, command_completion_event_t callback)
 Get the audit log for a guild. More...
 
void guild_command_create (const slashcommand &s, snowflake guild_id, command_completion_event_t callback=utility::log_error())
 Create a slash command local to a guild. More...
 
void guild_bulk_command_create (const std::vector< slashcommand > &commands, snowflake guild_id, command_completion_event_t callback=utility::log_error())
 Create/overwrite guild slash commands. Any existing guild slash commands on this guild will be deleted and replaced with these. More...
 
void global_bulk_command_create (const std::vector< slashcommand > &commands, command_completion_event_t callback=utility::log_error())
 Create/overwrite global slash commands. Any existing global slash commands will be deleted and replaced with these. More...
 
void global_command_edit (const slashcommand &s, command_completion_event_t callback=utility::log_error())
 Edit a global slash command (a bot can have a maximum of 100 of these) More...
 
void guild_command_get (snowflake id, snowflake guild_id, command_completion_event_t callback=utility::log_error())
 Get a slash command of a guild. More...
 
void guild_command_edit (const slashcommand &s, snowflake guild_id, command_completion_event_t callback=utility::log_error())
 Edit a slash command local to a guild. More...
 
void guild_command_edit_permissions (const slashcommand &s, snowflake guild_id, command_completion_event_t callback=utility::log_error())
 Edit slash command permissions of a guild. More...
 
void guild_command_get_permissions (snowflake id, snowflake guild_id, command_completion_event_t callback=utility::log_error())
 Get the permissions for a slash command of a guild. More...
 
void guild_bulk_command_edit_permissions (const std::vector< slashcommand > &commands, snowflake guild_id, command_completion_event_t callback=utility::log_error())
 Edit/Overwrite the permissions of all existing slash commands in a guild. More...
 
void global_command_delete (snowflake id, command_completion_event_t callback=utility::log_error())
 Delete a global slash command (a bot can have a maximum of 100 of these) More...
 
void guild_command_delete (snowflake id, snowflake guild_id, command_completion_event_t callback=utility::log_error())
 Delete a slash command local to a guild. More...
 
void guild_commands_get (snowflake guild_id, command_completion_event_t callback)
 Get the application's slash commands for a guild. More...
 
void guild_commands_get_permissions (snowflake guild_id, command_completion_event_t callback)
 Get all slash command permissions of a guild. More...
 
void global_commands_get (command_completion_event_t callback)
 Get the application's global slash commands. More...
 
void direct_message_create (snowflake user_id, const message &m, command_completion_event_t callback=utility::log_error())
 Create a direct message, also create the channel for the direct message if needed. More...
 
void message_get (snowflake message_id, snowflake channel_id, command_completion_event_t callback)
 Get a message. More...
 
void messages_get (snowflake channel_id, snowflake around, snowflake before, snowflake after, uint64_t limit, command_completion_event_t callback)
 Get multiple messages. More...
 
void message_create (const struct message &m, command_completion_event_t callback=utility::log_error())
 Send a message to a channel. The callback function is called when the message has been sent. More...
 
void message_crosspost (snowflake message_id, snowflake channel_id, command_completion_event_t callback=utility::log_error())
 Crosspost a message. The callback function is called when the message has been sent. More...
 
void message_edit (const struct message &m, command_completion_event_t callback=utility::log_error())
 Edit a message on a channel. The callback function is called when the message has been edited. More...
 
void message_add_reaction (const struct message &m, const std::string &reaction, command_completion_event_t callback=utility::log_error())
 Add a reaction to a message. The reaction string must be either an emojiname:id or a unicode character. More...
 
void message_delete_own_reaction (const struct message &m, const std::string &reaction, command_completion_event_t callback=utility::log_error())
 Delete own reaction from a message. The reaction string must be either an emojiname:id or a unicode character. More...
 
void message_delete_reaction (const struct message &m, snowflake user_id, const std::string &reaction, command_completion_event_t callback=utility::log_error())
 Delete a user's reaction from a message. The reaction string must be either an emojiname:id or a unicode character. More...
 
void message_get_reactions (const struct message &m, const std::string &reaction, snowflake before, snowflake after, snowflake limit, command_completion_event_t callback)
 Get reactions on a message for a particular emoji. The reaction string must be either an emojiname:id or a unicode character. More...
 
void message_delete_all_reactions (const struct message &m, command_completion_event_t callback=utility::log_error())
 Delete all reactions on a message. More...
 
void message_delete_reaction_emoji (const struct message &m, const std::string &reaction, command_completion_event_t callback=utility::log_error())
 Delete all reactions on a message using a particular emoji. The reaction string must be either an emojiname:id or a unicode character. More...
 
void message_add_reaction (snowflake message_id, snowflake channel_id, const std::string &reaction, command_completion_event_t callback=utility::log_error())
 Add a reaction to a message by id. The reaction string must be either an emojiname:id or a unicode character. More...
 
void message_delete_own_reaction (snowflake message_id, snowflake channel_id, const std::string &reaction, command_completion_event_t callback=utility::log_error())
 Delete own reaction from a message by id. The reaction string must be either an emojiname:id or a unicode character. More...
 
void message_delete_reaction (snowflake message_id, snowflake channel_id, snowflake user_id, const std::string &reaction, command_completion_event_t callback=utility::log_error())
 Delete a user's reaction from a message by id. The reaction string must be either an emojiname:id or a unicode character. More...
 
void message_get_reactions (snowflake message_id, snowflake channel_id, const std::string &reaction, snowflake before, snowflake after, snowflake limit, command_completion_event_t callback)
 Get reactions on a message for a particular emoji by id. The reaction string must be either an emojiname:id or a unicode character. More...
 
void message_delete_all_reactions (snowflake message_id, snowflake channel_id, command_completion_event_t callback=utility::log_error())
 Delete all reactions on a message by id. More...
 
void message_delete_reaction_emoji (snowflake message_id, snowflake channel_id, const std::string &reaction, command_completion_event_t callback=utility::log_error())
 Delete all reactions on a message using a particular emoji by id. The reaction string must be either an emojiname:id or a unicode character. More...
 
void message_delete (snowflake message_id, snowflake channel_id, command_completion_event_t callback=utility::log_error())
 Delete a message from a channel. The callback function is called when the message has been edited. More...
 
void message_delete_bulk (const std::vector< snowflake > &message_ids, snowflake channel_id, command_completion_event_t callback=utility::log_error())
 Bulk delete messages from a channel. The callback function is called when the message has been edited. More...
 
void channel_get (snowflake c, command_completion_event_t callback)
 Get a channel. More...
 
void channels_get (snowflake guild_id, command_completion_event_t callback)
 Get all channels for a guild. More...
 
void channel_create (const class channel &c, command_completion_event_t callback=utility::log_error())
 Create a channel. More...
 
void channel_edit (const class channel &c, command_completion_event_t callback=utility::log_error())
 Edit a channel. More...
 
void channel_edit_positions (const std::vector< channel > &c, command_completion_event_t callback=utility::log_error())
 Edit multiple channels positions. More...
 
void channel_edit_permissions (const class channel &c, const snowflake overwrite_id, const uint32_t allow, const uint32_t deny, const bool member, command_completion_event_t callback=utility::log_error())
 Edit a channel's permissions. More...
 
void channel_edit_permissions (const snowflake channel_id, const snowflake overwrite_id, const uint32_t allow, const uint32_t deny, const bool member, command_completion_event_t callback=utility::log_error())
 Edit a channel's permissions. More...
 
void channel_delete (snowflake channel_id, command_completion_event_t callback=utility::log_error())
 Delete a channel. More...
 
void invite_get (const std::string &invite, command_completion_event_t callback)
 Get details about an invite. More...
 
void invite_delete (const std::string &invite, command_completion_event_t callback=utility::log_error())
 Delete an invite. More...
 
void channel_invites_get (const class channel &c, command_completion_event_t callback)
 Get invites for a channel. More...
 
void channel_invite_create (const class channel &c, const class invite &i, command_completion_event_t callback=utility::log_error())
 Create invite for a channel. More...
 
void channel_pins_get (snowflake channel_id, command_completion_event_t callback)
 Get a channel's pins. More...
 
void gdm_add (snowflake channel_id, snowflake user_id, const std::string &access_token, const std::string &nick, command_completion_event_t callback=utility::log_error())
 Adds a recipient to a Group DM using their access token. More...
 
void gdm_remove (snowflake channel_id, snowflake user_id, command_completion_event_t callback=utility::log_error())
 Removes a recipient from a Group DM. More...
 
void channel_delete_permission (const class channel &c, snowflake overwrite_id, command_completion_event_t callback=utility::log_error())
 Remove a permission from a channel. More...
 
void channel_follow_news (const class channel &c, snowflake target_channel_id, command_completion_event_t callback=utility::log_error())
 Follow a news channel. More...
 
void channel_typing (const class channel &c, command_completion_event_t callback=utility::log_error())
 Trigger channel typing indicator. More...
 
void channel_typing (snowflake cid, command_completion_event_t callback=utility::log_error())
 Trigger channel typing indicator. More...
 
void message_pin (snowflake channel_id, snowflake message_id, command_completion_event_t callback=utility::log_error())
 Pin a message. More...
 
void message_unpin (snowflake channel_id, snowflake message_id, command_completion_event_t callback=utility::log_error())
 Unpin a message. More...
 
void guild_get (snowflake g, command_completion_event_t callback)
 Get a guild. More...
 
void guild_get_preview (snowflake g, command_completion_event_t callback)
 Get a guild preview. Returns a guild object but only a subset of the fields will be populated. More...
 
void guild_get_member (snowflake guild_id, snowflake user_id, command_completion_event_t callback)
 Get a guild member. More...
 
void guild_search_members (snowflake guild_id, const std::string &query, uint16_t limit, command_completion_event_t callback)
 Search for guild members based on whether their username or nickname starts with the given string. More...
 
void guild_get_members (snowflake guild_id, uint16_t limit, snowflake after, command_completion_event_t callback)
 Get all guild members. More...
 
void guild_add_member (const guild_member &gm, const std::string &access_token, command_completion_event_t callback=utility::log_error())
 Add guild member. Needs a specific oauth2 scope, from which you get the access_token. More...
 
void guild_edit_member (const guild_member &gm, command_completion_event_t callback=utility::log_error())
 Edit the properties of an existing guild member. More...
 
void guild_member_move (const snowflake channel_id, const snowflake guild_id, const snowflake user_id, command_completion_event_t callback=utility::log_error())
 Moves the guild member to a other voice channel, if member is connected to one. More...
 
void guild_set_nickname (snowflake guild_id, const std::string &nickname, command_completion_event_t callback=utility::log_error())
 Change current user nickname. More...
 
void guild_member_add_role (snowflake guild_id, snowflake user_id, snowflake role_id, command_completion_event_t callback=utility::log_error())
 Add role to guild member. More...
 
void guild_member_delete_role (snowflake guild_id, snowflake user_id, snowflake role_id, command_completion_event_t callback=utility::log_error())
 Remove role from guild member. More...
 
void guild_member_delete (snowflake guild_id, snowflake user_id, command_completion_event_t callback=utility::log_error())
 Remove (kick) a guild member. More...
 
void guild_member_kick (snowflake guild_id, snowflake user_id, command_completion_event_t callback=utility::log_error())
 Remove (kick) a guild member. More...
 
void guild_member_timeout (snowflake guild_id, snowflake user_id, time_t communication_disabled_until, command_completion_event_t callback=utility::log_error())
 Set the timeout of a guild member. More...
 
void guild_ban_add (snowflake guild_id, snowflake user_id, uint32_t delete_message_days, const std::string &reason, command_completion_event_t callback=utility::log_error())
 Add guild ban. More...
 
void guild_ban_delete (snowflake guild_id, snowflake user_id, command_completion_event_t callback=utility::log_error())
 Delete guild ban. More...
 
void guild_get_bans (snowflake guild_id, snowflake before, snowflake after, snowflake limit, command_completion_event_t callback)
 Get guild ban list. More...
 
void guild_get_ban (snowflake guild_id, snowflake user_id, command_completion_event_t callback)
 Get single guild ban. More...
 
void template_get (const std::string &code, command_completion_event_t callback)
 Get a template. More...
 
void guild_create_from_template (const std::string &code, const std::string &name, command_completion_event_t callback=utility::log_error())
 Create a new guild based on a template. More...
 
void guild_templates_get (snowflake guild_id, command_completion_event_t callback)
 Get guild templates. More...
 
void guild_template_create (snowflake guild_id, const std::string &name, const std::string &description, command_completion_event_t callback)
 Creates a template for the guild. More...
 
void guild_template_sync (snowflake guild_id, const std::string &code, command_completion_event_t callback=utility::log_error())
 Syncs the template to the guild's current state. More...
 
void guild_template_modify (snowflake guild_id, const std::string &code, const std::string &name, const std::string &description, command_completion_event_t callback=utility::log_error())
 Modifies the template's metadata. More...
 
void guild_template_delete (snowflake guild_id, const std::string &code, command_completion_event_t callback=utility::log_error())
 Deletes the template. More...
 
void guild_create (const class guild &g, command_completion_event_t callback=utility::log_error())
 Create a guild. More...
 
void guild_edit (const class guild &g, command_completion_event_t callback=utility::log_error())
 Edit a guild. More...
 
void guild_delete (snowflake guild_id, command_completion_event_t callback=utility::log_error())
 Delete a guild. More...
 
void guild_emojis_get (snowflake guild_id, command_completion_event_t callback)
 Get all emojis for a guild. More...
 
void guild_emoji_get (snowflake guild_id, snowflake emoji_id, command_completion_event_t callback)
 Get a single emoji. More...
 
void guild_emoji_create (snowflake guild_id, const class emoji &newemoji, command_completion_event_t callback=utility::log_error())
 Create single emoji. You must ensure that the emoji passed contained image data using the emoji::load_image() method. More...
 
void guild_emoji_edit (snowflake guild_id, const class emoji &newemoji, command_completion_event_t callback=utility::log_error())
 Edit a single emoji. More...
 
void guild_emoji_delete (snowflake guild_id, snowflake emoji_id, command_completion_event_t callback=utility::log_error())
 Delete a guild emoji. More...
 
void guild_get_prune_counts (snowflake guild_id, const struct prune &pruneinfo, command_completion_event_t callback)
 Get prune counts. More...
 
void guild_begin_prune (snowflake guild_id, const struct prune &pruneinfo, command_completion_event_t callback=utility::log_error())
 Begin guild prune. More...
 
void guild_get_voice_regions (snowflake guild_id, command_completion_event_t callback)
 Get guild voice regions. More...
 
void guild_get_invites (snowflake guild_id, command_completion_event_t callback)
 Get guild invites. More...
 
void guild_get_integrations (snowflake guild_id, command_completion_event_t callback)
 Get guild integrations. More...
 
void guild_modify_integration (snowflake guild_id, const class integration &i, command_completion_event_t callback=utility::log_error())
 Modify guild integration. More...
 
void guild_delete_integration (snowflake guild_id, snowflake integration_id, command_completion_event_t callback=utility::log_error())
 Delete guild integration. More...
 
void guild_sync_integration (snowflake guild_id, snowflake integration_id, command_completion_event_t callback=utility::log_error())
 Sync guild integration. More...
 
void guild_get_widget (snowflake guild_id, command_completion_event_t callback)
 Get guild widget. More...
 
void guild_edit_widget (snowflake guild_id, const class guild_widget &gw, command_completion_event_t callback=utility::log_error())
 Edit guild widget. More...
 
void guild_get_vanity (snowflake guild_id, command_completion_event_t callback)
 Get guild vanity url, if enabled. More...
 
void create_webhook (const class webhook &w, command_completion_event_t callback=utility::log_error())
 Create a webhook. More...
 
void get_guild_webhooks (snowflake guild_id, command_completion_event_t callback)
 Get guild webhooks. More...
 
void get_channel_webhooks (snowflake channel_id, command_completion_event_t callback)
 Get channel webhooks. More...
 
void get_webhook (snowflake webhook_id, command_completion_event_t callback)
 Get webhook. More...
 
void get_webhook_with_token (snowflake webhook_id, const std::string &token, command_completion_event_t callback)
 Get webhook using token. More...
 
void edit_webhook (const class webhook &wh, command_completion_event_t callback=utility::log_error())
 Edit webhook. More...
 
void edit_webhook_with_token (const class webhook &wh, command_completion_event_t callback=utility::log_error())
 Edit webhook with token (token is encapsulated in the webhook object) More...
 
void delete_webhook (snowflake webhook_id, command_completion_event_t callback=utility::log_error())
 Delete a webhook. More...
 
void delete_webhook_with_token (snowflake webhook_id, const std::string &token, command_completion_event_t callback=utility::log_error())
 Delete webhook with token. More...
 
void execute_webhook (const class webhook &wh, const struct message &m, bool wait=false, snowflake thread_id=0, command_completion_event_t callback=utility::log_error())
 Execute webhook. More...
 
void get_webhook_message (const class webhook &wh, command_completion_event_t callback=utility::log_error())
 Get webhook message. More...
 
void edit_webhook_message (const class webhook &wh, const struct message &m, command_completion_event_t callback=utility::log_error())
 Edit webhook message. More...
 
void delete_webhook_message (const class webhook &wh, snowflake message_id, command_completion_event_t callback=utility::log_error())
 Delete webhook message. More...
 
void roles_get (snowflake guild_id, command_completion_event_t callback)
 Get a role for a guild. More...
 
void role_create (const class role &r, command_completion_event_t callback=utility::log_error())
 Create a role on a guild. More...
 
void role_edit (const class role &r, command_completion_event_t callback=utility::log_error())
 Edit a role on a guild. More...
 
void roles_edit_position (snowflake guild_id, const std::vector< role > &roles, command_completion_event_t callback=utility::log_error())
 Edit multiple role's position in a guild. Returns a list of all roles of the guild on success. More...
 
void role_delete (snowflake guild_id, snowflake role_id, command_completion_event_t callback=utility::log_error())
 Delete a role. More...
 
void user_get (snowflake user_id, command_completion_event_t callback)
 Get a user by id. More...
 
void current_user_get (command_completion_event_t callback)
 Get current (bot) user. More...
 
void current_application_get (command_completion_event_t callback)
 Get current (bot) application. More...
 
void guild_current_member_edit (snowflake guild_id, const std::string &nickname, command_completion_event_t callback=utility::log_error())
 Modify current member. More...
 
void current_user_connections_get (command_completion_event_t callback)
 Get current user's connections (linked accounts, e.g. steam, xbox). This call requires the oauth2 connections scope and cannot be executed against a bot token. More...
 
void current_user_get_guilds (command_completion_event_t callback)
 Get current (bot) user guilds. More...
 
void current_user_edit (const std::string &nickname, const std::string &image_blob="", const image_type type=i_png, command_completion_event_t callback=utility::log_error())
 Edit current (bot) user. More...
 
void current_user_get_dms (command_completion_event_t callback)
 Get current user DM channels. More...
 
void create_dm_channel (snowflake user_id, command_completion_event_t callback=utility::log_error())
 Create a dm channel. More...
 
void current_user_leave_guild (snowflake guild_id, command_completion_event_t callback=utility::log_error())
 Leave a guild. More...
 
void thread_create (const std::string &thread_name, snowflake channel_id, uint16_t auto_archive_duration, channel_type thread_type, bool invitable, uint16_t rate_limit_per_user, command_completion_event_t callback=utility::log_error())
 Create a thread. More...
 
void thread_create_with_message (const std::string &thread_name, snowflake channel_id, snowflake message_id, uint16_t auto_archive_duration, uint16_t rate_limit_per_user, command_completion_event_t callback=utility::log_error())
 Create a thread with a message (Discord: ID of a thread is same as message ID) More...
 
void current_user_join_thread (snowflake thread_id, command_completion_event_t callback=utility::log_error())
 Join a thread. More...
 
void current_user_leave_thread (snowflake thread_id, command_completion_event_t callback=utility::log_error())
 Leave a thread. More...
 
void thread_member_add (snowflake thread_id, snowflake user_id, command_completion_event_t callback=utility::log_error())
 Add a member to a thread. More...
 
void thread_member_remove (snowflake thread_id, snowflake user_id, command_completion_event_t callback=utility::log_error())
 Remove a member from a thread. More...
 
void thread_member_get (const snowflake thread_id, const snowflake user_id, command_completion_event_t callback)
 Get a thread member. More...
 
void thread_members_get (snowflake thread_id, command_completion_event_t callback)
 Get members of a thread. More...
 
void threads_get_active (snowflake channel_id, command_completion_event_t callback)
 Get active threads in a channel (Sorted by ID in descending order) More...
 
void threads_get_public_archived (snowflake channel_id, time_t before_timestamp, uint16_t limit, command_completion_event_t callback)
 Get public archived threads in a channel (Sorted by archive_timestamp in descending order) More...
 
void threads_get_private_archived (snowflake channel_id, time_t before_timestamp, uint16_t limit, command_completion_event_t callback)
 Get private archived threads in a channel (Sorted by archive_timestamp in descending order) More...
 
void threads_get_joined_private_archived (snowflake channel_id, snowflake before_id, uint16_t limit, command_completion_event_t callback)
 Get private archived threads in a channel which current user has joined (Sorted by ID in descending order) More...
 
void guild_sticker_create (sticker &s, command_completion_event_t callback=utility::log_error())
 Create a sticker in a guild. More...
 
void guild_sticker_modify (sticker &s, command_completion_event_t callback=utility::log_error())
 Modify a sticker in a guild. More...
 
void guild_sticker_delete (snowflake sticker_id, snowflake guild_id, command_completion_event_t callback=utility::log_error())
 Delete a sticker from a guild. More...
 
void nitro_sticker_get (snowflake id, command_completion_event_t callback)
 Get a nitro sticker. More...
 
void guild_sticker_get (snowflake id, snowflake guild_id, command_completion_event_t callback)
 Get a guild sticker. More...
 
void guild_stickers_get (snowflake guild_id, command_completion_event_t callback)
 Get all guild stickers. More...
 
void sticker_packs_get (command_completion_event_t callback)
 Get sticker packs. More...
 
void stage_instance_create (const stage_instance &instance, command_completion_event_t callback=utility::log_error())
 Create a stage instance on a stage channel. More...
 
void stage_instance_get (const snowflake channel_id, command_completion_event_t callback)
 Get the stage instance associated with the channel id, if it exists. More...
 
void stage_instance_edit (const stage_instance &instance, command_completion_event_t callback=utility::log_error())
 Edit a stage instance. More...
 
void stage_instance_delete (const snowflake channel_id, command_completion_event_t callback=utility::log_error())
 Delete a stage instance. More...
 
void get_voice_regions (command_completion_event_t callback)
 Get all voice regions. More...
 
void get_gateway_bot (command_completion_event_t callback)
 Get the gateway information for the bot using the token. More...
 
void guild_events_get (snowflake guild_id, command_completion_event_t callback)
 Get all scheduled events for a guild. More...
 
void guild_event_users_get (snowflake guild_id, snowflake event_id, command_completion_event_t callback, uint8_t limit=100, snowflake before=0, snowflake after=0)
 Get users RSVP'd to an event. More...
 
void guild_event_create (const scheduled_event &event, command_completion_event_t callback=utility::log_error())
 Create a scheduled event on a guild. More...
 
void guild_event_delete (snowflake event_id, snowflake guild_id, command_completion_event_t callback=utility::log_error())
 Delete a scheduled event from a guild. More...
 
void guild_event_edit (const scheduled_event &event, command_completion_event_t callback=utility::log_error())
 Edit/modify a scheduled event on a guild. More...
 
void guild_event_get (snowflake guild_id, snowflake event_id, command_completion_event_t callback)
 Get a scheduled event for a guild. More...
 
void current_user_set_voice_state (snowflake guild_id, snowflake channel_id, bool suppress=false, time_t request_to_speak_timestamp=0, command_completion_event_t callback=utility::log_error())
 Set the bot's voice state on a stage channel. More...
 
void user_set_voice_state (snowflake user_id, snowflake guild_id, snowflake channel_id, bool suppress=false, command_completion_event_t callback=utility::log_error())
 Set a user's voice state on a stage channel. More...
 
slashcommand_map global_bulk_command_create_sync (const std::vector< slashcommand > &commands)
 Create/overwrite global slash commands. Any existing global slash commands will be deleted and replaced with these. More...
 
slashcommand global_command_create_sync (const slashcommand &s)
 Create a global slash command (a bot can have a maximum of 100 of these). More...
 
slashcommand global_command_get_sync (snowflake id)
 Get a global slash command. More...
 
confirmation global_command_delete_sync (snowflake id)
 Delete a global slash command (a bot can have a maximum of 100 of these) More...
 
confirmation global_command_edit_sync (const slashcommand &s)
 Edit a global slash command (a bot can have a maximum of 100 of these) More...
 
slashcommand_map global_commands_get_sync ()
 Get the application's global slash commands. More...
 
slashcommand_map guild_bulk_command_create_sync (const std::vector< slashcommand > &commands, snowflake guild_id)
 Create/overwrite guild slash commands. Any existing guild slash commands on this guild will be deleted and replaced with these. More...
 
guild_command_permissions_map guild_commands_get_permissions_sync (snowflake guild_id)
 Get all slash command permissions of a guild. More...
 
guild_command_permissions_map guild_bulk_command_edit_permissions_sync (const std::vector< slashcommand > &commands, snowflake guild_id)
 Edit/Overwrite the permissions of all existing slash commands in a guild. More...
 
slashcommand guild_command_create_sync (const slashcommand &s, snowflake guild_id)
 Create a slash command local to a guild. More...
 
confirmation guild_command_delete_sync (snowflake id, snowflake guild_id)
 Delete a slash command local to a guild. More...
 
confirmation guild_command_edit_permissions_sync (const slashcommand &s, snowflake guild_id)
 Edit slash command permissions of a guild. More...
 
slashcommand guild_command_get_sync (snowflake id, snowflake guild_id)
 Get a slash command of a guild. More...
 
guild_command_permissions guild_command_get_permissions_sync (snowflake id, snowflake guild_id)
 Get the permissions for a slash command of a guild. More...
 
confirmation guild_command_edit_sync (const slashcommand &s, snowflake guild_id)
 Edit a slash command local to a guild. More...
 
slashcommand_map guild_commands_get_sync (snowflake guild_id)
 Get the application's slash commands for a guild. More...
 
confirmation interaction_response_create_sync (snowflake interaction_id, const std::string &token, const interaction_response &r)
 Respond to a slash command. More...
 
confirmation interaction_response_edit_sync (const std::string &token, const message &m)
 Edit response to a slash command. More...
 
confirmation interaction_followup_create_sync (const std::string &token, const message &m)
 Create a followup message to a slash command. More...
 
confirmation interaction_followup_edit_original_sync (const std::string &token, const message &m)
 Edit original followup message to a slash command This is an alias for cluster::interaction_response_edit. More...
 
confirmation interaction_followup_delete_sync (const std::string &token)
 
confirmation interaction_followup_edit_sync (const std::string &token, const message &m)
 Edit followup message to a slash command The message ID in the message you pass should be correctly set to that of a followup message you previously sent. More...
 
message interaction_followup_get_sync (const std::string &token, snowflake message_id)
 Get the followup message to a slash command. More...
 
channel channel_create_sync (const class channel &c)
 Create a channel. More...
 
confirmation channel_delete_permission_sync (const class channel &c, snowflake overwrite_id)
 Remove a permission from a channel. More...
 
confirmation channel_delete_sync (snowflake channel_id)
 Delete a channel. More...
 
confirmation channel_edit_positions_sync (const std::vector< channel > &c)
 Edit multiple channels positions. More...
 
channel channel_edit_sync (const class channel &c)
 Edit a channel. More...
 
confirmation channel_follow_news_sync (const class channel &c, snowflake target_channel_id)
 Follow a news channel. More...
 
channel channel_get_sync (snowflake c)
 Get a channel. More...
 
confirmation channel_invite_create_sync (const class channel &c, const class invite &i)
 Create invite for a channel. More...
 
invite_map channel_invites_get_sync (const class channel &c)
 Get invites for a channel. More...
 
channel_map channels_get_sync (snowflake guild_id)
 Get all channels for a guild. More...
 
channel create_dm_channel_sync (snowflake user_id)
 Create a dm channel. More...
 
channel_map current_user_get_dms_sync ()
 Get current user DM channels. More...
 
message direct_message_create_sync (snowflake user_id, const message &m)
 Create a direct message, also create the channel for the direct message if needed. More...
 
confirmation gdm_add_sync (snowflake channel_id, snowflake user_id, const std::string &access_token, const std::string &nick)
 Adds a recipient to a Group DM using their access token. More...
 
confirmation gdm_remove_sync (snowflake channel_id, snowflake user_id)
 Removes a recipient from a Group DM. More...
 
emoji guild_emoji_create_sync (snowflake guild_id, const class emoji &newemoji)
 Create single emoji. You must ensure that the emoji passed contained image data using the emoji::load_image() method. More...
 
confirmation guild_emoji_delete_sync (snowflake guild_id, snowflake emoji_id)
 Delete a guild emoji. More...
 
emoji guild_emoji_edit_sync (snowflake guild_id, const class emoji &newemoji)
 Edit a single emoji. More...
 
emoji guild_emoji_get_sync (snowflake guild_id, snowflake emoji_id)
 Get a single emoji. More...
 
emoji_map guild_emojis_get_sync (snowflake guild_id)
 Get all emojis for a guild. More...
 
gateway get_gateway_bot_sync ()
 Get the gateway information for the bot using the token. More...
 
confirmation guild_current_member_edit_sync (snowflake guild_id, const std::string &nickname)
 Modify current member. More...
 
auditlog guild_auditlog_get_sync (snowflake guild_id)
 Get the audit log for a guild. More...
 
confirmation guild_ban_add_sync (snowflake guild_id, snowflake user_id, uint32_t delete_message_days, const std::string &reason)
 Add guild ban. More...
 
confirmation guild_ban_delete_sync (snowflake guild_id, snowflake user_id)
 Delete guild ban. More...
 
guild guild_create_sync (const class guild &g)
 Create a guild. More...
 
confirmation guild_delete_sync (snowflake guild_id)
 Delete a guild. More...
 
confirmation guild_delete_integration_sync (snowflake guild_id, snowflake integration_id)
 Delete guild integration. More...
 
guild guild_edit_sync (const class guild &g)
 Edit a guild. More...
 
guild_widget guild_edit_widget_sync (snowflake guild_id, const class guild_widget &gw)
 Edit guild widget. More...
 
ban guild_get_ban_sync (snowflake guild_id, snowflake user_id)
 Get single guild ban. More...
 
ban_map guild_get_bans_sync (snowflake guild_id, snowflake before, snowflake after, snowflake limit)
 Get guild ban list. More...
 
integration_map guild_get_integrations_sync (snowflake guild_id)
 Get guild integrations. More...
 
invite guild_get_vanity_sync (snowflake guild_id)
 Get guild vanity url, if enabled. More...
 
guild_widget guild_get_widget_sync (snowflake guild_id)
 Get guild widget. More...
 
confirmation guild_modify_integration_sync (snowflake guild_id, const class integration &i)
 Modify guild integration. More...
 
prune guild_get_prune_counts_sync (snowflake guild_id, const struct prune &pruneinfo)
 Get prune counts. More...
 
prune guild_begin_prune_sync (snowflake guild_id, const struct prune &pruneinfo)
 Begin guild prune. More...
 
confirmation guild_set_nickname_sync (snowflake guild_id, const std::string &nickname)
 Change current user nickname. More...
 
confirmation guild_sync_integration_sync (snowflake guild_id, snowflake integration_id)
 Sync guild integration. More...
 
confirmation guild_add_member_sync (const guild_member &gm, const std::string &access_token)
 Add guild member. Needs a specific oauth2 scope, from which you get the access_token. More...
 
guild_member guild_edit_member_sync (const guild_member &gm)
 Edit the properties of an existing guild member. More...
 
guild_member guild_get_member_sync (snowflake guild_id, snowflake user_id)
 Get a guild member. More...
 
guild_member_map guild_get_members_sync (snowflake guild_id, uint16_t limit, snowflake after)
 Get all guild members. More...
 
confirmation guild_member_add_role_sync (snowflake guild_id, snowflake user_id, snowflake role_id)
 Add role to guild member. More...
 
confirmation guild_member_delete_sync (snowflake guild_id, snowflake user_id)
 Remove (kick) a guild member. More...
 
confirmation guild_member_kick_sync (snowflake guild_id, snowflake user_id)
 Remove (kick) a guild member. More...
 
confirmation guild_member_timeout_sync (snowflake guild_id, snowflake user_id, time_t communication_disabled_until)
 Set the timeout of a guild member. More...
 
confirmation guild_member_delete_role_sync (snowflake guild_id, snowflake user_id, snowflake role_id)
 Remove role from guild member. More...
 
guild_member guild_member_move_sync (const snowflake channel_id, const snowflake guild_id, const snowflake user_id)
 Moves the guild member to a other voice channel, if member is connected to one. More...
 
guild_member_map guild_search_members_sync (snowflake guild_id, const std::string &query, uint16_t limit)
 Search for guild members based on whether their username or nickname starts with the given string. More...
 
invite_map guild_get_invites_sync (snowflake guild_id)
 Get guild invites. More...
 
message message_create_sync (const struct message &m)
 Send a message to a channel. The callback function is called when the message has been sent. More...
 
message message_crosspost_sync (snowflake message_id, snowflake channel_id)
 Crosspost a message. The callback function is called when the message has been sent. More...
 
confirmation message_delete_bulk_sync (const std::vector< snowflake > &message_ids, snowflake channel_id)
 Bulk delete messages from a channel. The callback function is called when the message has been edited. More...
 
confirmation message_delete_sync (snowflake message_id, snowflake channel_id)
 Delete a message from a channel. The callback function is called when the message has been edited. More...
 
message message_edit_sync (const struct message &m)
 Edit a message on a channel. The callback function is called when the message has been edited. More...
 
message message_get_sync (snowflake message_id, snowflake channel_id)
 Get a message. More...
 
confirmation message_pin_sync (snowflake channel_id, snowflake message_id)
 Pin a message. More...
 
message_map messages_get_sync (snowflake channel_id, snowflake around, snowflake before, snowflake after, uint64_t limit)
 Get multiple messages. More...
 
confirmation message_unpin_sync (snowflake channel_id, snowflake message_id)
 Unpin a message. More...
 
message_map channel_pins_get_sync (snowflake channel_id)
 Get a channel's pins. More...
 
role role_create_sync (const class role &r)
 Create a role on a guild. More...
 
confirmation role_delete_sync (snowflake guild_id, snowflake role_id)
 Delete a role. More...
 
role role_edit_sync (const class role &r)
 Edit a role on a guild. More...
 
role_map roles_edit_position_sync (snowflake guild_id, const std::vector< role > &roles)
 Edit multiple role's position in a guild. Returns a list of all roles of the guild on success. More...
 
role_map roles_get_sync (snowflake guild_id)
 Get a role for a guild. More...
 
scheduled_event_map guild_events_get_sync (snowflake guild_id)
 Get all scheduled events for a guild. More...
 
scheduled_event guild_event_create_sync (const scheduled_event &event)
 Create a scheduled event on a guild. More...
 
confirmation guild_event_delete_sync (snowflake event_id, snowflake guild_id)
 Delete a scheduled event from a guild. More...
 
scheduled_event guild_event_edit_sync (const scheduled_event &event)
 Edit/modify a scheduled event on a guild. More...
 
scheduled_event guild_event_get_sync (snowflake guild_id, snowflake event_id)
 Get a scheduled event for a guild. More...
 
stage_instance stage_instance_get_sync (const snowflake channel_id)
 Get the stage instance associated with the channel id, if it exists. More...
 
confirmation stage_instance_delete_sync (const snowflake channel_id)
 Delete a stage instance. More...
 
sticker guild_sticker_create_sync (sticker &s)
 Create a sticker in a guild. More...
 
confirmation guild_sticker_delete_sync (snowflake sticker_id, snowflake guild_id)
 Delete a sticker from a guild. More...
 
sticker guild_sticker_get_sync (snowflake id, snowflake guild_id)
 Get a guild sticker. More...
 
sticker guild_sticker_modify_sync (sticker &s)
 Modify a sticker in a guild. More...
 
sticker_map guild_stickers_get_sync (snowflake guild_id)
 Get all guild stickers. More...
 
sticker nitro_sticker_get_sync (snowflake id)
 Get a nitro sticker. More...
 
sticker_pack_map sticker_packs_get_sync ()
 Get sticker packs. More...
 
guild guild_create_from_template_sync (const std::string &code, const std::string &name)
 Create a new guild based on a template. More...
 
dtemplate guild_template_create_sync (snowflake guild_id, const std::string &name, const std::string &description)
 Creates a template for the guild. More...
 
confirmation guild_template_delete_sync (snowflake guild_id, const std::string &code)
 Deletes the template. More...
 
dtemplate guild_template_modify_sync (snowflake guild_id, const std::string &code, const std::string &name, const std::string &description)
 Modifies the template's metadata. More...
 
dtemplate_map guild_templates_get_sync (snowflake guild_id)
 Get guild templates. More...
 
dtemplate guild_template_sync_sync (snowflake guild_id, const std::string &code)
 Syncs the template to the guild's current state. More...
 
dtemplate template_get_sync (const std::string &code)
 Get a template. More...
 
confirmation current_user_join_thread_sync (snowflake thread_id)
 Join a thread. More...
 
confirmation current_user_leave_thread_sync (snowflake thread_id)
 Leave a thread. More...
 
thread_map threads_get_active_sync (snowflake channel_id)
 Get active threads in a channel (Sorted by ID in descending order) More...
 
thread_map threads_get_joined_private_archived_sync (snowflake channel_id, snowflake before_id, uint16_t limit)
 Get private archived threads in a channel which current user has joined (Sorted by ID in descending order) More...
 
thread_map threads_get_private_archived_sync (snowflake channel_id, time_t before_timestamp, uint16_t limit)
 Get private archived threads in a channel (Sorted by archive_timestamp in descending order) More...
 
thread_map threads_get_public_archived_sync (snowflake channel_id, time_t before_timestamp, uint16_t limit)
 Get public archived threads in a channel (Sorted by archive_timestamp in descending order) More...
 
thread_member thread_member_get_sync (const snowflake thread_id, const snowflake user_id)
 Get a thread member. More...
 
thread_member_map thread_members_get_sync (snowflake thread_id)
 Get members of a thread. More...
 
thread thread_create_sync (const std::string &thread_name, snowflake channel_id, uint16_t auto_archive_duration, channel_type thread_type, bool invitable, uint16_t rate_limit_per_user)
 Create a thread. More...
 
thread thread_create_with_message_sync (const std::string &thread_name, snowflake channel_id, snowflake message_id, uint16_t auto_archive_duration, uint16_t rate_limit_per_user)
 Create a thread with a message (Discord: ID of a thread is same as message ID) More...
 
confirmation thread_member_add_sync (snowflake thread_id, snowflake user_id)
 Add a member to a thread. More...
 
confirmation thread_member_remove_sync (snowflake thread_id, snowflake user_id)
 Remove a member from a thread. More...
 
user current_user_edit_sync (const std::string &nickname, const std::string &image_blob="", const image_type type=i_png)
 Edit current (bot) user. More...
 
application current_application_get_sync ()
 Get current (bot) application. More...
 
user_identified current_user_get_sync ()
 Get current (bot) user. More...
 
confirmation current_user_set_voice_state_sync (snowflake guild_id, snowflake channel_id, bool suppress=false, time_t request_to_speak_timestamp=0)
 Set the bot's voice state on a stage channel. More...
 
confirmation user_set_voice_state_sync (snowflake user_id, snowflake guild_id, snowflake channel_id, bool suppress=false)
 Set a user's voice state on a stage channel. More...
 
connection_map current_user_connections_get_sync ()
 Get current user's connections (linked accounts, e.g. steam, xbox). This call requires the oauth2 connections scope and cannot be executed against a bot token. More...
 
guild_map current_user_get_guilds_sync ()
 Get current (bot) user guilds. More...
 
confirmation current_user_leave_guild_sync (snowflake guild_id)
 Leave a guild. More...
 
user_identified user_get_sync (snowflake user_id)
 Get a user by id. More...
 
voiceregion_map get_voice_regions_sync ()
 Get all voice regions. More...
 
voiceregion_map guild_get_voice_regions_sync (snowflake guild_id)
 Get guild voice regions. More...
 
webhook create_webhook_sync (const class webhook &w)
 Create a webhook. More...
 
confirmation delete_webhook_sync (snowflake webhook_id)
 Delete a webhook. More...
 
confirmation delete_webhook_message_sync (const class webhook &wh, snowflake message_id)
 Delete webhook message. More...
 
confirmation delete_webhook_with_token_sync (snowflake webhook_id, const std::string &token)
 Delete webhook with token. More...
 
webhook edit_webhook_sync (const class webhook &wh)
 Edit webhook. More...
 
message edit_webhook_message_sync (const class webhook &wh, const struct message &m)
 Edit webhook message. More...
 
webhook edit_webhook_with_token_sync (const class webhook &wh)
 Edit webhook with token (token is encapsulated in the webhook object) More...
 
message execute_webhook_sync (const class webhook &wh, const struct message &m, bool wait=false, snowflake thread_id=0)
 Execute webhook. More...
 
webhook_map get_channel_webhooks_sync (snowflake channel_id)
 Get channel webhooks. More...
 
webhook_map get_guild_webhooks_sync (snowflake guild_id)
 Get guild webhooks. More...
 
webhook get_webhook_sync (snowflake webhook_id)
 Get webhook. More...
 
message get_webhook_message_sync (const class webhook &wh)
 Get webhook message. More...
 
webhook get_webhook_with_token_sync (snowflake webhook_id, const std::string &token)
 Get webhook using token. More...
 

Public Attributes

std::string token
 Current bot token for all shards on this cluster and all commands sent via HTTP. More...
 
time_t last_identify
 Last time the bot sent an IDENTIFY. More...
 
uint32_t intents
 Current bitmask of gateway intents. More...
 
uint32_t numshards
 Total number of shards across all clusters. More...
 
uint32_t cluster_id
 ID of this cluster, between 0 and MAXCLUSTERS-1 inclusive. More...
 
uint32_t maxclusters
 Total number of clusters that are active. More...
 
double rest_ping
 REST latency (HTTPS ping) in seconds. More...
 
dpp::user me
 The details of the bot user. This is assumed to be identical across all shards in the cluster. Each connecting shard updates this information. More...
 
cache_policy_t cache_policy
 Current cache policy for the cluster. More...
 
websocket_protocol_t ws_mode
 Websocket mode for all shards in the cluster, either ws_json or ws_etf. Production bots should use ETF, while development bots should use JSON. More...
 
std::condition_variable terminating
 Condition variable notified when the cluster is terminating. More...
 
event_router_t< voice_state_update_ton_voice_state_update
 on voice state update event More...
 
event_router_t< voice_client_disconnect_ton_voice_client_disconnect
 on voice client disconnect event More...
 
event_router_t< voice_client_speaking_ton_voice_client_speaking
 on voice client speaking event More...
 
event_router_t< log_ton_log
 Called when a log message is to be written to the log. You can attach any logging system here you wish, e.g. spdlog, or even just a simple use of std::cout or printf. If nothing attaches this log event, then the library will be silent. More...
 
event_router_t< guild_join_request_delete_ton_guild_join_request_delete
 on guild join request delete. Triggered when a user declines the membership screening questionnaire for a guild. More...
 
event_router_t< interaction_create_ton_interaction_create
 Called when a new interaction is created. Interactions are created by discord when commands you have registered are issued by a user. For an example of this in action please see Using Slash Commands and Interactions. More...
 
event_router_t< button_click_ton_button_click
 Called when a button is clicked attached to a message. Button clicks are triggered by discord when buttons are clicked which you have associated with a message using dpp::component. More...
 
event_router_t< autocomplete_ton_autocomplete
 Called when an auto completed field needs suggestions to present to the user This is triggered by discord when option choices have auto completion enabled which you have associated with a dpp::slashcommand. More...
 
event_router_t< select_click_ton_select_click
 Called when a select menu is clicked attached to a message. Select menu clicks are triggered by discord when select menus are clicked which you have associated with a message using dpp::component. More...
 
event_router_t< message_context_menu_ton_message_context_menu
 Called when a user right-clicks or long-presses on a message, where a slash command is bound to the ctxm_message command type. More...
 
event_router_t< user_context_menu_ton_user_context_menu
 Called when a user right-clicks or long-presses on a user, where a slash command is bound to the ctxm_user command type. More...
 
event_router_t< form_submit_ton_form_submit
 Called when a modal dialog is submitted. Form submits are triggered by discord when modal dialogs are submitted which you have associated with a slash command using dpp::interaction_modal_response. More...
 
event_router_t< guild_delete_ton_guild_delete
 Called when a guild is deleted. A guild can be deleted via the bot being kicked, the bot leaving the guild explicitly with dpp::guild_delete, or via the guild being unavailable due to an outage. More...
 
event_router_t< channel_delete_ton_channel_delete
 Called when a channel is deleted from a guild. The channel will still be temporarily available in the cache. Pointers to the channel should not be retained long-term as they will be deleted by the garbage collector. More...
 
event_router_t< channel_update_ton_channel_update
 Called when a channel is edited on a guild. The new channel details have already been applied to the guild when you receive this event. More...
 
event_router_t< ready_ton_ready
 Called when a shard is connected and ready. A set of on_guild_create events will follow this event. More...
 
event_router_t< message_delete_ton_message_delete
 Called when a message is deleted. The message has already been deleted from Discord when you receive this event. More...
 
event_router_t< guild_member_remove_ton_guild_member_remove
 Called when a user leaves a guild (either through being kicked, or choosing to leave) More...
 
event_router_t< resumed_ton_resumed
 Called when a connection to a shard successfully resumes. A resumed session does not need to re-synchronise guilds, members, etc. This is generally non-fatal and informational only. More...
 
event_router_t< guild_role_create_ton_guild_role_create
 Called when a new role is created on a guild. More...
 
event_router_t< typing_start_ton_typing_start
 Called when a user is typing on a channel. More...
 
event_router_t< message_reaction_add_ton_message_reaction_add
 Called when a new reaction is added to a message. More...
 
event_router_t< guild_members_chunk_ton_guild_members_chunk
 Called when a set of members is received for a guild. D++ will request these for all new guilds if needed, after the on_guild_create events. More...
 
event_router_t< message_reaction_remove_ton_message_reaction_remove
 Called when a single reaction is removed from a message. More...
 
event_router_t< guild_create_ton_guild_create
 Called when a new guild is created. D++ will request members for the guild for its cache using guild_members_chunk. More...
 
event_router_t< channel_create_ton_channel_create
 Called when a new channel is created on a guild. More...
 
event_router_t< message_reaction_remove_emoji_ton_message_reaction_remove_emoji
 Called when all reactions for a particular emoji are removed from a message. More...
 
event_router_t< message_delete_bulk_ton_message_delete_bulk
 Called when multiple messages are deleted from a channel or DM. More...
 
event_router_t< guild_role_update_ton_guild_role_update
 Called when an existing role is updated on a guild. More...
 
event_router_t< guild_role_delete_ton_guild_role_delete
 Called when a role is deleted in a guild. More...
 
event_router_t< channel_pins_update_ton_channel_pins_update
 Called when a message is pinned. Note that the pinned message is not returned to this event, just the timestamp of the last pinned message. More...
 
event_router_t< message_reaction_remove_all_ton_message_reaction_remove_all
 Called when all reactions are removed from a message. More...
 
event_router_t< voice_server_update_ton_voice_server_update
 Called when we are told which voice server we can use. This will be sent either when we establish a new voice channel connection, or as discord rearrange their infrastructure. More...
 
event_router_t< guild_emojis_update_ton_guild_emojis_update
 Called when new emojis are added to a guild. The complete set of emojis is sent every time. More...
 
event_router_t< guild_stickers_update_ton_guild_stickers_update
 Called when new stickers are added to a guild. The complete set of stickers is sent every time. More...
 
event_router_t< presence_update_ton_presence_update
 Called when a user's presence is updated. To receive these you will need the GUILD_PRESENCES privileged intent. You will receive many of these, very often, and receiving them will significantly increase your bot's CPU usage. If you don't need them it is recommended to not ask for them. More...
 
event_router_t< webhooks_update_ton_webhooks_update
 Called when the webhooks for a guild are updated. More...
 
event_router_t< guild_member_add_ton_guild_member_add
 Called when a new member joins a guild. More...
 
event_router_t< invite_delete_ton_invite_delete
 Called when an invite is deleted from a guild. More...
 
event_router_t< guild_update_ton_guild_update
 Called when details of a guild are updated. More...
 
event_router_t< guild_integrations_update_ton_guild_integrations_update
 Called when an integration is updated for a guild. This returns the complete list. An integration is a connection to a guild of a user's associated accounts, e.g. youtube or twitch, for automatic assignment of roles etc. More...
 
event_router_t< guild_member_update_ton_guild_member_update
 Called when details of a guild member (e.g. their roles or nickname) are updated. More...
 
event_router_t< invite_create_ton_invite_create
 Called when a new invite is created for a guild. More...
 
event_router_t< message_update_ton_message_update
 Called when a message is updated (edited). More...
 
event_router_t< user_update_ton_user_update
 Called when a user is updated. This is separate to guild_member_update and includes things such as an avatar change, username change, discriminator change or change in subscription status for nitro. More...
 
event_router_t< message_create_ton_message_create
 Called when a new message arrives from discord. Note that D++ does not cache messages. If you want to cache these objects you should create something yourself within your bot. Caching of messages is not on the roadmap to be supported as it consumes excessive amounts of RAM. More...
 
event_router_t< guild_ban_add_ton_guild_ban_add
 Called when a ban is added to a guild. More...
 
event_router_t< guild_ban_remove_ton_guild_ban_remove
 Called when a ban is removed from a guild. More...
 
event_router_t< integration_create_ton_integration_create
 Called when a new integration is attached to a guild by a user. An integration is a connection to a guild of a user's associated accounts, e.g. youtube or twitch, for automatic assignment of roles etc. More...
 
event_router_t< integration_update_ton_integration_update
 Called when an integration is updated by a user. This returns details of just the single integration that has changed. An integration is a connection to a guild of a user's associated accounts, e.g. youtube or twitch, for automatic assignment of roles etc. More...
 
event_router_t< integration_delete_ton_integration_delete
 Called when an integration is removed by a user. An integration is a connection to a guild of a user's associated accounts, e.g. youtube or twitch, for automatic assignment of roles etc. More...
 
event_router_t< thread_create_ton_thread_create
 Called when a thread is created Note: Threads are not cached by D++, but a list of thread IDs is accessible in a guild object. More...
 
event_router_t< thread_update_ton_thread_update
 Called when a thread is updated. More...
 
event_router_t< thread_delete_ton_thread_delete
 Called when a thread is deleted. More...
 
event_router_t< thread_list_sync_ton_thread_list_sync
 Called when thread list is synced (upon gaining access to a channel) Note: Threads are not cached by D++, but a list of thread IDs is accessible in a guild object. More...
 
event_router_t< thread_member_update_ton_thread_member_update
 Called when current user's thread member object is updated. More...
 
event_router_t< thread_members_update_ton_thread_members_update
 Called when a thread's member list is updated (without GUILD_MEMBERS intent, is only called for current user) More...
 
event_router_t< guild_scheduled_event_create_ton_guild_scheduled_event_create
 Called when a new scheduled event is created. More...
 
event_router_t< guild_scheduled_event_update_ton_guild_scheduled_event_update
 Called when a new scheduled event is updated. More...
 
event_router_t< guild_scheduled_event_delete_ton_guild_scheduled_event_delete
 Called when a new scheduled event is deleted. More...
 
event_router_t< guild_scheduled_event_user_add_ton_guild_scheduled_event_user_add
 Called when a user is added to a scheduled event. More...
 
event_router_t< guild_scheduled_event_user_remove_ton_guild_scheduled_event_user_remove
 Called when a user is removed to a scheduled event. More...
 
event_router_t< voice_buffer_send_ton_voice_buffer_send
 Called when packets are sent from the voice buffer. The voice buffer contains packets that are already encoded with Opus and encrypted with Sodium, and merged into packets by the repacketizer, which is done in the dpp::discord_voice_client::send_audio method. You should use the buffer size properties of dpp::voice_buffer_send_t to determine if you should fill the buffer with more content. More...
 
event_router_t< voice_user_talking_ton_voice_user_talking
 Called when a user is talking on a voice channel. More...
 
event_router_t< voice_ready_ton_voice_ready
 Called when a voice channel is connected and ready to send audio. Note that this is not directly attached to the READY event of the websocket, as there is further connection that needs to be done before audio is ready to send. More...
 
event_router_t< voice_receive_ton_voice_receive
 Called when new audio data is received. Each separate user's audio from the voice channel will arrive tagged with their user id in the event, if a user can be attributed to the received audio. More...
 
event_router_t< voice_receive_ton_voice_receive_combined
 Called when new audio data is received, combined and mixed for all speaking users. More...
 
event_router_t< voice_track_marker_ton_voice_track_marker
 Called when sending of audio passes over a track marker. Track markers are arbitrarily placed "bookmarks" in the audio buffer, placed by the bot developer. Each track marker can have a string value associated with it which is specified in dpp::discord_voice_client::insert_marker and returned to this event. More...
 
event_router_t< stage_instance_create_ton_stage_instance_create
 Called when a new stage instance is created on a stage channel. More...
 
event_router_t< stage_instance_update_ton_stage_instance_update
 Called when a stage instance is updated. More...
 
event_router_t< stage_instance_delete_ton_stage_instance_delete
 Called when an existing stage instance is deleted from a stage channel. More...
 

Friends

class discord_client
 
class discord_voice_client
 

Detailed Description

The cluster class represents a group of shards and a command queue for sending and receiving commands from discord via HTTP. You should usually instantiate a cluster object at the very least to make use of the library.

Constructor & Destructor Documentation

◆ cluster() [1/3]

dpp::cluster::cluster ( const std::string &  token,
uint32_t  intents = i_default_intents,
uint32_t  shards = 0,
uint32_t  cluster_id = 0,
uint32_t  maxclusters = 1,
bool  compressed = true,
cache_policy_t  policy = {cp_aggressivecp_aggressivecp_aggressive},
uint32_t  request_threads = 12,
uint32_t  request_threads_raw = 1 
)

Constructor for creating a cluster. All but the token are optional.

Parameters
tokenThe bot token to use for all HTTP commands and websocket connections
intentsA bitmask of dpd::intents values for all shards on this cluster. This is required to be sent for all bots with over 100 servers.
shardsThe total number of shards on this bot. If there are multiple clusters, then (shards / clusters) actual shards will run on this cluster. If you omit this value, the library will attempt to query the Discord API for the correct number of shards to start.
cluster_idThe ID of this cluster, should be between 0 and MAXCLUSTERS-1
maxclustersThe total number of clusters that are active, which may be on separate processes or even separate machines.
compressedWhether or not to use compression for shards on this cluster. Saves a ton of bandwidth at the cost of some CPU
policySet the user caching policy for the cluster, either lazy (only cache users/members when they message the bot) or aggressive (request whole member lists on seeing new guilds too)
request_threadsThe number of threads to allocate for making HTTP requests to Discord. This defaults to 12. You can increase this at runtime via the object returned from get_rest().
request_threads_rawThe number of threads to allocate for making HTTP requests to sites outside of Discord. This defaults to 1. You can increase this at runtime via the object returned from get_raw_rest().
Exceptions
dpp::exceptionThrown on windows, if WinSock fails to initialise, or on any other system if a dpp::request_queue fails to construct

◆ cluster() [2/3]

dpp::cluster::cluster ( const cluster )
delete

dpp::cluster is non-copyable

◆ cluster() [3/3]

dpp::cluster::cluster ( const cluster &&  )
delete

dpp::cluster is non-moveable

◆ ~cluster()

virtual dpp::cluster::~cluster ( )
virtual

Destroy the cluster object.

Member Function Documentation

◆ channel_create()

void dpp::cluster::channel_create ( const class channel c,
command_completion_event_t  callback = utility::log_error() 
)

Create a channel.

Create a new channel object for the guild. Requires the MANAGE_CHANNELS permission. If setting permission overwrites, only permissions your bot has in the guild can be allowed/denied. Setting MANAGE_ROLES permission in channels is only possible for guild administrators. Returns the new channel object on success. Fires a Channel Create Gateway event.

All parameters to this endpoint are optional excluding name

Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
See also
https://discord.com/developers/docs/resources/channel#create-channel
Parameters
cChannel to create
callbackFunction to call when the API call completes. On success the callback will contain a dpp::channel object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ channel_create_sync()

channel channel_create_sync ( const class channel c)

Create a channel.

Create a new channel object for the guild. Requires the MANAGE_CHANNELS permission. If setting permission overwrites, only permissions your bot has in the guild can be allowed/denied. Setting MANAGE_ROLES permission in channels is only possible for guild administrators. Returns the new channel object on success. Fires a Channel Create Gateway event.

All parameters to this endpoint are optional excluding name

Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
See also
dpp::cluster::channel_create
https://discord.com/developers/docs/resources/channel#create-channel
Parameters
cChannel to create
Returns
channel returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ channel_delete()

void dpp::cluster::channel_delete ( snowflake  channel_id,
command_completion_event_t  callback = utility::log_error() 
)

Delete a channel.

Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
See also
https://discord.com/developers/docs/resources/channel#deleteclose-channel
Parameters
channel_idChannel id to delete
callbackFunction to call when the API call completes. On success the callback will contain a dpp::confirmation object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ channel_delete_permission()

void dpp::cluster::channel_delete_permission ( const class channel c,
snowflake  overwrite_id,
command_completion_event_t  callback = utility::log_error() 
)

Remove a permission from a channel.

Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
See also
https://discord.com/developers/docs/resources/channel#delete-channel-permission
Parameters
cChannel to remove permission from
overwrite_idOverwrite to remove, user or channel ID
callbackFunction to call when the API call completes. On success the callback will contain a dpp::confirmation object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ channel_delete_permission_sync()

confirmation channel_delete_permission_sync ( const class channel c,
snowflake  overwrite_id 
)

Remove a permission from a channel.

Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
See also
dpp::cluster::channel_delete_permission
https://discord.com/developers/docs/resources/channel#delete-channel-permission
Parameters
cChannel to remove permission from
overwrite_idOverwrite to remove, user or channel ID
Returns
confirmation returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ channel_delete_sync()

confirmation channel_delete_sync ( snowflake  channel_id)

Delete a channel.

Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
See also
dpp::cluster::channel_delete
https://discord.com/developers/docs/resources/channel#deleteclose-channel
Parameters
channel_idChannel id to delete
Returns
confirmation returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ channel_edit()

void dpp::cluster::channel_edit ( const class channel c,
command_completion_event_t  callback = utility::log_error() 
)

Edit a channel.

Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
See also
https://discord.com/developers/docs/resources/channel#modify-channel
Parameters
cChannel to edit/update
callbackFunction to call when the API call completes. On success the callback will contain a dpp::channel object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ channel_edit_permissions() [1/2]

void dpp::cluster::channel_edit_permissions ( const class channel c,
const snowflake  overwrite_id,
const uint32_t  allow,
const uint32_t  deny,
const bool  member,
command_completion_event_t  callback = utility::log_error() 
)

Edit a channel's permissions.

See also
https://discord.com/developers/docs/resources/channel#edit-channel-permissions
Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
Parameters
cChannel to set permissions for
overwrite_idOverwrite to change (a user or role ID)
allowallow permissions
denydeny permissions
membertrue if the overwrite_id is a user id, false if it is a channel id
callbackFunction to call when the API call completes. On success the callback will contain a dpp::confirmation object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ channel_edit_permissions() [2/2]

void dpp::cluster::channel_edit_permissions ( const snowflake  channel_id,
const snowflake  overwrite_id,
const uint32_t  allow,
const uint32_t  deny,
const bool  member,
command_completion_event_t  callback = utility::log_error() 
)

Edit a channel's permissions.

See also
https://discord.com/developers/docs/resources/channel#edit-channel-permissions
Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
Parameters
channel_idID of the channel to set permissions for
overwrite_idOverwrite to change (a user or role ID)
allowallow permissions
denydeny permissions
membertrue if the overwrite_id is a user id, false if it is a channel id
callbackFunction to call when the API call completes. On success the callback will contain a dpp::confirmation object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ channel_edit_positions()

void dpp::cluster::channel_edit_positions ( const std::vector< channel > &  c,
command_completion_event_t  callback = utility::log_error() 
)

Edit multiple channels positions.

Modify the positions of a set of channel objects for the guild. Requires MANAGE_CHANNELS permission. Fires multiple Channel Update Gateway events. Only channels to be modified are required.

Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
See also
https://discord.com/developers/docs/resources/guild#modify-guild-channel-positions
Parameters
cChannel to change the position for
callbackFunction to call when the API call completes. On success the callback will contain a dpp::confirmation object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ channel_edit_positions_sync()

confirmation channel_edit_positions_sync ( const std::vector< channel > &  c)

Edit multiple channels positions.

Modify the positions of a set of channel objects for the guild. Requires MANAGE_CHANNELS permission. Fires multiple Channel Update Gateway events. Only channels to be modified are required.

Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
See also
dpp::cluster::channel_edit_positions
https://discord.com/developers/docs/resources/guild#modify-guild-channel-positions
Parameters
cChannel to change the position for
Returns
confirmation returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ channel_edit_sync()

channel channel_edit_sync ( const class channel c)

Edit a channel.

Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
See also
dpp::cluster::channel_edit
https://discord.com/developers/docs/resources/channel#modify-channel
Parameters
cChannel to edit/update
Returns
channel returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ channel_follow_news()

void dpp::cluster::channel_follow_news ( const class channel c,
snowflake  target_channel_id,
command_completion_event_t  callback = utility::log_error() 
)

Follow a news channel.

See also
https://discord.com/developers/docs/resources/channel#follow-news-channel
Parameters
cChannel id to follow
target_channel_idChannel to subscribe the channel to
callbackFunction to call when the API call completes. On success the callback will contain a dpp::confirmation object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ channel_follow_news_sync()

confirmation channel_follow_news_sync ( const class channel c,
snowflake  target_channel_id 
)

Follow a news channel.

See also
dpp::cluster::channel_follow_news
https://discord.com/developers/docs/resources/channel#follow-news-channel
Parameters
cChannel id to follow
target_channel_idChannel to subscribe the channel to
Returns
confirmation returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ channel_get()

void dpp::cluster::channel_get ( snowflake  c,
command_completion_event_t  callback 
)

Get a channel.

See also
https://discord.com/developers/docs/resources/channel#get-channel
Parameters
cChannel ID to retrieve
callbackFunction to call when the API call completes. On success the callback will contain a dpp::channel object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ channel_get_sync()

channel channel_get_sync ( snowflake  c)

Get a channel.

See also
dpp::cluster::channel_get
https://discord.com/developers/docs/resources/channel#get-channel
Parameters
cChannel ID to retrieve
Returns
channel returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ channel_invite_create()

void dpp::cluster::channel_invite_create ( const class channel c,
const class invite i,
command_completion_event_t  callback = utility::log_error() 
)

Create invite for a channel.

Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
See also
https://discord.com/developers/docs/resources/channel#create-channel-invite
Parameters
cChannel to create an invite on
iInvite to create
callbackFunction to call when the API call completes. On success the callback will contain a dpp::invite object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ channel_invite_create_sync()

confirmation channel_invite_create_sync ( const class channel c,
const class invite i 
)

Create invite for a channel.

Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
See also
dpp::cluster::channel_invite_create
https://discord.com/developers/docs/resources/channel#create-channel-invite
Parameters
cChannel to create an invite on
iInvite to create
Returns
confirmation returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ channel_invites_get()

void dpp::cluster::channel_invites_get ( const class channel c,
command_completion_event_t  callback 
)

Get invites for a channel.

See also
https://discord.com/developers/docs/resources/invite#get-invites
Parameters
cChannel to get invites for
callbackFunction to call when the API call completes. On success the callback will contain a dpp::invite_map object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ channel_invites_get_sync()

invite_map channel_invites_get_sync ( const class channel c)

Get invites for a channel.

See also
dpp::cluster::channel_invites_get
https://discord.com/developers/docs/resources/invite#get-invites
Parameters
cChannel to get invites for
Returns
invite_map returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ channel_pins_get()

void dpp::cluster::channel_pins_get ( snowflake  channel_id,
command_completion_event_t  callback 
)

Get a channel's pins.

See also
https://discord.com/developers/docs/resources/channel#get-pinned-messages
Parameters
channel_idChannel ID to get pins for
callbackFunction to call when the API call completes. On success the callback will contain a dpp::message_map object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ channel_pins_get_sync()

message_map channel_pins_get_sync ( snowflake  channel_id)

Get a channel's pins.

See also
dpp::cluster::channel_pins_get
https://discord.com/developers/docs/resources/channel#get-pinned-messages
Parameters
channel_idChannel ID to get pins for
Returns
message_map returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ channel_typing() [1/2]

void dpp::cluster::channel_typing ( const class channel c,
command_completion_event_t  callback = utility::log_error() 
)

Trigger channel typing indicator.

See also
https://discord.com/developers/docs/resources/channel#trigger-typing-indicator
Parameters
cChannel to set as typing on
callbackFunction to call when the API call completes. On success the callback will contain a dpp::confirmation object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ channel_typing() [2/2]

void dpp::cluster::channel_typing ( snowflake  cid,
command_completion_event_t  callback = utility::log_error() 
)

Trigger channel typing indicator.

See also
https://discord.com/developers/docs/resources/channel#trigger-typing-indicator
Parameters
cidChannel ID to set as typing on
callbackFunction to call when the API call completes. On success the callback will contain a dpp::confirmation object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ channels_get()

void dpp::cluster::channels_get ( snowflake  guild_id,
command_completion_event_t  callback 
)

Get all channels for a guild.

See also
https://discord.com/developers/docs/resources/channel#get-channels
Parameters
guild_idGuild ID to retrieve channels for
callbackFunction to call when the API call completes. On success the callback will contain a dpp::channel_map object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ channels_get_sync()

channel_map channels_get_sync ( snowflake  guild_id)

Get all channels for a guild.

See also
dpp::cluster::channels_get
https://discord.com/developers/docs/resources/channel#get-channels
Parameters
guild_idGuild ID to retrieve channels for
Returns
channel_map returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ clear_audit_reason()

cluster & dpp::cluster::clear_audit_reason ( )

Clear the audit log reason for the next REST call to be made. This is set per-thread, so you must ensure that if you call this method, your request that is associated with the reason happens on the same thread where you set the reason. Once the next call is made, the audit log reason is cleared for this thread automatically.

Example:

bot.set_audit_reason("Won't be sent")
.clear_audit_reason()
.channel_delete(my_channel_id);
Returns
cluster& Reference to self for chaining.

◆ create_dm_channel()

void dpp::cluster::create_dm_channel ( snowflake  user_id,
command_completion_event_t  callback = utility::log_error() 
)

Create a dm channel.

See also
https://discord.com/developers/docs/resources/user#create-dm
Parameters
user_idUser ID to create DM channel with
callbackFunction to call when the API call completes. On success the callback will contain a dpp::channel object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ create_dm_channel_sync()

channel create_dm_channel_sync ( snowflake  user_id)

Create a dm channel.

See also
dpp::cluster::create_dm_channel
https://discord.com/developers/docs/resources/user#create-dm
Parameters
user_idUser ID to create DM channel with
Returns
channel returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ create_webhook()

void dpp::cluster::create_webhook ( const class webhook w,
command_completion_event_t  callback = utility::log_error() 
)

Create a webhook.

Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
See also
https://discord.com/developers/docs/resources/webhook#create-webhook
Parameters
wWebhook to create
callbackFunction to call when the API call completes. On success the callback will contain a dpp::webhook object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ create_webhook_sync()

webhook create_webhook_sync ( const class webhook w)

Create a webhook.

Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
See also
dpp::cluster::create_webhook
https://discord.com/developers/docs/resources/webhook#create-webhook
Parameters
wWebhook to create
Returns
webhook returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ current_application_get()

void dpp::cluster::current_application_get ( command_completion_event_t  callback)

Get current (bot) application.

See also
https://discord.com/developers/docs/topics/oauth2#get-current-bot-application-information
Parameters
callbackFunction to call when the API call completes. On success the callback will contain a dpp::application object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ current_application_get_sync()

application current_application_get_sync ( )

Get current (bot) application.

See also
dpp::cluster::current_application_get
https://discord.com/developers/docs/topics/oauth2#get-current-bot-application-information
Returns
application returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ current_user_connections_get()

void dpp::cluster::current_user_connections_get ( command_completion_event_t  callback)

Get current user's connections (linked accounts, e.g. steam, xbox). This call requires the oauth2 connections scope and cannot be executed against a bot token.

See also
https://discord.com/developers/docs/resources/user#get-user-connections
Parameters
callbackFunction to call when the API call completes. On success the callback will contain a dpp::connection_map object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ current_user_connections_get_sync()

connection_map current_user_connections_get_sync ( )

Get current user's connections (linked accounts, e.g. steam, xbox). This call requires the oauth2 connections scope and cannot be executed against a bot token.

See also
dpp::cluster::current_user_connections_get
https://discord.com/developers/docs/resources/user#get-user-connections
Returns
connection_map returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ current_user_edit()

void dpp::cluster::current_user_edit ( const std::string &  nickname,
const std::string &  image_blob = "",
const image_type  type = i_png,
command_completion_event_t  callback = utility::log_error() 
)

Edit current (bot) user.

Modifies the current member in a guild. Returns the updated guild_member object on success. Fires a Guild Member Update Gateway event.

See also
https://discord.com/developers/docs/resources/user#modify-current-user
Parameters
nicknameNickname to set
image_blobAvatar data to upload (NOTE: Very heavily rate limited!)
typeType of image for avatar
callbackFunction to call when the API call completes. On success the callback will contain a dpp::user object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().
Exceptions
dpp::exceptionImage data is larger than the maximum size of 256 kilobytes

◆ current_user_edit_sync()

user current_user_edit_sync ( const std::string &  nickname,
const std::string &  image_blob = "",
const image_type  type = i_png 
)

Edit current (bot) user.

Modifies the current member in a guild. Returns the updated guild_member object on success. Fires a Guild Member Update Gateway event.

See also
dpp::cluster::current_user_edit
https://discord.com/developers/docs/resources/user#modify-current-user
Parameters
nicknameNickname to set
image_blobAvatar data to upload (NOTE: Very heavily rate limited!)
typeType of image for avatar
Returns
user returned object on completion
Exceptions
dpp::exceptionImage data is larger than the maximum size of 256 kilobytes
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ current_user_get()

void dpp::cluster::current_user_get ( command_completion_event_t  callback)

Get current (bot) user.

See also
https://discord.com/developers/docs/resources/user#get-current-user
Parameters
callbackFunction to call when the API call completes. On success the callback will contain a dpp::user_identified object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().
Note
The user_identified object is a subclass of dpp::user which contains further details if you have the oauth2 identify or email scopes. If you do not have these scopes, these fields are empty. You can safely convert a user_identified to user with dynamic_cast.

◆ current_user_get_dms()

void dpp::cluster::current_user_get_dms ( command_completion_event_t  callback)

Get current user DM channels.

Parameters
callbackFunction to call when the API call completes. On success the callback will contain a dpp::channel_map object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ current_user_get_dms_sync()

channel_map current_user_get_dms_sync ( )

Get current user DM channels.

Returns
channel_map returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ current_user_get_guilds()

void dpp::cluster::current_user_get_guilds ( command_completion_event_t  callback)

Get current (bot) user guilds.

See also
https://discord.com/developers/docs/resources/user#get-current-user-guilds
Parameters
callbackFunction to call when the API call completes. On success the callback will contain a dpp::guild_map object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ current_user_get_guilds_sync()

guild_map current_user_get_guilds_sync ( )

Get current (bot) user guilds.

See also
dpp::cluster::current_user_get_guilds
https://discord.com/developers/docs/resources/user#get-current-user-guilds
Returns
guild_map returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ current_user_get_sync()

user_identified current_user_get_sync ( )

Get current (bot) user.

See also
dpp::cluster::current_user_get
https://discord.com/developers/docs/resources/user#get-current-user
Returns
user_identified returned object on completion
Note
The user_identified object is a subclass of dpp::user which contains further details if you have the oauth2 identify or email scopes. If you do not have these scopes, these fields are empty. You can safely convert a user_identified to user with dynamic_cast.
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ current_user_join_thread()

void dpp::cluster::current_user_join_thread ( snowflake  thread_id,
command_completion_event_t  callback = utility::log_error() 
)

Join a thread.

See also
https://discord.com/developers/docs/topics/thread
Parameters
thread_idThread ID to join
callbackFunction to call when the API call completes. On success the callback will contain a dpp::confirmation object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ current_user_join_thread_sync()

confirmation current_user_join_thread_sync ( snowflake  thread_id)

Join a thread.

See also
dpp::cluster::current_user_join_thread
https://discord.com/developers/docs/topics/thread
Parameters
thread_idThread ID to join
Returns
confirmation returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ current_user_leave_guild()

void dpp::cluster::current_user_leave_guild ( snowflake  guild_id,
command_completion_event_t  callback = utility::log_error() 
)

Leave a guild.

See also
https://discord.com/developers/docs/resources/user#leave-guild
Parameters
guild_idGuild ID to leave
callbackFunction to call when the API call completes. On success the callback will contain a dpp::confirmation object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ current_user_leave_guild_sync()

confirmation current_user_leave_guild_sync ( snowflake  guild_id)

Leave a guild.

See also
dpp::cluster::current_user_leave_guild
https://discord.com/developers/docs/resources/user#leave-guild
Parameters
guild_idGuild ID to leave
Returns
confirmation returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ current_user_leave_thread()

void dpp::cluster::current_user_leave_thread ( snowflake  thread_id,
command_completion_event_t  callback = utility::log_error() 
)

Leave a thread.

See also
https://discord.com/developers/docs/topics/thread
Parameters
thread_idThread ID to leave
callbackFunction to call when the API call completes. On success the callback will contain a dpp::confirmation object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ current_user_leave_thread_sync()

confirmation current_user_leave_thread_sync ( snowflake  thread_id)

Leave a thread.

See also
dpp::cluster::current_user_leave_thread
https://discord.com/developers/docs/topics/thread
Parameters
thread_idThread ID to leave
Returns
confirmation returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ current_user_set_voice_state()

void dpp::cluster::current_user_set_voice_state ( snowflake  guild_id,
snowflake  channel_id,
bool  suppress = false,
time_t  request_to_speak_timestamp = 0,
command_completion_event_t  callback = utility::log_error() 
)

Set the bot's voice state on a stage channel.

Caveats

There are currently several caveats for this endpoint:

  • channel_id must currently point to a stage channel.
  • current user must already have joined channel_id.
  • You must have the MUTE_MEMBERS permission to unsuppress yourself. You can always suppress yourself.
  • You must have the REQUEST_TO_SPEAK permission to request to speak. You can always clear your own request to speak.
  • You are able to set request_to_speak_timestamp to any present or future time.
See also
https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state
Parameters
guild_idGuild to set voice state on
channel_idStage channel to set voice state on
callbackFunction to call when the API call completes.
suppressTrue if the user's audio should be suppressed, false if it should not
request_to_speak_timestampThe time at which we requested to speak, or 0 to clear the request. The time set here must be the current time or in the future. On success the callback will contain a dpp::scheduled_event object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().
Exceptions
std::logic_exceptionYou attempted to set a request_to_speak_timestamp in the past which is not the value of 0.

◆ current_user_set_voice_state_sync()

confirmation current_user_set_voice_state_sync ( snowflake  guild_id,
snowflake  channel_id,
bool  suppress = false,
time_t  request_to_speak_timestamp = 0 
)

Set the bot's voice state on a stage channel.

Caveats

There are currently several caveats for this endpoint:

  • channel_id must currently point to a stage channel.
  • current user must already have joined channel_id.
  • You must have the MUTE_MEMBERS permission to unsuppress yourself. You can always suppress yourself.
  • You must have the REQUEST_TO_SPEAK permission to request to speak. You can always clear your own request to speak.
  • You are able to set request_to_speak_timestamp to any present or future time.
See also
dpp::cluster::current_user_set_voice_state
https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state
Parameters
guild_idGuild to set voice state on
channel_idStage channel to set voice state on
Returns
confirmation returned object on completion
Parameters
suppressTrue if the user's audio should be suppressed, false if it should not
request_to_speak_timestampThe time at which we requested to speak, or 0 to clear the request. The time set here must be the current time or in the future.
Exceptions
std::logic_exceptionYou attempted to set a request_to_speak_timestamp in the past which is not the value of 0.
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ delete_webhook()

void dpp::cluster::delete_webhook ( snowflake  webhook_id,
command_completion_event_t  callback = utility::log_error() 
)

Delete a webhook.

Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
See also
https://discord.com/developers/docs/resources/webhook#delete-webhook
Parameters
webhook_idWebhook ID to delete
callbackFunction to call when the API call completes. On success the callback will contain a dpp::confirmation object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ delete_webhook_message()

void dpp::cluster::delete_webhook_message ( const class webhook wh,
snowflake  message_id,
command_completion_event_t  callback = utility::log_error() 
)

Delete webhook message.

See also
https://discord.com/developers/docs/resources/webhook#delete-webhook-message
Parameters
whWebhook to delete message for
message_idMessage ID to delete
callbackFunction to call when the API call completes. On success the callback will contain a dpp::confirmation object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ delete_webhook_message_sync()

confirmation delete_webhook_message_sync ( const class webhook wh,
snowflake  message_id 
)

Delete webhook message.

See also
dpp::cluster::delete_webhook_message
https://discord.com/developers/docs/resources/webhook#delete-webhook-message
Parameters
whWebhook to delete message for
message_idMessage ID to delete
Returns
confirmation returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ delete_webhook_sync()

confirmation delete_webhook_sync ( snowflake  webhook_id)

Delete a webhook.

Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
See also
dpp::cluster::delete_webhook
https://discord.com/developers/docs/resources/webhook#delete-webhook
Parameters
webhook_idWebhook ID to delete
Returns
confirmation returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ delete_webhook_with_token()

void dpp::cluster::delete_webhook_with_token ( snowflake  webhook_id,
const std::string &  token,
command_completion_event_t  callback = utility::log_error() 
)

Delete webhook with token.

See also
https://discord.com/developers/docs/resources/webhook#delete-webhook-with-token
Parameters
webhook_idWebhook ID to delete
tokenToken of webhook to delete
callbackFunction to call when the API call completes. On success the callback will contain a dpp::confirmation object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ delete_webhook_with_token_sync()

confirmation delete_webhook_with_token_sync ( snowflake  webhook_id,
const std::string &  token 
)

Delete webhook with token.

See also
dpp::cluster::delete_webhook_with_token
https://discord.com/developers/docs/resources/webhook#delete-webhook-with-token
Parameters
webhook_idWebhook ID to delete
tokenToken of webhook to delete
Returns
confirmation returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ direct_message_create()

void dpp::cluster::direct_message_create ( snowflake  user_id,
const message m,
command_completion_event_t  callback = utility::log_error() 
)

Create a direct message, also create the channel for the direct message if needed.

See also
https://discord.com/developers/docs/resources/user#create-dm
https://discord.com/developers/docs/resources/channel#create-message
Parameters
user_idUser ID of user to send message to
mMessage object
callbackFunction to call when the API call completes. On success the callback will contain a dpp::message object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ direct_message_create_sync()

message direct_message_create_sync ( snowflake  user_id,
const message m 
)

Create a direct message, also create the channel for the direct message if needed.

See also
dpp::cluster::direct_message_create
https://discord.com/developers/docs/resources/user#create-dm
dpp::cluster::direct_message_create
https://discord.com/developers/docs/resources/channel#create-message
Parameters
user_idUser ID of user to send message to
mMessage object
Returns
message returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ edit_webhook()

void dpp::cluster::edit_webhook ( const class webhook wh,
command_completion_event_t  callback = utility::log_error() 
)

Edit webhook.

Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
See also
https://discord.com/developers/docs/resources/webhook#modify-webhook
Parameters
whWebhook to edit
callbackFunction to call when the API call completes. On success the callback will contain a dpp::webhook object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ edit_webhook_message()

void dpp::cluster::edit_webhook_message ( const class webhook wh,
const struct message m,
command_completion_event_t  callback = utility::log_error() 
)

Edit webhook message.

When the content field is edited, the mentions array in the message object will be reconstructed from scratch based on the new content. The allowed_mentions field of the edit request controls how this happens. If there is no explicit allowed_mentions in the edit request, the content will be parsed with default allowances, that is, without regard to whether or not an allowed_mentions was present in the request that originally created the message.

See also
https://discord.com/developers/docs/resources/webhook#edit-webhook-message
Note
the attachments array must contain all attachments that should be present after edit, including retained and new attachments provided in the request body.
Parameters
whWebhook to edit message for
mNew message
callbackFunction to call when the API call completes. On success the callback will contain a dpp::message object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ edit_webhook_message_sync()

message edit_webhook_message_sync ( const class webhook wh,
const struct message m 
)

Edit webhook message.

When the content field is edited, the mentions array in the message object will be reconstructed from scratch based on the new content. The allowed_mentions field of the edit request controls how this happens. If there is no explicit allowed_mentions in the edit request, the content will be parsed with default allowances, that is, without regard to whether or not an allowed_mentions was present in the request that originally created the message.

See also
dpp::cluster::edit_webhook_message
https://discord.com/developers/docs/resources/webhook#edit-webhook-message
Note
the attachments array must contain all attachments that should be present after edit, including retained and new attachments provided in the request body.
Parameters
whWebhook to edit message for
mNew message
Returns
message returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ edit_webhook_sync()

webhook edit_webhook_sync ( const class webhook wh)

Edit webhook.

Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
See also
dpp::cluster::edit_webhook
https://discord.com/developers/docs/resources/webhook#modify-webhook
Parameters
whWebhook to edit
Returns
webhook returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ edit_webhook_with_token()

void dpp::cluster::edit_webhook_with_token ( const class webhook wh,
command_completion_event_t  callback = utility::log_error() 
)

Edit webhook with token (token is encapsulated in the webhook object)

See also
https://discord.com/developers/docs/resources/webhook#modify-webhook-with-token
Parameters
whWebhook to edit (should include token)
callbackFunction to call when the API call completes. On success the callback will contain a dpp::webhook object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ edit_webhook_with_token_sync()

webhook edit_webhook_with_token_sync ( const class webhook wh)

Edit webhook with token (token is encapsulated in the webhook object)

See also
dpp::cluster::edit_webhook_with_token
https://discord.com/developers/docs/resources/webhook#modify-webhook-with-token
Parameters
whWebhook to edit (should include token)
Returns
webhook returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ execute_webhook()

void dpp::cluster::execute_webhook ( const class webhook wh,
const struct message m,
bool  wait = false,
snowflake  thread_id = 0,
command_completion_event_t  callback = utility::log_error() 
)

Execute webhook.

See also
https://discord.com/developers/docs/resources/webhook#execute-webhook
Parameters
whWebhook to execute
mMessage to send
waitwaits for server confirmation of message send before response, and returns the created message body
thread_idSend a message to the specified thread within a webhook's channel. The thread will automatically be unarchived
callbackFunction to call when the API call completes. On success the callback will contain a dpp::message object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ execute_webhook_sync()

message execute_webhook_sync ( const class webhook wh,
const struct message m,
bool  wait = false,
snowflake  thread_id = 0 
)

Execute webhook.

See also
dpp::cluster::execute_webhook
https://discord.com/developers/docs/resources/webhook#execute-webhook
Parameters
whWebhook to execute
mMessage to send
waitwaits for server confirmation of message send before response, and returns the created message body
thread_idSend a message to the specified thread within a webhook's channel. The thread will automatically be unarchived
Returns
message returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ gdm_add()

void dpp::cluster::gdm_add ( snowflake  channel_id,
snowflake  user_id,
const std::string &  access_token,
const std::string &  nick,
command_completion_event_t  callback = utility::log_error() 
)

Adds a recipient to a Group DM using their access token.

See also
https://discord.com/developers/docs/resources/channel#group-dm-add-recipient
Parameters
channel_idChannel id to add group DM recipients to
user_idUser ID to add
access_tokenAccess token from OAuth2
nickNickname of user to apply to the chat
callbackFunction to call when the API call completes. On success the callback will contain a dpp::confirmation object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ gdm_add_sync()

confirmation gdm_add_sync ( snowflake  channel_id,
snowflake  user_id,
const std::string &  access_token,
const std::string &  nick 
)

Adds a recipient to a Group DM using their access token.

See also
dpp::cluster::gdm_add
https://discord.com/developers/docs/resources/channel#group-dm-add-recipient
Parameters
channel_idChannel id to add group DM recipients to
user_idUser ID to add
access_tokenAccess token from OAuth2
nickNickname of user to apply to the chat
Returns
confirmation returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ gdm_remove()

void dpp::cluster::gdm_remove ( snowflake  channel_id,
snowflake  user_id,
command_completion_event_t  callback = utility::log_error() 
)

Removes a recipient from a Group DM.

See also
https://discord.com/developers/docs/resources/channel#group-dm-remove-recipient
Parameters
channel_idChannel ID of group DM
user_idUser ID to remove from group DM
callbackFunction to call when the API call completes. On success the callback will contain a dpp::confirmation object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ gdm_remove_sync()

confirmation gdm_remove_sync ( snowflake  channel_id,
snowflake  user_id 
)

Removes a recipient from a Group DM.

See also
dpp::cluster::gdm_remove
https://discord.com/developers/docs/resources/channel#group-dm-remove-recipient
Parameters
channel_idChannel ID of group DM
user_idUser ID to remove from group DM
Returns
confirmation returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ get_audit_reason()

std::string dpp::cluster::get_audit_reason ( )

Get the audit reason set for the next REST call to be made on this thread. This is set per-thread, so you must ensure that if you call this method, your request that is associated with the reason happens on the same thread where you set the reason. Once the next call is made, the audit log reason is cleared for this thread automatically.

Note
This method call clears the audit reason when it returns it.
Returns
std::string The audit reason to be used.

◆ get_channel_webhooks()

void dpp::cluster::get_channel_webhooks ( snowflake  channel_id,
command_completion_event_t  callback 
)

Get channel webhooks.

See also
https://discord.com/developers/docs/resources/webhook#get-guild-webhooks
Parameters
channel_idChannel ID to get webhooks for
callbackFunction to call when the API call completes. On success the callback will contain a dpp::webhook_map object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ get_channel_webhooks_sync()

webhook_map get_channel_webhooks_sync ( snowflake  channel_id)

Get channel webhooks.

See also
dpp::cluster::get_channel_webhooks
https://discord.com/developers/docs/resources/webhook#get-guild-webhooks
Parameters
channel_idChannel ID to get webhooks for
Returns
webhook_map returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ get_dm_channel()

snowflake dpp::cluster::get_dm_channel ( snowflake  user_id)

Get the dm channel for a user id.

Parameters
user_idthe user id to get the dm channel for
Returns
Returns 0 on failure

◆ get_gateway_bot()

void dpp::cluster::get_gateway_bot ( command_completion_event_t  callback)

Get the gateway information for the bot using the token.

See also
https://discord.com/developers/docs/topics/gateway#get-gateway-bot
Parameters
callbackFunction to call when the API call completes. On success the callback will contain a dpp::gateway object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ get_gateway_bot_sync()

gateway get_gateway_bot_sync ( )

Get the gateway information for the bot using the token.

See also
dpp::cluster::get_gateway_bot
https://discord.com/developers/docs/topics/gateway#get-gateway-bot
Returns
gateway returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ get_guild_webhooks()

void dpp::cluster::get_guild_webhooks ( snowflake  guild_id,
command_completion_event_t  callback 
)

Get guild webhooks.

See also
https://discord.com/developers/docs/resources/webhook#get-guild-webhooks
Parameters
guild_idGuild ID to get webhooks for
callbackFunction to call when the API call completes. On success the callback will contain a dpp::webhook_map object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ get_guild_webhooks_sync()

webhook_map get_guild_webhooks_sync ( snowflake  guild_id)

Get guild webhooks.

See also
dpp::cluster::get_guild_webhooks
https://discord.com/developers/docs/resources/webhook#get-guild-webhooks
Parameters
guild_idGuild ID to get webhooks for
Returns
webhook_map returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ get_raw_rest()

request_queue * dpp::cluster::get_raw_rest ( )

Get the raw rest_queue object which handles all HTTP(S) requests that are not directed at Discord.

Returns
request_queue* pointer to request_queue object

◆ get_rest()

request_queue * dpp::cluster::get_rest ( )

Get the rest_queue object which handles HTTPS requests to Discord.

Returns
request_queue* pointer to request_queue object

◆ get_shard()

discord_client * dpp::cluster::get_shard ( uint32_t  id)

Get a shard by id, returning the discord_client.

Parameters
idShard ID
Returns
discord_client* shard, or null

◆ get_shards()

const shard_list & dpp::cluster::get_shards ( )

Get the list of shards.

Returns
shard_list& Reference to map of shards for this cluster

◆ get_voice_regions()

void dpp::cluster::get_voice_regions ( command_completion_event_t  callback)

Get all voice regions.

See also
https://discord.com/developers/docs/resources/voice#list-voice-regions
Parameters
callbackFunction to call when the API call completes. On success the callback will contain a dpp::voiceregion_map object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ get_voice_regions_sync()

voiceregion_map get_voice_regions_sync ( )

Get all voice regions.

See also
dpp::cluster::get_voice_regions
https://discord.com/developers/docs/resources/voice#list-voice-regions
Returns
voiceregion_map returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ get_webhook()

void dpp::cluster::get_webhook ( snowflake  webhook_id,
command_completion_event_t  callback 
)

Get webhook.

See also
https://discord.com/developers/docs/resources/webhook#get-webhook
Parameters
webhook_idWebhook ID to get
callbackFunction to call when the API call completes. On success the callback will contain a dpp::webhook object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ get_webhook_message()

void dpp::cluster::get_webhook_message ( const class webhook wh,
command_completion_event_t  callback = utility::log_error() 
)

Get webhook message.

See also
https://discord.com/developers/docs/resources/webhook#get-webhook-message
Parameters
whWebhook to get the original message for
callbackFunction to call when the API call completes. On success the callback will contain a dpp::message object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ get_webhook_message_sync()

message get_webhook_message_sync ( const class webhook wh)

Get webhook message.

See also
dpp::cluster::get_webhook_message
https://discord.com/developers/docs/resources/webhook#get-webhook-message
Parameters
whWebhook to get the original message for
Returns
message returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ get_webhook_sync()

webhook get_webhook_sync ( snowflake  webhook_id)

Get webhook.

See also
dpp::cluster::get_webhook
https://discord.com/developers/docs/resources/webhook#get-webhook
Parameters
webhook_idWebhook ID to get
Returns
webhook returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ get_webhook_with_token()

void dpp::cluster::get_webhook_with_token ( snowflake  webhook_id,
const std::string &  token,
command_completion_event_t  callback 
)

Get webhook using token.

See also
https://discord.com/developers/docs/resources/webhook#get-webhook-with-token
Parameters
webhook_idWebhook ID to retrieve
tokenToken of webhook
callbackFunction to call when the API call completes. On success the callback will contain a dpp::webhook object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ get_webhook_with_token_sync()

webhook get_webhook_with_token_sync ( snowflake  webhook_id,
const std::string &  token 
)

Get webhook using token.

See also
dpp::cluster::get_webhook_with_token
https://discord.com/developers/docs/resources/webhook#get-webhook-with-token
Parameters
webhook_idWebhook ID to retrieve
tokenToken of webhook
Returns
webhook returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ global_bulk_command_create()

void dpp::cluster::global_bulk_command_create ( const std::vector< slashcommand > &  commands,
command_completion_event_t  callback = utility::log_error() 
)

Create/overwrite global slash commands. Any existing global slash commands will be deleted and replaced with these.

See also
https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-global-application-commands
Parameters
commandsVector of slash commands to create/update. overwriting existing commands that are registered globally for this application. Updates will be available in all guilds after 1 hour. Commands that do not already exist will count toward daily application command create limits.
callbackFunction to call when the API call completes. On success the callback will contain a list of dpp::slashcommand object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ global_bulk_command_create_sync()

slashcommand_map global_bulk_command_create_sync ( const std::vector< slashcommand > &  commands)

Create/overwrite global slash commands. Any existing global slash commands will be deleted and replaced with these.

See also
dpp::cluster::global_bulk_command_create
https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-global-application-commands
Parameters
commandsVector of slash commands to create/update. overwriting existing commands that are registered globally for this application. Commands that do not already exist will count toward daily application command create limits.
Returns
slashcommand_map returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ global_command_create()

void dpp::cluster::global_command_create ( const slashcommand s,
command_completion_event_t  callback = utility::log_error() 
)

Create a global slash command (a bot can have a maximum of 100 of these).

See also
https://discord.com/developers/docs/interactions/application-commands#create-global-application-command
Parameters
sSlash command to create
callbackFunction to call when the API call completes. On success the callback will contain a dpp::slashcommand object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ global_command_create_sync()

slashcommand global_command_create_sync ( const slashcommand s)

Create a global slash command (a bot can have a maximum of 100 of these).

See also
dpp::cluster::global_command_create
https://discord.com/developers/docs/interactions/application-commands#create-global-application-command
Parameters
sSlash command to create
Returns
slashcommand returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ global_command_delete()

void dpp::cluster::global_command_delete ( snowflake  id,
command_completion_event_t  callback = utility::log_error() 
)

Delete a global slash command (a bot can have a maximum of 100 of these)

See also
https://discord.com/developers/docs/interactions/application-commands#delete-global-application-command
Parameters
idSlash command to delete
callbackFunction to call when the API call completes. On success the callback will contain a dpp::confirmation object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ global_command_delete_sync()

confirmation global_command_delete_sync ( snowflake  id)

Delete a global slash command (a bot can have a maximum of 100 of these)

See also
dpp::cluster::global_command_delete
https://discord.com/developers/docs/interactions/application-commands#delete-global-application-command
Parameters
idSlash command to delete
Returns
confirmation returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ global_command_edit()

void dpp::cluster::global_command_edit ( const slashcommand s,
command_completion_event_t  callback = utility::log_error() 
)

Edit a global slash command (a bot can have a maximum of 100 of these)

See also
https://discord.com/developers/docs/interactions/application-commands#edit-global-application-command
Parameters
sSlash command to change
callbackFunction to call when the API call completes. On success the callback will contain a dpp::confirmation object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ global_command_edit_sync()

confirmation global_command_edit_sync ( const slashcommand s)

Edit a global slash command (a bot can have a maximum of 100 of these)

See also
dpp::cluster::global_command_edit
https://discord.com/developers/docs/interactions/application-commands#edit-global-application-command
Parameters
sSlash command to change
Returns
confirmation returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ global_command_get()

void dpp::cluster::global_command_get ( snowflake  id,
command_completion_event_t  callback = utility::log_error() 
)

Get a global slash command.

See also
https://discord.com/developers/docs/interactions/application-commands#get-global-application-command
Parameters
idThe ID of the slash command
callbackFunction to call when the API call completes. On success the callback will contain a dpp::slashcommand object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ global_command_get_sync()

slashcommand global_command_get_sync ( snowflake  id)

Get a global slash command.

See also
dpp::cluster::global_command_get
https://discord.com/developers/docs/interactions/application-commands#get-global-application-command
Parameters
idThe ID of the slash command
Returns
slashcommand returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ global_commands_get()

void dpp::cluster::global_commands_get ( command_completion_event_t  callback)

Get the application's global slash commands.

See also
https://discord.com/developers/docs/interactions/application-commands#get-global-application-commands
Parameters
callbackFunction to call when the API call completes. On success the callback will contain a dpp::slashcommand_map object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ global_commands_get_sync()

slashcommand_map global_commands_get_sync ( )

Get the application's global slash commands.

See also
dpp::cluster::global_commands_get
https://discord.com/developers/docs/interactions/application-commands#get-global-application-commands
Returns
slashcommand_map returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_add_member()

void dpp::cluster::guild_add_member ( const guild_member gm,
const std::string &  access_token,
command_completion_event_t  callback = utility::log_error() 
)

Add guild member. Needs a specific oauth2 scope, from which you get the access_token.

Adds a user to the guild, provided you have a valid oauth2 access token for the user with the guilds.join scope. Returns the guild_member, which is defaulted if the user is already a member of the guild. Fires a Guild Member Add Gateway event.

For guilds with Membership Screening enabled, this endpoint will default to adding new members as pending in the guild member object. Members that are pending will have to complete membership screening before they become full members that can talk.

Note
All parameters to this endpoint except for access_token are optional. The bot must be a member of the guild with CREATE_INSTANT_INVITE permission.
See also
https://discord.com/developers/docs/resources/guild#add-guild-member
Parameters
gmGuild member to add
access_tokenAccess token from Oauth2 scope
callbackFunction to call when the API call completes. On success the callback will contain a dpp::guild_member object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_add_member_sync()

confirmation guild_add_member_sync ( const guild_member gm,
const std::string &  access_token 
)

Add guild member. Needs a specific oauth2 scope, from which you get the access_token.

Adds a user to the guild, provided you have a valid oauth2 access token for the user with the guilds.join scope. Returns the guild_member, which is defaulted if the user is already a member of the guild. Fires a Guild Member Add Gateway event.

For guilds with Membership Screening enabled, this endpoint will default to adding new members as pending in the guild member object. Members that are pending will have to complete membership screening before they become full members that can talk.

Note
All parameters to this endpoint except for access_token are optional. The bot must be a member of the guild with CREATE_INSTANT_INVITE permission.
See also
dpp::cluster::guild_add_member
https://discord.com/developers/docs/resources/guild#add-guild-member
Parameters
gmGuild member to add
access_tokenAccess token from Oauth2 scope
Returns
confirmation returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_auditlog_get()

void dpp::cluster::guild_auditlog_get ( snowflake  guild_id,
command_completion_event_t  callback 
)

Get the audit log for a guild.

See also
https://discord.com/developers/docs/resources/audit-log#get-guild-audit-log
Parameters
guild_idGuild to get the audit log of
callbackFunction to call when the API call completes. On success the callback will contain a dpp::auditlog object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_auditlog_get_sync()

auditlog guild_auditlog_get_sync ( snowflake  guild_id)

Get the audit log for a guild.

See also
dpp::cluster::guild_auditlog_get
https://discord.com/developers/docs/resources/audit-log#get-guild-audit-log
Parameters
guild_idGuild to get the audit log of
Returns
auditlog returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_ban_add()

void dpp::cluster::guild_ban_add ( snowflake  guild_id,
snowflake  user_id,
uint32_t  delete_message_days,
const std::string &  reason,
command_completion_event_t  callback = utility::log_error() 
)

Add guild ban.

Create a guild ban, and optionally delete previous messages sent by the banned user. Requires the BAN_MEMBERS permission. Fires a Guild Ban Add Gateway event.

See also
https://discord.com/developers/docs/resources/guild#create-guild-ban
Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
Parameters
guild_idGuild ID to add ban to
user_idUser ID to ban
delete_message_daysHow many days of their user's messages to also delete
reasonReason for ban
callbackFunction to call when the API call completes. On success the callback will contain a dpp::ban object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_ban_add_sync()

confirmation guild_ban_add_sync ( snowflake  guild_id,
snowflake  user_id,
uint32_t  delete_message_days,
const std::string &  reason 
)

Add guild ban.

Create a guild ban, and optionally delete previous messages sent by the banned user. Requires the BAN_MEMBERS permission. Fires a Guild Ban Add Gateway event.

See also
dpp::cluster::guild_ban_add
https://discord.com/developers/docs/resources/guild#create-guild-ban
Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
Parameters
guild_idGuild ID to add ban to
user_idUser ID to ban
delete_message_daysHow many days of their user's messages to also delete
reasonReason for ban
Returns
confirmation returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_ban_delete()

void dpp::cluster::guild_ban_delete ( snowflake  guild_id,
snowflake  user_id,
command_completion_event_t  callback = utility::log_error() 
)

Delete guild ban.

Remove the ban for a user. Requires the BAN_MEMBERS permissions. Fires a Guild Ban Remove Gateway event.

See also
https://discord.com/developers/docs/resources/guild#remove-guild-ban
Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
Parameters
guild_idGuild to delete ban from
user_idUser ID to delete ban for
callbackFunction to call when the API call completes. On success the callback will contain a dpp::confirmation object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_ban_delete_sync()

confirmation guild_ban_delete_sync ( snowflake  guild_id,
snowflake  user_id 
)

Delete guild ban.

Remove the ban for a user. Requires the BAN_MEMBERS permissions. Fires a Guild Ban Remove Gateway event.

See also
dpp::cluster::guild_ban_delete
https://discord.com/developers/docs/resources/guild#remove-guild-ban
Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
Parameters
guild_idGuild to delete ban from
user_idUser ID to delete ban for
Returns
confirmation returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_begin_prune()

void dpp::cluster::guild_begin_prune ( snowflake  guild_id,
const struct prune pruneinfo,
command_completion_event_t  callback = utility::log_error() 
)

Begin guild prune.

Begin a prune operation. Requires the KICK_MEMBERS permission. Returns a prune object indicating the number of members that were removed in the prune operation. For large guilds it's recommended to set the compute_prune_count option to false, forcing 'pruned' to 0. Fires multiple Guild Member Remove Gateway events. By default, prune will not remove users with roles. You can optionally include specific roles in your prune by providing the include_roles parameter. Any inactive user that has a subset of the provided role(s) will be included in the prune and users with additional roles will not.

See also
https://discord.com/developers/docs/resources/guild#begin-guild-prune
Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
Parameters
guild_idGuild ID to prune
pruneinfoPruning info
callbackFunction to call when the API call completes. On success the callback will contain a dpp::prune object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_begin_prune_sync()

prune guild_begin_prune_sync ( snowflake  guild_id,
const struct prune pruneinfo 
)

Begin guild prune.

Begin a prune operation. Requires the KICK_MEMBERS permission. Returns a prune object indicating the number of members that were removed in the prune operation. For large guilds it's recommended to set the compute_prune_count option to false, forcing 'pruned' to 0. Fires multiple Guild Member Remove Gateway events. By default, prune will not remove users with roles. You can optionally include specific roles in your prune by providing the include_roles parameter. Any inactive user that has a subset of the provided role(s) will be included in the prune and users with additional roles will not.

See also
dpp::cluster::guild_begin_prune
https://discord.com/developers/docs/resources/guild#begin-guild-prune
Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
Parameters
guild_idGuild ID to prune
pruneinfoPruning info
Returns
prune returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_bulk_command_create()

void dpp::cluster::guild_bulk_command_create ( const std::vector< slashcommand > &  commands,
snowflake  guild_id,
command_completion_event_t  callback = utility::log_error() 
)

Create/overwrite guild slash commands. Any existing guild slash commands on this guild will be deleted and replaced with these.

See also
https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-guild-application-commands
Parameters
commandsVector of slash commands to create/update. New guild commands will be available in the guild immediately. If the command did not already exist, it will count toward daily application command create limits.
guild_idGuild ID to create/update the slash commands in
callbackFunction to call when the API call completes. On success the callback will contain a list of dpp::slashcommand object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_bulk_command_create_sync()

slashcommand_map guild_bulk_command_create_sync ( const std::vector< slashcommand > &  commands,
snowflake  guild_id 
)

Create/overwrite guild slash commands. Any existing guild slash commands on this guild will be deleted and replaced with these.

See also
dpp::cluster::guild_bulk_command_create
https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-guild-application-commands
Parameters
commandsVector of slash commands to create/update. New guild commands will be available in the guild immediately. If the command did not already exist, it will count toward daily application command create limits.
guild_idGuild ID to create/update the slash commands in
Returns
slashcommand_map returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_bulk_command_edit_permissions()

void dpp::cluster::guild_bulk_command_edit_permissions ( const std::vector< slashcommand > &  commands,
snowflake  guild_id,
command_completion_event_t  callback = utility::log_error() 
)

Edit/Overwrite the permissions of all existing slash commands in a guild.

Note
You can only add up to 10 permission overwrites for a command
See also
https://discord.com/developers/docs/interactions/application-commands#batch-edit-application-command-permissions
Warning
The endpoint will overwrite all existing permissions for all commands of the application in a guild, including slash commands, user commands, and message commands. Meaning that if you forgot to pass a slash command, the permissions of it might be removed.
Parameters
commandsA vector of slash commands to edit/overwrite the permissions for
guild_idGuild ID to edit permissions of the slash commands in
callbackFunction to call when the API call completes. On success the callback will contain a dpp::guild_command_permissions_map object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_bulk_command_edit_permissions_sync()

guild_command_permissions_map guild_bulk_command_edit_permissions_sync ( const std::vector< slashcommand > &  commands,
snowflake  guild_id 
)

Edit/Overwrite the permissions of all existing slash commands in a guild.

Note
You can only add up to 10 permission overwrites for a command
See also
dpp::cluster::guild_bulk_command_edit_permissions
https://discord.com/developers/docs/interactions/application-commands#batch-edit-application-command-permissions
Warning
The endpoint will overwrite all existing permissions for all commands of the application in a guild, including slash commands, user commands, and message commands. Meaning that if you forgot to pass a slash command, the permissions of it might be removed.
Parameters
commandsA vector of slash commands to edit/overwrite the permissions for
guild_idGuild ID to edit permissions of the slash commands in
Returns
guild_command_permissions_map returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_command_create()

void dpp::cluster::guild_command_create ( const slashcommand s,
snowflake  guild_id,
command_completion_event_t  callback = utility::log_error() 
)

Create a slash command local to a guild.

See also
https://discord.com/developers/docs/interactions/application-commands#create-guild-application-command
Note
Creating a command with the same name as an existing command for your application will overwrite the old command.
Parameters
sSlash command to create
guild_idGuild ID to create the slash command in
callbackFunction to call when the API call completes. On success the callback will contain a dpp::slashcommand object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_command_create_sync()

slashcommand guild_command_create_sync ( const slashcommand s,
snowflake  guild_id 
)

Create a slash command local to a guild.

See also
dpp::cluster::guild_command_create
https://discord.com/developers/docs/interactions/application-commands#create-guild-application-command
Note
Creating a command with the same name as an existing command for your application will overwrite the old command.
Parameters
sSlash command to create
guild_idGuild ID to create the slash command in
Returns
slashcommand returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_command_delete()

void dpp::cluster::guild_command_delete ( snowflake  id,
snowflake  guild_id,
command_completion_event_t  callback = utility::log_error() 
)

Delete a slash command local to a guild.

See also
https://discord.com/developers/docs/interactions/application-commands#delete-guild-application-command
Parameters
idSlash command to delete
guild_idGuild ID to delete the slash command in
callbackFunction to call when the API call completes. On success the callback will contain a dpp::confirmation object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_command_delete_sync()

confirmation guild_command_delete_sync ( snowflake  id,
snowflake  guild_id 
)

Delete a slash command local to a guild.

See also
dpp::cluster::guild_command_delete
https://discord.com/developers/docs/interactions/application-commands#delete-guild-application-command
Parameters
idSlash command to delete
guild_idGuild ID to delete the slash command in
Returns
confirmation returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_command_edit()

void dpp::cluster::guild_command_edit ( const slashcommand s,
snowflake  guild_id,
command_completion_event_t  callback = utility::log_error() 
)

Edit a slash command local to a guild.

See also
https://discord.com/developers/docs/interactions/application-commands#edit-guild-application-command
Parameters
sSlash command to edit
guild_idGuild ID to edit the slash command in
callbackFunction to call when the API call completes. On success the callback will contain a dpp::confirmation object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_command_edit_permissions()

void dpp::cluster::guild_command_edit_permissions ( const slashcommand s,
snowflake  guild_id,
command_completion_event_t  callback = utility::log_error() 
)

Edit slash command permissions of a guild.

See also
https://discord.com/developers/docs/interactions/application-commands#edit-application-command-permissions
Note
You can only add up to 10 permission overwrites for a command
Parameters
sSlash command to edit the permissions for
guild_idGuild ID to edit the slash command in
callbackFunction to call when the API call completes. On success the callback will contain a dpp::confirmation object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_command_edit_permissions_sync()

confirmation guild_command_edit_permissions_sync ( const slashcommand s,
snowflake  guild_id 
)

Edit slash command permissions of a guild.

See also
dpp::cluster::guild_command_edit_permissions
https://discord.com/developers/docs/interactions/application-commands#edit-application-command-permissions
Note
You can only add up to 10 permission overwrites for a command
Parameters
sSlash command to edit the permissions for
guild_idGuild ID to edit the slash command in
Returns
confirmation returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_command_edit_sync()

confirmation guild_command_edit_sync ( const slashcommand s,
snowflake  guild_id 
)

Edit a slash command local to a guild.

See also
dpp::cluster::guild_command_edit
https://discord.com/developers/docs/interactions/application-commands#edit-guild-application-command
Parameters
sSlash command to edit
guild_idGuild ID to edit the slash command in
Returns
confirmation returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_command_get()

void dpp::cluster::guild_command_get ( snowflake  id,
snowflake  guild_id,
command_completion_event_t  callback = utility::log_error() 
)

Get a slash command of a guild.

See also
https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command
Note
The returned slash commands will not have permissions set, you need to use a permissions getter e.g. dpp::guild_commands_get_permissions to get the guild command permissions
Parameters
idThe ID of the slash command
guild_idGuild ID to get the slash command from
callbackFunction to call when the API call completes. On success the callback will contain a dpp::slashcommand object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_command_get_permissions()

void dpp::cluster::guild_command_get_permissions ( snowflake  id,
snowflake  guild_id,
command_completion_event_t  callback = utility::log_error() 
)

Get the permissions for a slash command of a guild.

See also
https://discord.com/developers/docs/interactions/application-commands#get-application-command-permissions
Parameters
idThe ID of the slash command to get the permissions for
guild_idGuild ID to get the permissions of
callbackFunction to call when the API call completes. On success the callback will contain a dpp::guild_command_permissions object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_command_get_permissions_sync()

guild_command_permissions guild_command_get_permissions_sync ( snowflake  id,
snowflake  guild_id 
)

Get the permissions for a slash command of a guild.

See also
dpp::cluster::guild_command_get_permissions
https://discord.com/developers/docs/interactions/application-commands#get-application-command-permissions
Parameters
idThe ID of the slash command to get the permissions for
guild_idGuild ID to get the permissions of
Returns
guild_command_permissions returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_command_get_sync()

slashcommand guild_command_get_sync ( snowflake  id,
snowflake  guild_id 
)

Get a slash command of a guild.

See also
dpp::cluster::guild_command_get
https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command
Note
The returned slash commands will not have permissions set, you need to use a permissions getter e.g. dpp::guild_commands_get_permissions to get the guild command permissions
Parameters
idThe ID of the slash command
guild_idGuild ID to get the slash command from
Returns
slashcommand returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_commands_get()

void dpp::cluster::guild_commands_get ( snowflake  guild_id,
command_completion_event_t  callback 
)

Get the application's slash commands for a guild.

See also
https://discord.com/developers/docs/interactions/application-commands#get-guild-application-commands
Note
The returned slash commands will not have permissions set, you need to use a permissions getter e.g. dpp::guild_commands_get_permissions to get the guild command permissions
Parameters
guild_idGuild ID to get the slash commands for
callbackFunction to call when the API call completes. On success the callback will contain a dpp::slashcommand_map object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_commands_get_permissions()

void dpp::cluster::guild_commands_get_permissions ( snowflake  guild_id,
command_completion_event_t  callback 
)

Get all slash command permissions of a guild.

See also
https://discord.com/developers/docs/interactions/application-commands#get-application-command-permissions
Parameters
guild_idGuild ID to get the slash commands permissions for
callbackFunction to call when the API call completes. On success the callback will contain a dpp::guild_command_permissions_map object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_commands_get_permissions_sync()

guild_command_permissions_map guild_commands_get_permissions_sync ( snowflake  guild_id)

Get all slash command permissions of a guild.

See also
dpp::cluster::guild_commands_get_permissions
https://discord.com/developers/docs/interactions/application-commands#get-application-command-permissions
Parameters
guild_idGuild ID to get the slash commands permissions for
Returns
guild_command_permissions_map returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_commands_get_sync()

slashcommand_map guild_commands_get_sync ( snowflake  guild_id)

Get the application's slash commands for a guild.

See also
dpp::cluster::guild_commands_get
https://discord.com/developers/docs/interactions/application-commands#get-guild-application-commands
Note
The returned slash commands will not have permissions set, you need to use a permissions getter e.g. dpp::guild_commands_get_permissions to get the guild command permissions
Parameters
guild_idGuild ID to get the slash commands for
Returns
slashcommand_map returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_create()

void dpp::cluster::guild_create ( const class guild g,
command_completion_event_t  callback = utility::log_error() 
)

Create a guild.

Create a new guild. Returns a guild object on success. Fires a Guild Create Gateway event.

When using the roles parameter, the first member of the array is used to change properties of the guild's everyone role. If you are trying to bootstrap a guild with additional roles, keep this in mind. The required id field within each role object is an integer placeholder, and will be replaced by the API upon consumption. Its purpose is to allow you to overwrite a role's permissions in a channel when also passing in channels with the channels array. When using the channels parameter, the position field is ignored, and none of the default channels are created. The id field within each channel object may be set to an integer placeholder, and will be replaced by the API upon consumption. Its purpose is to allow you to create GUILD_CATEGORY channels by setting the parent_id field on any children to the category's id field. Category channels must be listed before any children.

See also
https://discord.com/developers/docs/resources/guild#create-guild
Note
The region field is deprecated and is replaced by channel.rtc_region. This endpoint can be used only by bots in less than 10 guilds.
Parameters
gGuild to create
callbackFunction to call when the API call completes. On success the callback will contain a dpp::guild object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_create_from_template()

void dpp::cluster::guild_create_from_template ( const std::string &  code,
const std::string &  name,
command_completion_event_t  callback = utility::log_error() 
)

Create a new guild based on a template.

Note
This endpoint can be used only by bots in less than 10 guilds.
See also
https://discord.com/developers/docs/resources/guild-template#create-guild-from-guild-template
Parameters
codeTemplate code to create guild from
nameGuild name to create
callbackFunction to call when the API call completes. On success the callback will contain a dpp::guild object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_create_from_template_sync()

guild guild_create_from_template_sync ( const std::string &  code,
const std::string &  name 
)

Create a new guild based on a template.

Note
This endpoint can be used only by bots in less than 10 guilds.
See also
dpp::cluster::guild_create_from_template
https://discord.com/developers/docs/resources/guild-template#create-guild-from-guild-template
Parameters
codeTemplate code to create guild from
nameGuild name to create
Returns
guild returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_create_sync()

guild guild_create_sync ( const class guild g)

Create a guild.

Create a new guild. Returns a guild object on success. Fires a Guild Create Gateway event.

When using the roles parameter, the first member of the array is used to change properties of the guild's everyone role. If you are trying to bootstrap a guild with additional roles, keep this in mind. The required id field within each role object is an integer placeholder, and will be replaced by the API upon consumption. Its purpose is to allow you to overwrite a role's permissions in a channel when also passing in channels with the channels array. When using the channels parameter, the position field is ignored, and none of the default channels are created. The id field within each channel object may be set to an integer placeholder, and will be replaced by the API upon consumption. Its purpose is to allow you to create GUILD_CATEGORY channels by setting the parent_id field on any children to the category's id field. Category channels must be listed before any children.

See also
dpp::cluster::guild_create
https://discord.com/developers/docs/resources/guild#create-guild
Note
The region field is deprecated and is replaced by channel.rtc_region. This endpoint can be used only by bots in less than 10 guilds.
Parameters
gGuild to create
Returns
guild returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_current_member_edit()

void dpp::cluster::guild_current_member_edit ( snowflake  guild_id,
const std::string &  nickname,
command_completion_event_t  callback = utility::log_error() 
)

Modify current member.

Modifies the current member in a guild. Fires a Guild Member Update Gateway event.

Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
See also
https://discord.com/developers/docs/resources/guild#modify-current-member
Parameters
guild_idGuild ID to change on
nicknameNew nickname, or empty string to clear nickname
callbackFunction to call when the API call completes. On success the callback will contain a dpp::confirmation object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_current_member_edit_sync()

confirmation guild_current_member_edit_sync ( snowflake  guild_id,
const std::string &  nickname 
)

Modify current member.

Modifies the current member in a guild. Fires a Guild Member Update Gateway event.

Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
See also
dpp::cluster::guild_current_member_edit
https://discord.com/developers/docs/resources/guild#modify-current-member
Parameters
guild_idGuild ID to change on
nicknameNew nickname, or empty string to clear nickname
Returns
confirmation returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_delete()

void dpp::cluster::guild_delete ( snowflake  guild_id,
command_completion_event_t  callback = utility::log_error() 
)

Delete a guild.

Delete a guild permanently. User must be owner. Fires a Guild Delete Gateway event.

See also
https://discord.com/developers/docs/resources/guild#delete-guild
Parameters
guild_idGuild ID to delete
callbackFunction to call when the API call completes. On success the callback will contain a dpp::confirmation object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_delete_integration()

void dpp::cluster::guild_delete_integration ( snowflake  guild_id,
snowflake  integration_id,
command_completion_event_t  callback = utility::log_error() 
)

Delete guild integration.

Delete the attached integration object for the guild. Deletes any associated webhooks and kicks the associated bot if there is one. Requires the MANAGE_GUILD permission. Fires a Guild Integrations Update Gateway event.

See also
https://discord.com/developers/docs/resources/guild#delete-guild-integration
Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
Parameters
guild_idGuild ID to delete integration for
integration_idIntegration ID to delete
callbackFunction to call when the API call completes. On success the callback will contain a dpp::confirmation object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_delete_integration_sync()

confirmation guild_delete_integration_sync ( snowflake  guild_id,
snowflake  integration_id 
)

Delete guild integration.

Delete the attached integration object for the guild. Deletes any associated webhooks and kicks the associated bot if there is one. Requires the MANAGE_GUILD permission. Fires a Guild Integrations Update Gateway event.

See also
dpp::cluster::guild_delete_integration
https://discord.com/developers/docs/resources/guild#delete-guild-integration
Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
Parameters
guild_idGuild ID to delete integration for
integration_idIntegration ID to delete
Returns
confirmation returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_delete_sync()

confirmation guild_delete_sync ( snowflake  guild_id)

Delete a guild.

Delete a guild permanently. User must be owner. Fires a Guild Delete Gateway event.

See also
dpp::cluster::guild_delete
https://discord.com/developers/docs/resources/guild#delete-guild
Parameters
guild_idGuild ID to delete
Returns
confirmation returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_edit()

void dpp::cluster::guild_edit ( const class guild g,
command_completion_event_t  callback = utility::log_error() 
)

Edit a guild.

Modify a guild's settings. Requires the MANAGE_GUILD permission. Returns the updated guild object on success. Fires a Guild Update Gateway event.

See also
https://discord.com/developers/docs/resources/guild#modify-guild
Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
Parameters
gGuild to edit
callbackFunction to call when the API call completes. On success the callback will contain a dpp::guild object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_edit_member()

void dpp::cluster::guild_edit_member ( const guild_member gm,
command_completion_event_t  callback = utility::log_error() 
)

Edit the properties of an existing guild member.

Modify attributes of a guild member. Returns the guild_member. Fires a Guild Member Update Gateway event. If the channel_id is set to 0, this will force the target user to be disconnected from voice. To remove a timeout, set the communication_disabled_until to a non-zero time in the past, e.g. 1. When moving members to channels, the API user must have permissions to both connect to the channel and have the MOVE_MEMBERS permission.

See also
https://discord.com/developers/docs/resources/guild#modify-guild-member
Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
Parameters
gmGuild member to edit
callbackFunction to call when the API call completes. On success the callback will contain a dpp::guild_member object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_edit_member_sync()

guild_member guild_edit_member_sync ( const guild_member gm)

Edit the properties of an existing guild member.

Modify attributes of a guild member. Returns the guild_member. Fires a Guild Member Update Gateway event. If the channel_id is set to 0, this will force the target user to be disconnected from voice. To remove a timeout, set the communication_disabled_until to a non-zero time in the past, e.g. 1. When moving members to channels, the API user must have permissions to both connect to the channel and have the MOVE_MEMBERS permission.

See also
dpp::cluster::guild_edit_member
https://discord.com/developers/docs/resources/guild#modify-guild-member
Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
Parameters
gmGuild member to edit
Returns
guild_member returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_edit_sync()

guild guild_edit_sync ( const class guild g)

Edit a guild.

Modify a guild's settings. Requires the MANAGE_GUILD permission. Returns the updated guild object on success. Fires a Guild Update Gateway event.

See also
dpp::cluster::guild_edit
https://discord.com/developers/docs/resources/guild#modify-guild
Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
Parameters
gGuild to edit
Returns
guild returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_edit_widget()

void dpp::cluster::guild_edit_widget ( snowflake  guild_id,
const class guild_widget gw,
command_completion_event_t  callback = utility::log_error() 
)

Edit guild widget.

Requires the MANAGE_GUILD permission.

See also
https://discord.com/developers/docs/resources/guild#modify-guild-widget
Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
Parameters
guild_idGuild ID to edit widget for
gwNew guild widget information
callbackFunction to call when the API call completes. On success the callback will contain a dpp::guild_widget object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_edit_widget_sync()

guild_widget guild_edit_widget_sync ( snowflake  guild_id,
const class guild_widget gw 
)

Edit guild widget.

Requires the MANAGE_GUILD permission.

See also
dpp::cluster::guild_edit_widget
https://discord.com/developers/docs/resources/guild#modify-guild-widget
Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
Parameters
guild_idGuild ID to edit widget for
gwNew guild widget information
Returns
guild_widget returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_emoji_create()

void dpp::cluster::guild_emoji_create ( snowflake  guild_id,
const class emoji newemoji,
command_completion_event_t  callback = utility::log_error() 
)

Create single emoji. You must ensure that the emoji passed contained image data using the emoji::load_image() method.

Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
See also
https://discord.com/developers/docs/resources/emoji#create-guild-emoji
Parameters
guild_idGuild ID to create emoji om
newemojiEmoji to create
callbackFunction to call when the API call completes. On success the callback will contain a dpp::emoji object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_emoji_create_sync()

emoji guild_emoji_create_sync ( snowflake  guild_id,
const class emoji newemoji 
)

Create single emoji. You must ensure that the emoji passed contained image data using the emoji::load_image() method.

Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
See also
dpp::cluster::guild_emoji_create
https://discord.com/developers/docs/resources/emoji#create-guild-emoji
Parameters
guild_idGuild ID to create emoji om
newemojiEmoji to create
Returns
emoji returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_emoji_delete()

void dpp::cluster::guild_emoji_delete ( snowflake  guild_id,
snowflake  emoji_id,
command_completion_event_t  callback = utility::log_error() 
)

Delete a guild emoji.

Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
See also
https://discord.com/developers/docs/resources/emoji#delete-guild-emoji
Parameters
guild_idGuild ID to delete emoji on
emoji_idEmoji ID to delete
callbackFunction to call when the API call completes. On success the callback will contain a dpp::confirmation object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_emoji_delete_sync()

confirmation guild_emoji_delete_sync ( snowflake  guild_id,
snowflake  emoji_id 
)

Delete a guild emoji.

Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
See also
dpp::cluster::guild_emoji_delete
https://discord.com/developers/docs/resources/emoji#delete-guild-emoji
Parameters
guild_idGuild ID to delete emoji on
emoji_idEmoji ID to delete
Returns
confirmation returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_emoji_edit()

void dpp::cluster::guild_emoji_edit ( snowflake  guild_id,
const class emoji newemoji,
command_completion_event_t  callback = utility::log_error() 
)

Edit a single emoji.

You must ensure that the emoji passed contained image data using the emoji::load_image() method.

See also
https://discord.com/developers/docs/resources/emoji#get-guild-emoji
Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
Parameters
guild_idGuild ID to edit emoji on
newemojiEmoji to edit
callbackFunction to call when the API call completes. On success the callback will contain a dpp::emoji object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_emoji_edit_sync()

emoji guild_emoji_edit_sync ( snowflake  guild_id,
const class emoji newemoji 
)

Edit a single emoji.

You must ensure that the emoji passed contained image data using the emoji::load_image() method.

See also
dpp::cluster::guild_emoji_edit
https://discord.com/developers/docs/resources/emoji#get-guild-emoji
Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
Parameters
guild_idGuild ID to edit emoji on
newemojiEmoji to edit
Returns
emoji returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_emoji_get()

void dpp::cluster::guild_emoji_get ( snowflake  guild_id,
snowflake  emoji_id,
command_completion_event_t  callback 
)

Get a single emoji.

See also
https://discord.com/developers/docs/resources/emoji#get-guild-emoji
Parameters
guild_idGuild ID to get emoji for
emoji_idEmoji ID to get
callbackFunction to call when the API call completes. On success the callback will contain a dpp::emoji object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_emoji_get_sync()

emoji guild_emoji_get_sync ( snowflake  guild_id,
snowflake  emoji_id 
)

Get a single emoji.

See also
dpp::cluster::guild_emoji_get
https://discord.com/developers/docs/resources/emoji#get-guild-emoji
Parameters
guild_idGuild ID to get emoji for
emoji_idEmoji ID to get
Returns
emoji returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_emojis_get()

void dpp::cluster::guild_emojis_get ( snowflake  guild_id,
command_completion_event_t  callback 
)

Get all emojis for a guild.

See also
https://discord.com/developers/docs/resources/emoji#get-guild-emojis
Parameters
guild_idGuild ID to get emojis for
callbackFunction to call when the API call completes. On success the callback will contain a dpp::emoji_map object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_emojis_get_sync()

emoji_map guild_emojis_get_sync ( snowflake  guild_id)

Get all emojis for a guild.

See also
dpp::cluster::guild_emojis_get
https://discord.com/developers/docs/resources/emoji#get-guild-emojis
Parameters
guild_idGuild ID to get emojis for
Returns
emoji_map returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_event_create()

void dpp::cluster::guild_event_create ( const scheduled_event event,
command_completion_event_t  callback = utility::log_error() 
)

Create a scheduled event on a guild.

See also
https://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event
Parameters
eventEvent to create (guild ID must be populated)
callbackFunction to call when the API call completes. On success the callback will contain a dpp::scheduled_event_map object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_event_create_sync()

scheduled_event guild_event_create_sync ( const scheduled_event event)

Create a scheduled event on a guild.

See also
dpp::cluster::guild_event_create
https://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event
Parameters
eventEvent to create (guild ID must be populated)
Returns
scheduled_event returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_event_delete()

void dpp::cluster::guild_event_delete ( snowflake  event_id,
snowflake  guild_id,
command_completion_event_t  callback = utility::log_error() 
)

Delete a scheduled event from a guild.

See also
https://discord.com/developers/docs/resources/guild-scheduled-event#delete-guild-scheduled-event
Parameters
event_idEvent ID to delete
guild_idGuild ID of event to delete
callbackFunction to call when the API call completes. On success the callback will contain a dpp::confirmation object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_event_delete_sync()

confirmation guild_event_delete_sync ( snowflake  event_id,
snowflake  guild_id 
)

Delete a scheduled event from a guild.

See also
dpp::cluster::guild_event_delete
https://discord.com/developers/docs/resources/guild-scheduled-event#delete-guild-scheduled-event
Parameters
event_idEvent ID to delete
guild_idGuild ID of event to delete
Returns
confirmation returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_event_edit()

void dpp::cluster::guild_event_edit ( const scheduled_event event,
command_completion_event_t  callback = utility::log_error() 
)

Edit/modify a scheduled event on a guild.

See also
https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event
Parameters
eventEvent to create (event ID and guild ID must be populated)
callbackFunction to call when the API call completes. On success the callback will contain a dpp::scheduled_event_map object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_event_edit_sync()

scheduled_event guild_event_edit_sync ( const scheduled_event event)

Edit/modify a scheduled event on a guild.

See also
dpp::cluster::guild_event_edit
https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event
Parameters
eventEvent to create (event ID and guild ID must be populated)
Returns
scheduled_event returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_event_get()

void dpp::cluster::guild_event_get ( snowflake  guild_id,
snowflake  event_id,
command_completion_event_t  callback 
)

Get a scheduled event for a guild.

See also
https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event
Parameters
guild_idGuild to get event for
event_idEvent ID to get
callbackFunction to call when the API call completes. On success the callback will contain a dpp::scheduled_event object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_event_get_sync()

scheduled_event guild_event_get_sync ( snowflake  guild_id,
snowflake  event_id 
)

Get a scheduled event for a guild.

See also
dpp::cluster::guild_event_get
https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event
Parameters
guild_idGuild to get event for
event_idEvent ID to get
Returns
scheduled_event returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_event_users_get()

void dpp::cluster::guild_event_users_get ( snowflake  guild_id,
snowflake  event_id,
command_completion_event_t  callback,
uint8_t  limit = 100,
snowflake  before = 0,
snowflake  after = 0 
)

Get users RSVP'd to an event.

See also
https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event-users
Parameters
guild_idGuild to get user list for
event_idGuild to get user list for
limitMaximum number of results to return
beforeReturn user IDs that fall before this ID, if provided
afterReturn user IDs that fall after this ID, if provided
callbackFunction to call when the API call completes. On success the callback will contain a dpp::event_member_map object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_events_get()

void dpp::cluster::guild_events_get ( snowflake  guild_id,
command_completion_event_t  callback 
)

Get all scheduled events for a guild.

See also
https://discord.com/developers/docs/resources/guild-scheduled-event#list-scheduled-events-for-guild
Parameters
guild_idGuild to get events for
callbackFunction to call when the API call completes. On success the callback will contain a dpp::scheduled_event_map object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_events_get_sync()

scheduled_event_map guild_events_get_sync ( snowflake  guild_id)

Get all scheduled events for a guild.

See also
dpp::cluster::guild_events_get
https://discord.com/developers/docs/resources/guild-scheduled-event#list-scheduled-events-for-guild
Parameters
guild_idGuild to get events for
Returns
scheduled_event_map returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_get()

void dpp::cluster::guild_get ( snowflake  g,
command_completion_event_t  callback 
)

Get a guild.

Returns the guild object for the given id. This endpoint will also return approximate_member_count and approximate_presence_count for the guild.

See also
https://discord.com/developers/docs/resources/guild#get-guild
Parameters
gGuild ID to retrieve
callbackFunction to call when the API call completes. On success the callback will contain a dpp::guild object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_get_ban()

void dpp::cluster::guild_get_ban ( snowflake  guild_id,
snowflake  user_id,
command_completion_event_t  callback 
)

Get single guild ban.

Requires the BAN_MEMBERS permission.

See also
https://discord.com/developers/docs/resources/guild#get-guild-ban
Parameters
guild_idGuild ID to get ban for
user_idUser ID of ban to retrieve
callbackFunction to call when the API call completes. On success the callback will contain a dpp::ban object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_get_ban_sync()

ban guild_get_ban_sync ( snowflake  guild_id,
snowflake  user_id 
)

Get single guild ban.

Requires the BAN_MEMBERS permission.

See also
dpp::cluster::guild_get_ban
https://discord.com/developers/docs/resources/guild#get-guild-ban
Parameters
guild_idGuild ID to get ban for
user_idUser ID of ban to retrieve
Returns
ban returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_get_bans()

void dpp::cluster::guild_get_bans ( snowflake  guild_id,
snowflake  before,
snowflake  after,
snowflake  limit,
command_completion_event_t  callback 
)

Get guild ban list.

Requires the BAN_MEMBERS permission.

See also
https://discord.com/developers/docs/resources/guild#get-guild-bans
Note
Provide a user ID to before and after for pagination. Users will always be returned in ascending order by the user ID. If both before and after are provided, only before is respected.
Parameters
guild_idGuild ID to get bans for
beforeIf non-zero, all bans for user ids before this user id will be returned up to the limit
afterif non-zero, all bans for user ids after this user id will be returned up to the limit
limitthe maximum number of bans to retrieve in this call up to a maximum of 1000
callbackFunction to call when the API call completes. On success the callback will contain a dpp::ban_map object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_get_bans_sync()

ban_map guild_get_bans_sync ( snowflake  guild_id,
snowflake  before,
snowflake  after,
snowflake  limit 
)

Get guild ban list.

Requires the BAN_MEMBERS permission.

See also
dpp::cluster::guild_get_bans
https://discord.com/developers/docs/resources/guild#get-guild-bans
Note
Provide a user ID to before and after for pagination. Users will always be returned in ascending order by the user ID. If both before and after are provided, only before is respected.
Parameters
guild_idGuild ID to get bans for
beforeIf non-zero, all bans for user ids before this user id will be returned up to the limit
afterif non-zero, all bans for user ids after this user id will be returned up to the limit
limitthe maximum number of bans to retrieve in this call up to a maximum of 1000
Returns
ban_map returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_get_integrations()

void dpp::cluster::guild_get_integrations ( snowflake  guild_id,
command_completion_event_t  callback 
)

Get guild integrations.

Requires the MANAGE_GUILD permission.

See also
https://discord.com/developers/docs/resources/guild#get-guild-integrations
Parameters
guild_idGuild ID to get integrations for
callbackFunction to call when the API call completes. On success the callback will contain a dpp::integration_map object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_get_integrations_sync()

integration_map guild_get_integrations_sync ( snowflake  guild_id)

Get guild integrations.

Requires the MANAGE_GUILD permission.

See also
dpp::cluster::guild_get_integrations
https://discord.com/developers/docs/resources/guild#get-guild-integrations
Parameters
guild_idGuild ID to get integrations for
Returns
integration_map returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_get_invites()

void dpp::cluster::guild_get_invites ( snowflake  guild_id,
command_completion_event_t  callback 
)

Get guild invites.

Returns a list of invite objects (with invite metadata) for the guild. Requires the MANAGE_GUILD permission.

See also
https://discord.com/developers/docs/resources/guild#get-guild-invites
Parameters
guild_idGuild ID to get invites for
callbackFunction to call when the API call completes. On success the callback will contain a dpp::invite_map object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_get_invites_sync()

invite_map guild_get_invites_sync ( snowflake  guild_id)

Get guild invites.

Returns a list of invite objects (with invite metadata) for the guild. Requires the MANAGE_GUILD permission.

See also
dpp::cluster::guild_get_invites
https://discord.com/developers/docs/resources/guild#get-guild-invites
Parameters
guild_idGuild ID to get invites for
Returns
invite_map returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_get_member()

void dpp::cluster::guild_get_member ( snowflake  guild_id,
snowflake  user_id,
command_completion_event_t  callback 
)

Get a guild member.

See also
https://discord.com/developers/docs/resources/guild#get-guild-member
Parameters
guild_idGuild ID to get member for
user_idUser ID of member to get
callbackFunction to call when the API call completes. On success the callback will contain a dpp::guild_member object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_get_member_sync()

guild_member guild_get_member_sync ( snowflake  guild_id,
snowflake  user_id 
)

Get a guild member.

See also
dpp::cluster::guild_get_member
https://discord.com/developers/docs/resources/guild#get-guild-member
Parameters
guild_idGuild ID to get member for
user_idUser ID of member to get
Returns
guild_member returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_get_members()

void dpp::cluster::guild_get_members ( snowflake  guild_id,
uint16_t  limit,
snowflake  after,
command_completion_event_t  callback 
)

Get all guild members.

Note
This endpoint is restricted according to whether the GUILD_MEMBERS Privileged Intent is enabled for your application.
See also
https://discord.com/developers/docs/resources/guild#get-guild-members
Parameters
guild_idGuild ID to get all members for
limitmax number of members to return (1-1000)
afterthe highest user id in the previous page
callbackFunction to call when the API call completes. On success the callback will contain a dpp::guild_member_map object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_get_members_sync()

guild_member_map guild_get_members_sync ( snowflake  guild_id,
uint16_t  limit,
snowflake  after 
)

Get all guild members.

Note
This endpoint is restricted according to whether the GUILD_MEMBERS Privileged Intent is enabled for your application.
See also
dpp::cluster::guild_get_members
https://discord.com/developers/docs/resources/guild#get-guild-members
Parameters
guild_idGuild ID to get all members for
limitmax number of members to return (1-1000)
afterthe highest user id in the previous page
Returns
guild_member_map returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_get_preview()

void dpp::cluster::guild_get_preview ( snowflake  g,
command_completion_event_t  callback 
)

Get a guild preview. Returns a guild object but only a subset of the fields will be populated.

Returns the guild preview object for the given id g. If the user is not in the guild, then the guild must be lurkable (it must be Discoverable or have a live public stage).

See also
https://discord.com/developers/docs/resources/guild#get-guild-preview
Parameters
gGuild ID to retrieve
callbackFunction to call when the API call completes. On success the callback will contain a dpp::guild object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_get_prune_counts()

void dpp::cluster::guild_get_prune_counts ( snowflake  guild_id,
const struct prune pruneinfo,
command_completion_event_t  callback 
)

Get prune counts.

Returns a prune object indicating the number of members that would be removed in a prune operation. Requires the KICK_MEMBERS permission. By default, prune will not remove users with roles. You can optionally include specific roles in your prune by providing the include_roles parameter. Any inactive user that has a subset of the provided role(s) will be counted in the prune and users with additional roles will not.

See also
https://discord.com/developers/docs/resources/guild#get-guild-prune-count
Parameters
guild_idGuild ID to count for pruning
pruneinfoPruning info
callbackFunction to call when the API call completes. On success the callback will contain a dpp::prune object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_get_prune_counts_sync()

prune guild_get_prune_counts_sync ( snowflake  guild_id,
const struct prune pruneinfo 
)

Get prune counts.

Returns a prune object indicating the number of members that would be removed in a prune operation. Requires the KICK_MEMBERS permission. By default, prune will not remove users with roles. You can optionally include specific roles in your prune by providing the include_roles parameter. Any inactive user that has a subset of the provided role(s) will be counted in the prune and users with additional roles will not.

See also
dpp::cluster::guild_get_prune_counts
https://discord.com/developers/docs/resources/guild#get-guild-prune-count
Parameters
guild_idGuild ID to count for pruning
pruneinfoPruning info
Returns
prune returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_get_vanity()

void dpp::cluster::guild_get_vanity ( snowflake  guild_id,
command_completion_event_t  callback 
)

Get guild vanity url, if enabled.

Returns a partial dpp::invite object for guilds with that feature enabled. Requires the MANAGE_GUILD permission. code will be null if a vanity url for the guild is not set.

See also
https://discord.com/developers/docs/resources/guild#get-guild-vanity-url
Parameters
guild_idGuild to get vanity URL for
callbackFunction to call when the API call completes. On success the callback will contain a dpp::invite object in confirmation_callback_t::value filled to match the vanity url. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_get_vanity_sync()

invite guild_get_vanity_sync ( snowflake  guild_id)

Get guild vanity url, if enabled.

Returns a partial dpp::invite object for guilds with that feature enabled. Requires the MANAGE_GUILD permission. code will be null if a vanity url for the guild is not set.

See also
dpp::cluster::guild_get_vanity
https://discord.com/developers/docs/resources/guild#get-guild-vanity-url
Parameters
guild_idGuild to get vanity URL for
Returns
invite returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_get_voice_regions()

void dpp::cluster::guild_get_voice_regions ( snowflake  guild_id,
command_completion_event_t  callback 
)

Get guild voice regions.

Voice regions per guild are somewhat deprecated in preference of per-channel voice regions. Returns a list of voice region objects for the guild. Unlike the similar /voice route, this returns VIP servers when the guild is VIP-enabled.

See also
https://discord.com/developers/docs/resources/guild#get-guild-voice-regions
Parameters
guild_idGuild ID to get voice regions for
callbackFunction to call when the API call completes. On success the callback will contain a dpp::voiceregion_map object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_get_voice_regions_sync()

voiceregion_map guild_get_voice_regions_sync ( snowflake  guild_id)

Get guild voice regions.

Voice regions per guild are somewhat deprecated in preference of per-channel voice regions. Returns a list of voice region objects for the guild. Unlike the similar /voice route, this returns VIP servers when the guild is VIP-enabled.

See also
dpp::cluster::guild_get_voice_regions
https://discord.com/developers/docs/resources/guild#get-guild-voice-regions
Parameters
guild_idGuild ID to get voice regions for
Returns
voiceregion_map returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_get_widget()

void dpp::cluster::guild_get_widget ( snowflake  guild_id,
command_completion_event_t  callback 
)

Get guild widget.

Requires the MANAGE_GUILD permission.

See also
https://discord.com/developers/docs/resources/guild#get-guild-widget
Parameters
guild_idGuild ID to get widget for
callbackFunction to call when the API call completes. On success the callback will contain a dpp::guild_widget object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_get_widget_sync()

guild_widget guild_get_widget_sync ( snowflake  guild_id)

Get guild widget.

Requires the MANAGE_GUILD permission.

See also
dpp::cluster::guild_get_widget
https://discord.com/developers/docs/resources/guild#get-guild-widget
Parameters
guild_idGuild ID to get widget for
Returns
guild_widget returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_member_add_role()

void dpp::cluster::guild_member_add_role ( snowflake  guild_id,
snowflake  user_id,
snowflake  role_id,
command_completion_event_t  callback = utility::log_error() 
)

Add role to guild member.

Adds a role to a guild member. Requires the MANAGE_ROLES permission. Fires a Guild Member Update Gateway event.

See also
https://discord.com/developers/docs/resources/guild#add-guild-member-role
Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
Parameters
guild_idGuild ID to add a role to
user_idUser ID to add role to
role_idRole ID to add to the user
callbackFunction to call when the API call completes. On success the callback will contain a dpp::confirmation object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_member_add_role_sync()

confirmation guild_member_add_role_sync ( snowflake  guild_id,
snowflake  user_id,
snowflake  role_id 
)

Add role to guild member.

Adds a role to a guild member. Requires the MANAGE_ROLES permission. Fires a Guild Member Update Gateway event.

See also
dpp::cluster::guild_member_add_role
https://discord.com/developers/docs/resources/guild#add-guild-member-role
Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
Parameters
guild_idGuild ID to add a role to
user_idUser ID to add role to
role_idRole ID to add to the user
Returns
confirmation returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_member_delete()

void dpp::cluster::guild_member_delete ( snowflake  guild_id,
snowflake  user_id,
command_completion_event_t  callback = utility::log_error() 
)

Remove (kick) a guild member.

Remove a member from a guild. Requires KICK_MEMBERS permission. Fires a Guild Member Remove Gateway event.

See also
https://discord.com/developers/docs/resources/guild#remove-guild-member
Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
Deprecated:
Replaced by dpp::cluster::guild_member_kick
Parameters
guild_idGuild ID to kick member from
user_idUser ID to kick
callbackFunction to call when the API call completes. On success the callback will contain a dpp::confirmation object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_member_delete_role()

void dpp::cluster::guild_member_delete_role ( snowflake  guild_id,
snowflake  user_id,
snowflake  role_id,
command_completion_event_t  callback = utility::log_error() 
)

Remove role from guild member.

Removes a role from a guild member. Requires the MANAGE_ROLES permission. Fires a Guild Member Update Gateway event.

See also
https://discord.com/developers/docs/resources/guild#remove-guild-member-role
Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
Parameters
guild_idGuild ID to remove role from user on
user_idUser ID to remove role from
role_idRole to remove
callbackFunction to call when the API call completes. On success the callback will contain a dpp::confirmation object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_member_delete_role_sync()

confirmation guild_member_delete_role_sync ( snowflake  guild_id,
snowflake  user_id,
snowflake  role_id 
)

Remove role from guild member.

Removes a role from a guild member. Requires the MANAGE_ROLES permission. Fires a Guild Member Update Gateway event.

See also
dpp::cluster::guild_member_delete_role
https://discord.com/developers/docs/resources/guild#remove-guild-member-role
Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
Parameters
guild_idGuild ID to remove role from user on
user_idUser ID to remove role from
role_idRole to remove
Returns
confirmation returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_member_delete_sync()

confirmation guild_member_delete_sync ( snowflake  guild_id,
snowflake  user_id 
)

Remove (kick) a guild member.

Remove a member from a guild. Requires KICK_MEMBERS permission. Fires a Guild Member Remove Gateway event.

See also
dpp::cluster::guild_member_delete
https://discord.com/developers/docs/resources/guild#remove-guild-member
Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
Deprecated:
Replaced by dpp::cluster::guild_member_kick
Parameters
guild_idGuild ID to kick member from
user_idUser ID to kick
Returns
confirmation returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_member_kick()

void dpp::cluster::guild_member_kick ( snowflake  guild_id,
snowflake  user_id,
command_completion_event_t  callback = utility::log_error() 
)

Remove (kick) a guild member.

Remove a member from a guild. Requires KICK_MEMBERS permission. Fires a Guild Member Remove Gateway event.

See also
https://discord.com/developers/docs/resources/guild#remove-guild-member
Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
Parameters
guild_idGuild ID to kick member from
user_idUser ID to kick
callbackFunction to call when the API call completes. On success the callback will contain a dpp::confirmation object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_member_kick_sync()

confirmation guild_member_kick_sync ( snowflake  guild_id,
snowflake  user_id 
)

Remove (kick) a guild member.

Remove a member from a guild. Requires KICK_MEMBERS permission. Fires a Guild Member Remove Gateway event.

See also
dpp::cluster::guild_member_kick
https://discord.com/developers/docs/resources/guild#remove-guild-member
Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
Parameters
guild_idGuild ID to kick member from
user_idUser ID to kick
Returns
confirmation returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_member_move()

void dpp::cluster::guild_member_move ( const snowflake  channel_id,
const snowflake  guild_id,
const snowflake  user_id,
command_completion_event_t  callback = utility::log_error() 
)

Moves the guild member to a other voice channel, if member is connected to one.

Fires a Guild Member Update Gateway event.

Note
When moving members to channels, the API user must have permissions to both connect to the channel and have the MOVE_MEMBERS permission.
This method supports audit log reasons set by the cluster::set_audit_reason() method.
See also
https://discord.com/developers/docs/resources/guild#modify-guild-member
Parameters
channel_idId of the channel to which the user is used
guild_idGuild id to which the user is connected
user_idUser id, who should be moved
callbackFunction to call when the API call completes. On success the callback will contain a dpp::guild_member object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_member_move_sync()

guild_member guild_member_move_sync ( const snowflake  channel_id,
const snowflake  guild_id,
const snowflake  user_id 
)

Moves the guild member to a other voice channel, if member is connected to one.

Fires a Guild Member Update Gateway event.

Note
When moving members to channels, the API user must have permissions to both connect to the channel and have the MOVE_MEMBERS permission.
This method supports audit log reasons set by the cluster::set_audit_reason() method.
See also
dpp::cluster::guild_member_move
https://discord.com/developers/docs/resources/guild#modify-guild-member
Parameters
channel_idId of the channel to which the user is used
guild_idGuild id to which the user is connected
user_idUser id, who should be moved
Returns
guild_member returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_member_timeout()

void dpp::cluster::guild_member_timeout ( snowflake  guild_id,
snowflake  user_id,
time_t  communication_disabled_until,
command_completion_event_t  callback = utility::log_error() 
)

Set the timeout of a guild member.

Fires a Guild Member Update Gateway event.

See also
https://discord.com/developers/docs/resources/guild#modify-guild-member
Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
Parameters
guild_idGuild ID to timeout the member in
user_idUser ID to set the timeout for
communication_disabled_untilThe timestamp when the user's timeout will expire (up to 28 days in the future). Set to 0 to remove the timeout
callbackFunction to call when the API call completes. On success the callback will contain a dpp::confirmation object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_member_timeout_sync()

confirmation guild_member_timeout_sync ( snowflake  guild_id,
snowflake  user_id,
time_t  communication_disabled_until 
)

Set the timeout of a guild member.

Fires a Guild Member Update Gateway event.

See also
dpp::cluster::guild_member_timeout
https://discord.com/developers/docs/resources/guild#modify-guild-member
Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
Parameters
guild_idGuild ID to timeout the member in
user_idUser ID to set the timeout for
communication_disabled_untilThe timestamp when the user's timeout will expire (up to 28 days in the future). Set to 0 to remove the timeout
Returns
confirmation returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_modify_integration()

void dpp::cluster::guild_modify_integration ( snowflake  guild_id,
const class integration i,
command_completion_event_t  callback = utility::log_error() 
)

Modify guild integration.

Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
See also
https://discord.com/developers/docs/resources/guild#modify-guild-integration
Parameters
guild_idGuild ID to modify integration for
iIntegration to modify
callbackFunction to call when the API call completes. On success the callback will contain a dpp::integration object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_modify_integration_sync()

confirmation guild_modify_integration_sync ( snowflake  guild_id,
const class integration i 
)

Modify guild integration.

Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
See also
dpp::cluster::guild_modify_integration
https://discord.com/developers/docs/resources/guild#modify-guild-integration
Parameters
guild_idGuild ID to modify integration for
iIntegration to modify
Returns
confirmation returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_search_members()

void dpp::cluster::guild_search_members ( snowflake  guild_id,
const std::string &  query,
uint16_t  limit,
command_completion_event_t  callback 
)

Search for guild members based on whether their username or nickname starts with the given string.

Note
This endpoint is restricted according to whether the GUILD_MEMBERS Privileged Intent is enabled for your application.
See also
https://discord.com/developers/docs/resources/guild#search-guild-members
Parameters
guild_idGuild ID to search in
queryQuery string to match username(s) and nickname(s) against
limitmax number of members to return (1-1000)
callbackFunction to call when the API call completes. On success the callback will contain a dpp::guild_member_map object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_search_members_sync()

guild_member_map guild_search_members_sync ( snowflake  guild_id,
const std::string &  query,
uint16_t  limit 
)

Search for guild members based on whether their username or nickname starts with the given string.

Note
This endpoint is restricted according to whether the GUILD_MEMBERS Privileged Intent is enabled for your application.
See also
dpp::cluster::guild_search_members
https://discord.com/developers/docs/resources/guild#search-guild-members
Parameters
guild_idGuild ID to search in
queryQuery string to match username(s) and nickname(s) against
limitmax number of members to return (1-1000)
Returns
guild_member_map returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_set_nickname()

void dpp::cluster::guild_set_nickname ( snowflake  guild_id,
const std::string &  nickname,
command_completion_event_t  callback = utility::log_error() 
)

Change current user nickname.

Modifies the nickname of the current user in a guild. Fires a Guild Member Update Gateway event.

Deprecated:
Deprecated in favor of Modify Current Member. Will be replaced by dpp::cluster::guild_current_member_edit
Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
See also
https://discord.com/developers/docs/resources/guild#modify-current-user-nick
Parameters
guild_idGuild ID to change nickname on
nicknameNew nickname, or empty string to clear nickname
callbackFunction to call when the API call completes. On success the callback will contain a dpp::confirmation object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_set_nickname_sync()

confirmation guild_set_nickname_sync ( snowflake  guild_id,
const std::string &  nickname 
)

Change current user nickname.

Modifies the nickname of the current user in a guild. Fires a Guild Member Update Gateway event.

Deprecated:
Deprecated in favor of Modify Current Member. Will be replaced by dpp::cluster::guild_current_member_edit
Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
See also
dpp::cluster::guild_set_nickname
https://discord.com/developers/docs/resources/guild#modify-current-user-nick
Parameters
guild_idGuild ID to change nickname on
nicknameNew nickname, or empty string to clear nickname
Returns
confirmation returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_sticker_create()

void dpp::cluster::guild_sticker_create ( sticker s,
command_completion_event_t  callback = utility::log_error() 
)

Create a sticker in a guild.

Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
See also
https://discord.com/developers/docs/resources/sticker#create-guild-sticker
Parameters
sSticker to create. Must have its guild ID set.
callbackFunction to call when the API call completes. On success the callback will contain a dpp::sticker object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_sticker_create_sync()

sticker guild_sticker_create_sync ( sticker s)

Create a sticker in a guild.

Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
See also
dpp::cluster::guild_sticker_create
https://discord.com/developers/docs/resources/sticker#create-guild-sticker
Parameters
sSticker to create. Must have its guild ID set.
Returns
sticker returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_sticker_delete()

void dpp::cluster::guild_sticker_delete ( snowflake  sticker_id,
snowflake  guild_id,
command_completion_event_t  callback = utility::log_error() 
)

Delete a sticker from a guild.

Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
See also
https://discord.com/developers/docs/resources/sticker#delete-guild-sticker
Parameters
sticker_idsticker ID to delete
guild_idguild ID to delete from
callbackFunction to call when the API call completes. On success the callback will contain a dpp::sticker object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_sticker_delete_sync()

confirmation guild_sticker_delete_sync ( snowflake  sticker_id,
snowflake  guild_id 
)

Delete a sticker from a guild.

Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
See also
dpp::cluster::guild_sticker_delete
https://discord.com/developers/docs/resources/sticker#delete-guild-sticker
Parameters
sticker_idsticker ID to delete
guild_idguild ID to delete from
Returns
confirmation returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_sticker_get()

void dpp::cluster::guild_sticker_get ( snowflake  id,
snowflake  guild_id,
command_completion_event_t  callback 
)

Get a guild sticker.

See also
https://discord.com/developers/docs/resources/sticker#get-guild-sticker
Parameters
idId of sticker to get.
guild_idGuild ID of the guild where the sticker is
callbackFunction to call when the API call completes. On success the callback will contain a dpp::sticker object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_sticker_get_sync()

sticker guild_sticker_get_sync ( snowflake  id,
snowflake  guild_id 
)

Get a guild sticker.

See also
dpp::cluster::guild_sticker_get
https://discord.com/developers/docs/resources/sticker#get-guild-sticker
Parameters
idId of sticker to get.
guild_idGuild ID of the guild where the sticker is
Returns
sticker returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_sticker_modify()

void dpp::cluster::guild_sticker_modify ( sticker s,
command_completion_event_t  callback = utility::log_error() 
)

Modify a sticker in a guild.

Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
See also
https://discord.com/developers/docs/resources/sticker#modify-guild-sticker
Parameters
sSticker to modify. Must have its guild ID and sticker ID set.
callbackFunction to call when the API call completes. On success the callback will contain a dpp::sticker object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_sticker_modify_sync()

sticker guild_sticker_modify_sync ( sticker s)

Modify a sticker in a guild.

Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
See also
dpp::cluster::guild_sticker_modify
https://discord.com/developers/docs/resources/sticker#modify-guild-sticker
Parameters
sSticker to modify. Must have its guild ID and sticker ID set.
Returns
sticker returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_stickers_get()

void dpp::cluster::guild_stickers_get ( snowflake  guild_id,
command_completion_event_t  callback 
)

Get all guild stickers.

See also
https://discord.com/developers/docs/resources/sticker#get-guild-stickers
Parameters
guild_idGuild ID of the guild where the sticker is
callbackFunction to call when the API call completes. On success the callback will contain a dpp::sticker_map object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_stickers_get_sync()

sticker_map guild_stickers_get_sync ( snowflake  guild_id)

Get all guild stickers.

See also
dpp::cluster::guild_stickers_get
https://discord.com/developers/docs/resources/sticker#get-guild-stickers
Parameters
guild_idGuild ID of the guild where the sticker is
Returns
sticker_map returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_sync_integration()

void dpp::cluster::guild_sync_integration ( snowflake  guild_id,
snowflake  integration_id,
command_completion_event_t  callback = utility::log_error() 
)

Sync guild integration.

See also
https://discord.com/developers/docs/resources/guild#sync-guild-integration
Parameters
guild_idGuild ID to sync integration on
integration_idIntegration ID to synchronise
callbackFunction to call when the API call completes. On success the callback will contain a dpp::confirmation object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_sync_integration_sync()

confirmation guild_sync_integration_sync ( snowflake  guild_id,
snowflake  integration_id 
)

Sync guild integration.

See also
dpp::cluster::guild_sync_integration
https://discord.com/developers/docs/resources/guild#sync-guild-integration
Parameters
guild_idGuild ID to sync integration on
integration_idIntegration ID to synchronise
Returns
confirmation returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_template_create()

void dpp::cluster::guild_template_create ( snowflake  guild_id,
const std::string &  name,
const std::string &  description,
command_completion_event_t  callback 
)

Creates a template for the guild.

See also
https://discord.com/developers/docs/resources/guild-template#create-guild-template
Parameters
guild_idGuild to create template from
nameTemplate name to create
descriptionDescription of template to create
callbackFunction to call when the API call completes. On success the callback will contain a dpp::dtemplate object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_template_create_sync()

dtemplate guild_template_create_sync ( snowflake  guild_id,
const std::string &  name,
const std::string &  description 
)

Creates a template for the guild.

See also
dpp::cluster::guild_template_create
https://discord.com/developers/docs/resources/guild-template#create-guild-template
Parameters
guild_idGuild to create template from
nameTemplate name to create
descriptionDescription of template to create
Returns
dtemplate returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_template_delete()

void dpp::cluster::guild_template_delete ( snowflake  guild_id,
const std::string &  code,
command_completion_event_t  callback = utility::log_error() 
)

Deletes the template.

See also
https://discord.com/developers/docs/resources/guild-template#delete-guild-template
Parameters
guild_idGuild ID of template to delete
codeTemplate code to delete
callbackFunction to call when the API call completes. On success the callback will contain a dpp::confirmation object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_template_delete_sync()

confirmation guild_template_delete_sync ( snowflake  guild_id,
const std::string &  code 
)

Deletes the template.

See also
dpp::cluster::guild_template_delete
https://discord.com/developers/docs/resources/guild-template#delete-guild-template
Parameters
guild_idGuild ID of template to delete
codeTemplate code to delete
Returns
confirmation returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_template_modify()

void dpp::cluster::guild_template_modify ( snowflake  guild_id,
const std::string &  code,
const std::string &  name,
const std::string &  description,
command_completion_event_t  callback = utility::log_error() 
)

Modifies the template's metadata.

See also
https://discord.com/developers/docs/resources/guild-template#modify-guild-template
Parameters
guild_idGuild ID of template to modify
codeTemplate code to modify
nameNew name of template
descriptionNew description of template
callbackFunction to call when the API call completes. On success the callback will contain a dpp::dtemplate object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_template_modify_sync()

dtemplate guild_template_modify_sync ( snowflake  guild_id,
const std::string &  code,
const std::string &  name,
const std::string &  description 
)

Modifies the template's metadata.

See also
dpp::cluster::guild_template_modify
https://discord.com/developers/docs/resources/guild-template#modify-guild-template
Parameters
guild_idGuild ID of template to modify
codeTemplate code to modify
nameNew name of template
descriptionNew description of template
Returns
dtemplate returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_template_sync()

void dpp::cluster::guild_template_sync ( snowflake  guild_id,
const std::string &  code,
command_completion_event_t  callback = utility::log_error() 
)

Syncs the template to the guild's current state.

See also
https://discord.com/developers/docs/resources/guild-template#sync-guild-template
Parameters
guild_idGuild to synchronise template for
codeCode of template to synchronise
callbackFunction to call when the API call completes. On success the callback will contain a dpp::dtemplate object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_template_sync_sync()

dtemplate guild_template_sync_sync ( snowflake  guild_id,
const std::string &  code 
)

Syncs the template to the guild's current state.

See also
dpp::cluster::guild_template_sync
https://discord.com/developers/docs/resources/guild-template#sync-guild-template
Parameters
guild_idGuild to synchronise template for
codeCode of template to synchronise
Returns
dtemplate returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ guild_templates_get()

void dpp::cluster::guild_templates_get ( snowflake  guild_id,
command_completion_event_t  callback 
)

Get guild templates.

See also
https://discord.com/developers/docs/resources/guild-template#get-guild-templates
Parameters
guild_idGuild ID to get templates for
callbackFunction to call when the API call completes. On success the callback will contain a dpp::dtemplate_map object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ guild_templates_get_sync()

dtemplate_map guild_templates_get_sync ( snowflake  guild_id)

Get guild templates.

See also
dpp::cluster::guild_templates_get
https://discord.com/developers/docs/resources/guild-template#get-guild-templates
Parameters
guild_idGuild ID to get templates for
Returns
dtemplate_map returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ interaction_followup_create()

void dpp::cluster::interaction_followup_create ( const std::string &  token,
const message m,
command_completion_event_t  callback 
)

Create a followup message to a slash command.

Parameters
tokenToken for the interaction webhook
mfollowup message to create
callbackFunction to call when the API call completes. On success the callback will contain a dpp::confirmation object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ interaction_followup_create_sync()

confirmation interaction_followup_create_sync ( const std::string &  token,
const message m 
)

Create a followup message to a slash command.

Parameters
tokenToken for the interaction webhook
mfollowup message to create
Returns
confirmation returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ interaction_followup_delete()

void dpp::cluster::interaction_followup_delete ( const std::string &  token,
command_completion_event_t  callback = utility::log_error() 
)
Parameters
tokenToken for the interaction webhook
callbackFunction to call when the API call completes. On success the callback will contain a dpp::confirmation object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ interaction_followup_delete_sync()

confirmation interaction_followup_delete_sync ( const std::string &  token)
Parameters
tokenToken for the interaction webhook
Returns
confirmation returned object on completion
Exceptions
dpp::rest_exceptionupon failure to execute REST function
Warning
This function is a blocking (synchronous) call and should only be used from within a separate thread. Avoid direct use of this function inside an event handler.

◆ interaction_followup_edit()

void dpp::cluster::interaction_followup_edit ( const std::string &  token,
const message m,
command_completion_event_t  callback = utility::log_error() 
)

Edit followup message to a slash command The message ID in the message you pass should be correctly set to that of a followup message you previously sent.

Parameters
tokenToken for the interaction webhook
mmessage to edit, the ID should be set
callbackFunction to call when the API call completes. On success the callback will contain a dpp::confirmation object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().

◆ interaction_followup_edit_original()

void dpp::cluster::interactio