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})
 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...
 
 ~cluster ()
 Destroy the cluster object. 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...
 
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. Returns once all shards are connected. 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...
 
event_handle on_voice_state_update (std::function< void(const voice_state_update_t &_event)> _voice_state_update)
 on voice state update event More...
 
bool detach_voice_state_update (const event_handle _voice_state_update)
 Detach listener from on_voice_state_update event. More...
 
event_handle on_voice_client_disconnect (std::function< void(const voice_client_disconnect_t &_event)> _voice_client_disconnect)
 on voice client disconnect event More...
 
bool detach_voice_client_disconnect (const event_handle _voice_client_disconnect)
 Detach listener from on_voice_client_disconnect event. More...
 
event_handle on_voice_client_speaking (std::function< void(const voice_client_speaking_t &_event)> _voice_client_speaking)
 on voice client speaking event More...
 
bool detach_voice_client_speaking (const event_handle _voice_client_speaking)
 Detach listener from on_voice_client_speaking event. More...
 
event_handle on_log (std::function< void(const log_t &_event)> _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...
 
bool detach_log (const event_handle _log)
 Detach listener from on_log event. More...
 
event_handle on_guild_join_request_delete (std::function< void(const guild_join_request_delete_t &_event)> _guild_join_request_delete)
 on guild join request delete. Triggered when a user declines the membership screening questionnaire for a guild. More...
 
bool detach_guild_join_request_delete (const event_handle _guild_join_request_delete)
 Detach listener from on_guild_join_request_delete event. More...
 
event_handle on_interaction_create (std::function< void(const interaction_create_t &_event)> _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...
 
bool detach_interaction_create (const event_handle _interaction_create)
 Detach listener from on_interaction_create event. More...
 
event_handle on_button_click (std::function< void(const button_click_t &_event)> _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...
 
bool detach_button_click (const event_handle _button_click)
 Detach listener from on_button_click event. More...
 
event_handle on_autocomplete (std::function< void(const autocomplete_t &_event)> _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...
 
bool detach_autocomplete (const event_handle _autocomplete)
 Detach listener from on_autocomplete event. More...
 
event_handle on_select_click (std::function< void(const select_click_t &_event)> _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...
 
bool detach_select_click (const event_handle _select_click)
 Detach listener from on_select_click event. More...
 
event_handle on_guild_delete (std::function< void(const guild_delete_t &_event)> _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 unavaialble due to an outage. More...
 
bool detach_guild_delete (const event_handle _guild_delete)
 Detach listener from on_guild_delete event. More...
 
event_handle on_channel_delete (std::function< void(const channel_delete_t &_event)> _channel_delete)
 Called when a channel is deleted from a guild. The channel will still be temporarily avaialble in the cache. Pointers to the channel should not be retained long-term as they will be deleted by the garbage collector. More...
 
bool detach_channel_delete (const event_handle _channel_delete)
 Detach listener from on_channel_delete event. More...
 
event_handle on_channel_update (std::function< void(const channel_update_t &_event)> _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...
 
bool detach_channel_update (const event_handle _channel_update)
 Detach listener from on_channel_update event. More...
 
event_handle on_ready (std::function< void(const ready_t &_event)> _ready)
 Called when a shard is connected and ready. A set of on_guild_create events will follow this event. More...
 
bool detach_ready (const event_handle _ready)
 Detach listener from on_ready event. More...
 
event_handle on_message_delete (std::function< void(const message_delete_t &_event)> _message_delete)
 Called when a message is deleted. The message has already been deleted from Discord when you receive this event. More...
 
bool detach_message_delete (const event_handle _message_delete)
 Detach listener from on_message_delete event. More...
 
event_handle on_application_command_delete (std::function< void(const application_command_delete_t &_event)> _application_command_delete)
 Called when an application command (slash command) is deleted. More...
 
bool detach_application_command_delete (const event_handle _application_command_delete)
 Detach listener from on_application_command_delete event. More...
 
event_handle on_guild_member_remove (std::function< void(const guild_member_remove_t &_event)> _guild_member_remove)
 Called when a user leaves a guild (either through being kicked, or choosing to leave) More...
 
bool detach_guild_member_remove (const event_handle _guild_member_remove)
 Detach listener from on_guild_member_remove event. More...
 
event_handle on_application_command_create (std::function< void(const application_command_create_t &_event)> _application_command_create)
 Called when a new application command (slash command) is registered. More...
 
bool detach_application_command_create (const event_handle _application_command_create)
 Detach listener from on_application_command_create event. More...
 
event_handle on_resumed (std::function< void(const resumed_t &_event)> _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...
 
bool detach_resumed (const event_handle _resumed)
 Detach listener from on_resumed event. More...
 
event_handle on_guild_role_create (std::function< void(const guild_role_create_t &_event)> _guild_role_create)
 Called when a new role is created on a guild. More...
 
bool detach_guild_role_create (const event_handle _guild_role_create)
 Detach listener from on_guild_role_create event. More...
 
event_handle on_typing_start (std::function< void(const typing_start_t &_event)> _typing_start)
 Called when a user is typing on a channel. More...
 
bool detach_typing_start (const event_handle _typing_start)
 Detach listener from on_typing_start event. More...
 
event_handle on_message_reaction_add (std::function< void(const message_reaction_add_t &_event)> _message_reaction_add)
 Called when a new reaction is added to a message. More...
 
bool detach_message_reaction_add (const event_handle _message_reaction_add)
 Detach listener from on_message_reaction_add event. More...
 
event_handle on_guild_members_chunk (std::function< void(const guild_members_chunk_t &_event)> _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...
 
bool detach_guild_members_chunk (const event_handle _guild_members_chunk)
 Detach listener from on_guild_members_chunk event. More...
 
event_handle on_message_reaction_remove (std::function< void(const message_reaction_remove_t &_event)> _message_reaction_remove)
 Called when a single reaction is removed from a message. More...
 
bool detach_message_reaction_remove (const event_handle _message_reaction_remove)
 Detach listener from on_message_reaction_remove event. More...
 
event_handle on_guild_create (std::function< void(const guild_create_t &_event)> _guild_create)
 Called when a new guild is created. D++ will request members for the guild for its cache using guild_members_chunk. More...
 
bool detach_guild_create (const event_handle _guild_create)
 Detach listener from on_guild_create event. More...
 
event_handle on_channel_create (std::function< void(const channel_create_t &_event)> _channel_create)
 Called when a new channel is created on a guild. More...
 
bool detach_channel_create (const event_handle _channel_create)
 Detach listener from on_channel_create event. More...
 
event_handle on_message_reaction_remove_emoji (std::function< void(const message_reaction_remove_emoji_t &_event)> _message_reaction_remove_emoji)
 Called when all reactions for a particular emoji are removed from a message. More...
 
bool detach_message_reaction_remove_emoji (const event_handle _message_reaction_remove_emoji)
 Detach listener from on_message_reaction_remove_emoji event. More...
 
event_handle on_message_delete_bulk (std::function< void(const message_delete_bulk_t &_event)> _message_delete_bulk)
 Called when multiple messages are deleted from a channel or DM. More...
 
bool detach_message_delete_bulk (const event_handle _message_delete_bulk)
 Detach listener from on_message_delete_bulk event. More...
 
event_handle on_guild_role_update (std::function< void(const guild_role_update_t &_event)> _guild_role_update)
 Called when an existing role is updated on a guild. More...
 
bool detach_guild_role_update (const event_handle _guild_role_update)
 Detach listener from on_guild_role_update event. More...
 
event_handle on_guild_role_delete (std::function< void(const guild_role_delete_t &_event)> _guild_role_delete)
 Called when a role is deleted in a guild. More...
 
bool detach_guild_role_delete (const event_handle _guild_role_delete)
 Detach listener from on_guild_role_delete event. More...
 
event_handle on_channel_pins_update (std::function< void(const channel_pins_update_t &_event)> _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...
 
bool detach_channel_pins_update (const event_handle _channel_pins_update)
 Detach listener from on_channel_pins_update event. More...
 
event_handle on_message_reaction_remove_all (std::function< void(const message_reaction_remove_all_t &_event)> _message_reaction_remove_all)
 Called when all reactions are removed from a message. More...
 
bool detach_message_reaction_remove_all (const event_handle _message_reaction_remove_all)
 Detach listener from on_message_reaction_remove_all event. More...
 
event_handle on_voice_server_update (std::function< void(const voice_server_update_t &_event)> _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...
 
bool detach_voice_server_update (const event_handle _voice_server_update)
 Detach listener from on_voice_server_update event. More...
 
event_handle on_guild_emojis_update (std::function< void(const guild_emojis_update_t &_event)> _guild_emojis_update)
 Called when new emojis are added to a guild. The complete set of emojis is sent every time. More...
 
bool detach_guild_emojis_update (const event_handle _guild_emojis_update)
 Detach listener from on_guild_emojis_update event. More...
 
event_handle on_guild_stickers_update (std::function< void(const guild_stickers_update_t &_event)> _guild_stickers_update)
 Called when new stickers are added to a guild. The complete set of stickers is sent every time. More...
 
bool detach_guild_stickers_update (const event_handle _guild_stickers_update)
 Detach listener from on_guild_stickers_update event. More...
 
event_handle on_presence_update (std::function< void(const presence_update_t &_event)> _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...
 
bool detach_presence_update (const event_handle _presence_update)
 Detach listener from on_presence_update event. More...
 
event_handle on_webhooks_update (std::function< void(const webhooks_update_t &_event)> _webhooks_update)
 Called when the webhooks for a guild are updated. More...
 
bool detach_webhooks_update (const event_handle _webhooks_update)
 Detach listener from on_webhooks_update event. More...
 
event_handle on_guild_member_add (std::function< void(const guild_member_add_t &_event)> _guild_member_add)
 Called when a new member joins a guild. More...
 
bool detach_guild_member_add (const event_handle _guild_member_add)
 Detach listener from on_guild_member_add event. More...
 
event_handle on_invite_delete (std::function< void(const invite_delete_t &_event)> _invite_delete)
 Called when an invite is deleted from a guild. More...
 
bool detach_invite_delete (const event_handle _invite_delete)
 Detach listener from on_invite_delete event. More...
 
event_handle on_guild_update (std::function< void(const guild_update_t &_event)> _guild_update)
 Called when details of a guild are updated. More...
 
bool detach_guild_update (const event_handle _guild_update)
 Detach listener from on_guild_update event. More...
 
event_handle on_guild_integrations_update (std::function< void(const guild_integrations_update_t &_event)> _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...
 
bool detach_guild_integrations_update (const event_handle _guild_integrations_update)
 Detach listener from on_guild_integrations_update event. More...
 
event_handle on_guild_member_update (std::function< void(const guild_member_update_t &_event)> _guild_member_update)
 Called when details of a guild member (e.g. their roles or nickname) are updated. More...
 
bool detach_guild_member_update (const event_handle _guild_member_update)
 Detach listener from on_guild_member_update event. More...
 
event_handle on_application_command_update (std::function< void(const application_command_update_t &_event)> _application_command_update)
 Called when an application command (slash command) is updated. You will only receive this event for application commands that belong to your bot/application. More...
 
bool detach_application_command_update (const event_handle _application_command_update)
 Detach listener from on_application_command_update event. More...
 
event_handle on_invite_create (std::function< void(const invite_create_t &_event)> _invite_create)
 Called when a new invite is created for a guild. More...
 
bool detach_invite_create (const event_handle _invite_create)
 Detach listener from on_invite_create event. More...
 
event_handle on_message_update (std::function< void(const message_update_t &_event)> _message_update)
 Called when a message is updated (edited). More...
 
bool detach_message_update (const event_handle _message_update)
 Detach listener from on_message_update event. More...
 
event_handle on_user_update (std::function< void(const user_update_t &_event)> _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...
 
bool detach_user_update (const event_handle _user_update)
 Detach listener from on_user_update event. More...
 
event_handle on_message_create (std::function< void(const message_create_t &_event)> _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...
 
bool detach_message_create (const event_handle _message_create)
 Detach listener from on_message_create event. More...
 
event_handle on_guild_ban_add (std::function< void(const guild_ban_add_t &_event)> _guild_ban_add)
 Called when a ban is added to a guild. More...
 
bool detach_guild_ban_add (const event_handle _guild_ban_add)
 Detach listener from on_guild_ban_add event. More...
 
event_handle on_guild_ban_remove (std::function< void(const guild_ban_remove_t &_event)> _guild_ban_remove)
 Called when a ban is removed from a guild. More...
 
bool detach_guild_ban_remove (const event_handle _guild_ban_remove)
 Detach listener from on_guild_ban_remove event. More...
 
event_handle on_integration_create (std::function< void(const integration_create_t &_event)> _integration_create)
 Called when a new intgration 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...
 
bool detach_integration_create (const event_handle _integration_create)
 Detach listener from on_integration_create event. More...
 
event_handle on_integration_update (std::function< void(const integration_update_t &_event)> _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...
 
bool detach_integration_update (const event_handle _integration_update)
 Detach listener from on_integration_update event. More...
 
event_handle on_integration_delete (std::function< void(const integration_delete_t &_event)> _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...
 
bool detach_integration_delete (const event_handle _integration_delete)
 Detach listener from on_integration_delete event. More...
 
event_handle on_thread_create (std::function< void(const thread_create_t &_event)> _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...
 
bool detach_thread_create (const event_handle _thread_create)
 Detach listener from on_thread_create event. More...
 
event_handle on_thread_update (std::function< void(const thread_update_t &_event)> _thread_update)
 Called when a thread is updated. More...
 
bool detach_thread_update (const event_handle _thread_update)
 Detach listener from on_thread_update event. More...
 
event_handle on_thread_delete (std::function< void(const thread_delete_t &_event)> _thread_delete)
 Called when a thread is deleted. More...
 
bool detach_thread_delete (const event_handle _thread_delete)
 Detach listener from on_thread_delete event. More...
 
event_handle on_thread_list_sync (std::function< void(const thread_list_sync_t &_event)> _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...
 
bool detach_thread_list_sync (const event_handle _thread_list_sync)
 Detach listener from on_thread_list_sync event. More...
 
event_handle on_thread_member_update (std::function< void(const thread_member_update_t &_event)> _thread_member_update)
 Called when current user's thread member object is updated. More...
 
bool detach_thread_member_update (const event_handle _thread_member_update)
 Detach listener from on_thread_member_update event. More...
 
event_handle on_thread_members_update (std::function< void(const thread_members_update_t &_event)> _thread_members_update)
 Called when a thread's member list is updated (without GUILD_MEMBERS intent, is only called for current user) More...
 
bool detach_thread_members_update (const event_handle _thread_members_update)
 Detach listener from on_thread_members_update event. More...
 
event_handle on_voice_buffer_send (std::function< void(const voice_buffer_send_t &_event)> _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...
 
bool detach_voice_buffer_send (const event_handle _voice_buffer_send)
 Detach listener from on_voice_buffer_send event. More...
 
event_handle on_voice_user_talking (std::function< void(const voice_user_talking_t &_event)> _voice_user_talking)
 Called when a user is talking on a voice channel. More...
 
bool detach_voice_user_talking (const event_handle _voice_user_talking)
 Detach listener from on_voice_user_talking event. More...
 
event_handle on_voice_ready (std::function< void(const voice_ready_t &_event)> _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...
 
bool detach_voice_ready (const event_handle _voice_ready)
 Detach listener from on_voice_ready event. More...
 
event_handle on_voice_receive (std::function< void(const voice_receive_t &_event)> _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...
 
bool detach_voice_receive (const event_handle _voice_receive)
 Detach listener from on_voice_receive event. More...
 
event_handle on_voice_track_marker (std::function< void(const voice_track_marker_t &_event)> _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...
 
bool detach_voice_track_marker (const event_handle _voice_track_marker)
 Detach listener from on_voice_track_marker event. More...
 
event_handle on_stage_instance_create (std::function< void(const stage_instance_create_t &_event)> _stage_instance_create)
 Called when a new stage instance is created on a stage channel. More...
 
bool detach_stage_instance_create (const event_handle _stage_instance_create)
 Detach listener from on_stage_instance_create event. More...
 
event_handle on_stage_instance_update (std::function< void(const stage_instance_update_t &_event)> _stage_instance_update)
 Called when a stage instance is updated. More...
 
bool detach_stage_instance_update (const event_handle _stage_instance_update)
 Detach listener from on_stage_instance_update event. More...
 
event_handle on_stage_instance_delete (std::function< void(const stage_instance_delete_t &_event)> _stage_instance_delete)
 Called when an existing stage instance is deleted from a stage channel. More...
 
bool detach_stage_instance_delete (const event_handle _stage_instance_delete)
 Detach listener from on_stage_instance_delete event. 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 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 asnyncronous 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={})
 Respond to a slash command. More...
 
void interaction_response_edit (const std::string &token, const message &r, command_completion_event_t callback={})
 Respond to a slash command. More...
 
void global_command_create (const slashcommand &s, command_completion_event_t callback={})
 Create a global slash command (a bot can have a maximum of 100 of these). 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={})
 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={})
 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={})
 Create/overwrite global slash commands. Any existing global slash commands will be deletd and replaced with these. More...
 
void global_command_edit (const slashcommand &s, command_completion_event_t callback={})
 Edit a global slash command (a bot can have a maximum of 100 of these) More...
 
void guild_command_edit (const slashcommand &s, snowflake guild_id, command_completion_event_t callback={})
 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={})
 Edit slash command permissions local to a guild, permissions are read from s.permissions. More...
 
void global_command_delete (snowflake id, command_completion_event_t callback={})
 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={})
 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 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={})
 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, snowflake limit, command_completion_event_t callback)
 Get multiple messages. More...
 
void message_create (const struct message &m, command_completion_event_t callback={})
 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={})
 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={})
 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={})
 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={})
 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={})
 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={})
 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={})
 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={})
 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={})
 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={})
 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={})
 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={})
 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={})
 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={})
 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={})
 Create a channel. More...
 
void channel_edit (const class channel &c, command_completion_event_t callback={})
 Edit a channel. More...
 
void channel_edit_position (const class channel &c, command_completion_event_t callback={})
 Edit a channel's position. More...
 
void channel_edit_permissions (const class channel &c, snowflake overwrite_id, uint32_t allow, uint32_t deny, bool member, command_completion_event_t callback={})
 Edit a channel's permissions. More...
 
void channel_delete (snowflake channel_id, command_completion_event_t callback={})
 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={})
 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={})
 Create invite for a channel. More...
 
void 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={})
 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={})
 Removes a recipient from a Group DM. More...
 
void channel_delete_permission (const class channel &c, snowflake overwrite_id, command_completion_event_t callback={})
 Remove a permission from a channel. More...
 
void channel_follow_news (const class channel &c, snowflake target_channel_id, command_completion_event_t callback={})
 Follow a news channel. More...
 
void channel_typing (const class channel &c, command_completion_event_t callback={})
 Trigger channel typing indicator. More...
 
void channel_typing (snowflake cid, command_completion_event_t callback={})
 Trigger channel typing indicator. More...
 
void message_pin (snowflake channel_id, snowflake message_id, command_completion_event_t callback={})
 Pin a message. More...
 
void message_unpin (snowflake channel_id, snowflake message_id, command_completion_event_t callback={})
 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={})
 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={})
 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={})
 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={})
 Change current user nickname. More...
 
void guild_member_add_role (snowflake guild_id, snowflake user_id, snowflake role_id, command_completion_event_t callback={})
 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={})
 Remove role from guild member. More...
 
void guild_member_delete (snowflake guild_id, snowflake user_id, command_completion_event_t callback={})
 Remove (kick) 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={})
 Add guild ban. More...
 
void guild_ban_delete (snowflake guild_id, snowflake user_id, command_completion_event_t callback={})
 Delete guild ban. More...
 
void guild_get_bans (snowflake guild_id, 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={})
 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={})
 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={})
 Modifies the template's metadata. More...
 
void guild_template_delete (snowflake guild_id, const std::string &code, command_completion_event_t callback={})
 Deletes the template. More...
 
void guild_create (const class guild &g, command_completion_event_t callback={})
 Create a guild. More...
 
void guild_edit (const class guild &g, command_completion_event_t callback={})
 Edit a guild. More...
 
void guild_delete (snowflake guild_id, command_completion_event_t callback={})
 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={})
 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={})
 Edit a single emoji. You must ensure that the emoji passed contained image data using the emoji::load_image() method. More...
 
void guild_emoji_delete (snowflake guild_id, snowflake emoji_id, command_completion_event_t callback={})
 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={})
 Begin guild prune. More...
 
void 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. More...
 
void get_guild_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 itegrations. More...
 
void guild_modify_integration (snowflake guild_id, const class integration &i, command_completion_event_t callback={})
 Modify guild integration. More...
 
void guild_delete_integration (snowflake guild_id, snowflake integration_id, command_completion_event_t callback={})
 Delete guild integration. More...
 
void guild_sync_integration (snowflake guild_id, snowflake integration_id, command_completion_event_t callback={})
 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={})
 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={})
 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={})
 Edit webhook. More...
 
void edit_webhook_with_token (const class webhook &wh, command_completion_event_t callback={})
 Edit webhook with token (token is encapsulated in the webhook object) More...
 
void delete_webhook (snowflake webhook_id, command_completion_event_t callback={})
 Delete a webhook. More...
 
void delete_webhook_with_token (snowflake webhook_id, const std::string &token, command_completion_event_t callback={})
 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={})
 Execute webhook. More...
 
void get_webhook_message (const class webhook &wh, command_completion_event_t callback={})
 Get webhook message. More...
 
void edit_webhook_message (const class webhook &wh, const struct message &m, command_completion_event_t callback={})
 Edit webhook message. More...
 
void delete_webhook_message (const class webhook &wh, snowflake message_id, command_completion_event_t callback={})
 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={})
 Create a role on a guild. More...
 
void role_edit (const class role &r, command_completion_event_t callback={})
 Edit a role on a guild. More...
 
void role_edit_position (const class role &r, command_completion_event_t callback={})
 Edit a role's position in a guild. More...
 
void role_delete (snowflake guild_id, snowflake role_id, command_completion_event_t callback={})
 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 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={})
 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={})
 Create a dm channel. More...
 
void current_user_leave_guild (snowflake guild_id, command_completion_event_t callback={})
 Leave a guild. More...
 
void thread_create (const std::string &thread_name, snowflake channel_id, uint16_t auto_archive_duration, channel_type thread_type, command_completion_event_t callback={})
 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, command_completion_event_t callback={})
 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={})
 Join a thread. More...
 
void current_user_leave_thread (snowflake thread_id, command_completion_event_t callback={})
 Leave a thread. More...
 
void thread_member_add (snowflake thread_id, snowflake user_id, command_completion_event_t callback={})
 Add a member to a thread. More...
 
void thread_member_remove (snowflake thread_id, snowflake user_id, command_completion_event_t callback={})
 Remove a member from a thread. More...
 
void get_thread_member (const snowflake thread_id, const snowflake user_id, command_completion_event_t callback)
 Get a thread member. More...
 
void get_thread_members (snowflake thread_id, command_completion_event_t callback)
 Get members of a thread. More...
 
void get_active_threads (snowflake channel_id, command_completion_event_t callback)
 Get active threads in a channel (Sorted by ID in descending order) More...
 
void get_public_archived_threads (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 get_private_archived_threads (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 get_joined_private_archived_threads (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={})
 Create a sticker in a guild. More...
 
void guild_sticker_modify (sticker &s, command_completion_event_t callback={})
 Modify a sticker in a guild. More...
 
void guild_sticker_delete (snowflake sticker_id, snowflake guild_id, command_completion_event_t callback={})
 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={})
 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={})
 Edit a stage instance. More...
 
void stage_instance_delete (const snowflake channel_id, command_completion_event_t callback={})
 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...
 

Public Attributes

std::string token
 
time_t last_identify
 
uint32_t intents
 
uint32_t numshards
 
uint32_t cluster_id
 
uint32_t maxclusters
 
double rest_ping
 
dpp::dispatcher dispatch
 
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...
 

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} 
)

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)

◆ 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()

dpp::cluster::~cluster ( )

Destroy the cluster object.

Member Function Documentation

◆ channel_create()

void dpp::cluster::channel_create ( const class channel c,
command_completion_event_t  callback = {} 
)

Create a channel.

Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
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_delete()

void dpp::cluster::channel_delete ( snowflake  channel_id,
command_completion_event_t  callback = {} 
)

Delete a channel.

Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
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 = {} 
)

Remove a permission from a channel.

Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
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_edit()

void dpp::cluster::channel_edit ( const class channel c,
command_completion_event_t  callback = {} 
)

Edit a channel.

Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
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()

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

Edit a channel's permissions.

Parameters
cChannel to set permissions for
overwrite_idOverwrite to change (a user or channel 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_position()

void dpp::cluster::channel_edit_position ( const class channel c,
command_completion_event_t  callback = {} 
)

Edit a channel's position.

Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
Parameters
cChannel to change the position for
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_follow_news()

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

Follow a 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_get()

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

Get a 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_invite_create()

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

Create invite for a channel.

Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
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_invites_get()

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

Get invites for a channel.

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_typing() [1/2]

void dpp::cluster::channel_typing ( const class channel c,
command_completion_event_t  callback = {} 
)

Trigger channel 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 = {} 
)

Trigger channel 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.

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().

◆ 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 = {} 
)

Create a dm channel.

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_webhook()

void dpp::cluster::create_webhook ( const class webhook w,
command_completion_event_t  callback = {} 
)

Create a 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().

◆ current_application_get()

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

Get current (bot) application.

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_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.

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_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 = {} 
)

Edit current (bot) 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().

◆ current_user_get()

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

Get current (bot) user.

Parameters
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().

◆ 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_guilds()

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

Get current (bot) 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_join_thread()

void dpp::cluster::current_user_join_thread ( snowflake  thread_id,
command_completion_event_t  callback = {} 
)

Join a 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_leave_guild()

void dpp::cluster::current_user_leave_guild ( snowflake  guild_id,
command_completion_event_t  callback = {} 
)

Leave a 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_thread()

void dpp::cluster::current_user_leave_thread ( snowflake  thread_id,
command_completion_event_t  callback = {} 
)

Leave a 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().

◆ delete_webhook()

void dpp::cluster::delete_webhook ( snowflake  webhook_id,
command_completion_event_t  callback = {} 
)

Delete a 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 = {} 
)

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_with_token()

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

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().

◆ detach_application_command_create()

bool dpp::cluster::detach_application_command_create ( const event_handle  _application_command_create)

Detach listener from on_application_command_create event.

Parameters
_application_command_createHandle to remove from event, previously returned by dpp::cluster::on_application_command_create()
Returns
true on successful detach of listener

◆ detach_application_command_delete()

bool dpp::cluster::detach_application_command_delete ( const event_handle  _application_command_delete)

Detach listener from on_application_command_delete event.

Parameters
_application_command_deleteHandle to remove from event, previously returned by dpp::cluster::on_application_command_delete()
Returns
true on successful detach of listener

◆ detach_application_command_update()

bool dpp::cluster::detach_application_command_update ( const event_handle  _application_command_update)

Detach listener from on_application_command_update event.

Parameters
_application_command_updateHandle to remove from event, previously returned by dpp::cluster::on_application_command_update()
Returns
true on successful detach of listener

◆ detach_autocomplete()

bool dpp::cluster::detach_autocomplete ( const event_handle  _autocomplete)

Detach listener from on_autocomplete event.

Parameters
_autocompleteHandle to remove from event, previously returned by dpp::cluster::on_autocomplete()
Returns
true on successful detach of listener

◆ detach_button_click()

bool dpp::cluster::detach_button_click ( const event_handle  _button_click)

Detach listener from on_button_click event.

Parameters
_button_clickHandle to remove from event, previously returned by dpp::cluster::on_button_click()
Returns
true on successful detach of listener

◆ detach_channel_create()

bool dpp::cluster::detach_channel_create ( const event_handle  _channel_create)

Detach listener from on_channel_create event.

Parameters
_channel_createHandle to remove from event, previously returned by dpp::cluster::on_channel_create()
Returns
true on successful detach of listener

◆ detach_channel_delete()

bool dpp::cluster::detach_channel_delete ( const event_handle  _channel_delete)

Detach listener from on_channel_delete event.

Parameters
_channel_deleteHandle to remove from event, previously returned by dpp::cluster::on_channel_delete()
Returns
true on successful detach of listener

◆ detach_channel_pins_update()

bool dpp::cluster::detach_channel_pins_update ( const event_handle  _channel_pins_update)

Detach listener from on_channel_pins_update event.

Parameters
_channel_pins_updateHandle to remove from event, previously returned by dpp::cluster::on_channel_pins_update()
Returns
true on successful detach of listener

◆ detach_channel_update()

bool dpp::cluster::detach_channel_update ( const event_handle  _channel_update)

Detach listener from on_channel_update event.

Parameters
_channel_updateHandle to remove from event, previously returned by dpp::cluster::on_channel_update()
Returns
true on successful detach of listener

◆ detach_guild_ban_add()

bool dpp::cluster::detach_guild_ban_add ( const event_handle  _guild_ban_add)

Detach listener from on_guild_ban_add event.

Parameters
_guild_ban_addHandle to remove from event, previously returned by dpp::cluster::on_guild_ban_add()
Returns
true on successful detach of listener

◆ detach_guild_ban_remove()

bool dpp::cluster::detach_guild_ban_remove ( const event_handle  _guild_ban_remove)

Detach listener from on_guild_ban_remove event.

Parameters
_guild_ban_removeHandle to remove from event, previously returned by dpp::cluster::on_guild_ban_remove()
Returns
true on successful detach of listener

◆ detach_guild_create()

bool dpp::cluster::detach_guild_create ( const event_handle  _guild_create)

Detach listener from on_guild_create event.

Parameters
_guild_createHandle to remove from event, previously returned by dpp::cluster::on_guild_create()
Returns
true on successful detach of listener

◆ detach_guild_delete()

bool dpp::cluster::detach_guild_delete ( const event_handle  _guild_delete)

Detach listener from on_guild_delete event.

Parameters
_guild_deleteHandle to remove from event, previously returned by dpp::cluster::on_guild_delete()
Returns
true on successful detach of listener

◆ detach_guild_emojis_update()

bool dpp::cluster::detach_guild_emojis_update ( const event_handle  _guild_emojis_update)

Detach listener from on_guild_emojis_update event.

Parameters
_guild_emojis_updateHandle to remove from event, previously returned by dpp::cluster::on_guild_emojis_update()
Returns
true on successful detach of listener

◆ detach_guild_integrations_update()

bool dpp::cluster::detach_guild_integrations_update ( const event_handle  _guild_integrations_update)

Detach listener from on_guild_integrations_update event.

Parameters
_guild_integrations_updateHandle to remove from event, previously returned by dpp::cluster::on_guild_integrations_update()
Returns
true on successful detach of listener

◆ detach_guild_join_request_delete()

bool dpp::cluster::detach_guild_join_request_delete ( const event_handle  _guild_join_request_delete)

Detach listener from on_guild_join_request_delete event.

Parameters
_guild_join_request_deleteHandle to remove from event, previously returned by dpp::cluster::on_guild_join_request_delete()
Returns
true on successful detach of listener

◆ detach_guild_member_add()

bool dpp::cluster::detach_guild_member_add ( const event_handle  _guild_member_add)

Detach listener from on_guild_member_add event.

Parameters
_guild_member_addHandle to remove from event, previously returned by dpp::cluster::on_guild_member_add()
Returns
true on successful detach of listener

◆ detach_guild_member_remove()

bool dpp::cluster::detach_guild_member_remove ( const event_handle  _guild_member_remove)

Detach listener from on_guild_member_remove event.

Parameters
_guild_member_removeHandle to remove from event, previously returned by dpp::cluster::on_guild_member_remove()
Returns
true on successful detach of listener

◆ detach_guild_member_update()

bool dpp::cluster::detach_guild_member_update ( const event_handle  _guild_member_update)

Detach listener from on_guild_member_update event.

Parameters
_guild_member_updateHandle to remove from event, previously returned by dpp::cluster::on_guild_member_update()
Returns
true on successful detach of listener

◆ detach_guild_members_chunk()

bool dpp::cluster::detach_guild_members_chunk ( const event_handle  _guild_members_chunk)

Detach listener from on_guild_members_chunk event.

Parameters
_guild_members_chunkHandle to remove from event, previously returned by dpp::cluster::on_guild_members_chunk()
Returns
true on successful detach of listener

◆ detach_guild_role_create()

bool dpp::cluster::detach_guild_role_create ( const event_handle  _guild_role_create)

Detach listener from on_guild_role_create event.

Parameters
_guild_role_createHandle to remove from event, previously returned by dpp::cluster::on_guild_role_create()
Returns
true on successful detach of listener

◆ detach_guild_role_delete()

bool dpp::cluster::detach_guild_role_delete ( const event_handle  _guild_role_delete)

Detach listener from on_guild_role_delete event.

Parameters
_guild_role_deleteHandle to remove from event, previously returned by dpp::cluster::on_guild_role_delete()
Returns
true on successful detach of listener

◆ detach_guild_role_update()

bool dpp::cluster::detach_guild_role_update ( const event_handle  _guild_role_update)

Detach listener from on_guild_role_update event.

Parameters
_guild_role_updateHandle to remove from event, previously returned by dpp::cluster::on_guild_role_update()
Returns
true on successful detach of listener

◆ detach_guild_stickers_update()

bool dpp::cluster::detach_guild_stickers_update ( const event_handle  _guild_stickers_update)

Detach listener from on_guild_stickers_update event.

Parameters
_guild_stickers_updateHandle to remove from event, previously returned by dpp::cluster::on_guild_stickers_update()
Returns
true on successful detach of listener

◆ detach_guild_update()

bool dpp::cluster::detach_guild_update ( const event_handle  _guild_update)

Detach listener from on_guild_update event.

Parameters
_guild_updateHandle to remove from event, previously returned by dpp::cluster::on_guild_update()
Returns
true on successful detach of listener

◆ detach_integration_create()

bool dpp::cluster::detach_integration_create ( const event_handle  _integration_create)

Detach listener from on_integration_create event.

Parameters
_integration_createHandle to remove from event, previously returned by dpp::cluster::on_integration_create()
Returns
true on successful detach of listener

◆ detach_integration_delete()

bool dpp::cluster::detach_integration_delete ( const event_handle  _integration_delete)

Detach listener from on_integration_delete event.

Parameters
_integration_deleteHandle to remove from event, previously returned by dpp::cluster::on_integration_delete()
Returns
true on successful detach of listener

◆ detach_integration_update()

bool dpp::cluster::detach_integration_update ( const event_handle  _integration_update)

Detach listener from on_integration_update event.

Parameters
_integration_updateHandle to remove from event, previously returned by dpp::cluster::on_integration_update()
Returns
true on successful detach of listener

◆ detach_interaction_create()

bool dpp::cluster::detach_interaction_create ( const event_handle  _interaction_create)

Detach listener from on_interaction_create event.

Parameters
_interaction_createHandle to remove from event, previously returned by dpp::cluster::on_interaction_create()
Returns
true on successful detach of listener

◆ detach_invite_create()

bool dpp::cluster::detach_invite_create ( const event_handle  _invite_create)

Detach listener from on_invite_create event.

Parameters
_invite_createHandle to remove from event, previously returned by dpp::cluster::on_invite_create()
Returns
true on successful detach of listener

◆ detach_invite_delete()

bool dpp::cluster::detach_invite_delete ( const event_handle  _invite_delete)

Detach listener from on_invite_delete event.

Parameters
_invite_deleteHandle to remove from event, previously returned by dpp::cluster::on_invite_delete()
Returns
true on successful detach of listener

◆ detach_log()

bool dpp::cluster::detach_log ( const event_handle  _log)

Detach listener from on_log event.

Parameters
_logHandle to remove from event, previously returned by dpp::cluster::on_log()
Returns
true on successful detach of listener

◆ detach_message_create()

bool dpp::cluster::detach_message_create ( const event_handle  _message_create)

Detach listener from on_message_create event.

Parameters
_message_createHandle to remove from event, previously returned by dpp::cluster::on_message_create()
Returns
true on successful detach of listener

◆ detach_message_delete()

bool dpp::cluster::detach_message_delete ( const event_handle  _message_delete)

Detach listener from on_message_delete event.

Parameters
_message_deleteHandle to remove from event, previously returned by dpp::cluster::on_message_delete()
Returns
true on successful detach of listener

◆ detach_message_delete_bulk()

bool dpp::cluster::detach_message_delete_bulk ( const event_handle  _message_delete_bulk)

Detach listener from on_message_delete_bulk event.

Parameters
_message_delete_bulkHandle to remove from event, previously returned by dpp::cluster::on_message_delete_bulk()
Returns
true on successful detach of listener

◆ detach_message_reaction_add()

bool dpp::cluster::detach_message_reaction_add ( const event_handle  _message_reaction_add)

Detach listener from on_message_reaction_add event.

Parameters
_message_reaction_addHandle to remove from event, previously returned by dpp::cluster::on_message_reaction_add()
Returns
true on successful detach of listener

◆ detach_message_reaction_remove()

bool dpp::cluster::detach_message_reaction_remove ( const event_handle  _message_reaction_remove)

Detach listener from on_message_reaction_remove event.

Parameters
_message_reaction_removeHandle to remove from event, previously returned by dpp::cluster::on_message_reaction_remove()
Returns
true on successful detach of listener

◆ detach_message_reaction_remove_all()

bool dpp::cluster::detach_message_reaction_remove_all ( const event_handle  _message_reaction_remove_all)

Detach listener from on_message_reaction_remove_all event.

Parameters
_message_reaction_remove_allHandle to remove from event, previously returned by dpp::cluster::on_message_reaction_remove_all()
Returns
true on successful detach of listener

◆ detach_message_reaction_remove_emoji()

bool dpp::cluster::detach_message_reaction_remove_emoji ( const event_handle  _message_reaction_remove_emoji)

Detach listener from on_message_reaction_remove_emoji event.

Parameters
_message_reaction_remove_emojiHandle to remove from event, previously returned by dpp::cluster::on_message_reaction_remove_emoji()
Returns
true on successful detach of listener

◆ detach_message_update()

bool dpp::cluster::detach_message_update ( const event_handle  _message_update)

Detach listener from on_message_update event.

Parameters
_message_updateHandle to remove from event, previously returned by dpp::cluster::on_message_update()
Returns
true on successful detach of listener

◆ detach_presence_update()

bool dpp::cluster::detach_presence_update ( const event_handle  _presence_update)

Detach listener from on_presence_update event.

Parameters
_presence_updateHandle to remove from event, previously returned by dpp::cluster::on_presence_update()
Returns
true on successful detach of listener

◆ detach_ready()

bool dpp::cluster::detach_ready ( const event_handle  _ready)

Detach listener from on_ready event.

Parameters
_readyHandle to remove from event, previously returned by dpp::cluster::on_ready()
Returns
true on successful detach of listener

◆ detach_resumed()

bool dpp::cluster::detach_resumed ( const event_handle  _resumed)

Detach listener from on_resumed event.

Parameters
_resumedHandle to remove from event, previously returned by dpp::cluster::on_resumed()
Returns
true on successful detach of listener

◆ detach_select_click()

bool dpp::cluster::detach_select_click ( const event_handle  _select_click)

Detach listener from on_select_click event.

Parameters
_select_clickHandle to remove from event, previously returned by dpp::cluster::on_select_click()
Returns
true on successful detach of listener

◆ detach_stage_instance_create()

bool dpp::cluster::detach_stage_instance_create ( const event_handle  _stage_instance_create)

Detach listener from on_stage_instance_create event.

Parameters
_stage_instance_createHandle to remove from event, previously returned by dpp::cluster::on_stage_instance_create()
Returns
true on successful detach of listener

◆ detach_stage_instance_delete()

bool dpp::cluster::detach_stage_instance_delete ( const event_handle  _stage_instance_delete)

Detach listener from on_stage_instance_delete event.

Parameters
_stage_instance_deleteHandle to remove from event, previously returned by dpp::cluster::on_stage_instance_delete()
Returns
true on successful detach of listener

◆ detach_stage_instance_update()

bool dpp::cluster::detach_stage_instance_update ( const event_handle  _stage_instance_update)

Detach listener from on_stage_instance_update event.

Parameters
_stage_instance_updateHandle to remove from event, previously returned by dpp::cluster::on_stage_instance_update()
Returns
true on successful detach of listener

◆ detach_thread_create()

bool dpp::cluster::detach_thread_create ( const event_handle  _thread_create)

Detach listener from on_thread_create event.

Parameters
_thread_createHandle to remove from event, previously returned by dpp::cluster::on_thread_create()
Returns
true on successful detach of listener

◆ detach_thread_delete()

bool dpp::cluster::detach_thread_delete ( const event_handle  _thread_delete)

Detach listener from on_thread_delete event.

Parameters
_thread_deleteHandle to remove from event, previously returned by dpp::cluster::on_thread_delete()
Returns
true on successful detach of listener

◆ detach_thread_list_sync()

bool dpp::cluster::detach_thread_list_sync ( const event_handle  _thread_list_sync)

Detach listener from on_thread_list_sync event.

Parameters
_thread_list_syncHandle to remove from event, previously returned by dpp::cluster::on_thread_list_sync()
Returns
true on successful detach of listener

◆ detach_thread_member_update()

bool dpp::cluster::detach_thread_member_update ( const event_handle  _thread_member_update)

Detach listener from on_thread_member_update event.

Parameters
_thread_member_updateHandle to remove from event, previously returned by dpp::cluster::on_thread_member_update()
Returns
true on successful detach of listener

◆ detach_thread_members_update()

bool dpp::cluster::detach_thread_members_update ( const event_handle  _thread_members_update)

Detach listener from on_thread_members_update event.

Parameters
_thread_members_updateHandle to remove from event, previously returned by dpp::cluster::on_thread_members_update()
Returns
true on successful detach of listener

◆ detach_thread_update()

bool dpp::cluster::detach_thread_update ( const event_handle  _thread_update)

Detach listener from on_thread_update event.

Parameters
_thread_updateHandle to remove from event, previously returned by dpp::cluster::on_thread_update()
Returns
true on successful detach of listener

◆ detach_typing_start()

bool dpp::cluster::detach_typing_start ( const event_handle  _typing_start)

Detach listener from on_typing_start event.

Parameters
_typing_startHandle to remove from event, previously returned by dpp::cluster::on_typing_start()
Returns
true on successful detach of listener

◆ detach_user_update()

bool dpp::cluster::detach_user_update ( const event_handle  _user_update)

Detach listener from on_user_update event.

Parameters
_user_updateHandle to remove from event, previously returned by dpp::cluster::on_user_update()
Returns
true on successful detach of listener

◆ detach_voice_buffer_send()

bool dpp::cluster::detach_voice_buffer_send ( const event_handle  _voice_buffer_send)

Detach listener from on_voice_buffer_send event.

Parameters
_voice_buffer_sendHandle to remove from event, previously returned by dpp::cluster::on_voice_buffer_send()
Returns
true on successful detach of listener

◆ detach_voice_client_disconnect()

bool dpp::cluster::detach_voice_client_disconnect ( const event_handle  _voice_client_disconnect)

Detach listener from on_voice_client_disconnect event.

Parameters
_voice_client_disconnectHandle to remove from event, previously returned by dpp::cluster::on_voice_client_disconnect()
Returns
true on successful detach of listener

◆ detach_voice_client_speaking()

bool dpp::cluster::detach_voice_client_speaking ( const event_handle  _voice_client_speaking)

Detach listener from on_voice_client_speaking event.

Parameters
_voice_client_speakingHandle to remove from event, previously returned by dpp::cluster::on_voice_client_speaking()
Returns
true on successful detach of listener

◆ detach_voice_ready()

bool dpp::cluster::detach_voice_ready ( const event_handle  _voice_ready)

Detach listener from on_voice_ready event.

Parameters
_voice_readyHandle to remove from event, previously returned by dpp::cluster::on_voice_ready()
Returns
true on successful detach of listener

◆ detach_voice_receive()

bool dpp::cluster::detach_voice_receive ( const event_handle  _voice_receive)

Detach listener from on_voice_receive event.

Parameters
_voice_receiveHandle to remove from event, previously returned by dpp::cluster::on_voice_receive()
Returns
true on successful detach of listener

◆ detach_voice_server_update()

bool dpp::cluster::detach_voice_server_update ( const event_handle  _voice_server_update)

Detach listener from on_voice_server_update event.

Parameters
_voice_server_updateHandle to remove from event, previously returned by dpp::cluster::on_voice_server_update()
Returns
true on successful detach of listener

◆ detach_voice_state_update()

bool dpp::cluster::detach_voice_state_update ( const event_handle  _voice_state_update)

Detach listener from on_voice_state_update event.

Parameters
_voice_state_updateHandle to remove from event, previously returned by dpp::cluster::on_voice_state_update()
Returns
true on successful detach of listener

◆ detach_voice_track_marker()

bool dpp::cluster::detach_voice_track_marker ( const event_handle  _voice_track_marker)

Detach listener from on_voice_track_marker event.

Parameters
_voice_track_markerHandle to remove from event, previously returned by dpp::cluster::on_voice_track_marker()
Returns
true on successful detach of listener

◆ detach_voice_user_talking()

bool dpp::cluster::detach_voice_user_talking ( const event_handle  _voice_user_talking)

Detach listener from on_voice_user_talking event.

Parameters
_voice_user_talkingHandle to remove from event, previously returned by dpp::cluster::on_voice_user_talking()
Returns
true on successful detach of listener

◆ detach_webhooks_update()

bool dpp::cluster::detach_webhooks_update ( const event_handle  _webhooks_update)

Detach listener from on_webhooks_update event.

Parameters
_webhooks_updateHandle to remove from event, previously returned by dpp::cluster::on_webhooks_update()
Returns
true on successful detach of listener

◆ direct_message_create()

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

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

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().

◆ edit_webhook()

void dpp::cluster::edit_webhook ( const class webhook wh,
command_completion_event_t  callback = {} 
)

Edit 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 = {} 
)

Edit webhook message.

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_with_token()

void dpp::cluster::edit_webhook_with_token ( const class webhook wh,
command_completion_event_t  callback = {} 
)

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

Parameters
whWehook 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().

◆ 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 = {} 
)

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().

◆ 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 = {} 
)

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

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_remove()

void dpp::cluster::gdm_remove ( snowflake  channel_id,
snowflake  user_id,
command_completion_event_t  callback = {} 
)

Removes a recipient from a Group DM.

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().

◆ get_active_threads()

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

Get active threads in a channel (Sorted by ID in descending order)

Parameters
channel_idChannel to get active threads 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().

◆ 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.

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_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.

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_guild_invites()

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

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().

◆ get_guild_webhooks()

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

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_joined_private_archived_threads()

void dpp::cluster::get_joined_private_archived_threads ( 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)

Parameters
channel_idChannel to get public archived threads for
before_idGet threads before this id
limitNumber of threads to get
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().

◆ get_private_archived_threads()

void dpp::cluster::get_private_archived_threads ( 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)

Parameters
channel_idChannel to get public archived threads for
before_timestampGet threads before this timestamp
limitNumber of threads to get
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().

◆ get_public_archived_threads()

void dpp::cluster::get_public_archived_threads ( 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)

Parameters
channel_idChannel to get public archived threads for
before_timestampGet threads before this timestamp
limitNumber of threads to get
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().

◆ 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_thread_member()

void dpp::cluster::get_thread_member ( const snowflake  thread_id,
const snowflake  user_id,
command_completion_event_t  callback 
)

Get a thread member.

Parameters
thread_idThread to get member for
user_idID of the user to get
callbackFunction to call when the API call completes On success the callback will contain a dpp::thread_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().

◆ get_thread_members()

void dpp::cluster::get_thread_members ( snowflake  thread_id,
command_completion_event_t  callback 
)

Get members of a thread.

Parameters
thread_idThread to get members for
callbackFunction to call when the API call completes On success the callback will contain a dpp::thread_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().

◆ get_voice_regions()

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

Get all 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_webhook()

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

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 = {} 
)

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_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.

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().

◆ global_bulk_command_create()

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

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

Note
Global commands are cached by discord server-side and can take up to an hour to be visible. For testing, you should use cluster::guild_bulk_command_create instead.
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::slashcommmand 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()

void dpp::cluster::global_command_create ( const slashcommand s,
command_completion_event_t  callback = {} 
)

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

Note
Global commands are cached by discord server-side and can take up to an hour to be visible. For testing, you should use cluster::guild_command_create instead.
Parameters
sSlash command to create
callbackFunction to call when the API call completes. On success the callback will contain a dpp::slashcommmand 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()

void dpp::cluster::global_command_delete ( snowflake  id,
command_completion_event_t  callback = {} 
)

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

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_edit()

void dpp::cluster::global_command_edit ( const slashcommand s,
command_completion_event_t  callback = {} 
)

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

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_commands_get()

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

Get the application's global slash 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().

◆ guild_add_member()

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

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

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_auditlog_get()

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

Get the audit log for a guild.

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_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 = {} 
)

Add 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 ther 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_delete()

void dpp::cluster::guild_ban_delete ( snowflake  guild_id,
snowflake  user_id,
command_completion_event_t  callback = {} 
)

Delete 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_begin_prune()

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

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_bulk_command_create()

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

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

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::slashcommmand 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()

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

Create a slash command local to a guild.

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::slashcommmand 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()

void dpp::cluster::guild_command_delete ( snowflake  id,
snowflake  guild_id,
command_completion_event_t  callback = {} 
)

Delete a slash command local to a guild.

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_edit()

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

Edit a slash command local to a guild.

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 = {} 
)

Edit slash command permissions local to a guild, permissions are read from s.permissions.

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_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.

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_create()

void dpp::cluster::guild_create ( const class guild g,
command_completion_event_t  callback = {} 
)

Create a guild.

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 = {} 
)

Create a new guild based on a 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_delete()

void dpp::cluster::guild_delete ( snowflake  guild_id,
command_completion_event_t  callback = {} 
)

Delete a 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 = {} 
)

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_edit()

void dpp::cluster::guild_edit ( const class guild g,
command_completion_event_t  callback = {} 
)

Edit a 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 = {} 
)

Edit the properties of an existing 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_widget()

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

Edit guild widget.

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_emoji_create()

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

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.
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_delete()

void dpp::cluster::guild_emoji_delete ( snowflake  guild_id,
snowflake  emoji_id,
command_completion_event_t  callback = {} 
)

Delete a guild emoji.

Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
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_edit()

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

Edit a 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.
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_get()

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

Get a single 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_emojis_get()

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

Get all emojis for a guild.

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_get()

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

Get a 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.

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_bans()

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

Get guild ban list.

Parameters
guild_idGuild ID to get bans for
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_integrations()

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

Get guild itegrations.

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_member()

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

Get a 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_members()

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

Get all 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_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.

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.

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_vanity()

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

Get guild vanity url, if enabled.

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_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.

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_widget()

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

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_member_add_role()

void dpp::cluster::guild_member_add_role ( snowflake  guild_id,
snowflake  user_id,
snowflake  role_id,
command_completion_event_t  callback = {} 
)

Add role to guild member.

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_delete()

void dpp::cluster::guild_member_delete ( snowflake  guild_id,
snowflake  user_id,
command_completion_event_t  callback = {} 
)

Remove (kick) a 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_delete_role()

void dpp::cluster::guild_member_delete_role ( snowflake  guild_id,
snowflake  user_id,
snowflake  role_id,
command_completion_event_t  callback = {} 
)

Remove role from guild member.

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_move()

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

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

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_modify_integration()

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

Modify guild integration.

Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
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_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.

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_set_nickname()

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

Change current user nickname.

Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
Parameters
guild_idGuild ID to change nickanem 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_sticker_create()

void dpp::cluster::guild_sticker_create ( sticker s,
command_completion_event_t  callback = {} 
)

Create a sticker in a guild.

Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
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_delete()

void dpp::cluster::guild_sticker_delete ( snowflake  sticker_id,
snowflake  guild_id,
command_completion_event_t  callback = {} 
)

Delete a sticker from a guild.

Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
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_get()

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

Get a 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_modify()

void dpp::cluster::guild_sticker_modify ( sticker s,
command_completion_event_t  callback = {} 
)

Modify a sticker in a guild.

Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
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_stickers_get()

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

Get all 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 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()

void dpp::cluster::guild_sync_integration ( snowflake  guild_id,
snowflake  integration_id,
command_completion_event_t  callback = {} 
)

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_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.

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::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_template_delete()

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

Deletes the 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_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 = {} 
)

Modifies the template's metadata.

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::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_template_sync()

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

Syncs the template to the guild's current state.

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::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_templates_get()

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

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::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().

◆ interaction_response_create()

void dpp::cluster::interaction_response_create ( snowflake  interaction_id,
const std::string &  token,
const interaction_response r,
command_completion_event_t  callback = {} 
)

Respond to a slash command.

Parameters
interaction_idInteraction id to respond to
tokenToken for the interaction webhook
rResponse to send
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_response_edit()

void dpp::cluster::interaction_response_edit ( const std::string &  token,
const message r,
command_completion_event_t  callback = {} 
)

Respond to a slash command.

Parameters
tokenToken for the interaction webhook
rMessage to send
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().

◆ invite_delete()

void dpp::cluster::invite_delete ( const std::string &  invite,
command_completion_event_t  callback = {} 
)

Delete an invite.

Parameters
inviteInvite 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().

◆ invite_get()

void dpp::cluster::invite_get ( const std::string &  invite,
command_completion_event_t  callback 
)

Get details about an invite.

Parameters
inviteInvite code to get information on
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().

◆ log()

void dpp::cluster::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.

Parameters
severityThe log level from dpp::loglevel
msgThe log message to output

◆ message_add_reaction() [1/2]

void dpp::cluster::message_add_reaction ( const struct message m,
const std::string &  reaction,
command_completion_event_t  callback = {} 
)

Add a reaction to a message. The reaction string must be either an emojiname:id or a unicode character.

Parameters
mMessage to add a reaction to
reactionReaction to add. Emojis should be in the form emojiname: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().

◆ message_add_reaction() [2/2]

void dpp::cluster::message_add_reaction ( snowflake  message_id,
snowflake  channel_id,
const std::string &  reaction,
command_completion_event_t  callback = {} 
)

Add a reaction to a message by id. The reaction string must be either an emojiname:id or a unicode character.

Parameters
message_idMessage to add reactions to
channel_idChannel to add reactions to
reactionReaction to add. Emojis should be in the form emojiname: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().

◆ message_create()

void dpp::cluster::message_create ( const struct message m,
command_completion_event_t  callback = {} 
)

Send a message to a channel. The callback function is called when the message has been sent.

Parameters
mMessage to send
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().

◆ message_crosspost()

void dpp::cluster::message_crosspost ( snowflake  message_id,
snowflake  channel_id,
command_completion_event_t  callback = {} 
)

Crosspost a message. The callback function is called when the message has been sent.

Parameters
message_idMessage to crosspost
channel_idChannel ID to crosspost from
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().

◆ message_delete()

void dpp::cluster::message_delete ( snowflake  message_id,
snowflake  channel_id,
command_completion_event_t  callback = {} 
)

Delete a message from a channel. The callback function is called when the message has been edited.

Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
Parameters
message_idMessage ID to delete
channel_idChannel to delete from
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().

◆ message_delete_all_reactions() [1/2]

void dpp::cluster::message_delete_all_reactions ( const struct message m,
command_completion_event_t  callback = {} 
)

Delete all reactions on a message.

Parameters
mMessage to delete reactions from
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().

◆ message_delete_all_reactions() [2/2]

void dpp::cluster::message_delete_all_reactions ( snowflake  message_id,
snowflake  channel_id,
command_completion_event_t  callback = {} 
)

Delete all reactions on a message by id.

Parameters
message_idMessage to delete reactions from
channel_idChannel to delete reactions from
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().

◆ message_delete_bulk()

void dpp::cluster::message_delete_bulk ( const std::vector< snowflake > &  message_ids,
snowflake  channel_id,
command_completion_event_t  callback = {} 
)

Bulk delete messages from a channel. The callback function is called when the message has been edited.

Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
Parameters
message_idsList of message IDs to delete (maximum of 100 message IDs)
channel_idChannel to delete from
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().

◆ message_delete_own_reaction() [1/2]

void dpp::cluster::message_delete_own_reaction ( const struct message m,
const std::string &  reaction,
command_completion_event_t  callback = {} 
)

Delete own reaction from a message. The reaction string must be either an emojiname:id or a unicode character.

Parameters
mMessage to delete own reaction from
reactionReaction to delete. The reaction should be in the form emojiname: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().

◆ message_delete_own_reaction() [2/2]

void dpp::cluster::message_delete_own_reaction ( snowflake  message_id,
snowflake  channel_id,
const std::string &  reaction,
command_completion_event_t  callback = {} 
)

Delete own reaction from a message by id. The reaction string must be either an emojiname:id or a unicode character.

Parameters
message_idMessage to delete reactions from
channel_idChannel to delete reactions from
reactionReaction to delete. The reaction should be in the form emojiname: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().

◆ message_delete_reaction() [1/2]

void dpp::cluster::message_delete_reaction ( const struct message m,
snowflake  user_id,
const std::string &  reaction,
command_completion_event_t  callback = {} 
)

Delete a user's reaction from a message. The reaction string must be either an emojiname:id or a unicode character.

Parameters
mMessage to delete a user's reaction from
user_idUser ID who's reaction you want to remove
reactionReaction to remove. Reactions should be in the form emojiname: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().

◆ message_delete_reaction() [2/2]

void dpp::cluster::message_delete_reaction ( snowflake  message_id,
snowflake  channel_id,
snowflake  user_id,
const std::string &  reaction,
command_completion_event_t  callback = {} 
)

Delete a user's reaction from a message by id. The reaction string must be either an emojiname:id or a unicode character.

Parameters
message_idMessage to delete reactions from
channel_idChannel to delete reactions from
user_idUser ID who's reaction you want to remove
reactionReaction to remove. Reactions should be in the form emojiname: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().

◆ message_delete_reaction_emoji() [1/2]

void dpp::cluster::message_delete_reaction_emoji ( const struct message m,
const std::string &  reaction,
command_completion_event_t  callback = {} 
)

Delete all reactions on a message using a particular emoji. The reaction string must be either an emojiname:id or a unicode character.

Parameters
mMessage to delete reactions from
reactionReaction to delete, in the form emojiname:id or a unicode character
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().

◆ message_delete_reaction_emoji() [2/2]

void dpp::cluster::message_delete_reaction_emoji ( snowflake  message_id,
snowflake  channel_id,
const std::string &  reaction,
command_completion_event_t  callback = {} 
)

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.

Parameters
message_idMessage to delete reactions from
channel_idChannel to delete reactions from
reactionReaction to delete, in the form emojiname:id or a unicode character
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().

◆ message_edit()

void dpp::cluster::message_edit ( const struct message m,
command_completion_event_t  callback = {} 
)

Edit a message on a channel. The callback function is called when the message has been edited.

Parameters
mMessage to edit
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().

◆ message_get()

void dpp::cluster::message_get ( snowflake  message_id,
snowflake  channel_id,
command_completion_event_t  callback 
)

Get a message.

Parameters
message_idMessage ID
channel_idChannel ID
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().

◆ message_get_reactions() [1/2]

void dpp::cluster::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.

Parameters
mMessage to get reactions for
reactionReaction should be in the form emojiname:id or a unicode character
beforeReactions before this ID should be retrieved if this is set to non-zero
afterReactions before this ID should be retrieved if this is set to non-zero
limitThis number of reactions maximum should be returned
callbackFunction to call when the API call completes. On success the callback will contain a dpp::user_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().

◆ message_get_reactions() [2/2]

void dpp::cluster::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.

Parameters
message_idMessage to get reactions for
channel_idChannel to get reactions for
reactionReaction should be in the form emojiname:id or a unicode character
beforeReactions before this ID should be retrieved if this is set to non-zero
afterReactions before this ID should be retrieved if this is set to non-zero
limitThis number of reactions maximum should be returned
callbackFunction to call when the API call completes. On success the callback will contain a dpp::user_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().

◆ message_pin()

void dpp::cluster::message_pin ( snowflake  channel_id,
snowflake  message_id,
command_completion_event_t  callback = {} 
)

Pin a message.

Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
Parameters
channel_idChannel id to pin message on
message_idMessage id to pin message 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().

◆ message_unpin()

void dpp::cluster::message_unpin ( snowflake  channel_id,
snowflake  message_id,
command_completion_event_t  callback = {} 
)

Unpin a message.

Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
Parameters
channel_idChannel id to unpin message on
message_idMessage id to unpin message 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().

◆ messages_get()

void dpp::cluster::messages_get ( snowflake  channel_id,
snowflake  around,
snowflake  before,
snowflake  after,
snowflake  limit,
command_completion_event_t  callback 
)

Get multiple messages.

Parameters
channel_idChannel ID to retrieve messages for
aroundMessages should be retrieved around this ID if this is set to non-zero
beforeMessages before this ID should be retrieved if this is set to non-zero
afterMessages before this ID should be retrieved if this is set to non-zero
limitThis number of messages maximum should be returned
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().

◆ nitro_sticker_get()

void dpp::cluster::nitro_sticker_get ( snowflake  id,
command_completion_event_t  callback 
)

Get a nitro sticker.

Parameters
idId of sticker to get.
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().

◆ on_application_command_create()

event_handle dpp::cluster::on_application_command_create ( std::function< void(const application_command_create_t &_event)>  _application_command_create)

Called when a new application command (slash command) is registered.

Parameters
_application_command_createUser function to attach to event Event is called with the parameter type const dpp::application_command_create_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_application_command_delete()

event_handle dpp::cluster::on_application_command_delete ( std::function< void(const application_command_delete_t &_event)>  _application_command_delete)

Called when an application command (slash command) is deleted.

Parameters
_application_command_deleteUser function to attach to event Event is called with the parameter type const dpp::application_command_delete_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_application_command_update()

event_handle dpp::cluster::on_application_command_update ( std::function< void(const application_command_update_t &_event)>  _application_command_update)

Called when an application command (slash command) is updated. You will only receive this event for application commands that belong to your bot/application.

Parameters
_application_command_updateUser function to attach to event Event is called with the parameter type const dpp::application_command_update_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_autocomplete()

event_handle dpp::cluster::on_autocomplete ( std::function< void(const autocomplete_t &_event)>  _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.

Parameters
_autocompleteUser function to attach to event Event is called with the parameter type const dpp::autocomplete_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_button_click()

event_handle dpp::cluster::on_button_click ( std::function< void(const button_click_t &_event)>  _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.

Parameters
_button_clickUser function to attach to event Event is called with the parameter type const dpp::button_click_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_channel_create()

event_handle dpp::cluster::on_channel_create ( std::function< void(const channel_create_t &_event)>  _channel_create)

Called when a new channel is created on a guild.

Parameters
_channel_createUser function to attach to event Event is called with the parameter type const dpp::channel_create_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_channel_delete()

event_handle dpp::cluster::on_channel_delete ( std::function< void(const channel_delete_t &_event)>  _channel_delete)

Called when a channel is deleted from a guild. The channel will still be temporarily avaialble in the cache. Pointers to the channel should not be retained long-term as they will be deleted by the garbage collector.

Parameters
_channel_deleteUser function to attach to event Event is called with the parameter type const dpp::channel_delete_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_channel_pins_update()

event_handle dpp::cluster::on_channel_pins_update ( std::function< void(const channel_pins_update_t &_event)>  _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.

Parameters
_channel_pins_updateUser function to attach to event Event is called with the parameter type const dpp::channel_pins_update_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_channel_update()

event_handle dpp::cluster::on_channel_update ( std::function< void(const channel_update_t &_event)>  _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.

Parameters
_channel_updateUser function to attach to event Event is called with the parameter type const dpp::channel_update_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_guild_ban_add()

event_handle dpp::cluster::on_guild_ban_add ( std::function< void(const guild_ban_add_t &_event)>  _guild_ban_add)

Called when a ban is added to a guild.

Parameters
_guild_ban_addUser function to attach to event Event is called with the parameter type const dpp::guild_ban_add_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_guild_ban_remove()

event_handle dpp::cluster::on_guild_ban_remove ( std::function< void(const guild_ban_remove_t &_event)>  _guild_ban_remove)

Called when a ban is removed from a guild.

Parameters
_guild_ban_removeUser function to attach to event Event is called with the parameter type const dpp::guild_ban_remove_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_guild_create()

event_handle dpp::cluster::on_guild_create ( std::function< void(const guild_create_t &_event)>  _guild_create)

Called when a new guild is created. D++ will request members for the guild for its cache using guild_members_chunk.

Parameters
_guild_createUser function to attach to event Event is called with the parameter type const dpp::guild_create_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_guild_delete()

event_handle dpp::cluster::on_guild_delete ( std::function< void(const guild_delete_t &_event)>  _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 unavaialble due to an outage.

Parameters
_guild_deleteUser function to attach to event Event is called with the parameter type const dpp::guild_delete_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_guild_emojis_update()

event_handle dpp::cluster::on_guild_emojis_update ( std::function< void(const guild_emojis_update_t &_event)>  _guild_emojis_update)

Called when new emojis are added to a guild. The complete set of emojis is sent every time.

Parameters
_guild_emojis_updateUser function to attach to event Event is called with the parameter type const dpp::guild_emojis_update_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_guild_integrations_update()

event_handle dpp::cluster::on_guild_integrations_update ( std::function< void(const guild_integrations_update_t &_event)>  _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.

Parameters
_guild_integrations_updateUser function to attach to event Event is called with the parameter type const dpp::guild_integrations_update_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_guild_join_request_delete()

event_handle dpp::cluster::on_guild_join_request_delete ( std::function< void(const guild_join_request_delete_t &_event)>  _guild_join_request_delete)

on guild join request delete. Triggered when a user declines the membership screening questionnaire for a guild.

Parameters
_guild_join_request_deleteUser function to attach to event Event is called with the parameter type const dpp::guild_join_request_delete_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_guild_member_add()

event_handle dpp::cluster::on_guild_member_add ( std::function< void(const guild_member_add_t &_event)>  _guild_member_add)

Called when a new member joins a guild.

Parameters
_guild_member_addUser function to attach to event Event is called with the parameter type const dpp::guild_member_add_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_guild_member_remove()

event_handle dpp::cluster::on_guild_member_remove ( std::function< void(const guild_member_remove_t &_event)>  _guild_member_remove)

Called when a user leaves a guild (either through being kicked, or choosing to leave)

Parameters
_guild_member_removeUser function to attach to event Event is called with the parameter type const dpp::guild_member_remove_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_guild_member_update()

event_handle dpp::cluster::on_guild_member_update ( std::function< void(const guild_member_update_t &_event)>  _guild_member_update)

Called when details of a guild member (e.g. their roles or nickname) are updated.

Parameters
_guild_member_updateUser function to attach to event Event is called with the parameter type const dpp::guild_member_update_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_guild_members_chunk()

event_handle dpp::cluster::on_guild_members_chunk ( std::function< void(const guild_members_chunk_t &_event)>  _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.

Parameters
_guild_members_chunkUser function to attach to event Event is called with the parameter type const dpp::guild_members_chunk_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_guild_role_create()

event_handle dpp::cluster::on_guild_role_create ( std::function< void(const guild_role_create_t &_event)>  _guild_role_create)

Called when a new role is created on a guild.

Parameters
_guild_role_createUser function to attach to event Event is called with the parameter type const dpp::guild_role_create_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_guild_role_delete()

event_handle dpp::cluster::on_guild_role_delete ( std::function< void(const guild_role_delete_t &_event)>  _guild_role_delete)

Called when a role is deleted in a guild.

Parameters
_guild_role_deleteUser function to attach to event Event is called with the parameter type const dpp::guild_role_delete_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_guild_role_update()

event_handle dpp::cluster::on_guild_role_update ( std::function< void(const guild_role_update_t &_event)>  _guild_role_update)

Called when an existing role is updated on a guild.

Parameters
_guild_role_updateUser function to attach to event Event is called with the parameter type const dpp::guild_role_update_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_guild_stickers_update()

event_handle dpp::cluster::on_guild_stickers_update ( std::function< void(const guild_stickers_update_t &_event)>  _guild_stickers_update)

Called when new stickers are added to a guild. The complete set of stickers is sent every time.

Parameters
_guild_stickers_updateUser function to attach to event Event is called with the parameter type const dpp::guild_stickers_update_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_guild_update()

event_handle dpp::cluster::on_guild_update ( std::function< void(const guild_update_t &_event)>  _guild_update)

Called when details of a guild are updated.

Parameters
_guild_updateUser function to attach to event Event is called with the parameter type const dpp::guild_update_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_integration_create()

event_handle dpp::cluster::on_integration_create ( std::function< void(const integration_create_t &_event)>  _integration_create)

Called when a new intgration 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.

Parameters
_integration_createUser function to attach to event Event is called with the parameter type const dpp::integration_create_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_integration_delete()

event_handle dpp::cluster::on_integration_delete ( std::function< void(const integration_delete_t &_event)>  _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.

Parameters
_integration_deleteUser function to attach to event Event is called with the parameter type const dpp::integration_delete_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_integration_update()

event_handle dpp::cluster::on_integration_update ( std::function< void(const integration_update_t &_event)>  _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.

Parameters
_integration_updateUser function to attach to event Event is called with the parameter type const dpp::integration_update_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_interaction_create()

event_handle dpp::cluster::on_interaction_create ( std::function< void(const interaction_create_t &_event)>  _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.

Parameters
_interaction_createUser function to attach to event Event is called with the parameter type const dpp::interaction_create_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_invite_create()

event_handle dpp::cluster::on_invite_create ( std::function< void(const invite_create_t &_event)>  _invite_create)

Called when a new invite is created for a guild.

Parameters
_invite_createUser function to attach to event Event is called with the parameter type const dpp::invite_create_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_invite_delete()

event_handle dpp::cluster::on_invite_delete ( std::function< void(const invite_delete_t &_event)>  _invite_delete)

Called when an invite is deleted from a guild.

Parameters
_invite_deleteUser function to attach to event Event is called with the parameter type const dpp::invite_delete_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_log()

event_handle dpp::cluster::on_log ( std::function< void(const log_t &_event)>  _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.

Parameters
_logUser function to attach to event Event is called with the parameter type const dpp::log_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_message_create()

event_handle dpp::cluster::on_message_create ( std::function< void(const message_create_t &_event)>  _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.

Parameters
_message_createUser function to attach to event Event is called with the parameter type const dpp::message_create_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_message_delete()

event_handle dpp::cluster::on_message_delete ( std::function< void(const message_delete_t &_event)>  _message_delete)

Called when a message is deleted. The message has already been deleted from Discord when you receive this event.

Parameters
_message_deleteUser function to attach to event Event is called with the parameter type const dpp::message_delete_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_message_delete_bulk()

event_handle dpp::cluster::on_message_delete_bulk ( std::function< void(const message_delete_bulk_t &_event)>  _message_delete_bulk)

Called when multiple messages are deleted from a channel or DM.

Parameters
_message_delete_bulkUser function to attach to event Event is called with the parameter type const dpp::message_delete_bulk_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_message_reaction_add()

event_handle dpp::cluster::on_message_reaction_add ( std::function< void(const message_reaction_add_t &_event)>  _message_reaction_add)

Called when a new reaction is added to a message.

Parameters
_message_reaction_addUser function to attach to event Event is called with the parameter type const dpp::message_reaction_add_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_message_reaction_remove()

event_handle dpp::cluster::on_message_reaction_remove ( std::function< void(const message_reaction_remove_t &_event)>  _message_reaction_remove)

Called when a single reaction is removed from a message.

Parameters
_message_reaction_removeUser function to attach to event Event is called with the parameter type const dpp::message_reaction_remove_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_message_reaction_remove_all()

event_handle dpp::cluster::on_message_reaction_remove_all ( std::function< void(const message_reaction_remove_all_t &_event)>  _message_reaction_remove_all)

Called when all reactions are removed from a message.

Parameters
_message_reaction_remove_allUser function to attach to event Event is called with the parameter type const dpp::message_reaction_remove_all_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_message_reaction_remove_emoji()

event_handle dpp::cluster::on_message_reaction_remove_emoji ( std::function< void(const message_reaction_remove_emoji_t &_event)>  _message_reaction_remove_emoji)

Called when all reactions for a particular emoji are removed from a message.

Parameters
_message_reaction_remove_emojiUser function to attach to event Event is called with the parameter type const dpp::message_reaction_remove_emoji_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_message_update()

event_handle dpp::cluster::on_message_update ( std::function< void(const message_update_t &_event)>  _message_update)

Called when a message is updated (edited).

Parameters
_message_updateUser function to attach to event Event is called with the parameter type const dpp::message_update_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_presence_update()

event_handle dpp::cluster::on_presence_update ( std::function< void(const presence_update_t &_event)>  _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.

Parameters
_presence_updateUser function to attach to event Event is called with the parameter type const dpp::presence_update_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_ready()

event_handle dpp::cluster::on_ready ( std::function< void(const ready_t &_event)>  _ready)

Called when a shard is connected and ready. A set of on_guild_create events will follow this event.

Parameters
_readyUser function to attach to event Event is called with the parameter type const dpp::ready_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_resumed()

event_handle dpp::cluster::on_resumed ( std::function< void(const resumed_t &_event)>  _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.

Parameters
_resumedUser function to attach to event Event is called with the parameter type const dpp::resumed_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_select_click()

event_handle dpp::cluster::on_select_click ( std::function< void(const select_click_t &_event)>  _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.

Parameters
_select_clickUser function to attach to event Event is called with the parameter type const dpp::select_click_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_stage_instance_create()

event_handle dpp::cluster::on_stage_instance_create ( std::function< void(const stage_instance_create_t &_event)>  _stage_instance_create)

Called when a new stage instance is created on a stage channel.

Parameters
_stage_instance_createUser function to attach to event
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_stage_instance_delete()

event_handle dpp::cluster::on_stage_instance_delete ( std::function< void(const stage_instance_delete_t &_event)>  _stage_instance_delete)

Called when an existing stage instance is deleted from a stage channel.

Parameters
_stage_instance_deleteUser function to attach to event Event is called with the parameter type const dpp::stage_instance_delete_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_stage_instance_update()

event_handle dpp::cluster::on_stage_instance_update ( std::function< void(const stage_instance_update_t &_event)>  _stage_instance_update)

Called when a stage instance is updated.

Parameters
_stage_instance_updateUser function to attach to event Event is called with the parameter type const dpp::stage_instance_update_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_thread_create()

event_handle dpp::cluster::on_thread_create ( std::function< void(const thread_create_t &_event)>  _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.

Parameters
_thread_createUser function to attach to event Event is called with the parameter type const dpp::thread_create_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_thread_delete()

event_handle dpp::cluster::on_thread_delete ( std::function< void(const thread_delete_t &_event)>  _thread_delete)

Called when a thread is deleted.

Parameters
_thread_deleteUser function to attach to event Event is called with the parameter type const dpp::thread_delete_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_thread_list_sync()

event_handle dpp::cluster::on_thread_list_sync ( std::function< void(const thread_list_sync_t &_event)>  _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.

Parameters
_thread_list_syncUser function to attach to event Event is called with the parameter type const dpp::thread_list_sync_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_thread_member_update()

event_handle dpp::cluster::on_thread_member_update ( std::function< void(const thread_member_update_t &_event)>  _thread_member_update)

Called when current user's thread member object is updated.

Parameters
_thread_member_updateUser function to attach to event Event is called with the parameter type const dpp::thread_member_update_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_thread_members_update()

event_handle dpp::cluster::on_thread_members_update ( std::function< void(const thread_members_update_t &_event)>  _thread_members_update)

Called when a thread's member list is updated (without GUILD_MEMBERS intent, is only called for current user)

Parameters
_thread_members_updateUser function to attach to event Event is called with the parameter type const dpp::thread_members_update_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_thread_update()

event_handle dpp::cluster::on_thread_update ( std::function< void(const thread_update_t &_event)>  _thread_update)

Called when a thread is updated.

Parameters
_thread_updateUser function to attach to event Event is called with the parameter type const dpp::thread_update_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_typing_start()

event_handle dpp::cluster::on_typing_start ( std::function< void(const typing_start_t &_event)>  _typing_start)

Called when a user is typing on a channel.

Parameters
_typing_startUser function to attach to event Event is called with the parameter type const dpp::typing_start_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_user_update()

event_handle dpp::cluster::on_user_update ( std::function< void(const user_update_t &_event)>  _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.

Parameters
_user_updateUser function to attach to event Event is called with the parameter type const dpp::user_update_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_voice_buffer_send()

event_handle dpp::cluster::on_voice_buffer_send ( std::function< void(const voice_buffer_send_t &_event)>  _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.

Parameters
_voice_buffer_sendUser function to attach to event Event is called with the parameter type const dpp::voice_buffer_send_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_voice_client_disconnect()

event_handle dpp::cluster::on_voice_client_disconnect ( std::function< void(const voice_client_disconnect_t &_event)>  _voice_client_disconnect)

on voice client disconnect event

Parameters
_voice_client_disconnectUser function to attach to event Event is called with the parameter type const dpp::voice_client_disconnect_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_voice_client_speaking()

event_handle dpp::cluster::on_voice_client_speaking ( std::function< void(const voice_client_speaking_t &_event)>  _voice_client_speaking)

on voice client speaking event

Parameters
_voice_client_speakingUser function to attach to event Event is called with the parameter type const dpp::voice_client_speaking_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_voice_ready()

event_handle dpp::cluster::on_voice_ready ( std::function< void(const voice_ready_t &_event)>  _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.

Parameters
_voice_readyUser function to attach to event Event is called with the parameter type const dpp::voice_ready_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_voice_receive()

event_handle dpp::cluster::on_voice_receive ( std::function< void(const voice_receive_t &_event)>  _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.

Note
Receiveing audio for bots is not officially supported by discord.
Parameters
_voice_receiveUser function to attach to event Event is called with the parameter type const dpp::voice_receive_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_voice_server_update()

event_handle dpp::cluster::on_voice_server_update ( std::function< void(const voice_server_update_t &_event)>  _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.

Parameters
_voice_server_updateUser function to attach to event Event is called with the parameter type const dpp::voice_server_update_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_voice_state_update()

event_handle dpp::cluster::on_voice_state_update ( std::function< void(const voice_state_update_t &_event)>  _voice_state_update)

on voice state update event

Parameters
_voice_state_updateUser function to attach to event Event is called with the parameter type const dpp::voice_state_update_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_voice_track_marker()

event_handle dpp::cluster::on_voice_track_marker ( std::function< void(const voice_track_marker_t &_event)>  _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.

Parameters
_voice_track_markerUser function to attach to event Event is called with the parameter type const dpp::voice_track_marker_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_voice_user_talking()

event_handle dpp::cluster::on_voice_user_talking ( std::function< void(const voice_user_talking_t &_event)>  _voice_user_talking)

Called when a user is talking on a voice channel.

Parameters
_voice_user_talkingUser function to attach to event Event is called with the parameter type const dpp::voice_user_talking_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ on_webhooks_update()

event_handle dpp::cluster::on_webhooks_update ( std::function< void(const webhooks_update_t &_event)>  _webhooks_update)

Called when the webhooks for a guild are updated.

Parameters
_webhooks_updateUser function to attach to event Event is called with the parameter type const dpp::webhooks_update_t&
Returns
event_handle An opaque handle to the attached event, which can be used to refer to it later if needed

◆ pins_get()

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

Get a channel's pins.

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().

◆ post_rest()

void dpp::cluster::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.

Parameters
endpointEndpoint to post to, e.g. /api/guilds
major_parametersMajor parameters for the endpoint e.g. a guild id
parametersMinor parameters for the API request
methodMethod, e.g. GET, POST
postdataPost data (usually JSON encoded)
callbackFunction to call when the HTTP call completes. The callback parameter will contain amongst other things, the decoded json.
filenameFilename to post for POST requests (for uploading files)
filecontentFile content to post for POST requests (for uploading files)

◆ request()

void dpp::cluster::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 asnyncronous access to HTTP APIs outside of Discord.

Parameters
urlEndpoint to post to, e.g. /api/guilds
methodMethod, e.g. GET, POST
callbackFunction to call when the HTTP call completes. No processing is done on the returned data.
postdataPOST data
mimetypeMIME type of POST data
headersHeaders to send with the request

◆ role_create()

void dpp::cluster::role_create ( const class role r,
command_completion_event_t  callback = {} 
)

Create a role on a guild.

Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
Parameters
rRole to create (guild ID is encapsulated in the role object)
callbackFunction to call when the API call completes. On success the callback will contain a dpp::role 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().

◆ role_delete()

void dpp::cluster::role_delete ( snowflake  guild_id,
snowflake  role_id,
command_completion_event_t  callback = {} 
)

Delete a role.

Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
Parameters
guild_idGuild ID to delete the role on
role_idRole 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().

◆ role_edit()

void dpp::cluster::role_edit ( const class role r,
command_completion_event_t  callback = {} 
)

Edit a role on a guild.

Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
Parameters
rRole to edit
callbackFunction to call when the API call completes. On success the callback will contain a dpp::role 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().

◆ role_edit_position()

void dpp::cluster::role_edit_position ( const class role r,
command_completion_event_t  callback = {} 
)

Edit a role's position in a guild.

Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
Parameters
rRole to change position of
callbackFunction to call when the API call completes. On success the callback will contain a dpp::role 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().

◆ roles_get()

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

Get a role for a guild.

Parameters
guild_idGuild ID to get role for
callbackFunction to call when the API call completes. On success the callback will contain a dpp::role_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().

◆ set_audit_reason()

cluster & dpp::cluster::set_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.

Example:

bot.set_audit_reason("Too much abusive content")
.channel_delete(my_channel_id);
Parameters
reasonThe reason to set for the next REST call on this thread
Returns
cluster& Reference to self for chaining.

◆ set_dm_channel()

void dpp::cluster::set_dm_channel ( snowflake  user_id,
snowflake  channel_id 
)

Set the dm channel id for a user id.

Parameters
user_iduser id to set the dm channel for
channel_iddm channel to set

◆ set_presence()

void dpp::cluster::set_presence ( const class dpp::presence p)

Set the presence for all shards on the cluster.

Parameters
pThe presence to set. Only the online status and the first activity are sent.

◆ set_websocket_protocol()

cluster & dpp::cluster::set_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.

Parameters
modewebsocket protocol to use, either ws_json or ws_etf.
Returns
cluster& Reference to self for chaining.

◆ stage_instance_create()

void dpp::cluster::stage_instance_create ( const stage_instance instance,
command_completion_event_t  callback = {} 
)

Create a stage instance on a stage channel.

Parameters
instanceStage instance to create
callbackUser function to execute when the api call completes On success the callback will contain a dpp::stage_instance 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
This method supports audit log reasons set by the cluster::set_audit_reason() method.

◆ stage_instance_delete()

void dpp::cluster::stage_instance_delete ( const snowflake  channel_id,
command_completion_event_t  callback = {} 
)

Delete a stage instance.

Parameters
channel_idID of the associated channel
callbackUser function to execute 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().
Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.

◆ stage_instance_edit()

void dpp::cluster::stage_instance_edit ( const stage_instance instance,
command_completion_event_t  callback = {} 
)

Edit a stage instance.

Parameters
instanceStage instance to edit
callbackUser function to execute when the api call completes On success the callback will contain a dpp::stage_instance 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
This method supports audit log reasons set by the cluster::set_audit_reason() method.

◆ stage_instance_get()

void dpp::cluster::stage_instance_get ( const snowflake  channel_id,
command_completion_event_t  callback 
)

Get the stage instance associated with the channel id, if it exists.

Parameters
channel_idID of the associated channel
callbackUser function to execute when the api call completes On success the callback will contain a dpp::stage_instance 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().

◆ start()

void dpp::cluster::start ( bool  return_after = true)

Start the cluster, connecting all its shards. Returns once all shards are connected.

Parameters
return_afterIf true the bot will return to your program after starting shards, if false this function will never return.

◆ sticker_packs_get()

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

Get sticker packs.

Parameters
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().

◆ template_get()

void dpp::cluster::template_get ( const std::string &  code,
command_completion_event_t  callback 
)

Get a template.

Parameters
codeTemplate code
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().

◆ thread_create()

void dpp::cluster::thread_create ( const std::string &  thread_name,
snowflake  channel_id,
uint16_t  auto_archive_duration,
channel_type  thread_type,
command_completion_event_t  callback = {} 
)

Create a thread.

Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
Parameters
thread_nameName of the thread
channel_idChannel in which thread to create
auto_archive_durationDuration after which thread auto-archives. Can be set to - 60, 1440 (for boosted guilds can also be: 4320, 10080)
thread_typeType of thread - GUILD_PUBLIC_THREAD, GUILD_NEWS_THREAD, GUILD_PRIVATE_THREAD
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().

◆ thread_create_with_message()

void dpp::cluster::thread_create_with_message ( const std::string &  thread_name,
snowflake  channel_id,
snowflake  message_id,
uint16_t  auto_archive_duration,
command_completion_event_t  callback = {} 
)

Create a thread with a message (Discord: ID of a thread is same as message ID)

Note
This method supports audit log reasons set by the cluster::set_audit_reason() method.
Parameters
thread_nameName of the thread
channel_idChannel in which thread to create
message_idmessage to start thread with
auto_archive_durationDuration after which thread auto-archives. Can be set to - 60, 1440 (for boosted guilds can also be: 4320, 10080)
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().

◆ thread_member_add()

void dpp::cluster::thread_member_add ( snowflake  thread_id,
snowflake  user_id,
command_completion_event_t  callback = {} 
)

Add a member to a thread.

Parameters
thread_idThread ID to add to
user_idMember ID to add
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().

◆ thread_member_remove()

void dpp::cluster::thread_member_remove ( snowflake  thread_id,
snowflake  user_id,
command_completion_event_t  callback = {} 
)

Remove a member from a thread.

Parameters
thread_idThread ID to remove from
user_idMember ID 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().

◆ uptime()

dpp::utility::uptime dpp::cluster::uptime ( )

Returns the uptime of the cluster.

Returns
dpp::utility::uptime The uptime of the cluster

◆ user_get()

void dpp::cluster::user_get ( snowflake  user_id,
command_completion_event_t  callback 
)

Get a user by id.

Parameters
user_idUser ID to retrieve
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().

Member Data Documentation

◆ cache_policy

cache_policy_t dpp::cluster::cache_policy

Current cache policy for the cluster.

◆ cluster_id

uint32_t dpp::cluster::cluster_id

ID of this cluster, between 0 and MAXCLUSTERS-1 inclusive

◆ dispatch

dpp::dispatcher dpp::cluster::dispatch

Routes events from Discord back to user program code via std::functions

◆ intents

uint32_t dpp::cluster::intents

Current bitmask of gateway intents

◆ last_identify

time_t dpp::cluster::last_identify

◆ maxclusters

uint32_t dpp::cluster::maxclusters

Total number of clusters that are active

◆ me

dpp::user dpp::cluster::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.

◆ numshards

uint32_t dpp::cluster::numshards

Total number of shards across all clusters

◆ rest_ping

double dpp::cluster::rest_ping

REST latency (HTTPS ping)

◆ token

std::string dpp::cluster::token

Current bot token for all shards on this cluster and all commands sent via HTTP

◆ ws_mode

websocket_protocol_t dpp::cluster::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.

D++ Library version 10.0.29D++ Library version 10.0.28D++ Library version 10.0.27D++ Library version 10.0.26D++ Library version 10.0.25D++ Library version 10.0.24D++ Library version 10.0.23D++ Library version 10.0.22D++ Library version 10.0.21D++ Library version 10.0.20D++ Library version 10.0.19D++ Library version 10.0.18D++ Library version 10.0.17D++ Library version 10.0.16D++ Library version 10.0.15D++ Library version 10.0.14D++ Library version 10.0.13D++ Library version 10.0.12D++ Library version 10.0.11D++ Library version 10.0.10D++ Library version 10.0.9D++ Library version 10.0.8D++ Library version 10.0.7D++ Library version 10.0.6D++ Library version 10.0.5D++ Library version 10.0.4D++ Library version 10.0.3D++ Library version 10.0.2D++ Library version 10.0.1D++ Library version 10.0.0D++ Library version 9.0.19D++ Library version 9.0.18D++ Library version 9.0.17D++ Library version 9.0.16D++ Library version 9.0.15D++ Library version 9.0.14D++ Library version 9.0.13D++ Library version 9.0.12D++ Library version 9.0.11D++ Library version 9.0.10D++ Library version 9.0.9D++ Library version 9.0.8D++ Library version 9.0.7D++ Library version 9.0.6D++ Library version 9.0.5D++ Library version 9.0.4D++ Library version 9.0.3D++ Library version 9.0.2D++ Library version 9.0.1D++ Library version 9.0.0D++ Library version 1.0.2D++ Library version 1.0.1D++ Library version 1.0.0