The cluster class represents a group of shards and a command queue for sending and receiving commands from discord via HTTP. More...
#include "cluster.h"
Public Member Functions | |
cluster (const cluster &&)=delete | |
dpp::cluster is non-moveable More... | |
cluster (const cluster &)=delete | |
dpp::cluster is non-copyable More... | |
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=cache_policy::cpol_default, uint32_t request_threads=12, uint32_t request_threads_raw=1) | |
Constructor for creating a cluster. More... | |
virtual | ~cluster () |
Destroy the cluster object. More... | |
void | application_role_connection_get (snowflake application_id, command_completion_event_t callback) |
Get the application's role connection metadata records. More... | |
application_role_connection | application_role_connection_get_sync (snowflake application_id) |
Get the application's role connection metadata records. More... | |
void | application_role_connection_update (snowflake application_id, const std::vector< application_role_connection_metadata > &connection_metadata, command_completion_event_t callback=utility::log_error()) |
Update the application's role connection metadata records. More... | |
application_role_connection | application_role_connection_update_sync (snowflake application_id, const std::vector< application_role_connection_metadata > &connection_metadata) |
Update the application's role connection metadata records. More... | |
void | automod_rule_create (snowflake guild_id, const automod_rule &r, command_completion_event_t callback=utility::log_error()) |
Create an auto moderation rule. More... | |
automod_rule | automod_rule_create_sync (snowflake guild_id, const automod_rule &r) |
Create an auto moderation rule. More... | |
void | automod_rule_delete (snowflake guild_id, snowflake rule_id, command_completion_event_t callback=utility::log_error()) |
Delete an auto moderation rule. More... | |
confirmation | automod_rule_delete_sync (snowflake guild_id, snowflake rule_id) |
Delete an auto moderation rule. More... | |
void | automod_rule_edit (snowflake guild_id, const automod_rule &r, command_completion_event_t callback=utility::log_error()) |
Edit an auto moderation rule. More... | |
automod_rule | automod_rule_edit_sync (snowflake guild_id, const automod_rule &r) |
Edit an auto moderation rule. More... | |
void | automod_rule_get (snowflake guild_id, snowflake rule_id, command_completion_event_t callback) |
Get a single auto moderation rule. More... | |
automod_rule | automod_rule_get_sync (snowflake guild_id, snowflake rule_id) |
Get a single auto moderation rule. More... | |
void | automod_rules_get (snowflake guild_id, command_completion_event_t callback) |
Get all auto moderation rules for a guild. More... | |
automod_rule_map | automod_rules_get_sync (snowflake guild_id) |
Get all auto moderation rules for a guild. More... | |
void | channel_create (const class channel &c, command_completion_event_t callback=utility::log_error()) |
Create a channel. More... | |
channel | channel_create_sync (const class channel &c) |
Create a channel. More... | |
void | channel_delete (snowflake channel_id, command_completion_event_t callback=utility::log_error()) |
Delete a channel. More... | |
void | channel_delete_permission (const class channel &c, snowflake overwrite_id, command_completion_event_t callback=utility::log_error()) |
Remove a permission from a channel. More... | |
confirmation | channel_delete_permission_sync (const class channel &c, snowflake overwrite_id) |
Remove a permission from a channel. More... | |
confirmation | channel_delete_sync (snowflake channel_id) |
Delete a channel. More... | |
void | channel_edit (const class channel &c, command_completion_event_t callback=utility::log_error()) |
Edit a channel. More... | |
void | channel_edit_permissions (const class channel &c, const snowflake overwrite_id, const uint64_t allow, const uint64_t deny, const bool member, command_completion_event_t callback=utility::log_error()) |
Edit a channel's permissions. More... | |
void | channel_edit_permissions (const snowflake channel_id, const snowflake overwrite_id, const uint64_t allow, const uint64_t deny, const bool member, command_completion_event_t callback=utility::log_error()) |
Edit a channel's permissions. More... | |
confirmation | channel_edit_permissions_sync (const class channel &c, const snowflake overwrite_id, const uint64_t allow, const uint64_t deny, const bool member) |
Edit a channel's permissions. More... | |
confirmation | channel_edit_permissions_sync (const snowflake channel_id, const snowflake overwrite_id, const uint64_t allow, const uint64_t deny, const bool member) |
Edit a channel's permissions. More... | |
void | channel_edit_positions (const std::vector< channel > &c, command_completion_event_t callback=utility::log_error()) |
Edit multiple channels positions. More... | |
confirmation | channel_edit_positions_sync (const std::vector< channel > &c) |
Edit multiple channels positions. More... | |
channel | channel_edit_sync (const class channel &c) |
Edit a channel. More... | |
void | channel_follow_news (const class channel &c, snowflake target_channel_id, command_completion_event_t callback=utility::log_error()) |
Follow an announcement (news) channel. More... | |
confirmation | channel_follow_news_sync (const class channel &c, snowflake target_channel_id) |
Follow an announcement (news) channel. More... | |
void | channel_get (snowflake c, command_completion_event_t callback) |
Get a channel. More... | |
channel | channel_get_sync (snowflake c) |
Get a channel. More... | |
void | channel_invite_create (const class channel &c, const class invite &i, command_completion_event_t callback=utility::log_error()) |
Create invite for a channel. More... | |
invite | channel_invite_create_sync (const class channel &c, const class invite &i) |
Create invite for a channel. More... | |
void | channel_invites_get (const class channel &c, command_completion_event_t callback) |
Get invites for a channel. More... | |
invite_map | channel_invites_get_sync (const class channel &c) |
Get invites for a channel. More... | |
void | channel_pins_get (snowflake channel_id, command_completion_event_t callback) |
Get a channel's pins. More... | |
message_map | channel_pins_get_sync (snowflake channel_id) |
Get a channel's pins. More... | |
void | channel_set_voice_status (snowflake channel_id, const std::string &status, command_completion_event_t callback=utility::log_error()) |
Set the status of a voice channel. More... | |
confirmation | channel_set_voice_status_sync (snowflake channel_id, const std::string &status) |
Set the status of a voice channel. More... | |
void | channel_typing (const class channel &c, command_completion_event_t callback=utility::log_error()) |
Trigger channel typing indicator. More... | |
void | channel_typing (snowflake cid, command_completion_event_t callback=utility::log_error()) |
Trigger channel typing indicator. More... | |
confirmation | channel_typing_sync (const class channel &c) |
Trigger channel typing indicator. More... | |
confirmation | channel_typing_sync (snowflake cid) |
Trigger channel typing indicator. More... | |
void | channels_get (snowflake guild_id, command_completion_event_t callback) |
Get all channels for a guild. More... | |
channel_map | channels_get_sync (snowflake guild_id) |
Get all channels for a guild. More... | |
cluster & | clear_audit_reason () |
Clear the audit log reason for the next REST call to be made. More... | |
async< confirmation_callback_t > | co_application_role_connection_get (snowflake application_id) |
Get the application's role connection metadata records. More... | |
async< confirmation_callback_t > | co_application_role_connection_update (snowflake application_id, const std::vector< application_role_connection_metadata > &connection_metadata) |
Update the application's role connection metadata records. More... | |
async< confirmation_callback_t > | co_automod_rule_create (snowflake guild_id, const automod_rule &r) |
Create an auto moderation rule. More... | |
async< confirmation_callback_t > | co_automod_rule_delete (snowflake guild_id, snowflake rule_id) |
Delete an auto moderation rule. More... | |
async< confirmation_callback_t > | co_automod_rule_edit (snowflake guild_id, const automod_rule &r) |
Edit an auto moderation rule. More... | |
async< confirmation_callback_t > | co_automod_rule_get (snowflake guild_id, snowflake rule_id) |
Get a single auto moderation rule. More... | |
async< confirmation_callback_t > | co_automod_rules_get (snowflake guild_id) |
Get all auto moderation rules for a guild. More... | |
async< confirmation_callback_t > | co_channel_create (const class channel &c) |
Create a channel. More... | |
async< confirmation_callback_t > | co_channel_delete (snowflake channel_id) |
Delete a channel. More... | |
async< confirmation_callback_t > | co_channel_delete_permission (const class channel &c, snowflake overwrite_id) |
Remove a permission from a channel. More... | |
async< confirmation_callback_t > | co_channel_edit (const class channel &c) |
Edit a channel. More... | |
async< confirmation_callback_t > | co_channel_edit_permissions (const class channel &c, const snowflake overwrite_id, const uint64_t allow, const uint64_t deny, const bool member) |
Edit a channel's permissions. More... | |
async< confirmation_callback_t > | co_channel_edit_permissions (const snowflake channel_id, const snowflake overwrite_id, const uint64_t allow, const uint64_t deny, const bool member) |
Edit a channel's permissions. More... | |
async< confirmation_callback_t > | co_channel_edit_positions (const std::vector< channel > &c) |
Edit multiple channels positions. More... | |
async< confirmation_callback_t > | co_channel_follow_news (const class channel &c, snowflake target_channel_id) |
Follow an announcement (news) channel. More... | |
async< confirmation_callback_t > | co_channel_get (snowflake c) |
Get a channel. More... | |
async< confirmation_callback_t > | co_channel_invite_create (const class channel &c, const class invite &i) |
Create invite for a channel. More... | |
async< confirmation_callback_t > | co_channel_invites_get (const class channel &c) |
Get invites for a channel. More... | |
async< confirmation_callback_t > | co_channel_pins_get (snowflake channel_id) |
Get a channel's pins. More... | |
async< confirmation_callback_t > | co_channel_set_voice_status (snowflake channel_id, const std::string &status) |
Set the status of a voice channel. More... | |
async< confirmation_callback_t > | co_channel_typing (const class channel &c) |
Trigger channel typing indicator. More... | |
async< confirmation_callback_t > | co_channel_typing (snowflake cid) |
Trigger channel typing indicator. More... | |
async< confirmation_callback_t > | co_channels_get (snowflake guild_id) |
Get all channels for a guild. More... | |
async< confirmation_callback_t > | co_create_dm_channel (snowflake user_id) |
Create a dm channel. More... | |
async< confirmation_callback_t > | co_current_application_get () |
Get current (bot) application. More... | |
async< confirmation_callback_t > | co_current_user_connections_get () |
Get current user's connections (linked accounts, e.g. More... | |
async< confirmation_callback_t > | co_current_user_edit (const std::string &nickname, const std::string &image_blob="", const image_type type=i_png) |
Edit current (bot) user. More... | |
async< confirmation_callback_t > | co_current_user_get () |
Get current (bot) user. More... | |
async< confirmation_callback_t > | co_current_user_get_dms () |
Get current user DM channels. More... | |
async< confirmation_callback_t > | co_current_user_get_guilds () |
Get current (bot) user guilds. More... | |
async< confirmation_callback_t > | co_current_user_join_thread (snowflake thread_id) |
Join a thread. More... | |
async< confirmation_callback_t > | co_current_user_leave_guild (snowflake guild_id) |
Leave a guild. More... | |
async< confirmation_callback_t > | co_current_user_leave_thread (snowflake thread_id) |
Leave a thread. More... | |
async< confirmation_callback_t > | co_current_user_set_voice_state (snowflake guild_id, snowflake channel_id, bool suppress=false, time_t request_to_speak_timestamp=0) |
Set the bot's voice state on a stage channel. More... | |
async< confirmation_callback_t > | co_delete_webhook (snowflake webhook_id) |
Delete a webhook. More... | |
async< confirmation_callback_t > | co_delete_webhook_message (const class webhook &wh, snowflake message_id, snowflake thread_id=0) |
Delete webhook message. More... | |
async< confirmation_callback_t > | co_delete_webhook_with_token (snowflake webhook_id, const std::string &token) |
Delete webhook with token. More... | |
async< confirmation_callback_t > | co_direct_message_create (snowflake user_id, const message &m) |
Create a direct message, also create the channel for the direct message if needed. More... | |
async< confirmation_callback_t > | co_edit_webhook (const class webhook &wh) |
Edit webhook. More... | |
async< confirmation_callback_t > | co_edit_webhook_message (const class webhook &wh, const struct message &m, snowflake thread_id=0) |
Edit webhook message. More... | |
async< confirmation_callback_t > | co_edit_webhook_with_token (const class webhook &wh) |
Edit webhook with token (token is encapsulated in the webhook object) More... | |
async< confirmation_callback_t > | co_entitlement_test_create (const class entitlement &new_entitlement) |
Creates a test entitlement to a given SKU for a given guild or user. More... | |
async< confirmation_callback_t > | co_entitlement_test_delete (snowflake entitlement_id) |
Deletes a currently-active test entitlement. More... | |
async< confirmation_callback_t > | co_entitlements_get (snowflake user_id=0, const std::vector< snowflake > &sku_ids={}, snowflake before_id=0, snowflake after_id=0, uint8_t limit=100, snowflake guild_id=0, bool exclude_ended=false) |
Returns all entitlements for a given app, active and expired. More... | |
async< confirmation_callback_t > | co_execute_webhook (const class webhook &wh, const struct message &m, bool wait=false, snowflake thread_id=0, const std::string &thread_name="") |
Execute webhook. More... | |
async< confirmation_callback_t > | co_gdm_add (snowflake channel_id, snowflake user_id, const std::string &access_token, const std::string &nick) |
Adds a recipient to a Group DM using their access token. More... | |
async< confirmation_callback_t > | co_gdm_remove (snowflake channel_id, snowflake user_id) |
Removes a recipient from a Group DM. More... | |
async< confirmation_callback_t > | co_get_channel_webhooks (snowflake channel_id) |
Get channel webhooks. More... | |
async< confirmation_callback_t > | co_get_gateway_bot () |
Get the gateway information for the bot using the token. More... | |
async< confirmation_callback_t > | co_get_guild_webhooks (snowflake guild_id) |
Get guild webhooks. More... | |
async< confirmation_callback_t > | co_get_voice_regions () |
Get all voice regions. More... | |
async< confirmation_callback_t > | co_get_webhook (snowflake webhook_id) |
Get webhook. More... | |
async< confirmation_callback_t > | co_get_webhook_message (const class webhook &wh, snowflake message_id, snowflake thread_id=0) |
Get webhook message. More... | |
async< confirmation_callback_t > | co_get_webhook_with_token (snowflake webhook_id, const std::string &token) |
Get webhook using token. More... | |
async< confirmation_callback_t > | co_global_bulk_command_create (const std::vector< slashcommand > &commands) |
Create/overwrite global slash commands. More... | |
async< confirmation_callback_t > | co_global_bulk_command_delete () |
Delete all existing global slash commands. More... | |
async< confirmation_callback_t > | co_global_command_create (const slashcommand &s) |
Create a global slash command (a bot can have a maximum of 100 of these). More... | |
async< confirmation_callback_t > | co_global_command_delete (snowflake id) |
Delete a global slash command (a bot can have a maximum of 100 of these) More... | |
async< confirmation_callback_t > | co_global_command_edit (const slashcommand &s) |
Edit a global slash command (a bot can have a maximum of 100 of these) More... | |
async< confirmation_callback_t > | co_global_command_get (snowflake id) |
Get a global slash command. More... | |
async< confirmation_callback_t > | co_global_commands_get () |
Get the application's global slash commands. More... | |
async< confirmation_callback_t > | co_guild_add_member (const guild_member &gm, const std::string &access_token) |
Add guild member. More... | |
async< confirmation_callback_t > | co_guild_auditlog_get (snowflake guild_id, snowflake user_id, uint32_t action_type, snowflake before, snowflake after, uint32_t limit) |
Get the audit log for a guild. More... | |
async< confirmation_callback_t > | co_guild_ban_add (snowflake guild_id, snowflake user_id, uint32_t delete_message_seconds=0) |
Add guild ban. More... | |
async< confirmation_callback_t > | co_guild_ban_delete (snowflake guild_id, snowflake user_id) |
Delete guild ban. More... | |
async< confirmation_callback_t > | co_guild_begin_prune (snowflake guild_id, const struct prune &pruneinfo) |
Begin guild prune. More... | |
async< confirmation_callback_t > | co_guild_bulk_command_create (const std::vector< slashcommand > &commands, snowflake guild_id) |
Create/overwrite guild slash commands. More... | |
async< confirmation_callback_t > | co_guild_bulk_command_delete (snowflake guild_id) |
Delete all existing guild slash commands. More... | |
async< confirmation_callback_t > | co_guild_bulk_command_edit_permissions (const std::vector< slashcommand > &commands, snowflake guild_id) |
Edit/Overwrite the permissions of all existing slash commands in a guild. More... | |
async< confirmation_callback_t > | co_guild_command_create (const slashcommand &s, snowflake guild_id) |
Create a slash command local to a guild. More... | |
async< confirmation_callback_t > | co_guild_command_delete (snowflake id, snowflake guild_id) |
Delete a slash command local to a guild. More... | |
async< confirmation_callback_t > | co_guild_command_edit (const slashcommand &s, snowflake guild_id) |
Edit a slash command local to a guild. More... | |
async< confirmation_callback_t > | co_guild_command_edit_permissions (const slashcommand &s, snowflake guild_id) |
Edit slash command permissions of a guild. More... | |
async< confirmation_callback_t > | co_guild_command_get (snowflake id, snowflake guild_id) |
Get a slash command of a guild. More... | |
async< confirmation_callback_t > | co_guild_command_get_permissions (snowflake id, snowflake guild_id) |
Get the permissions for a slash command of a guild. More... | |
async< confirmation_callback_t > | co_guild_commands_get (snowflake guild_id) |
Get the application's slash commands for a guild. More... | |
async< confirmation_callback_t > | co_guild_commands_get_permissions (snowflake guild_id) |
Get all slash command permissions of a guild. More... | |
async< confirmation_callback_t > | co_guild_create (const class guild &g) |
Create a guild. More... | |
async< confirmation_callback_t > | co_guild_create_from_template (const std::string &code, const std::string &name) |
Create a new guild based on a template. More... | |
async< confirmation_callback_t > | co_guild_current_member_edit (snowflake guild_id, const std::string &nickname) |
Modify current member. More... | |
async< confirmation_callback_t > | co_guild_delete (snowflake guild_id) |
Delete a guild. More... | |
async< confirmation_callback_t > | co_guild_delete_integration (snowflake guild_id, snowflake integration_id) |
Delete guild integration. More... | |
async< confirmation_callback_t > | co_guild_edit (const class guild &g) |
Edit a guild. More... | |
async< confirmation_callback_t > | co_guild_edit_member (const guild_member &gm) |
Edit the properties of an existing guild member. More... | |
async< confirmation_callback_t > | co_guild_edit_onboarding (const struct onboarding &o) |
Edit the guild's onboarding configuration. More... | |
async< confirmation_callback_t > | co_guild_edit_welcome_screen (snowflake guild_id, const struct welcome_screen &welcome_screen, bool enabled) |
Edit the guild's welcome screen. More... | |
async< confirmation_callback_t > | co_guild_edit_widget (snowflake guild_id, const class guild_widget &gw) |
Edit guild widget. More... | |
async< confirmation_callback_t > | co_guild_emoji_create (snowflake guild_id, const class emoji &newemoji) |
Create single emoji. More... | |
async< confirmation_callback_t > | co_guild_emoji_delete (snowflake guild_id, snowflake emoji_id) |
Delete a guild emoji. More... | |
async< confirmation_callback_t > | co_guild_emoji_edit (snowflake guild_id, const class emoji &newemoji) |
Edit a single emoji. More... | |
async< confirmation_callback_t > | co_guild_emoji_get (snowflake guild_id, snowflake emoji_id) |
Get a single emoji. More... | |
async< confirmation_callback_t > | co_guild_emojis_get (snowflake guild_id) |
Get all emojis for a guild. More... | |
async< confirmation_callback_t > | co_guild_event_create (const scheduled_event &event) |
Create a scheduled event on a guild. More... | |
async< confirmation_callback_t > | co_guild_event_delete (snowflake event_id, snowflake guild_id) |
Delete a scheduled event from a guild. More... | |
async< confirmation_callback_t > | co_guild_event_edit (const scheduled_event &event) |
Edit/modify a scheduled event on a guild. More... | |
async< confirmation_callback_t > | co_guild_event_get (snowflake guild_id, snowflake event_id) |
Get a scheduled event for a guild. More... | |
async< confirmation_callback_t > | co_guild_events_get (snowflake guild_id) |
Get all scheduled events for a guild. More... | |
async< confirmation_callback_t > | co_guild_get_ban (snowflake guild_id, snowflake user_id) |
Get single guild ban. More... | |
async< confirmation_callback_t > | co_guild_get_bans (snowflake guild_id, snowflake before, snowflake after, snowflake limit) |
Get guild ban list. More... | |
async< confirmation_callback_t > | co_guild_get_integrations (snowflake guild_id) |
Get guild integrations. More... | |
async< confirmation_callback_t > | co_guild_get_invites (snowflake guild_id) |
Get guild invites. More... | |
async< confirmation_callback_t > | co_guild_get_member (snowflake guild_id, snowflake user_id) |
Get a guild member. More... | |
async< confirmation_callback_t > | co_guild_get_members (snowflake guild_id, uint16_t limit, snowflake after) |
Get all guild members. More... | |
async< confirmation_callback_t > | co_guild_get_onboarding (snowflake guild_id) |
Get the guild's onboarding configuration. More... | |
async< confirmation_callback_t > | co_guild_get_prune_counts (snowflake guild_id, const struct prune &pruneinfo) |
Get prune counts. More... | |
async< confirmation_callback_t > | co_guild_get_vanity (snowflake guild_id) |
Get guild vanity url, if enabled. More... | |
async< confirmation_callback_t > | co_guild_get_voice_regions (snowflake guild_id) |
Get guild voice regions. More... | |
async< confirmation_callback_t > | co_guild_get_welcome_screen (snowflake guild_id) |
Get the guild's welcome screen. More... | |
async< confirmation_callback_t > | co_guild_get_widget (snowflake guild_id) |
Get guild widget. More... | |
async< confirmation_callback_t > | co_guild_member_add_role (snowflake guild_id, snowflake user_id, snowflake role_id) |
Add role to guild member. More... | |
async< confirmation_callback_t > | co_guild_member_delete (snowflake guild_id, snowflake user_id) |
Remove (kick) a guild member. More... | |
async< confirmation_callback_t > | co_guild_member_delete_role (snowflake guild_id, snowflake user_id, snowflake role_id) |
Remove role from guild member. More... | |
async< confirmation_callback_t > | co_guild_member_kick (snowflake guild_id, snowflake user_id) |
Remove (kick) a guild member. More... | |
async< confirmation_callback_t > | co_guild_member_move (const snowflake channel_id, const snowflake guild_id, const snowflake user_id) |
Moves the guild member to a other voice channel, if member is connected to one. More... | |
async< confirmation_callback_t > | co_guild_member_remove_role (snowflake guild_id, snowflake user_id, snowflake role_id) |
Remove role from guild member. More... | |
async< confirmation_callback_t > | co_guild_member_timeout (snowflake guild_id, snowflake user_id, time_t communication_disabled_until) |
Set the timeout of a guild member. More... | |
async< confirmation_callback_t > | co_guild_member_timeout_remove (snowflake guild_id, snowflake user_id) |
Remove the timeout of a guild member. More... | |
async< confirmation_callback_t > | co_guild_modify_integration (snowflake guild_id, const class integration &i) |
Modify guild integration. More... | |
async< confirmation_callback_t > | co_guild_search_members (snowflake guild_id, const std::string &query, uint16_t limit) |
Search for guild members based on whether their username or nickname starts with the given string. More... | |
async< confirmation_callback_t > | co_guild_set_nickname (snowflake guild_id, const std::string &nickname) |
Change current user nickname. More... | |
async< confirmation_callback_t > | co_guild_sticker_create (const sticker &s) |
Create a sticker in a guild. More... | |
async< confirmation_callback_t > | co_guild_sticker_delete (snowflake sticker_id, snowflake guild_id) |
Delete a sticker from a guild. More... | |
async< confirmation_callback_t > | co_guild_sticker_get (snowflake id, snowflake guild_id) |
Get a guild sticker. More... | |
async< confirmation_callback_t > | co_guild_sticker_modify (const sticker &s) |
Modify a sticker in a guild. More... | |
async< confirmation_callback_t > | co_guild_stickers_get (snowflake guild_id) |
Get all guild stickers. More... | |
async< confirmation_callback_t > | co_guild_sync_integration (snowflake guild_id, snowflake integration_id) |
Sync guild integration. More... | |
async< confirmation_callback_t > | co_guild_template_create (snowflake guild_id, const std::string &name, const std::string &description) |
Creates a template for the guild. More... | |
async< confirmation_callback_t > | co_guild_template_delete (snowflake guild_id, const std::string &code) |
Deletes the template. More... | |
async< confirmation_callback_t > | co_guild_template_modify (snowflake guild_id, const std::string &code, const std::string &name, const std::string &description) |
Modifies the template's metadata. More... | |
async< confirmation_callback_t > | co_guild_template_sync (snowflake guild_id, const std::string &code) |
Syncs the template to the guild's current state. More... | |
async< confirmation_callback_t > | co_guild_templates_get (snowflake guild_id) |
Get guild templates. More... | |
async< confirmation_callback_t > | co_interaction_followup_create (const std::string &token, const message &m) |
Create a followup message to a slash command. More... | |
async< confirmation_callback_t > | co_interaction_followup_delete (const std::string &token) |
Delete the initial interaction response. More... | |
async< confirmation_callback_t > | co_interaction_followup_edit (const std::string &token, const message &m) |
Edit followup message to a slash command The message ID in the message you pass should be correctly set to that of a followup message you previously sent. More... | |
async< confirmation_callback_t > | co_interaction_followup_edit_original (const std::string &token, const message &m) |
Edit original followup message to a slash command This is an alias for cluster::interaction_response_edit. More... | |
async< confirmation_callback_t > | co_interaction_followup_get (const std::string &token, snowflake message_id) |
Get the followup message to a slash command. More... | |
async< confirmation_callback_t > | co_interaction_followup_get_original (const std::string &token) |
Get the original followup message to a slash command This is an alias for cluster::interaction_response_get_original. More... | |
async< confirmation_callback_t > | co_interaction_response_create (snowflake interaction_id, const std::string &token, const interaction_response &r) |
Respond to a slash command. More... | |
async< confirmation_callback_t > | co_interaction_response_edit (const std::string &token, const message &m) |
Edit response to a slash command. More... | |
async< confirmation_callback_t > | co_interaction_response_get_original (const std::string &token) |
Get the original response to a slash command. More... | |
async< confirmation_callback_t > | co_invite_get (const std::string &invite_code) |
Get details about an invite. More... | |
async< confirmation_callback_t > | co_message_add_reaction (const struct message &m, const std::string &reaction) |
Add a reaction to a message. More... | |
async< confirmation_callback_t > | co_message_add_reaction (snowflake message_id, snowflake channel_id, const std::string &reaction) |
Add a reaction to a message by id. More... | |
async< confirmation_callback_t > | co_message_create (const struct message &m) |
Send a message to a channel. More... | |
async< confirmation_callback_t > | co_message_crosspost (snowflake message_id, snowflake channel_id) |
Crosspost a message. More... | |
async< confirmation_callback_t > | co_message_delete (snowflake message_id, snowflake channel_id) |
Delete a message from a channel. More... | |
async< confirmation_callback_t > | co_message_delete_all_reactions (const struct message &m) |
Delete all reactions on a message. More... | |
async< confirmation_callback_t > | co_message_delete_all_reactions (snowflake message_id, snowflake channel_id) |
Delete all reactions on a message by id. More... | |
async< confirmation_callback_t > | co_message_delete_bulk (const std::vector< snowflake > &message_ids, snowflake channel_id) |
Bulk delete messages from a channel. More... | |
async< confirmation_callback_t > | co_message_delete_own_reaction (const struct message &m, const std::string &reaction) |
Delete own reaction from a message. More... | |
async< confirmation_callback_t > | co_message_delete_own_reaction (snowflake message_id, snowflake channel_id, const std::string &reaction) |
Delete own reaction from a message by id. More... | |
async< confirmation_callback_t > | co_message_delete_reaction (const struct message &m, snowflake user_id, const std::string &reaction) |
Delete a user's reaction from a message. More... | |
async< confirmation_callback_t > | co_message_delete_reaction (snowflake message_id, snowflake channel_id, snowflake user_id, const std::string &reaction) |
Delete a user's reaction from a message by id. More... | |
async< confirmation_callback_t > | co_message_delete_reaction_emoji (const struct message &m, const std::string &reaction) |
Delete all reactions on a message using a particular emoji. More... | |
async< confirmation_callback_t > | co_message_delete_reaction_emoji (snowflake message_id, snowflake channel_id, const std::string &reaction) |
Delete all reactions on a message using a particular emoji by id. More... | |
async< confirmation_callback_t > | co_message_edit (const struct message &m) |
Edit a message on a channel. More... | |
async< confirmation_callback_t > | co_message_edit_flags (const struct message &m) |
Edit the flags of a message on a channel. More... | |
async< confirmation_callback_t > | co_message_get (snowflake message_id, snowflake channel_id) |
Get a message. More... | |
async< confirmation_callback_t > | co_message_get_reactions (const struct message &m, const std::string &reaction, snowflake before, snowflake after, snowflake limit) |
Get reactions on a message for a particular emoji. More... | |
async< confirmation_callback_t > | co_message_get_reactions (snowflake message_id, snowflake channel_id, const std::string &reaction, snowflake before, snowflake after, snowflake limit) |
Get reactions on a message for a particular emoji by id. More... | |
async< confirmation_callback_t > | co_message_pin (snowflake channel_id, snowflake message_id) |
Pin a message. More... | |
async< confirmation_callback_t > | co_message_unpin (snowflake channel_id, snowflake message_id) |
Unpin a message. More... | |
async< confirmation_callback_t > | co_messages_get (snowflake channel_id, snowflake around, snowflake before, snowflake after, uint64_t limit) |
Get multiple messages. More... | |
async< confirmation_callback_t > | co_nitro_sticker_get (snowflake id) |
Get a nitro sticker. More... | |
async< confirmation_callback_t > | co_poll_end (const message &m) |
Immediately end a poll. More... | |
async< confirmation_callback_t > | co_poll_end (snowflake message_id, snowflake channel_id) |
Immediately end a poll. More... | |
async< confirmation_callback_t > | co_poll_get_answer_voters (const message &m, uint32_t answer_id, snowflake after, uint64_t limit) |
Get a list of users that voted for this specific answer. More... | |
async< confirmation_callback_t > | co_poll_get_answer_voters (snowflake message_id, snowflake channel_id, uint32_t answer_id, snowflake after, uint64_t limit) |
Get a list of users that voted for this specific answer. More... | |
async< confirmation_callback_t > | co_role_create (const class role &r) |
Create a role on a guild. More... | |
async< confirmation_callback_t > | co_role_delete (snowflake guild_id, snowflake role_id) |
Delete a role. More... | |
async< confirmation_callback_t > | co_role_edit (const class role &r) |
Edit a role on a guild. More... | |
async< confirmation_callback_t > | co_roles_edit_position (snowflake guild_id, const std::vector< role > &roles) |
Edit multiple role's position in a guild. More... | |
async< confirmation_callback_t > | co_roles_get (snowflake guild_id) |
Get a role for a guild. More... | |
async< confirmation_callback_t > | co_skus_get () |
Returns all SKUs for a given application. More... | |
async< timer > | co_sleep (uint64_t seconds) |
Get an awaitable to wait a certain amount of seconds. More... | |
async< confirmation_callback_t > | co_stage_instance_delete (const snowflake channel_id) |
Delete a stage instance. More... | |
async< confirmation_callback_t > | co_stage_instance_get (const snowflake channel_id) |
Get the stage instance associated with the channel id, if it exists. More... | |
async< confirmation_callback_t > | co_sticker_packs_get () |
Get a list of available sticker packs. More... | |
async< confirmation_callback_t > | co_template_get (const std::string &code) |
Get a template. More... | |
async< confirmation_callback_t > | co_thread_create (const std::string &thread_name, snowflake channel_id, uint16_t auto_archive_duration, channel_type thread_type, bool invitable, uint16_t rate_limit_per_user) |
Create a thread. More... | |
async< confirmation_callback_t > | co_thread_create_in_forum (const std::string &thread_name, snowflake channel_id, const message &msg, auto_archive_duration_t auto_archive_duration, uint16_t rate_limit_per_user, std::vector< snowflake > applied_tags={}) |
Create a thread in a forum or media channel. More... | |
async< confirmation_callback_t > | co_thread_create_with_message (const std::string &thread_name, snowflake channel_id, snowflake message_id, uint16_t auto_archive_duration, uint16_t rate_limit_per_user) |
Create a thread with a message (Discord: ID of a thread is same as message ID) More... | |
async< confirmation_callback_t > | co_thread_edit (const thread &t) |
Edit a thread. More... | |
async< confirmation_callback_t > | co_thread_get (snowflake thread_id) |
Get the thread specified by thread_id. More... | |
async< confirmation_callback_t > | co_thread_member_add (snowflake thread_id, snowflake user_id) |
Add a member to a thread. More... | |
async< confirmation_callback_t > | co_thread_member_get (const snowflake thread_id, const snowflake user_id) |
Get a thread member. More... | |
async< confirmation_callback_t > | co_thread_member_remove (snowflake thread_id, snowflake user_id) |
Remove a member from a thread. More... | |
async< confirmation_callback_t > | co_thread_members_get (snowflake thread_id) |
Get members of a thread. More... | |
async< confirmation_callback_t > | co_threads_get_active (snowflake guild_id) |
Get all active threads in the guild, including public and private threads. More... | |
async< confirmation_callback_t > | co_threads_get_joined_private_archived (snowflake channel_id, snowflake before_id, uint16_t limit) |
Get private archived threads in a channel which current user has joined (Sorted by ID in descending order) More... | |
async< confirmation_callback_t > | co_threads_get_private_archived (snowflake channel_id, time_t before_timestamp, uint16_t limit) |
Get private archived threads in a channel (Sorted by archive_timestamp in descending order) More... | |
async< confirmation_callback_t > | co_threads_get_public_archived (snowflake channel_id, time_t before_timestamp, uint16_t limit) |
Get public archived threads in a channel (Sorted by archive_timestamp in descending order) More... | |
async< confirmation_callback_t > | co_user_application_role_connection_get (snowflake application_id) |
Get user application role connection. More... | |
async< confirmation_callback_t > | co_user_application_role_connection_update (snowflake application_id, const application_role_connection &connection) |
Update user application role connection. More... | |
async< confirmation_callback_t > | co_user_get (snowflake user_id) |
Get a user by id, without using the cache. More... | |
async< confirmation_callback_t > | co_user_get_cached (snowflake user_id) |
Get a user by id, checking in the cache first. More... | |
async< confirmation_callback_t > | co_user_set_voice_state (snowflake user_id, snowflake guild_id, snowflake channel_id, bool suppress=false) |
Set a user's voice state on a stage channel. More... | |
void | create_dm_channel (snowflake user_id, command_completion_event_t callback=utility::log_error()) |
Create a dm channel. More... | |
channel | create_dm_channel_sync (snowflake user_id) |
Create a dm channel. More... | |
void | create_webhook (const class webhook &w, command_completion_event_t callback=utility::log_error()) |
Create a webhook. More... | |
void | current_application_get (command_completion_event_t callback) |
Get current (bot) application. More... | |
application | current_application_get_sync () |
Get current (bot) application. More... | |
void | current_user_connections_get (command_completion_event_t callback) |
Get current user's connections (linked accounts, e.g. More... | |
connection_map | current_user_connections_get_sync () |
Get current user's connections (linked accounts, e.g. More... | |
void | current_user_edit (const std::string &nickname, const std::string &image_blob="", const image_type type=i_png, command_completion_event_t callback=utility::log_error()) |
Edit current (bot) user. More... | |
user | current_user_edit_sync (const std::string &nickname, const std::string &image_blob="", const image_type type=i_png) |
Edit current (bot) user. More... | |
void | current_user_get (command_completion_event_t callback) |
Get current (bot) user. More... | |
void | current_user_get_dms (command_completion_event_t callback) |
Get current user DM channels. More... | |
channel_map | current_user_get_dms_sync () |
Get current user DM channels. More... | |
void | current_user_get_guilds (command_completion_event_t callback) |
Get current (bot) user guilds. More... | |
guild_map | current_user_get_guilds_sync () |
Get current (bot) user guilds. More... | |
user_identified | current_user_get_sync () |
Get current (bot) user. More... | |
void | current_user_join_thread (snowflake thread_id, command_completion_event_t callback=utility::log_error()) |
Join a thread. More... | |
confirmation | current_user_join_thread_sync (snowflake thread_id) |
Join a thread. More... | |
void | current_user_leave_guild (snowflake guild_id, command_completion_event_t callback=utility::log_error()) |
Leave a guild. More... | |
confirmation | current_user_leave_guild_sync (snowflake guild_id) |
Leave a guild. More... | |
void | current_user_leave_thread (snowflake thread_id, command_completion_event_t callback=utility::log_error()) |
Leave a thread. More... | |
confirmation | current_user_leave_thread_sync (snowflake thread_id) |
Leave a thread. More... | |
void | current_user_set_voice_state (snowflake guild_id, snowflake channel_id, bool suppress=false, time_t request_to_speak_timestamp=0, command_completion_event_t callback=utility::log_error()) |
Set the bot's voice state on a stage channel. More... | |
confirmation | current_user_set_voice_state_sync (snowflake guild_id, snowflake channel_id, bool suppress=false, time_t request_to_speak_timestamp=0) |
Set the bot's voice state on a stage channel. More... | |
void | delete_webhook (snowflake webhook_id, command_completion_event_t callback=utility::log_error()) |
Delete a webhook. More... | |
void | delete_webhook_message (const class webhook &wh, snowflake message_id, snowflake thread_id=0, command_completion_event_t callback=utility::log_error()) |
Delete webhook message. More... | |
confirmation | delete_webhook_message_sync (const class webhook &wh, snowflake message_id, snowflake thread_id=0) |
Delete webhook message. More... | |
confirmation | delete_webhook_sync (snowflake webhook_id) |
Delete a webhook. More... | |
void | delete_webhook_with_token (snowflake webhook_id, const std::string &token, command_completion_event_t callback=utility::log_error()) |
Delete webhook with token. More... | |
confirmation | delete_webhook_with_token_sync (snowflake webhook_id, const std::string &token) |
Delete webhook with token. More... | |
void | direct_message_create (snowflake user_id, const message &m, command_completion_event_t callback=utility::log_error()) |
Create a direct message, also create the channel for the direct message if needed. More... | |
message | direct_message_create_sync (snowflake user_id, const message &m) |
Create a direct message, also create the channel for the direct message if needed. More... | |
void | edit_webhook (const class webhook &wh, command_completion_event_t callback=utility::log_error()) |
Edit webhook. More... | |
void | edit_webhook_message (const class webhook &wh, const struct message &m, snowflake thread_id=0, command_completion_event_t callback=utility::log_error()) |
Edit webhook message. More... | |
message | edit_webhook_message_sync (const class webhook &wh, const struct message &m, snowflake thread_id=0) |
Edit webhook message. More... | |
webhook | edit_webhook_sync (const class webhook &wh) |
Edit webhook. More... | |
void | edit_webhook_with_token (const class webhook &wh, command_completion_event_t callback=utility::log_error()) |
Edit webhook with token (token is encapsulated in the webhook object) More... | |
webhook | edit_webhook_with_token_sync (const class webhook &wh) |
Edit webhook with token (token is encapsulated in the webhook object) More... | |
void | entitlement_test_create (const class entitlement &new_entitlement, command_completion_event_t callback=utility::log_error()) |
Creates a test entitlement to a given SKU for a given guild or user. More... | |
entitlement | entitlement_test_create_sync (const class entitlement &new_entitlement) |
Creates a test entitlement to a given SKU for a given guild or user. More... | |
void | entitlement_test_delete (snowflake entitlement_id, command_completion_event_t callback=utility::log_error()) |
Deletes a currently-active test entitlement. More... | |
confirmation | entitlement_test_delete_sync (snowflake entitlement_id) |
Deletes a currently-active test entitlement. More... | |
void | entitlements_get (snowflake user_id=0, const std::vector< snowflake > &sku_ids={}, snowflake before_id=0, snowflake after_id=0, uint8_t limit=100, snowflake guild_id=0, bool exclude_ended=false, command_completion_event_t callback=utility::log_error()) |
Returns all entitlements for a given app, active and expired. More... | |
entitlement_map | entitlements_get_sync (snowflake user_id=0, const std::vector< snowflake > &sku_ids={}, snowflake before_id=0, snowflake after_id=0, uint8_t limit=100, snowflake guild_id=0, bool exclude_ended=false) |
Returns all entitlements for a given app, active and expired. More... | |
void | execute_webhook (const class webhook &wh, const struct message &m, bool wait=false, snowflake thread_id=0, const std::string &thread_name="", command_completion_event_t callback=utility::log_error()) |
Execute webhook. More... | |
message | execute_webhook_sync (const class webhook &wh, const struct message &m, bool wait=false, snowflake thread_id=0, const std::string &thread_name="") |
Execute webhook. More... | |
void | gdm_add (snowflake channel_id, snowflake user_id, const std::string &access_token, const std::string &nick, command_completion_event_t callback=utility::log_error()) |
Adds a recipient to a Group DM using their access token. More... | |
confirmation | gdm_add_sync (snowflake channel_id, snowflake user_id, const std::string &access_token, const std::string &nick) |
Adds a recipient to a Group DM using their access token. More... | |
void | gdm_remove (snowflake channel_id, snowflake user_id, command_completion_event_t callback=utility::log_error()) |
Removes a recipient from a Group DM. More... | |
confirmation | gdm_remove_sync (snowflake channel_id, snowflake user_id) |
Removes a recipient from a Group DM. More... | |
std::string | get_audit_reason () |
Get the audit reason set for the next REST call to be made on this thread. More... | |
void | get_channel_webhooks (snowflake channel_id, command_completion_event_t callback) |
Get channel webhooks. More... | |
webhook_map | get_channel_webhooks_sync (snowflake channel_id) |
Get channel webhooks. More... | |
snowflake | get_dm_channel (snowflake user_id) |
Get the dm channel for a user id. More... | |
void | get_gateway_bot (command_completion_event_t callback) |
Get the gateway information for the bot using the token. More... | |
gateway | get_gateway_bot_sync () |
Get the gateway information for the bot using the token. More... | |
void | get_guild_webhooks (snowflake guild_id, command_completion_event_t callback) |
Get guild webhooks. More... | |
webhook_map | get_guild_webhooks_sync (snowflake guild_id) |
Get guild webhooks. More... | |
request_queue * | get_raw_rest () |
Get the raw rest_queue object which handles all HTTP(S) requests that are not directed at Discord. More... | |
request_queue * | get_rest () |
Get the rest_queue object which handles HTTPS requests to Discord. More... | |
discord_client * | get_shard (uint32_t id) |
Get a shard by id, returning the discord_client. More... | |
const shard_list & | get_shards () |
Get the list of shards. More... | |
void | get_voice_regions (command_completion_event_t callback) |
Get all voice regions. More... | |
voiceregion_map | get_voice_regions_sync () |
Get all voice regions. More... | |
void | get_webhook (snowflake webhook_id, command_completion_event_t callback) |
Get webhook. More... | |
void | get_webhook_message (const class webhook &wh, snowflake message_id, snowflake thread_id=0, command_completion_event_t callback=utility::log_error()) |
Get webhook message. More... | |
message | get_webhook_message_sync (const class webhook &wh, snowflake message_id, snowflake thread_id=0) |
Get webhook message. More... | |
webhook | get_webhook_sync (snowflake webhook_id) |
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... | |
webhook | get_webhook_with_token_sync (snowflake webhook_id, const std::string &token) |
Get webhook using token. More... | |
void | global_bulk_command_create (const std::vector< slashcommand > &commands, command_completion_event_t callback=utility::log_error()) |
Create/overwrite global slash commands. More... | |
slashcommand_map | global_bulk_command_create_sync (const std::vector< slashcommand > &commands) |
Create/overwrite global slash commands. More... | |
void | global_bulk_command_delete (command_completion_event_t callback=utility::log_error()) |
Delete all existing global slash commands. More... | |
slashcommand_map | global_bulk_command_delete_sync () |
Delete all existing global slash commands. More... | |
void | global_command_create (const slashcommand &s, command_completion_event_t callback=utility::log_error()) |
Create a global slash command (a bot can have a maximum of 100 of these). More... | |
slashcommand | global_command_create_sync (const slashcommand &s) |
Create a global slash command (a bot can have a maximum of 100 of these). More... | |
void | global_command_delete (snowflake id, command_completion_event_t callback=utility::log_error()) |
Delete a global slash command (a bot can have a maximum of 100 of these) More... | |
confirmation | global_command_delete_sync (snowflake id) |
Delete a global slash command (a bot can have a maximum of 100 of these) More... | |
void | global_command_edit (const slashcommand &s, command_completion_event_t callback=utility::log_error()) |
Edit a global slash command (a bot can have a maximum of 100 of these) More... | |
confirmation | global_command_edit_sync (const slashcommand &s) |
Edit a global slash command (a bot can have a maximum of 100 of these) More... | |
void | global_command_get (snowflake id, command_completion_event_t callback=utility::log_error()) |
Get a global slash command. More... | |
slashcommand | global_command_get_sync (snowflake id) |
Get a global slash command. More... | |
void | global_commands_get (command_completion_event_t callback) |
Get the application's global slash commands. More... | |
slashcommand_map | global_commands_get_sync () |
Get the application's global slash commands. More... | |
void | guild_add_member (const guild_member &gm, const std::string &access_token, command_completion_event_t callback=utility::log_error()) |
Add guild member. More... | |
confirmation | guild_add_member_sync (const guild_member &gm, const std::string &access_token) |
Add guild member. More... | |
void | guild_auditlog_get (snowflake guild_id, snowflake user_id, uint32_t action_type, snowflake before, snowflake after, uint32_t limit, command_completion_event_t callback) |
Get the audit log for a guild. More... | |
auditlog | guild_auditlog_get_sync (snowflake guild_id, snowflake user_id, uint32_t action_type, snowflake before, snowflake after, uint32_t limit) |
Get the audit log for a guild. More... | |
void | guild_ban_add (snowflake guild_id, snowflake user_id, uint32_t delete_message_seconds=0, command_completion_event_t callback=utility::log_error()) |
Add guild ban. More... | |
confirmation | guild_ban_add_sync (snowflake guild_id, snowflake user_id, uint32_t delete_message_seconds=0) |
Add guild ban. More... | |
void | guild_ban_delete (snowflake guild_id, snowflake user_id, command_completion_event_t callback=utility::log_error()) |
Delete guild ban. More... | |
confirmation | guild_ban_delete_sync (snowflake guild_id, snowflake user_id) |
Delete guild ban. More... | |
void | guild_begin_prune (snowflake guild_id, const struct prune &pruneinfo, command_completion_event_t callback=utility::log_error()) |
Begin guild prune. More... | |
prune | guild_begin_prune_sync (snowflake guild_id, const struct prune &pruneinfo) |
Begin guild prune. More... | |
void | guild_bulk_command_create (const std::vector< slashcommand > &commands, snowflake guild_id, command_completion_event_t callback=utility::log_error()) |
Create/overwrite guild slash commands. More... | |
slashcommand_map | guild_bulk_command_create_sync (const std::vector< slashcommand > &commands, snowflake guild_id) |
Create/overwrite guild slash commands. More... | |
void | guild_bulk_command_delete (snowflake guild_id, command_completion_event_t callback=utility::log_error()) |
Delete all existing guild slash commands. More... | |
slashcommand_map | guild_bulk_command_delete_sync (snowflake guild_id) |
Delete all existing guild slash commands. More... | |
void | guild_bulk_command_edit_permissions (const std::vector< slashcommand > &commands, snowflake guild_id, command_completion_event_t callback=utility::log_error()) |
Edit/Overwrite the permissions of all existing slash commands in a guild. More... | |
guild_command_permissions_map | guild_bulk_command_edit_permissions_sync (const std::vector< slashcommand > &commands, snowflake guild_id) |
Edit/Overwrite the permissions of all existing slash commands in a guild. More... | |
void | guild_command_create (const slashcommand &s, snowflake guild_id, command_completion_event_t callback=utility::log_error()) |
Create a slash command local to a guild. More... | |
slashcommand | guild_command_create_sync (const slashcommand &s, snowflake guild_id) |
Create a slash command local to a guild. More... | |
void | guild_command_delete (snowflake id, snowflake guild_id, command_completion_event_t callback=utility::log_error()) |
Delete a slash command local to a guild. More... | |
confirmation | guild_command_delete_sync (snowflake id, snowflake guild_id) |
Delete a slash command local to a guild. More... | |
void | guild_command_edit (const slashcommand &s, snowflake guild_id, command_completion_event_t callback=utility::log_error()) |
Edit a slash command local to a guild. More... | |
void | guild_command_edit_permissions (const slashcommand &s, snowflake guild_id, command_completion_event_t callback=utility::log_error()) |
Edit slash command permissions of a guild. More... | |
confirmation | guild_command_edit_permissions_sync (const slashcommand &s, snowflake guild_id) |
Edit slash command permissions of a guild. More... | |
confirmation | guild_command_edit_sync (const slashcommand &s, snowflake guild_id) |
Edit a slash command local to a guild. More... | |
void | guild_command_get (snowflake id, snowflake guild_id, command_completion_event_t callback=utility::log_error()) |
Get a slash command of a guild. More... | |
void | guild_command_get_permissions (snowflake id, snowflake guild_id, command_completion_event_t callback=utility::log_error()) |
Get the permissions for a slash command of a guild. More... | |
guild_command_permissions | guild_command_get_permissions_sync (snowflake id, snowflake guild_id) |
Get the permissions for a slash command of a guild. More... | |
slashcommand | guild_command_get_sync (snowflake id, snowflake guild_id) |
Get a slash command of a guild. More... | |
void | guild_commands_get (snowflake guild_id, command_completion_event_t callback) |
Get the application's slash commands for a guild. More... | |
void | guild_commands_get_permissions (snowflake guild_id, command_completion_event_t callback) |
Get all slash command permissions of a guild. More... | |
guild_command_permissions_map | guild_commands_get_permissions_sync (snowflake guild_id) |
Get all slash command permissions of a guild. More... | |
slashcommand_map | guild_commands_get_sync (snowflake guild_id) |
Get the application's slash commands for a guild. More... | |
void | guild_create (const class guild &g, command_completion_event_t callback=utility::log_error()) |
Create a guild. More... | |
void | guild_create_from_template (const std::string &code, const std::string &name, command_completion_event_t callback=utility::log_error()) |
Create a new guild based on a template. More... | |
guild | guild_create_from_template_sync (const std::string &code, const std::string &name) |
Create a new guild based on a template. More... | |
guild | guild_create_sync (const class guild &g) |
Create a guild. More... | |
void | guild_current_member_edit (snowflake guild_id, const std::string &nickname, command_completion_event_t callback=utility::log_error()) |
Modify current member. More... | |
confirmation | guild_current_member_edit_sync (snowflake guild_id, const std::string &nickname) |
Modify current member. More... | |
void | guild_delete (snowflake guild_id, command_completion_event_t callback=utility::log_error()) |
Delete a guild. More... | |
void | guild_delete_integration (snowflake guild_id, snowflake integration_id, command_completion_event_t callback=utility::log_error()) |
Delete guild integration. More... | |
confirmation | guild_delete_integration_sync (snowflake guild_id, snowflake integration_id) |
Delete guild integration. More... | |
confirmation | guild_delete_sync (snowflake guild_id) |
Delete a guild. More... | |
void | guild_edit (const class guild &g, command_completion_event_t callback=utility::log_error()) |
Edit a guild. More... | |
void | guild_edit_member (const guild_member &gm, command_completion_event_t callback=utility::log_error()) |
Edit the properties of an existing guild member. More... | |
guild_member | guild_edit_member_sync (const guild_member &gm) |
Edit the properties of an existing guild member. More... | |
void | guild_edit_onboarding (const struct onboarding &o, command_completion_event_t callback=utility::log_error()) |
Edit the guild's onboarding configuration. More... | |
onboarding | guild_edit_onboarding_sync (const struct onboarding &o) |
Edit the guild's onboarding configuration. More... | |
guild | guild_edit_sync (const class guild &g) |
Edit a guild. More... | |
void | guild_edit_welcome_screen (snowflake guild_id, const struct welcome_screen &welcome_screen, bool enabled, command_completion_event_t callback=utility::log_error()) |
Edit the guild's welcome screen. More... | |
dpp::welcome_screen | guild_edit_welcome_screen_sync (snowflake guild_id, const struct welcome_screen &welcome_screen, bool enabled) |
Edit the guild's welcome screen. More... | |
void | guild_edit_widget (snowflake guild_id, const class guild_widget &gw, command_completion_event_t callback=utility::log_error()) |
Edit guild widget. More... | |
guild_widget | guild_edit_widget_sync (snowflake guild_id, const class guild_widget &gw) |
Edit guild widget. More... | |
void | guild_emoji_create (snowflake guild_id, const class emoji &newemoji, command_completion_event_t callback=utility::log_error()) |
Create single emoji. More... | |
emoji | guild_emoji_create_sync (snowflake guild_id, const class emoji &newemoji) |
Create single emoji. More... | |
void | guild_emoji_delete (snowflake guild_id, snowflake emoji_id, command_completion_event_t callback=utility::log_error()) |
Delete a guild emoji. More... | |
confirmation | guild_emoji_delete_sync (snowflake guild_id, snowflake emoji_id) |
Delete a guild emoji. More... | |
void | guild_emoji_edit (snowflake guild_id, const class emoji &newemoji, command_completion_event_t callback=utility::log_error()) |
Edit a single emoji. More... | |
emoji | guild_emoji_edit_sync (snowflake guild_id, const class emoji &newemoji) |
Edit a single emoji. More... | |
void | guild_emoji_get (snowflake guild_id, snowflake emoji_id, command_completion_event_t callback) |
Get a single emoji. More... | |
emoji | guild_emoji_get_sync (snowflake guild_id, snowflake emoji_id) |
Get a single emoji. More... | |
void | guild_emojis_get (snowflake guild_id, command_completion_event_t callback) |
Get all emojis for a guild. More... | |
emoji_map | guild_emojis_get_sync (snowflake guild_id) |
Get all emojis for a guild. More... | |
void | guild_event_create (const scheduled_event &event, command_completion_event_t callback=utility::log_error()) |
Create a scheduled event on a guild. More... | |
scheduled_event | guild_event_create_sync (const scheduled_event &event) |
Create a scheduled event on a guild. More... | |
void | guild_event_delete (snowflake event_id, snowflake guild_id, command_completion_event_t callback=utility::log_error()) |
Delete a scheduled event from a guild. More... | |
confirmation | guild_event_delete_sync (snowflake event_id, snowflake guild_id) |
Delete a scheduled event from a guild. More... | |
void | guild_event_edit (const scheduled_event &event, command_completion_event_t callback=utility::log_error()) |
Edit/modify a scheduled event on a guild. More... | |
scheduled_event | guild_event_edit_sync (const scheduled_event &event) |
Edit/modify a scheduled event on a guild. More... | |
void | guild_event_get (snowflake guild_id, snowflake event_id, command_completion_event_t callback) |
Get a scheduled event for a guild. More... | |
scheduled_event | guild_event_get_sync (snowflake guild_id, snowflake event_id) |
Get a scheduled event for a guild. More... | |
void | guild_event_users_get (snowflake guild_id, snowflake event_id, command_completion_event_t callback, uint8_t limit=100, snowflake before=0, snowflake after=0) |
Get users RSVP'd to an event. More... | |
void | guild_events_get (snowflake guild_id, command_completion_event_t callback) |
Get all scheduled events for a guild. More... | |
scheduled_event_map | guild_events_get_sync (snowflake guild_id) |
Get all scheduled events for a guild. More... | |
void | guild_get (snowflake g, command_completion_event_t callback) |
Get a guild. More... | |
void | guild_get_ban (snowflake guild_id, snowflake user_id, command_completion_event_t callback) |
Get single guild ban. More... | |
ban | guild_get_ban_sync (snowflake guild_id, snowflake user_id) |
Get single guild ban. More... | |
void | guild_get_bans (snowflake guild_id, snowflake before, snowflake after, snowflake limit, command_completion_event_t callback) |
Get guild ban list. More... | |
ban_map | guild_get_bans_sync (snowflake guild_id, snowflake before, snowflake after, snowflake limit) |
Get guild ban list. More... | |
void | guild_get_integrations (snowflake guild_id, command_completion_event_t callback) |
Get guild integrations. More... | |
integration_map | guild_get_integrations_sync (snowflake guild_id) |
Get guild integrations. More... | |
void | guild_get_invites (snowflake guild_id, command_completion_event_t callback) |
Get guild invites. More... | |
invite_map | guild_get_invites_sync (snowflake guild_id) |
Get guild invites. More... | |
void | guild_get_member (snowflake guild_id, snowflake user_id, command_completion_event_t callback) |
Get a guild member. More... | |
guild_member | guild_get_member_sync (snowflake guild_id, snowflake user_id) |
Get a guild member. More... | |
void | guild_get_members (snowflake guild_id, uint16_t limit, snowflake after, command_completion_event_t callback) |
Get all guild members. More... | |
guild_member_map | guild_get_members_sync (snowflake guild_id, uint16_t limit, snowflake after) |
Get all guild members. More... | |
void | guild_get_onboarding (snowflake guild_id, command_completion_event_t callback) |
Get the guild's onboarding configuration. More... | |
onboarding | guild_get_onboarding_sync (snowflake guild_id) |
Get the guild's onboarding configuration. More... | |
void | guild_get_preview (snowflake g, command_completion_event_t callback) |
Get a guild preview. More... | |
void | guild_get_prune_counts (snowflake guild_id, const struct prune &pruneinfo, command_completion_event_t callback) |
Get prune counts. More... | |
prune | guild_get_prune_counts_sync (snowflake guild_id, const struct prune &pruneinfo) |
Get prune counts. More... | |
void | guild_get_vanity (snowflake guild_id, command_completion_event_t callback) |
Get guild vanity url, if enabled. More... | |
invite | guild_get_vanity_sync (snowflake guild_id) |
Get guild vanity url, if enabled. More... | |
void | guild_get_voice_regions (snowflake guild_id, command_completion_event_t callback) |
Get guild voice regions. More... | |
voiceregion_map | guild_get_voice_regions_sync (snowflake guild_id) |
Get guild voice regions. More... | |
void | guild_get_welcome_screen (snowflake guild_id, command_completion_event_t callback) |
Get the guild's welcome screen. More... | |
dpp::welcome_screen | guild_get_welcome_screen_sync (snowflake guild_id) |
Get the guild's welcome screen. More... | |
void | guild_get_widget (snowflake guild_id, command_completion_event_t callback) |
Get guild widget. More... | |
guild_widget | guild_get_widget_sync (snowflake guild_id) |
Get guild widget. More... | |
void | guild_member_add_role (snowflake guild_id, snowflake user_id, snowflake role_id, command_completion_event_t callback=utility::log_error()) |
Add role to guild member. More... | |
confirmation | guild_member_add_role_sync (snowflake guild_id, snowflake user_id, snowflake role_id) |
Add role to guild member. More... | |
void | guild_member_delete (snowflake guild_id, snowflake user_id, command_completion_event_t callback=utility::log_error()) |
Remove (kick) a guild member. More... | |
void | guild_member_delete_role (snowflake guild_id, snowflake user_id, snowflake role_id, command_completion_event_t callback=utility::log_error()) |
Remove role from guild member. More... | |
confirmation | guild_member_delete_role_sync (snowflake guild_id, snowflake user_id, snowflake role_id) |
Remove role from guild member. More... | |
confirmation | guild_member_delete_sync (snowflake guild_id, snowflake user_id) |
Remove (kick) a guild member. More... | |
void | guild_member_kick (snowflake guild_id, snowflake user_id, command_completion_event_t callback=utility::log_error()) |
Remove (kick) a guild member. More... | |
confirmation | guild_member_kick_sync (snowflake guild_id, snowflake user_id) |
Remove (kick) a guild member. More... | |
void | guild_member_move (const snowflake channel_id, const snowflake guild_id, const snowflake user_id, command_completion_event_t callback=utility::log_error()) |
Moves the guild member to a other voice channel, if member is connected to one. More... | |
guild_member | guild_member_move_sync (const snowflake channel_id, const snowflake guild_id, const snowflake user_id) |
Moves the guild member to a other voice channel, if member is connected to one. More... | |
void | guild_member_remove_role (snowflake guild_id, snowflake user_id, snowflake role_id, command_completion_event_t callback=utility::log_error()) |
Remove role from guild member. More... | |
confirmation | guild_member_remove_role_sync (snowflake guild_id, snowflake user_id, snowflake role_id) |
Remove role from guild member. More... | |
void | guild_member_timeout (snowflake guild_id, snowflake user_id, time_t communication_disabled_until, command_completion_event_t callback=utility::log_error()) |
Set the timeout of a guild member. More... | |
void | guild_member_timeout_remove (snowflake guild_id, snowflake user_id, command_completion_event_t callback=utility::log_error()) |
Remove the timeout of a guild member. More... | |
confirmation | guild_member_timeout_remove_sync (snowflake guild_id, snowflake user_id) |
Remove the timeout of a guild member. More... | |
confirmation | guild_member_timeout_sync (snowflake guild_id, snowflake user_id, time_t communication_disabled_until) |
Set the timeout of a guild member. More... | |
void | guild_modify_integration (snowflake guild_id, const class integration &i, command_completion_event_t callback=utility::log_error()) |
Modify guild integration. More... | |
confirmation | guild_modify_integration_sync (snowflake guild_id, const class integration &i) |
Modify guild integration. 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... | |
guild_member_map | guild_search_members_sync (snowflake guild_id, const std::string &query, uint16_t limit) |
Search for guild members based on whether their username or nickname starts with the given string. More... | |
void | guild_set_nickname (snowflake guild_id, const std::string &nickname, command_completion_event_t callback=utility::log_error()) |
Change current user nickname. More... | |
confirmation | guild_set_nickname_sync (snowflake guild_id, const std::string &nickname) |
Change current user nickname. More... | |
void | guild_sticker_create (const sticker &s, command_completion_event_t callback=utility::log_error()) |
Create a sticker in a guild. More... | |
sticker | guild_sticker_create_sync (const sticker &s) |
Create a sticker in a guild. More... | |
void | guild_sticker_delete (snowflake sticker_id, snowflake guild_id, command_completion_event_t callback=utility::log_error()) |
Delete a sticker from a guild. More... | |
confirmation | guild_sticker_delete_sync (snowflake sticker_id, snowflake guild_id) |
Delete a sticker from a guild. More... | |
void | guild_sticker_get (snowflake id, snowflake guild_id, command_completion_event_t callback) |
Get a guild sticker. More... | |
sticker | guild_sticker_get_sync (snowflake id, snowflake guild_id) |
Get a guild sticker. More... | |
void | guild_sticker_modify (const sticker &s, command_completion_event_t callback=utility::log_error()) |
Modify a sticker in a guild. More... | |
sticker | guild_sticker_modify_sync (const sticker &s) |
Modify a sticker in a guild. More... | |
void | guild_stickers_get (snowflake guild_id, command_completion_event_t callback) |
Get all guild stickers. More... | |
sticker_map | guild_stickers_get_sync (snowflake guild_id) |
Get all guild stickers. More... | |
void | guild_sync_integration (snowflake guild_id, snowflake integration_id, command_completion_event_t callback=utility::log_error()) |
Sync guild integration. More... | |
confirmation | guild_sync_integration_sync (snowflake guild_id, snowflake integration_id) |
Sync guild integration. More... | |
void | guild_template_create (snowflake guild_id, const std::string &name, const std::string &description, command_completion_event_t callback=utility::log_error()) |
Creates a template for the guild. More... | |
dtemplate | guild_template_create_sync (snowflake guild_id, const std::string &name, const std::string &description) |
Creates a template for the guild. More... | |
void | guild_template_delete (snowflake guild_id, const std::string &code, command_completion_event_t callback=utility::log_error()) |
Deletes the template. More... | |
confirmation | guild_template_delete_sync (snowflake guild_id, const std::string &code) |
Deletes the template. More... | |
void | guild_template_modify (snowflake guild_id, const std::string &code, const std::string &name, const std::string &description, command_completion_event_t callback=utility::log_error()) |
Modifies the template's metadata. More... | |
dtemplate | guild_template_modify_sync (snowflake guild_id, const std::string &code, const std::string &name, const std::string &description) |
Modifies the template's metadata. More... | |
void | guild_template_sync (snowflake guild_id, const std::string &code, command_completion_event_t callback=utility::log_error()) |
Syncs the template to the guild's current state. More... | |
dtemplate | guild_template_sync_sync (snowflake guild_id, const std::string &code) |
Syncs the template to the guild's current state. More... | |
void | guild_templates_get (snowflake guild_id, command_completion_event_t callback) |
Get guild templates. More... | |
dtemplate_map | guild_templates_get_sync (snowflake guild_id) |
Get guild templates. More... | |
void | interaction_followup_create (const std::string &token, const message &m, command_completion_event_t callback=utility::log_error()) |
Create a followup message to a slash command. More... | |
confirmation | interaction_followup_create_sync (const std::string &token, const message &m) |
Create a followup message to a slash command. More... | |
void | interaction_followup_delete (const std::string &token, command_completion_event_t callback=utility::log_error()) |
Delete the initial interaction response. More... | |
confirmation | interaction_followup_delete_sync (const std::string &token) |
Delete the initial interaction response. More... | |
void | interaction_followup_edit (const std::string &token, const message &m, command_completion_event_t callback=utility::log_error()) |
Edit followup message to a slash command The message ID in the message you pass should be correctly set to that of a followup message you previously sent. More... | |
void | interaction_followup_edit_original (const std::string &token, const message &m, command_completion_event_t callback=utility::log_error()) |
Edit original followup message to a slash command This is an alias for cluster::interaction_response_edit. More... | |
confirmation | interaction_followup_edit_original_sync (const std::string &token, const message &m) |
Edit original followup message to a slash command This is an alias for cluster::interaction_response_edit. More... | |
confirmation | interaction_followup_edit_sync (const std::string &token, const message &m) |
Edit followup message to a slash command The message ID in the message you pass should be correctly set to that of a followup message you previously sent. More... | |
void | interaction_followup_get (const std::string &token, snowflake message_id, command_completion_event_t callback) |
Get the followup message to a slash command. More... | |
void | interaction_followup_get_original (const std::string &token, command_completion_event_t callback=utility::log_error()) |
Get the original followup message to a slash command This is an alias for cluster::interaction_response_get_original. More... | |
message | interaction_followup_get_original_sync (const std::string &token) |
Get the original followup message to a slash command This is an alias for cluster::interaction_response_get_original. More... | |
message | interaction_followup_get_sync (const std::string &token, snowflake message_id) |
Get the followup message to a slash command. More... | |
void | interaction_response_create (snowflake interaction_id, const std::string &token, const interaction_response &r, command_completion_event_t callback=utility::log_error()) |
Respond to a slash command. More... | |
confirmation | interaction_response_create_sync (snowflake interaction_id, const std::string &token, const interaction_response &r) |
Respond to a slash command. More... | |
void | interaction_response_edit (const std::string &token, const message &m, command_completion_event_t callback=utility::log_error()) |
Edit response to a slash command. More... | |
confirmation | interaction_response_edit_sync (const std::string &token, const message &m) |
Edit response to a slash command. More... | |
void | interaction_response_get_original (const std::string &token, command_completion_event_t callback=utility::log_error()) |
Get the original response to a slash command. More... | |
message | interaction_response_get_original_sync (const std::string &token) |
Get the original response to a slash command. More... | |
void | invite_delete (const std::string &invite, command_completion_event_t callback=utility::log_error()) |
Delete an invite. More... | |
void | invite_get (const std::string &invite_code, command_completion_event_t callback) |
Get details about an invite. More... | |
invite | invite_get_sync (const std::string &invite_code) |
Get details about an invite. More... | |
void | log (dpp::loglevel severity, const std::string &msg) const |
Log a message to whatever log the user is using. More... | |
void | message_add_reaction (const struct message &m, const std::string &reaction, command_completion_event_t callback=utility::log_error()) |
Add a reaction to a message. More... | |
void | message_add_reaction (snowflake message_id, snowflake channel_id, const std::string &reaction, command_completion_event_t callback=utility::log_error()) |
Add a reaction to a message by id. More... | |
confirmation | message_add_reaction_sync (const struct message &m, const std::string &reaction) |
Add a reaction to a message. More... | |
confirmation | message_add_reaction_sync (snowflake message_id, snowflake channel_id, const std::string &reaction) |
Add a reaction to a message by id. More... | |
void | message_create (const struct message &m, command_completion_event_t callback=utility::log_error()) |
Send a message to a channel. More... | |
message | message_create_sync (const struct message &m) |
Send a message to a channel. More... | |
void | message_crosspost (snowflake message_id, snowflake channel_id, command_completion_event_t callback=utility::log_error()) |
Crosspost a message. More... | |
message | message_crosspost_sync (snowflake message_id, snowflake channel_id) |
Crosspost a message. More... | |
void | message_delete (snowflake message_id, snowflake channel_id, command_completion_event_t callback=utility::log_error()) |
Delete a message from a channel. More... | |
void | message_delete_all_reactions (const struct message &m, command_completion_event_t callback=utility::log_error()) |
Delete all reactions on a message. More... | |
void | message_delete_all_reactions (snowflake message_id, snowflake channel_id, command_completion_event_t callback=utility::log_error()) |
Delete all reactions on a message by id. More... | |
confirmation | message_delete_all_reactions_sync (const struct message &m) |
Delete all reactions on a message. More... | |
confirmation | message_delete_all_reactions_sync (snowflake message_id, snowflake channel_id) |
Delete all reactions on a message by id. More... | |
void | message_delete_bulk (const std::vector< snowflake > &message_ids, snowflake channel_id, command_completion_event_t callback=utility::log_error()) |
Bulk delete messages from a channel. More... | |
confirmation | message_delete_bulk_sync (const std::vector< snowflake > &message_ids, snowflake channel_id) |
Bulk delete messages from a channel. More... | |
void | message_delete_own_reaction (const struct message &m, const std::string &reaction, command_completion_event_t callback=utility::log_error()) |
Delete own reaction from a message. More... | |
void | message_delete_own_reaction (snowflake message_id, snowflake channel_id, const std::string &reaction, command_completion_event_t callback=utility::log_error()) |
Delete own reaction from a message by id. More... | |
confirmation | message_delete_own_reaction_sync (const struct message &m, const std::string &reaction) |
Delete own reaction from a message. More... | |
confirmation | message_delete_own_reaction_sync (snowflake message_id, snowflake channel_id, const std::string &reaction) |
Delete own reaction from a message by id. More... | |
void | message_delete_reaction (const struct message &m, snowflake user_id, const std::string &reaction, command_completion_event_t callback=utility::log_error()) |
Delete a user's reaction from a message. More... | |
void | message_delete_reaction (snowflake message_id, snowflake channel_id, snowflake user_id, const std::string &reaction, command_completion_event_t callback=utility::log_error()) |
Delete a user's reaction from a message by id. More... | |
void | message_delete_reaction_emoji (const struct message &m, const std::string &reaction, command_completion_event_t callback=utility::log_error()) |
Delete all reactions on a message using a particular emoji. More... | |
void | message_delete_reaction_emoji (snowflake message_id, snowflake channel_id, const std::string &reaction, command_completion_event_t callback=utility::log_error()) |
Delete all reactions on a message using a particular emoji by id. More... | |
confirmation | message_delete_reaction_emoji_sync (const struct message &m, const std::string &reaction) |
Delete all reactions on a message using a particular emoji. More... | |
confirmation | message_delete_reaction_emoji_sync (snowflake message_id, snowflake channel_id, const std::string &reaction) |
Delete all reactions on a message using a particular emoji by id. More... | |
confirmation | message_delete_reaction_sync (const struct message &m, snowflake user_id, const std::string &reaction) |
Delete a user's reaction from a message. More... | |
confirmation | message_delete_reaction_sync (snowflake message_id, snowflake channel_id, snowflake user_id, const std::string &reaction) |
Delete a user's reaction from a message by id. More... | |
confirmation | message_delete_sync (snowflake message_id, snowflake channel_id) |
Delete a message from a channel. More... | |
void | message_edit (const struct message &m, command_completion_event_t callback=utility::log_error()) |
Edit a message on a channel. More... | |
void | message_edit_flags (const struct message &m, command_completion_event_t callback=utility::log_error()) |
Edit the flags of a message on a channel. More... | |
message | message_edit_flags_sync (const struct message &m) |
Edit the flags of a message on a channel. More... | |
message | message_edit_sync (const struct message &m) |
Edit a message on a channel. More... | |
void | message_get (snowflake message_id, snowflake channel_id, command_completion_event_t callback) |
Get a message. 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. 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. More... | |
user_map | message_get_reactions_sync (const struct message &m, const std::string &reaction, snowflake before, snowflake after, snowflake limit) |
Get reactions on a message for a particular emoji. More... | |
emoji_map | message_get_reactions_sync (snowflake message_id, snowflake channel_id, const std::string &reaction, snowflake before, snowflake after, snowflake limit) |
Get reactions on a message for a particular emoji by id. More... | |
message | message_get_sync (snowflake message_id, snowflake channel_id) |
Get a message. More... | |
void | message_pin (snowflake channel_id, snowflake message_id, command_completion_event_t callback=utility::log_error()) |
Pin a message. More... | |
confirmation | message_pin_sync (snowflake channel_id, snowflake message_id) |
Pin a message. More... | |
void | message_unpin (snowflake channel_id, snowflake message_id, command_completion_event_t callback=utility::log_error()) |
Unpin a message. More... | |
confirmation | message_unpin_sync (snowflake channel_id, snowflake message_id) |
Unpin a message. More... | |
void | messages_get (snowflake channel_id, snowflake around, snowflake before, snowflake after, uint64_t limit, command_completion_event_t callback) |
Get multiple messages. More... | |
message_map | messages_get_sync (snowflake channel_id, snowflake around, snowflake before, snowflake after, uint64_t limit) |
Get multiple messages. More... | |
void | nitro_sticker_get (snowflake id, command_completion_event_t callback) |
Get a nitro sticker. More... | |
sticker | nitro_sticker_get_sync (snowflake id) |
Get a nitro sticker. More... | |
cluster & | operator= (const cluster &&)=delete |
dpp::cluster is non-moveable More... | |
cluster & | operator= (const cluster &)=delete |
dpp::cluster is non-copyable More... | |
void | poll_end (const message &m, command_completion_event_t callback=utility::log_error()) |
Immediately end a poll. More... | |
void | poll_end (snowflake message_id, snowflake channel_id, command_completion_event_t callback=utility::log_error()) |
Immediately end a poll. More... | |
message | poll_end_sync (const message &m) |
Immediately end a poll. More... | |
message | poll_end_sync (snowflake message_id, snowflake channel_id) |
Immediately end a poll. More... | |
void | poll_get_answer_voters (const message &m, uint32_t answer_id, snowflake after, uint64_t limit, command_completion_event_t callback=utility::log_error()) |
Get a list of users that voted for this specific answer. More... | |
void | poll_get_answer_voters (snowflake message_id, snowflake channel_id, uint32_t answer_id, snowflake after, uint64_t limit, command_completion_event_t callback=utility::log_error()) |
Get a list of users that voted for this specific answer. More... | |
user_map | poll_get_answer_voters_sync (const message &m, uint32_t answer_id, snowflake after, uint64_t limit) |
Get a list of users that voted for this specific answer. More... | |
user_map | poll_get_answer_voters_sync (snowflake message_id, snowflake channel_id, uint32_t answer_id, snowflake after, uint64_t limit) |
Get a list of users that voted for this specific answer. More... | |
void | post_rest (const std::string &endpoint, const std::string &major_parameters, const std::string ¶meters, http_method method, const std::string &postdata, json_encode_t callback, const std::string &filename="", const std::string &filecontent="", const std::string &filemimetype="", const std::string &protocol="1.1") |
Post a REST request. More... | |
void | post_rest_multipart (const std::string &endpoint, const std::string &major_parameters, const std::string ¶meters, http_method method, const std::string &postdata, json_encode_t callback, const std::vector< message_file_data > &file_data={}) |
Post a multipart REST request. 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={}, const std::string &protocol="1.1") |
Make a HTTP(S) request. More... | |
void | role_create (const class role &r, command_completion_event_t callback=utility::log_error()) |
Create a role on a guild. More... | |
role | role_create_sync (const class role &r) |
Create a role on a guild. More... | |
void | role_delete (snowflake guild_id, snowflake role_id, command_completion_event_t callback=utility::log_error()) |
Delete a role. More... | |
confirmation | role_delete_sync (snowflake guild_id, snowflake role_id) |
Delete a role. More... | |
void | role_edit (const class role &r, command_completion_event_t callback=utility::log_error()) |
Edit a role on a guild. More... | |
role | role_edit_sync (const class role &r) |
Edit a role on a guild. More... | |
void | roles_edit_position (snowflake guild_id, const std::vector< role > &roles, command_completion_event_t callback=utility::log_error()) |
Edit multiple role's position in a guild. More... | |
role_map | roles_edit_position_sync (snowflake guild_id, const std::vector< role > &roles) |
Edit multiple role's position in a guild. More... | |
void | roles_get (snowflake guild_id, command_completion_event_t callback) |
Get a role for a guild. More... | |
role_map | roles_get_sync (snowflake guild_id) |
Get a role for a guild. More... | |
cluster & | set_audit_reason (const std::string &reason) |
Set the audit log reason for the next REST call to be made. More... | |
cluster & | set_default_gateway (std::string &default_gateway) |
Sets the address of the default gateway, for connecting the websockets. More... | |
void | set_dm_channel (snowflake user_id, snowflake channel_id) |
Set the dm channel id for a user id. More... | |
void | set_presence (const class dpp::presence &p) |
Set the presence for all shards on the cluster. More... | |
cluster & | set_websocket_protocol (websocket_protocol_t mode) |
Set the websocket protocol for all shards on this cluster. More... | |
void | shutdown () |
End cluster execution without destructing it. More... | |
void | skus_get (command_completion_event_t callback=utility::log_error()) |
Returns all SKUs for a given application. More... | |
sku_map | skus_get_sync () |
Returns all SKUs for a given application. More... | |
void | stage_instance_create (const stage_instance &instance, command_completion_event_t callback=utility::log_error()) |
Create a stage instance on a stage channel. More... | |
void | stage_instance_delete (const snowflake channel_id, command_completion_event_t callback=utility::log_error()) |
Delete a stage instance. More... | |
confirmation | stage_instance_delete_sync (const snowflake channel_id) |
Delete a stage instance. More... | |
void | stage_instance_edit (const stage_instance &instance, command_completion_event_t callback=utility::log_error()) |
Edit a stage instance. More... | |
void | stage_instance_get (const snowflake channel_id, command_completion_event_t callback) |
Get the stage instance associated with the channel id, if it exists. More... | |
stage_instance | stage_instance_get_sync (const snowflake channel_id) |
Get the stage instance associated with the channel id, if it exists. More... | |
void | start (bool return_after=true) |
Start the cluster, connecting all its shards. More... | |
timer | start_timer (timer_callback_t on_tick, uint64_t frequency, timer_callback_t on_stop={}) |
Start a timer. More... | |
void | sticker_packs_get (command_completion_event_t callback) |
Get a list of available sticker packs. More... | |
sticker_pack_map | sticker_packs_get_sync () |
Get a list of available sticker packs. More... | |
bool | stop_timer (timer t) |
Stop a ticking timer. More... | |
void | template_get (const std::string &code, command_completion_event_t callback) |
Get a template. More... | |
dtemplate | template_get_sync (const std::string &code) |
Get a template. More... | |
void | thread_create (const std::string &thread_name, snowflake channel_id, uint16_t auto_archive_duration, channel_type thread_type, bool invitable, uint16_t rate_limit_per_user, command_completion_event_t callback=utility::log_error()) |
Create a thread. More... | |
void | thread_create_in_forum (const std::string &thread_name, snowflake channel_id, const message &msg, auto_archive_duration_t auto_archive_duration, uint16_t rate_limit_per_user, std::vector< snowflake > applied_tags={}, command_completion_event_t callback=utility::log_error()) |
Create a thread in a forum or media channel. More... | |
thread | thread_create_in_forum_sync (const std::string &thread_name, snowflake channel_id, const message &msg, auto_archive_duration_t auto_archive_duration, uint16_t rate_limit_per_user, std::vector< snowflake > applied_tags={}) |
Create a thread in a forum or media channel. More... | |
thread | thread_create_sync (const std::string &thread_name, snowflake channel_id, uint16_t auto_archive_duration, channel_type thread_type, bool invitable, uint16_t rate_limit_per_user) |
Create a thread. More... | |
void | thread_create_with_message (const std::string &thread_name, snowflake channel_id, snowflake message_id, uint16_t auto_archive_duration, uint16_t rate_limit_per_user, command_completion_event_t callback=utility::log_error()) |
Create a thread with a message (Discord: ID of a thread is same as message ID) More... | |
thread | thread_create_with_message_sync (const std::string &thread_name, snowflake channel_id, snowflake message_id, uint16_t auto_archive_duration, uint16_t rate_limit_per_user) |
Create a thread with a message (Discord: ID of a thread is same as message ID) More... | |
void | thread_edit (const thread &t, command_completion_event_t callback=utility::log_error()) |
Edit a thread. More... | |
thread | thread_edit_sync (const thread &t) |
Edit a thread. More... | |
void | thread_get (snowflake thread_id, command_completion_event_t callback) |
Get the thread specified by thread_id. More... | |
thread | thread_get_sync (snowflake thread_id) |
Get the thread specified by thread_id. More... | |
void | thread_member_add (snowflake thread_id, snowflake user_id, command_completion_event_t callback=utility::log_error()) |
Add a member to a thread. More... | |
confirmation | thread_member_add_sync (snowflake thread_id, snowflake user_id) |
Add a member to a thread. More... | |
void | thread_member_get (const snowflake thread_id, const snowflake user_id, command_completion_event_t callback) |
Get a thread member. More... | |
thread_member | thread_member_get_sync (const snowflake thread_id, const snowflake user_id) |
Get a thread member. More... | |
void | thread_member_remove (snowflake thread_id, snowflake user_id, command_completion_event_t callback=utility::log_error()) |
Remove a member from a thread. More... | |
confirmation | thread_member_remove_sync (snowflake thread_id, snowflake user_id) |
Remove a member from a thread. More... | |
void | thread_members_get (snowflake thread_id, command_completion_event_t callback) |
Get members of a thread. More... | |
thread_member_map | thread_members_get_sync (snowflake thread_id) |
Get members of a thread. More... | |
void | threads_get_active (snowflake guild_id, command_completion_event_t callback) |
Get all active threads in the guild, including public and private threads. More... | |
active_threads | threads_get_active_sync (snowflake guild_id) |
Get all active threads in the guild, including public and private threads. More... | |
void | threads_get_joined_private_archived (snowflake channel_id, snowflake before_id, uint16_t limit, command_completion_event_t callback) |
Get private archived threads in a channel which current user has joined (Sorted by ID in descending order) More... | |
thread_map | threads_get_joined_private_archived_sync (snowflake channel_id, snowflake before_id, uint16_t limit) |
Get private archived threads in a channel which current user has joined (Sorted by ID in descending order) More... | |
void | threads_get_private_archived (snowflake channel_id, time_t before_timestamp, uint16_t limit, command_completion_event_t callback) |
Get private archived threads in a channel (Sorted by archive_timestamp in descending order) More... | |
thread_map | threads_get_private_archived_sync (snowflake channel_id, time_t before_timestamp, uint16_t limit) |
Get private archived threads in a channel (Sorted by archive_timestamp in descending order) More... | |
void | threads_get_public_archived (snowflake channel_id, time_t before_timestamp, uint16_t limit, command_completion_event_t callback) |
Get public archived threads in a channel (Sorted by archive_timestamp in descending order) More... | |
thread_map | threads_get_public_archived_sync (snowflake channel_id, time_t before_timestamp, uint16_t limit) |
Get public archived threads in a channel (Sorted by archive_timestamp in descending order) More... | |
dpp::utility::uptime | uptime () |
Returns the uptime of the cluster. More... | |
void | user_application_role_connection_get (snowflake application_id, command_completion_event_t callback) |
Get user application role connection. More... | |
application_role_connection | user_application_role_connection_get_sync (snowflake application_id) |
Get user application role connection. More... | |
void | user_application_role_connection_update (snowflake application_id, const application_role_connection &connection, command_completion_event_t callback=utility::log_error()) |
Update user application role connection. More... | |
application_role_connection | user_application_role_connection_update_sync (snowflake application_id, const application_role_connection &connection) |
Update user application role connection. More... | |
void | user_get (snowflake user_id, command_completion_event_t callback) |
Get a user by id, without using the cache. More... | |
void | user_get_cached (snowflake user_id, command_completion_event_t callback) |
Get a user by id, checking in the cache first. More... | |
user_identified | user_get_cached_sync (snowflake user_id) |
Get a user by id, checking in the cache first. More... | |
user_identified | user_get_sync (snowflake user_id) |
Get a user by id, without using the cache. More... | |
void | user_set_voice_state (snowflake user_id, snowflake guild_id, snowflake channel_id, bool suppress=false, command_completion_event_t callback=utility::log_error()) |
Set a user's voice state on a stage channel. More... | |
confirmation | user_set_voice_state_sync (snowflake user_id, snowflake guild_id, snowflake channel_id, bool suppress=false) |
Set a user's voice state on a stage channel. More... | |
Public Attributes | |
cache_policy_t | cache_policy |
Current cache policy for the cluster. More... | |
uint32_t | cluster_id |
ID of this cluster, between 0 and MAXCLUSTERS-1 inclusive. More... | |
uint32_t | intents |
Current bitmask of gateway intents. More... | |
time_t | last_identify |
Last time the bot sent an IDENTIFY. More... | |
uint32_t | maxclusters |
Total number of clusters that are active. More... | |
dpp::user | me |
The details of the bot user. More... | |
uint32_t | numshards |
Total number of shards across all clusters. More... | |
event_router_t< autocomplete_t > | on_autocomplete |
Called when an auto completed field needs suggestions to present to the user This is triggered by discord when option choices have auto completion enabled which you have associated with a dpp::slashcommand. More... | |
event_router_t< automod_rule_create_t > | on_automod_rule_create |
Called when a new automod rule is created. More... | |
event_router_t< automod_rule_delete_t > | on_automod_rule_delete |
Called when an automod rule is deleted. More... | |
event_router_t< automod_rule_execute_t > | on_automod_rule_execute |
Called when an automod rule is triggered/executed. More... | |
event_router_t< automod_rule_update_t > | on_automod_rule_update |
Called when an automod rule is updated. More... | |
event_router_t< button_click_t > | on_button_click |
Called when a button is clicked attached to a message. More... | |
event_router_t< channel_create_t > | on_channel_create |
Called when a new channel is created on a guild. More... | |
event_router_t< channel_delete_t > | on_channel_delete |
Called when a channel is deleted from a guild. More... | |
event_router_t< channel_pins_update_t > | on_channel_pins_update |
Called when a message is pinned. More... | |
event_router_t< channel_update_t > | on_channel_update |
Called when a channel is edited on a guild. More... | |
event_router_t< entitlement_create_t > | on_entitlement_create |
Called when a user subscribes to an SKU. More... | |
event_router_t< entitlement_delete_t > | on_entitlement_delete |
Called when a user's entitlement is deleted. More... | |
event_router_t< entitlement_update_t > | on_entitlement_update |
Called when a user's subscription renews for the next billing period. More... | |
event_router_t< form_submit_t > | on_form_submit |
Called when a modal dialog is submitted. More... | |
event_router_t< guild_audit_log_entry_create_t > | on_guild_audit_log_entry_create |
Called when a guild audit log entry is created. More... | |
event_router_t< guild_ban_add_t > | on_guild_ban_add |
Called when a ban is added to a guild. More... | |
event_router_t< guild_ban_remove_t > | on_guild_ban_remove |
Called when a ban is removed from a guild. More... | |
event_router_t< guild_create_t > | on_guild_create |
Called when a new guild is created. More... | |
event_router_t< guild_delete_t > | on_guild_delete |
Called when a guild is deleted. More... | |
event_router_t< guild_emojis_update_t > | on_guild_emojis_update |
Called when new emojis are added to a guild. More... | |
event_router_t< guild_integrations_update_t > | on_guild_integrations_update |
Called when an integration is updated for a guild. More... | |
event_router_t< guild_join_request_delete_t > | on_guild_join_request_delete |
on guild join request delete. More... | |
event_router_t< guild_member_add_t > | on_guild_member_add |
Called when a new member joins a guild. More... | |
event_router_t< guild_member_remove_t > | on_guild_member_remove |
Called when a user leaves a guild (either through being kicked, or choosing to leave) More... | |
event_router_t< guild_member_update_t > | on_guild_member_update |
Called when details of a guild member (e.g. More... | |
event_router_t< guild_members_chunk_t > | on_guild_members_chunk |
Called when a set of members is received for a guild. More... | |
event_router_t< guild_role_create_t > | on_guild_role_create |
Called when a new role is created on a guild. More... | |
event_router_t< guild_role_delete_t > | on_guild_role_delete |
Called when a role is deleted in a guild. More... | |
event_router_t< guild_role_update_t > | on_guild_role_update |
Called when an existing role is updated on a guild. More... | |
event_router_t< guild_scheduled_event_create_t > | on_guild_scheduled_event_create |
Called when a new scheduled event is created. More... | |
event_router_t< guild_scheduled_event_delete_t > | on_guild_scheduled_event_delete |
Called when a new scheduled event is deleted. More... | |
event_router_t< guild_scheduled_event_update_t > | on_guild_scheduled_event_update |
Called when a new scheduled event is updated. More... | |
event_router_t< guild_scheduled_event_user_add_t > | on_guild_scheduled_event_user_add |
Called when a user is added to a scheduled event. More... | |
event_router_t< guild_scheduled_event_user_remove_t > | on_guild_scheduled_event_user_remove |
Called when a user is removed from a scheduled event. More... | |
event_router_t< guild_stickers_update_t > | on_guild_stickers_update |
Called when new stickers are added to a guild. More... | |
event_router_t< guild_update_t > | on_guild_update |
Called when details of a guild are updated. More... | |
event_router_t< integration_create_t > | on_integration_create |
Called when a new integration is attached to a guild by a user. More... | |
event_router_t< integration_delete_t > | on_integration_delete |
Called when an integration is removed by a user. More... | |
event_router_t< integration_update_t > | on_integration_update |
Called when an integration is updated by a user. More... | |
event_router_t< interaction_create_t > | on_interaction_create |
Called when a new interaction is created. More... | |
event_router_t< invite_create_t > | on_invite_create |
Called when a new invite is created for a guild. More... | |
event_router_t< invite_delete_t > | on_invite_delete |
Called when an invite is deleted from a guild. More... | |
event_router_t< log_t > | on_log |
Called when a log message is to be written to the log. More... | |
event_router_t< message_context_menu_t > | on_message_context_menu |
Called when a user right-clicks or long-presses on a message, where a slash command is bound to the dpp::ctxm_message command type. More... | |
event_router_t< message_create_t > | on_message_create |
Called when a new message arrives from discord. More... | |
event_router_t< message_delete_t > | on_message_delete |
Called when a message is deleted. More... | |
event_router_t< message_delete_bulk_t > | on_message_delete_bulk |
Called when multiple messages are deleted from a channel or DM. More... | |
event_router_t< message_poll_vote_add_t > | on_message_poll_vote_add |
Called when a vote is added to a message poll. More... | |
event_router_t< message_poll_vote_remove_t > | on_message_poll_vote_remove |
Called when a vote is removed from a message poll. More... | |
event_router_t< message_reaction_add_t > | on_message_reaction_add |
Called when a new reaction is added to a message. More... | |
event_router_t< message_reaction_remove_t > | on_message_reaction_remove |
Called when a single reaction is removed from a message. More... | |
event_router_t< message_reaction_remove_all_t > | on_message_reaction_remove_all |
Called when all reactions are removed from a message. More... | |
event_router_t< message_reaction_remove_emoji_t > | on_message_reaction_remove_emoji |
Called when all reactions for a particular emoji are removed from a message. More... | |
event_router_t< message_update_t > | on_message_update |
Called when a message is updated (edited). More... | |
event_router_t< presence_update_t > | on_presence_update |
Called when a user's presence is updated. More... | |
event_router_t< ready_t > | on_ready |
Called when a shard is connected and ready. More... | |
event_router_t< resumed_t > | on_resumed |
Called when a connection to a shard successfully resumes. More... | |
event_router_t< select_click_t > | on_select_click |
Called when a select menu is clicked attached to a message. More... | |
event_router_t< slashcommand_t > | on_slashcommand |
Called when a slash command is issued. More... | |
event_router_t< stage_instance_create_t > | on_stage_instance_create |
Called when a new stage instance is created on a stage channel. More... | |
event_router_t< stage_instance_delete_t > | on_stage_instance_delete |
Called when an existing stage instance is deleted from a stage channel. More... | |
event_router_t< stage_instance_update_t > | on_stage_instance_update |
Called when a stage instance is updated. More... | |
event_router_t< thread_create_t > | on_thread_create |
Called when a thread is created. More... | |
event_router_t< thread_delete_t > | on_thread_delete |
Called when a thread is deleted. More... | |
event_router_t< thread_list_sync_t > | on_thread_list_sync |
Called when thread list is synced (upon gaining access to a channel). More... | |
event_router_t< thread_member_update_t > | on_thread_member_update |
Called when current user's thread member object is updated. More... | |
event_router_t< thread_members_update_t > | on_thread_members_update |
Called when a thread's member list is updated (without GUILD_MEMBERS intent, is only called for current user) More... | |
event_router_t< thread_update_t > | on_thread_update |
Called when a thread is updated. More... | |
event_router_t< typing_start_t > | on_typing_start |
Called when a user is typing on a channel. More... | |
event_router_t< user_context_menu_t > | on_user_context_menu |
Called when a user right-clicks or long-presses on a user, where a slash command is bound to the dpp::ctxm_user command type. More... | |
event_router_t< user_update_t > | on_user_update |
Called when a user is updated. More... | |
event_router_t< voice_buffer_send_t > | on_voice_buffer_send |
Called when packets are sent from the voice buffer. More... | |
event_router_t< voice_client_disconnect_t > | on_voice_client_disconnect |
on voice client disconnect event More... | |
event_router_t< voice_client_speaking_t > | on_voice_client_speaking |
on voice client speaking event More... | |
event_router_t< voice_ready_t > | on_voice_ready |
Called when a voice channel is connected and ready to send audio. More... | |
event_router_t< voice_receive_t > | on_voice_receive |
Called when new audio data is received. More... | |
event_router_t< voice_receive_t > | on_voice_receive_combined |
Called when new audio data is received, combined and mixed for all speaking users. More... | |
event_router_t< voice_server_update_t > | on_voice_server_update |
Called when we are told which voice server we can use. More... | |
event_router_t< voice_state_update_t > | on_voice_state_update |
on voice state update event More... | |
event_router_t< voice_track_marker_t > | on_voice_track_marker |
Called when sending of audio passes over a track marker. More... | |
event_router_t< voice_user_talking_t > | on_voice_user_talking |
Called when a user is talking on a voice channel. More... | |
event_router_t< webhooks_update_t > | on_webhooks_update |
Called when the webhooks for a guild are updated. More... | |
double | rest_ping |
REST latency (HTTPS ping) in seconds. More... | |
std::condition_variable | terminating |
Condition variable notified when the cluster is terminating. More... | |
std::string | token |
Current bot token for all shards on this cluster and all commands sent via HTTP. More... | |
websocket_protocol_t | ws_mode |
Websocket mode for all shards in the cluster, either ws_json or ws_etf. More... | |
Friends | |
class | discord_client |
class | discord_voice_client |
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.
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 = cache_policy::cpol_default , |
||
uint32_t | request_threads = 12 , |
||
uint32_t | request_threads_raw = 1 |
||
) |
Constructor for creating a cluster.
All but the token are optional.
token | The bot token to use for all HTTP commands and websocket connections |
intents | A bitmask of dpd::intents values for all shards on this cluster. This is required to be sent for all bots with over 100 servers. |
shards | The 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_id | The ID of this cluster, should be between 0 and MAXCLUSTERS-1 |
maxclusters | The total number of clusters that are active, which may be on separate processes or even separate machines. |
compressed | Whether or not to use compression for shards on this cluster. Saves a ton of bandwidth at the cost of some CPU |
policy | Set the caching policy for the cluster, either lazy (only cache users/members when they message the bot) or aggressive (request whole member lists on seeing new guilds too) |
request_threads | The number of threads to allocate for making HTTP requests to Discord. This defaults to 12. You can increase this at runtime via the object returned from get_rest(). |
request_threads_raw | The number of threads to allocate for making HTTP requests to sites outside of Discord. This defaults to 1. You can increase this at runtime via the object returned from get_raw_rest(). |
dpp::exception | Thrown on windows, if WinSock fails to initialise, or on any other system if a dpp::request_queue fails to construct |
|
delete |
dpp::cluster is non-copyable
|
delete |
dpp::cluster is non-moveable
|
virtual |
Destroy the cluster object.
References dpp::err_websocket_proto_already_set.
void dpp::cluster::application_role_connection_get | ( | snowflake | application_id, |
command_completion_event_t | callback | ||
) |
Get the application's role connection metadata records.
application_id | The application ID |
callback | Function to call when the API call completes. On success the callback will contain a dpp::application_role_connection_metadata_list object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error(). |
Referenced by co_role_create(), and role_create_sync().
application_role_connection dpp::cluster::application_role_connection_get_sync | ( | snowflake | application_id | ) |
Get the application's role connection metadata records.
application_id | The application ID |
dpp::rest_exception | upon failure to execute REST function |
References guild_event_create().
void dpp::cluster::application_role_connection_update | ( | snowflake | application_id, |
const std::vector< application_role_connection_metadata > & | connection_metadata, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Update the application's role connection metadata records.
application_id | The application ID |
connection_metadata | The application role connection metadata to update |
callback | Function to call when the API call completes. On success the callback will contain a dpp::application_role_connection_metadata_list object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error(). |
Referenced by co_role_delete(), and role_delete_sync().
application_role_connection dpp::cluster::application_role_connection_update_sync | ( | snowflake | application_id, |
const std::vector< application_role_connection_metadata > & | connection_metadata | ||
) |
Update the application's role connection metadata records.
application_id | The application ID |
connection_metadata | The application role connection metadata to update |
dpp::rest_exception | upon failure to execute REST function |
References guild_event_delete().
void dpp::cluster::automod_rule_create | ( | snowflake | guild_id, |
const automod_rule & | r, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Create an auto moderation rule.
guild_id | Guild id of the auto moderation rule |
r | Auto moderation rule to create |
callback | Function to call when the API call completes. On success the callback will contain a dpp::automod_rule object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error(). |
Referenced by co_interaction_followup_edit(), and interaction_followup_edit_sync().
automod_rule dpp::cluster::automod_rule_create_sync | ( | snowflake | guild_id, |
const automod_rule & | r | ||
) |
Create an auto moderation rule.
guild_id | Guild id of the auto moderation rule |
r | Auto moderation rule to create |
dpp::rest_exception | upon failure to execute REST function |
References channel_delete().
void dpp::cluster::automod_rule_delete | ( | snowflake | guild_id, |
snowflake | rule_id, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Delete an auto moderation rule.
guild_id | Guild id of the auto moderation rule |
rule_id | Auto moderation rule id to delete |
callback | Function 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(). |
Referenced by co_interaction_followup_get_original(), and interaction_followup_get_original_sync().
confirmation dpp::cluster::automod_rule_delete_sync | ( | snowflake | guild_id, |
snowflake | rule_id | ||
) |
Delete an auto moderation rule.
guild_id | Guild id of the auto moderation rule |
rule_id | Auto moderation rule id to delete |
dpp::rest_exception | upon failure to execute REST function |
References channel_edit_permissions().
void dpp::cluster::automod_rule_edit | ( | snowflake | guild_id, |
const automod_rule & | r, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Edit an auto moderation rule.
guild_id | Guild id of the auto moderation rule |
r | Auto moderation rule to edit. The rule's id must be set. |
callback | Function to call when the API call completes. On success the callback will contain a dpp::automod_rule object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error(). |
Referenced by co_interaction_followup_get(), and interaction_followup_get_sync().
automod_rule dpp::cluster::automod_rule_edit_sync | ( | snowflake | guild_id, |
const automod_rule & | r | ||
) |
Edit an auto moderation rule.
guild_id | Guild id of the auto moderation rule |
r | Auto moderation rule to edit. The rule's id must be set. |
dpp::rest_exception | upon failure to execute REST function |
References channel_edit_permissions().
void dpp::cluster::automod_rule_get | ( | snowflake | guild_id, |
snowflake | rule_id, | ||
command_completion_event_t | callback | ||
) |
Get a single auto moderation rule.
guild_id | Guild id of the auto moderation rule |
rule_id | Rule id to retrieve |
callback | Function to call when the API call completes. On success the callback will contain a dpp::automod_rule object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error(). |
Referenced by co_interaction_followup_delete(), and interaction_followup_delete_sync().
automod_rule dpp::cluster::automod_rule_get_sync | ( | snowflake | guild_id, |
snowflake | rule_id | ||
) |
Get a single auto moderation rule.
guild_id | Guild id of the auto moderation rule |
rule_id | Rule id to retrieve |
dpp::rest_exception | upon failure to execute REST function |
References channel_delete_permission().
void dpp::cluster::automod_rules_get | ( | snowflake | guild_id, |
command_completion_event_t | callback | ||
) |
Get all auto moderation rules for a guild.
guild_id | Guild id of the auto moderation rule |
callback | Function to call when the API call completes. On success the callback will contain a dpp::automod_rule_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(). |
Referenced by co_interaction_followup_edit_original(), and interaction_followup_edit_original_sync().
automod_rule_map dpp::cluster::automod_rules_get_sync | ( | snowflake | guild_id | ) |
Get all auto moderation rules for a guild.
guild_id | Guild id of the auto moderation rule |
dpp::rest_exception | upon failure to execute REST function |
References channel_create().
void dpp::cluster::channel_create | ( | const class channel & | c, |
command_completion_event_t | callback = utility::log_error() |
||
) |
Create a channel.
Create a new channel object for the guild. Requires the MANAGE_CHANNELS
permission. If setting permission overwrites, only permissions your bot has in the guild can be allowed/denied. Setting MANAGE_ROLES
permission in channels is only possible for guild administrators. Returns the new channel object on success. Fires a Channel Create Gateway
event.
All parameters to this endpoint are optional excluding name
c | Channel to create |
callback | Function 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(). |
Referenced by automod_rules_get_sync(), and co_automod_rules_get().
Create a channel.
Create a new channel object for the guild. Requires the MANAGE_CHANNELS
permission. If setting permission overwrites, only permissions your bot has in the guild can be allowed/denied. Setting MANAGE_ROLES
permission in channels is only possible for guild administrators. Returns the new channel object on success. Fires a Channel Create Gateway
event.
All parameters to this endpoint are optional excluding name
c | Channel to create |
dpp::rest_exception | upon failure to execute REST function |
References channel_edit_positions().
void dpp::cluster::channel_delete | ( | snowflake | channel_id, |
command_completion_event_t | callback = utility::log_error() |
||
) |
Delete a channel.
channel_id | Channel id to delete |
callback | Function 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(). |
Referenced by automod_rule_create_sync(), and co_automod_rule_create().
void dpp::cluster::channel_delete_permission | ( | const class channel & | c, |
snowflake | overwrite_id, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Remove a permission from a channel.
c | Channel to remove permission from |
overwrite_id | Overwrite to remove, user or channel ID |
callback | Function 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(). |
Referenced by automod_rule_get_sync(), and co_automod_rule_get().
confirmation dpp::cluster::channel_delete_permission_sync | ( | const class channel & | c, |
snowflake | overwrite_id | ||
) |
Remove a permission from a channel.
c | Channel to remove permission from |
overwrite_id | Overwrite to remove, user or channel ID |
dpp::rest_exception | upon failure to execute REST function |
References channel_edit().
confirmation dpp::cluster::channel_delete_sync | ( | snowflake | channel_id | ) |
Delete a channel.
channel_id | Channel id to delete |
dpp::rest_exception | upon failure to execute REST function |
References channel_follow_news().
void dpp::cluster::channel_edit | ( | const class channel & | c, |
command_completion_event_t | callback = utility::log_error() |
||
) |
Edit a channel.
c | Channel to edit/update |
callback | Function 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(). |
Referenced by channel_delete_permission_sync(), and co_channel_delete_permission().
void dpp::cluster::channel_edit_permissions | ( | const class channel & | c, |
const snowflake | overwrite_id, | ||
const uint64_t | allow, | ||
const uint64_t | deny, | ||
const bool | member, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Edit a channel's permissions.
c | Channel to set permissions for |
overwrite_id | Overwrite to change (a user or role ID) |
allow | allow permissions bitmask |
deny | deny permissions bitmask |
member | true if the overwrite_id is a user id, false if it is a channel id |
callback | Function 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(). |
Referenced by automod_rule_delete_sync(), automod_rule_edit_sync(), co_automod_rule_delete(), and co_automod_rule_edit().
void dpp::cluster::channel_edit_permissions | ( | const snowflake | channel_id, |
const snowflake | overwrite_id, | ||
const uint64_t | allow, | ||
const uint64_t | deny, | ||
const bool | member, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Edit a channel's permissions.
channel_id | ID of the channel to set permissions for |
overwrite_id | Overwrite to change (a user or role ID) |
allow | allow permissions bitmask |
deny | deny permissions bitmask |
member | true if the overwrite_id is a user id, false if it is a channel id |
callback | Function 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(). |
confirmation dpp::cluster::channel_edit_permissions_sync | ( | const class channel & | c, |
const snowflake | overwrite_id, | ||
const uint64_t | allow, | ||
const uint64_t | deny, | ||
const bool | member | ||
) |
Edit a channel's permissions.
c | Channel to set permissions for |
overwrite_id | Overwrite to change (a user or role ID) |
allow | allow permissions bitmask |
deny | deny permissions bitmask |
member | true if the overwrite_id is a user id, false if it is a channel id |
dpp::rest_exception | upon failure to execute REST function |
References channel_get().
confirmation dpp::cluster::channel_edit_permissions_sync | ( | const snowflake | channel_id, |
const snowflake | overwrite_id, | ||
const uint64_t | allow, | ||
const uint64_t | deny, | ||
const bool | member | ||
) |
Edit a channel's permissions.
channel_id | ID of the channel to set permissions for |
overwrite_id | Overwrite to change (a user or role ID) |
allow | allow permissions bitmask |
deny | deny permissions bitmask |
member | true if the overwrite_id is a user id, false if it is a channel id |
dpp::rest_exception | upon failure to execute REST function |
References channel_invite_create().
void dpp::cluster::channel_edit_positions | ( | const std::vector< channel > & | c, |
command_completion_event_t | callback = utility::log_error() |
||
) |
Edit multiple channels positions.
Modify the positions of a set of channel objects for the guild. Requires MANAGE_CHANNELS
permission. Fires multiple Channel Update Gateway
events. Only channels to be modified are required.
c | Channel to change the position for |
callback | Function 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(). |
Referenced by channel_create_sync(), and co_channel_create().
confirmation dpp::cluster::channel_edit_positions_sync | ( | const std::vector< channel > & | c | ) |
Edit multiple channels positions.
Modify the positions of a set of channel objects for the guild. Requires MANAGE_CHANNELS
permission. Fires multiple Channel Update Gateway
events. Only channels to be modified are required.
c | Channel to change the position for |
dpp::rest_exception | upon failure to execute REST function |
References channel_invites_get().
Edit a channel.
c | Channel to edit/update |
dpp::rest_exception | upon failure to execute REST function |
References channel_typing().
void dpp::cluster::channel_follow_news | ( | const class channel & | c, |
snowflake | target_channel_id, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Follow an announcement (news) channel.
c | Channel id to follow |
target_channel_id | Channel to subscribe the channel to |
callback | Function 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(). |
Referenced by channel_delete_sync(), and co_channel_delete().
confirmation dpp::cluster::channel_follow_news_sync | ( | const class channel & | c, |
snowflake | target_channel_id | ||
) |
Follow an announcement (news) channel.
c | Channel id to follow |
target_channel_id | Channel to subscribe the channel to |
dpp::rest_exception | upon failure to execute REST function |
References channel_typing().
void dpp::cluster::channel_get | ( | snowflake | c, |
command_completion_event_t | callback | ||
) |
Get a channel.
c | Channel ID to retrieve |
callback | Function 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(). |
References API_PATH, and dpp::m_get.
Referenced by channel_edit_permissions_sync(), and co_channel_edit_permissions().
Get a channel.
c | Channel ID to retrieve |
dpp::rest_exception | upon failure to execute REST function |
References channels_get().
void dpp::cluster::channel_invite_create | ( | const class channel & | c, |
const class invite & | i, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Create invite for a channel.
c | Channel to create an invite on |
i | Invite to create |
callback | Function 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(). |
Referenced by channel_edit_permissions_sync(), and co_channel_edit_permissions().
Create invite for a channel.
c | Channel to create an invite on |
i | Invite to create |
dpp::rest_exception | upon failure to execute REST function |
References channel_set_voice_status().
void dpp::cluster::channel_invites_get | ( | const class channel & | c, |
command_completion_event_t | callback | ||
) |
Get invites for a channel.
c | Channel to get invites for |
callback | Function 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(). |
Referenced by channel_edit_positions_sync(), and co_channel_edit_positions().
invite_map dpp::cluster::channel_invites_get_sync | ( | const class channel & | c | ) |
Get invites for a channel.
c | Channel to get invites for |
dpp::rest_exception | upon failure to execute REST function |
References create_dm_channel().
void dpp::cluster::channel_pins_get | ( | snowflake | channel_id, |
command_completion_event_t | callback | ||
) |
Get a channel's pins.
channel_id | Channel ID to get pins for |
callback | Function 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(). |
Referenced by co_message_unpin(), and message_unpin_sync().
message_map dpp::cluster::channel_pins_get_sync | ( | snowflake | channel_id | ) |
Get a channel's pins.
channel_id | Channel ID to get pins for |
dpp::rest_exception | upon failure to execute REST function |
References roles_get().
void dpp::cluster::channel_set_voice_status | ( | snowflake | channel_id, |
const std::string & | status, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Set the status of a voice channel.
channel_id | The channel to update. |
status | The new status for the channel. |
callback | Function 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(). |
Referenced by channel_invite_create_sync(), and co_channel_invite_create().
confirmation dpp::cluster::channel_set_voice_status_sync | ( | snowflake | channel_id, |
const std::string & | status | ||
) |
Set the status of a voice channel.
channel_id | The channel to update. |
status | The new status for the channel. |
dpp::rest_exception | upon failure to execute REST function |
References gdm_remove().
void dpp::cluster::channel_typing | ( | const class channel & | c, |
command_completion_event_t | callback = utility::log_error() |
||
) |
Trigger channel typing indicator.
c | Channel to set as typing on |
callback | Function 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(). |
Referenced by channel_edit_sync(), channel_follow_news_sync(), co_channel_edit(), and co_channel_follow_news().
void dpp::cluster::channel_typing | ( | snowflake | cid, |
command_completion_event_t | callback = utility::log_error() |
||
) |
Trigger channel typing indicator.
cid | Channel ID to set as typing on |
callback | Function 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(). |
confirmation dpp::cluster::channel_typing_sync | ( | const class channel & | c | ) |
Trigger channel typing indicator.
c | Channel to set as typing on |
dpp::rest_exception | upon failure to execute REST function |
References current_user_get_dms().
confirmation dpp::cluster::channel_typing_sync | ( | snowflake | cid | ) |
Trigger channel typing indicator.
cid | Channel ID to set as typing on |
dpp::rest_exception | upon failure to execute REST function |
References direct_message_create(), and dpp::unicode_emoji::m.
void dpp::cluster::channels_get | ( | snowflake | guild_id, |
command_completion_event_t | callback | ||
) |
Get all channels for a guild.
guild_id | Guild ID to retrieve channels for |
callback | Function 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(). |
Referenced by channel_get_sync(), and co_channel_get().
channel_map dpp::cluster::channels_get_sync | ( | snowflake | guild_id | ) |
Get all channels for a guild.
guild_id | Guild ID to retrieve channels for |
dpp::rest_exception | upon failure to execute REST function |
References gdm_add().
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:
async< confirmation_callback_t > dpp::cluster::co_application_role_connection_get | ( | snowflake | application_id | ) |
Get the application's role connection metadata records.
application_id | The application ID |
References guild_event_create().
async< confirmation_callback_t > dpp::cluster::co_application_role_connection_update | ( | snowflake | application_id, |
const std::vector< application_role_connection_metadata > & | connection_metadata | ||
) |
Update the application's role connection metadata records.
application_id | The application ID |
connection_metadata | The application role connection metadata to update |
References guild_event_delete().
async< confirmation_callback_t > dpp::cluster::co_automod_rule_create | ( | snowflake | guild_id, |
const automod_rule & | r | ||
) |
Create an auto moderation rule.
guild_id | Guild id of the auto moderation rule |
r | Auto moderation rule to create |
References channel_delete().
async< confirmation_callback_t > dpp::cluster::co_automod_rule_delete | ( | snowflake | guild_id, |
snowflake | rule_id | ||
) |
Delete an auto moderation rule.
guild_id | Guild id of the auto moderation rule |
rule_id | Auto moderation rule id to delete |
References channel_edit_permissions().
async< confirmation_callback_t > dpp::cluster::co_automod_rule_edit | ( | snowflake | guild_id, |
const automod_rule & | r | ||
) |
Edit an auto moderation rule.
guild_id | Guild id of the auto moderation rule |
r | Auto moderation rule to edit. The rule's id must be set. |
References channel_edit_permissions().
async< confirmation_callback_t > dpp::cluster::co_automod_rule_get | ( | snowflake | guild_id, |
snowflake | rule_id | ||
) |
Get a single auto moderation rule.
guild_id | Guild id of the auto moderation rule |
rule_id | Rule id to retrieve |
References channel_delete_permission().
async< confirmation_callback_t > dpp::cluster::co_automod_rules_get | ( | snowflake | guild_id | ) |
Get all auto moderation rules for a guild.
guild_id | Guild id of the auto moderation rule |
References channel_create().
async< confirmation_callback_t > dpp::cluster::co_channel_create | ( | const class channel & | c | ) |
Create a channel.
Create a new channel object for the guild. Requires the MANAGE_CHANNELS
permission. If setting permission overwrites, only permissions your bot has in the guild can be allowed/denied. Setting MANAGE_ROLES
permission in channels is only possible for guild administrators. Returns the new channel object on success. Fires a Channel Create Gateway
event.
All parameters to this endpoint are optional excluding name
c | Channel to create |
References channel_edit_positions().
async< confirmation_callback_t > dpp::cluster::co_channel_delete | ( | snowflake | channel_id | ) |
Delete a channel.
channel_id | Channel id to delete |
References channel_follow_news().
async< confirmation_callback_t > dpp::cluster::co_channel_delete_permission | ( | const class channel & | c, |
snowflake | overwrite_id | ||
) |
Remove a permission from a channel.
c | Channel to remove permission from |
overwrite_id | Overwrite to remove, user or channel ID |
References channel_edit().
async< confirmation_callback_t > dpp::cluster::co_channel_edit | ( | const class channel & | c | ) |
Edit a channel.
c | Channel to edit/update |
References channel_typing().
async< confirmation_callback_t > dpp::cluster::co_channel_edit_permissions | ( | const class channel & | c, |
const snowflake | overwrite_id, | ||
const uint64_t | allow, | ||
const uint64_t | deny, | ||
const bool | member | ||
) |
Edit a channel's permissions.
c | Channel to set permissions for |
overwrite_id | Overwrite to change (a user or role ID) |
allow | allow permissions bitmask |
deny | deny permissions bitmask |
member | true if the overwrite_id is a user id, false if it is a channel id |
References channel_get().
async< confirmation_callback_t > dpp::cluster::co_channel_edit_permissions | ( | const snowflake | channel_id, |
const snowflake | overwrite_id, | ||
const uint64_t | allow, | ||
const uint64_t | deny, | ||
const bool | member | ||
) |
Edit a channel's permissions.
channel_id | ID of the channel to set permissions for |
overwrite_id | Overwrite to change (a user or role ID) |
allow | allow permissions bitmask |
deny | deny permissions bitmask |
member | true if the overwrite_id is a user id, false if it is a channel id |
References channel_invite_create().
async< confirmation_callback_t > dpp::cluster::co_channel_edit_positions | ( | const std::vector< channel > & | c | ) |
Edit multiple channels positions.
Modify the positions of a set of channel objects for the guild. Requires MANAGE_CHANNELS
permission. Fires multiple Channel Update Gateway
events. Only channels to be modified are required.
c | Channel to change the position for |
References channel_invites_get().
async< confirmation_callback_t > dpp::cluster::co_channel_follow_news | ( | const class channel & | c, |
snowflake | target_channel_id | ||
) |
Follow an announcement (news) channel.
c | Channel id to follow |
target_channel_id | Channel to subscribe the channel to |
References channel_typing().
async< confirmation_callback_t > dpp::cluster::co_channel_get | ( | snowflake | c | ) |
Get a channel.
c | Channel ID to retrieve |
References channels_get().
async< confirmation_callback_t > dpp::cluster::co_channel_invite_create | ( | const class channel & | c, |
const class invite & | i | ||
) |
Create invite for a channel.
c | Channel to create an invite on |
i | Invite to create |
References channel_set_voice_status().
async< confirmation_callback_t > dpp::cluster::co_channel_invites_get | ( | const class channel & | c | ) |
Get invites for a channel.
c | Channel to get invites for |
References create_dm_channel().
async< confirmation_callback_t > dpp::cluster::co_channel_pins_get | ( | snowflake | channel_id | ) |
Get a channel's pins.
channel_id | Channel ID to get pins for |
References roles_get().
async< confirmation_callback_t > dpp::cluster::co_channel_set_voice_status | ( | snowflake | channel_id, |
const std::string & | status | ||
) |
Set the status of a voice channel.
channel_id | The channel to update. |
status | The new status for the channel. |
References gdm_remove().
async< confirmation_callback_t > dpp::cluster::co_channel_typing | ( | const class channel & | c | ) |
Trigger channel typing indicator.
c | Channel to set as typing on |
References current_user_get_dms().
async< confirmation_callback_t > dpp::cluster::co_channel_typing | ( | snowflake | cid | ) |
Trigger channel typing indicator.
cid | Channel ID to set as typing on |
References direct_message_create(), and dpp::unicode_emoji::m.
async< confirmation_callback_t > dpp::cluster::co_channels_get | ( | snowflake | guild_id | ) |
Get all channels for a guild.
guild_id | Guild ID to retrieve channels for |
References gdm_add().
async< confirmation_callback_t > dpp::cluster::co_create_dm_channel | ( | snowflake | user_id | ) |
Create a dm channel.
user_id | User ID to create DM channel with |
References guild_emoji_create().
async< confirmation_callback_t > dpp::cluster::co_current_application_get | ( | ) |
Get current (bot) application.
References current_user_get_guilds().
async< confirmation_callback_t > dpp::cluster::co_current_user_connections_get | ( | ) |
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.
References get_voice_regions().
async< confirmation_callback_t > dpp::cluster::co_current_user_edit | ( | const std::string & | nickname, |
const std::string & | image_blob = "" , |
||
const image_type | type = i_png |
||
) |
Edit current (bot) user.
Modifies the current member in a guild. Returns the updated guild_member object on success. Fires a Guild Member Update
Gateway event.
nickname | Nickname to set |
image_blob | Avatar data to upload (NOTE: Very heavily rate limited!) |
type | Type of image for avatar. It can be one of i_gif , i_jpg or i_png . |
dpp::length_exception | Image data is larger than the maximum size of 256 kilobytes |
References current_user_connections_get().
async< confirmation_callback_t > dpp::cluster::co_current_user_get | ( | ) |
Get current (bot) user.
dynamic_cast
. References current_user_leave_guild().
async< confirmation_callback_t > dpp::cluster::co_current_user_get_dms | ( | ) |
Get current user DM channels.
References guild_emoji_delete().
async< confirmation_callback_t > dpp::cluster::co_current_user_get_guilds | ( | ) |
Get current (bot) user guilds.
References guild_get_voice_regions().
async< confirmation_callback_t > dpp::cluster::co_current_user_join_thread | ( | snowflake | thread_id | ) |
Join a thread.
thread_id | Thread ID to join |
References threads_get_public_archived().
async< confirmation_callback_t > dpp::cluster::co_current_user_leave_guild | ( | snowflake | guild_id | ) |
Leave a guild.
guild_id | Guild ID to leave |
References create_webhook().
async< confirmation_callback_t > dpp::cluster::co_current_user_leave_thread | ( | snowflake | thread_id | ) |
Leave a thread.
thread_id | Thread ID to leave |
References thread_member_get().
async< confirmation_callback_t > dpp::cluster::co_current_user_set_voice_state | ( | snowflake | guild_id, |
snowflake | channel_id, | ||
bool | suppress = false , |
||
time_t | request_to_speak_timestamp = 0 |
||
) |
Set the bot's voice state on a stage channel.
Caveats
There are currently several caveats for this endpoint:
channel_id
must currently point to a stage channel.channel_id
.MUTE_MEMBERS
permission to unsuppress yourself. You can always suppress yourself.REQUEST_TO_SPEAK
permission to request to speak. You can always clear your own request to speak.request_to_speak_timestamp
to any present or future time.guild_id | Guild to set voice state on |
channel_id | Stage channel to set voice state on |
suppress | True if the user's audio should be suppressed, false if it should not |
request_to_speak_timestamp | The time at which we requested to speak, or 0 to clear the request. The time set here must be the current time or in the future. |
std::logic_exception | You attempted to set a request_to_speak_timestamp in the past which is not the value of 0. |
References user_get().
async< confirmation_callback_t > dpp::cluster::co_delete_webhook | ( | snowflake | webhook_id | ) |
Delete a webhook.
webhook_id | Webhook ID to delete |
References edit_webhook_with_token().
async< confirmation_callback_t > dpp::cluster::co_delete_webhook_message | ( | const class webhook & | wh, |
snowflake | message_id, | ||
snowflake | thread_id = 0 |
||
) |
Delete webhook message.
wh | Webhook to delete message for |
message_id | Message ID to delete |
thread_id | ID of the thread the message is in |
References execute_webhook(), and dpp::unicode_emoji::m.
async< confirmation_callback_t > dpp::cluster::co_delete_webhook_with_token | ( | snowflake | webhook_id, |
const std::string & | token | ||
) |
Delete webhook with token.
webhook_id | Webhook ID to delete |
token | Token of webhook to delete |
References get_channel_webhooks().
async< confirmation_callback_t > dpp::cluster::co_direct_message_create | ( | snowflake | user_id, |
const message & | m | ||
) |
Create a direct message, also create the channel for the direct message if needed.
user_id | User ID of user to send message to |
m | Message object |
References guild_emoji_edit().
async< confirmation_callback_t > dpp::cluster::co_edit_webhook | ( | const class webhook & | wh | ) |
Edit webhook.
wh | Webhook to edit |
References get_guild_webhooks().
async< confirmation_callback_t > dpp::cluster::co_edit_webhook_message | ( | const class webhook & | wh, |
const struct message & | m, | ||
snowflake | thread_id = 0 |
||
) |
Edit webhook message.
When the content field is edited, the mentions array in the message object will be reconstructed from scratch based on the new content. The allowed_mentions field of the edit request controls how this happens. If there is no explicit allowed_mentions in the edit request, the content will be parsed with default allowances, that is, without regard to whether or not an allowed_mentions was present in the request that originally created the message.
wh | Webhook to edit message for |
m | New message |
thread_id | ID of the thread the message is in |
References get_webhook().
async< confirmation_callback_t > dpp::cluster::co_edit_webhook_with_token | ( | const class webhook & | wh | ) |
Edit webhook with token (token is encapsulated in the webhook object)
wh | Webhook to edit (should include token) |
References get_webhook_message().
async< confirmation_callback_t > dpp::cluster::co_entitlement_test_create | ( | const class entitlement & | new_entitlement | ) |
Creates a test entitlement to a given SKU for a given guild or user.
Discord will act as though that user or guild has entitlement to your premium offering.
new_entitlement | The entitlement to create. Make sure your dpp::entitlement_type (inside your dpp::entitlement object) matches the type of the owner_id (if type is guild, owner_id is a guild id), otherwise it won't work! |
References guild_ban_add().
async< confirmation_callback_t > dpp::cluster::co_entitlement_test_delete | ( | snowflake | entitlement_id | ) |
Deletes a currently-active test entitlement.
Discord will act as though that user or guild no longer has entitlement to your premium offering.
entitlement_id | The test entitlement to delete. |
References guild_ban_delete().
async< confirmation_callback_t > dpp::cluster::co_entitlements_get | ( | snowflake | user_id = 0 , |
const std::vector< snowflake > & | sku_ids = {} , |
||
snowflake | before_id = 0 , |
||
snowflake | after_id = 0 , |
||
uint8_t | limit = 100 , |
||
snowflake | guild_id = 0 , |
||
bool | exclude_ended = false |
||
) |
Returns all entitlements for a given app, active and expired.
user_id | User ID to look up entitlements for. |
sku_ids | List of SKU IDs to check entitlements for. |
before_id | Retrieve entitlements before this entitlement ID. |
after_id | Retrieve entitlements after this entitlement ID. |
limit | Number of entitlements to return, 1-100 (default 100). |
guild_id | Guild ID to look up entitlements for. |
exclude_ended | Whether ended entitlements should be excluded from the search. |
References guild_auditlog_get().
async< confirmation_callback_t > dpp::cluster::co_execute_webhook | ( | const class webhook & | wh, |
const struct message & | m, | ||
bool | wait = false , |
||
snowflake | thread_id = 0 , |
||
const std::string & | thread_name = "" |
||
) |
Execute webhook.
wh | Webhook to execute |
m | Message to send |
wait | waits for server confirmation of message send before response, and returns the created message body |
thread_id | Send a message to the specified thread within a webhook's channel. The thread will automatically be unarchived |
thread_name | Name of thread to create (requires the webhook channel to be a forum channel) |
thread_id
or thread_name
. If thread_id
is provided, the message will send in that thread. If thread_name
is provided, a thread with that name will be created in the forum channel. References get_webhook_with_token(), and token.
async< confirmation_callback_t > dpp::cluster::co_gdm_add | ( | snowflake | channel_id, |
snowflake | user_id, | ||
const std::string & | access_token, | ||
const std::string & | nick | ||
) |
Adds a recipient to a Group DM using their access token.
channel_id | Channel id to add group DM recipients to |
user_id | User ID to add |
access_token | Access token from OAuth2 |
nick | Nickname of user to apply to the chat |
References guild_emoji_get().
async< confirmation_callback_t > dpp::cluster::co_gdm_remove | ( | snowflake | channel_id, |
snowflake | user_id | ||
) |
Removes a recipient from a Group DM.
channel_id | Channel ID of group DM |
user_id | User ID to remove from group DM |
References guild_emojis_get().
async< confirmation_callback_t > dpp::cluster::co_get_channel_webhooks | ( | snowflake | channel_id | ) |
Get channel webhooks.
channel_id | Channel ID to get webhooks for |
async< confirmation_callback_t > dpp::cluster::co_get_gateway_bot | ( | ) |
Get the gateway information for the bot using the token.
References guild_create().
async< confirmation_callback_t > dpp::cluster::co_get_guild_webhooks | ( | snowflake | guild_id | ) |
Get guild webhooks.
guild_id | Guild ID to get webhooks for |
References request().
async< confirmation_callback_t > dpp::cluster::co_get_voice_regions | ( | ) |
Get all voice regions.
References delete_webhook_with_token(), and token.
async< confirmation_callback_t > dpp::cluster::co_get_webhook | ( | snowflake | webhook_id | ) |
Get webhook.
webhook_id | Webhook ID to get |
async< confirmation_callback_t > dpp::cluster::co_get_webhook_message | ( | const class webhook & | wh, |
snowflake | message_id, | ||
snowflake | thread_id = 0 |
||
) |
Get webhook message.
wh | Webhook to get the original message for |
message_id | The message ID |
thread_id | ID of the thread the message is in |
async< confirmation_callback_t > dpp::cluster::co_get_webhook_with_token | ( | snowflake | webhook_id, |
const std::string & | token | ||
) |
Get webhook using token.
webhook_id | Webhook ID to retrieve |
token | Token of webhook |
async< confirmation_callback_t > dpp::cluster::co_global_bulk_command_create | ( | const std::vector< slashcommand > & | commands | ) |
Create/overwrite global slash commands.
Any existing global slash commands will be deleted and replaced with these.
commands | Vector of slash commands to create/update. overwriting existing commands that are registered globally for this application. Commands that do not already exist will count toward daily application command create limits. |
References global_command_edit().
async< confirmation_callback_t > dpp::cluster::co_global_bulk_command_delete | ( | ) |
Delete all existing global slash commands.
References global_commands_get().
async< confirmation_callback_t > dpp::cluster::co_global_command_create | ( | const slashcommand & | s | ) |
Create a global slash command (a bot can have a maximum of 100 of these).
s | Slash command to create |
References guild_bulk_command_create().
async< confirmation_callback_t > dpp::cluster::co_global_command_delete | ( | snowflake | id | ) |
Delete a global slash command (a bot can have a maximum of 100 of these)
id | Slash command to delete |
References guild_commands_get_permissions().
async< confirmation_callback_t > dpp::cluster::co_global_command_edit | ( | const slashcommand & | s | ) |
Edit a global slash command (a bot can have a maximum of 100 of these)
s | Slash command to change |
References guild_bulk_command_edit_permissions().
async< confirmation_callback_t > dpp::cluster::co_global_command_get | ( | snowflake | id | ) |
Get a global slash command.
id | The ID of the slash command |
References guild_bulk_command_delete().
async< confirmation_callback_t > dpp::cluster::co_global_commands_get | ( | ) |
Get the application's global slash commands.
References guild_command_create().
async< confirmation_callback_t > dpp::cluster::co_guild_add_member | ( | const guild_member & | gm, |
const std::string & | access_token | ||
) |
Add guild member.
Needs a specific oauth2 scope, from which you get the access_token.
Adds a user to the guild, provided you have a valid oauth2 access token for the user with the guilds.join scope. Returns the guild_member, which is defaulted if the user is already a member of the guild. Fires a Guild Member Add
Gateway event.
For guilds with Membership Screening enabled, this endpoint will default to adding new members as pending in the guild member object. Members that are pending will have to complete membership screening before they become full members that can talk.
CREATE_INSTANT_INVITE
permission. gm | Guild member to add |
access_token | Access token from Oauth2 scope |
References guild_member_delete().
async< confirmation_callback_t > dpp::cluster::co_guild_auditlog_get | ( | snowflake | guild_id, |
snowflake | user_id, | ||
uint32_t | action_type, | ||
snowflake | before, | ||
snowflake | after, | ||
uint32_t | limit | ||
) |
Get the audit log for a guild.
guild_id | Guild to get the audit log of |
user_id | Entries from a specific user ID. Set this to 0 will fetch any user |
action_type | Entries for a specific dpp::audit_type. Set this to 0 will fetch any type |
before | Entries with ID less than a specific audit log entry ID. Used for paginating |
after | Entries with ID greater than a specific audit log entry ID. Used for paginating |
limit | Maximum number of entries (between 1-100) to return |
References guild_delete_integration().
async< confirmation_callback_t > dpp::cluster::co_guild_ban_add | ( | snowflake | guild_id, |
snowflake | user_id, | ||
uint32_t | delete_message_seconds = 0 |
||
) |
Add guild ban.
Create a guild ban, and optionally delete previous messages sent by the banned user. Requires the BAN_MEMBERS
permission. Fires a Guild Ban Add
Gateway event.
guild_id | Guild ID to add ban to |
user_id | User ID to ban |
delete_message_seconds | How many seconds to delete messages for, between 0 and 604800 (7 days). Defaults to 0 |
References guild_edit().
async< confirmation_callback_t > dpp::cluster::co_guild_ban_delete | ( | snowflake | guild_id, |
snowflake | user_id | ||
) |
Delete guild ban.
Remove the ban for a user. Requires the BAN_MEMBERS
permissions. Fires a Guild Ban Remove Gateway event.
guild_id | Guild to delete ban from |
user_id | User ID to delete ban for |
References guild_edit_widget().
async< confirmation_callback_t > dpp::cluster::co_guild_begin_prune | ( | snowflake | guild_id, |
const struct prune & | pruneinfo | ||
) |
Begin guild prune.
Begin a prune operation. Requires the KICK_MEMBERS
permission. Returns a prune object indicating the number of members that were removed in the prune operation. For large guilds it's recommended to set the compute_prune_count
option to false, forcing 'pruned' to 0. Fires multiple Guild Member Remove
Gateway events. By default, prune will not remove users with roles. You can optionally include specific roles in your prune by providing the include_roles
parameter. Any inactive user that has a subset of the provided role(s) will be included in the prune and users with additional roles will not.
guild_id | Guild ID to prune |
pruneinfo | Pruning info |
References guild_get_welcome_screen().
async< confirmation_callback_t > dpp::cluster::co_guild_bulk_command_create | ( | const std::vector< slashcommand > & | commands, |
snowflake | guild_id | ||
) |
Create/overwrite guild slash commands.
Any existing guild slash commands on this guild will be deleted and replaced with these.
commands | Vector 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_id | Guild ID to create/update the slash commands in |
References guild_command_delete().
async< confirmation_callback_t > dpp::cluster::co_guild_bulk_command_delete | ( | snowflake | guild_id | ) |
Delete all existing guild slash commands.
guild_id | Guild ID to delete the slash commands in. |
References guild_command_edit_permissions().
async< confirmation_callback_t > dpp::cluster::co_guild_bulk_command_edit_permissions | ( | const std::vector< slashcommand > & | commands, |
snowflake | guild_id | ||
) |
Edit/Overwrite the permissions of all existing slash commands in a guild.
commands | A vector of slash commands to edit/overwrite the permissions for |
guild_id | Guild ID to edit permissions of the slash commands in |
References guild_command_get_permissions().
async< confirmation_callback_t > dpp::cluster::co_guild_command_create | ( | const slashcommand & | s, |
snowflake | guild_id | ||
) |
Create a slash command local to a guild.
s | Slash command to create |
guild_id | Guild ID to create the slash command in |
References guild_command_edit().
async< confirmation_callback_t > dpp::cluster::co_guild_command_delete | ( | snowflake | id, |
snowflake | guild_id | ||
) |
Delete a slash command local to a guild.
id | Slash command to delete |
guild_id | Guild ID to delete the slash command in |
References guild_commands_get().
async< confirmation_callback_t > dpp::cluster::co_guild_command_edit | ( | const slashcommand & | s, |
snowflake | guild_id | ||
) |
Edit a slash command local to a guild.
s | Slash command to edit |
guild_id | Guild ID to edit the slash command in |
References interaction_followup_create(), dpp::unicode_emoji::m, and token.
async< confirmation_callback_t > dpp::cluster::co_guild_command_edit_permissions | ( | const slashcommand & | s, |
snowflake | guild_id | ||
) |
Edit slash command permissions of a guild.
s | Slash command to edit the permissions for |
guild_id | Guild ID to edit the slash command in |
References interaction_response_create(), and token.
async< confirmation_callback_t > dpp::cluster::co_guild_command_get | ( | snowflake | id, |
snowflake | guild_id | ||
) |
Get a slash command of a guild.
id | The ID of the slash command |
guild_id | Guild ID to get the slash command from |
References interaction_response_edit(), dpp::unicode_emoji::m, and token.
async< confirmation_callback_t > dpp::cluster::co_guild_command_get_permissions | ( | snowflake | id, |
snowflake | guild_id | ||
) |
Get the permissions for a slash command of a guild.
id | The ID of the slash command to get the permissions for |
guild_id | Guild ID to get the permissions of |
References interaction_response_get_original(), and token.
async< confirmation_callback_t > dpp::cluster::co_guild_commands_get | ( | snowflake | guild_id | ) |
Get the application's slash commands for a guild.
guild_id | Guild ID to get the slash commands for |
References interaction_followup_edit_original(), dpp::unicode_emoji::m, and token.
async< confirmation_callback_t > dpp::cluster::co_guild_commands_get_permissions | ( | snowflake | guild_id | ) |
Get all slash command permissions of a guild.
guild_id | Guild ID to get the slash commands permissions for |
References guild_command_get().
async< confirmation_callback_t > dpp::cluster::co_guild_create | ( | const class guild & | g | ) |
Create a guild.
Create a new guild. Returns a guild object on success. Fires a Guild Create Gateway
event.
When using the roles parameter, the first member of the array is used to change properties of the guild's everyone role. If you are trying to bootstrap a guild with additional roles, keep this in mind. The required id field within each role object is an integer placeholder, and will be replaced by the API upon consumption. Its purpose is to allow you to overwrite a role's permissions in a channel when also passing in channels with the channels array. When using the channels parameter, the position field is ignored, and none of the default channels are created. The id field within each channel object may be set to an integer placeholder, and will be replaced by the API upon consumption. Its purpose is to allow you to create GUILD_CATEGORY
channels by setting the parent_id
field on any children to the category's id field. Category channels must be listed before any children.
g | Guild to create |
References guild_get_ban().
async< confirmation_callback_t > dpp::cluster::co_guild_create_from_template | ( | const std::string & | code, |
const std::string & | name | ||
) |
Create a new guild based on a template.
code | Template code to create guild from |
name | Guild name to create |
References guild_template_sync().
async< confirmation_callback_t > dpp::cluster::co_guild_current_member_edit | ( | snowflake | guild_id, |
const std::string & | nickname | ||
) |
Modify current member.
Modifies the current member in a guild. Fires a Guild Member Update
Gateway event.
guild_id | Guild ID to change on |
nickname | New nickname, or empty string to clear nickname |
References guild_delete().
async< confirmation_callback_t > dpp::cluster::co_guild_delete | ( | snowflake | guild_id | ) |
Delete a guild.
Delete a guild permanently. User must be owner. Fires a Guild Delete Gateway
event.
guild_id | Guild ID to delete |
References guild_get_bans().
async< confirmation_callback_t > dpp::cluster::co_guild_delete_integration | ( | snowflake | guild_id, |
snowflake | integration_id | ||
) |
Delete guild integration.
Delete the attached integration object for the guild. Deletes any associated webhooks and kicks the associated bot if there is one. Requires the MANAGE_GUILD
permission. Fires a Guild Integrations Update Gateway event.
guild_id | Guild ID to delete integration for |
integration_id | Integration ID to delete |
References guild_get().
async< confirmation_callback_t > dpp::cluster::co_guild_edit | ( | const class guild & | g | ) |
Edit a guild.
Modify a guild's settings. Requires the MANAGE_GUILD
permission. Returns the updated guild object on success. Fires a Guild Update Gateway
event.
g | Guild to edit |
References guild_get_integrations().
async< confirmation_callback_t > dpp::cluster::co_guild_edit_member | ( | const guild_member & | gm | ) |
Edit the properties of an existing guild member.
Modify attributes of a guild member. Returns the guild_member. Fires a Guild Member Update
Gateway event. To remove a timeout, set the communication_disabled_until
to a non-zero time in the past, e.g. 1. When moving members to channels, the API user must have permissions to both connect to the channel and have the MOVE_MEMBERS
permission. For moving and disconnecting users from voice, use dpp::cluster::guild_member_move.
gm | Guild member to edit |
References guild_member_kick().
async< confirmation_callback_t > dpp::cluster::co_guild_edit_onboarding | ( | const struct onboarding & | o | ) |
Edit the guild's onboarding configuration.
Requires the MANAGE_GUILD
and MANAGE_ROLES
permissions.
onboarding::mode
field modifies what is considered when enforcing these constraints.o | The onboarding object |
References guild_get_member().
async< confirmation_callback_t > dpp::cluster::co_guild_edit_welcome_screen | ( | snowflake | guild_id, |
const struct welcome_screen & | welcome_screen, | ||
bool | enabled | ||
) |
Edit the guild's welcome screen.
Requires the MANAGE_GUILD
permission. May fire a Guild Update
Gateway event.
guild_id | The guild ID to edit the welcome screen for |
welcome_screen | The welcome screen |
enabled | Whether the welcome screen should be enabled or disabled |
References guild_member_add_role().
async< confirmation_callback_t > dpp::cluster::co_guild_edit_widget | ( | snowflake | guild_id, |
const class guild_widget & | gw | ||
) |
Edit guild widget.
Requires the MANAGE_GUILD
permission.
guild_id | Guild ID to edit widget for |
gw | New guild widget information |
References guild_get_preview().
async< confirmation_callback_t > dpp::cluster::co_guild_emoji_create | ( | snowflake | guild_id, |
const class emoji & | newemoji | ||
) |
Create single emoji.
You must ensure that the emoji passed contained image data using the emoji::load_image() method.
guild_id | Guild ID to create emoji om |
newemoji | Emoji to create |
References entitlements_get().
async< confirmation_callback_t > dpp::cluster::co_guild_emoji_delete | ( | snowflake | guild_id, |
snowflake | emoji_id | ||
) |
Delete a guild emoji.
guild_id | Guild ID to delete emoji on |
emoji_id | Emoji ID to delete |
References entitlement_test_create().
async< confirmation_callback_t > dpp::cluster::co_guild_emoji_edit | ( | snowflake | guild_id, |
const class emoji & | newemoji | ||
) |
Edit a single emoji.
You must ensure that the emoji passed contained image data using the emoji::load_image() method.
guild_id | Guild ID to edit emoji on |
newemoji | Emoji to edit |
References entitlement_test_delete().
async< confirmation_callback_t > dpp::cluster::co_guild_emoji_get | ( | snowflake | guild_id, |
snowflake | emoji_id | ||
) |
Get a single emoji.
guild_id | Guild ID to get emoji for |
emoji_id | Emoji ID to get |
References get_gateway_bot().
async< confirmation_callback_t > dpp::cluster::co_guild_emojis_get | ( | snowflake | guild_id | ) |
Get all emojis for a guild.
guild_id | Guild ID to get emojis for |
References guild_current_member_edit().
async< confirmation_callback_t > dpp::cluster::co_guild_event_create | ( | const scheduled_event & | event | ) |
Create a scheduled event on a guild.
event | Event to create (guild ID must be populated) |
References stage_instance_create().
async< confirmation_callback_t > dpp::cluster::co_guild_event_delete | ( | snowflake | event_id, |
snowflake | guild_id | ||
) |
Delete a scheduled event from a guild.
event_id | Event ID to delete |
guild_id | Guild ID of event to delete |
References stage_instance_get().
async< confirmation_callback_t > dpp::cluster::co_guild_event_edit | ( | const scheduled_event & | event | ) |
Edit/modify a scheduled event on a guild.
event | Event to create (event ID and guild ID must be populated) |
References stage_instance_edit().
async< confirmation_callback_t > dpp::cluster::co_guild_event_get | ( | snowflake | guild_id, |
snowflake | event_id | ||
) |
Get a scheduled event for a guild.
guild_id | Guild to get event for |
event_id | Event ID to get |
References stage_instance_delete().
async< confirmation_callback_t > dpp::cluster::co_guild_events_get | ( | snowflake | guild_id | ) |
Get all scheduled events for a guild.
guild_id | Guild to get events for |
References skus_get().
async< confirmation_callback_t > dpp::cluster::co_guild_get_ban | ( | snowflake | guild_id, |
snowflake | user_id | ||
) |
Get single guild ban.
Requires the BAN_MEMBERS
permission.
guild_id | Guild ID to get ban for |
user_id | User ID of ban to retrieve |
References guild_get_vanity().
async< confirmation_callback_t > dpp::cluster::co_guild_get_bans | ( | snowflake | guild_id, |
snowflake | before, | ||
snowflake | after, | ||
snowflake | limit | ||
) |
Get guild ban list.
Requires the BAN_MEMBERS
permission.
before
and after
for pagination. Users will always be returned in ascending order by the user ID. If both before and after are provided, only before is respected. guild_id | Guild ID to get bans for |
before | If non-zero, all bans for user ids before this user id will be returned up to the limit |
after | if non-zero, all bans for user ids after this user id will be returned up to the limit |
limit | the maximum number of bans to retrieve in this call up to a maximum of 1000 |
References guild_get_widget().
async< confirmation_callback_t > dpp::cluster::co_guild_get_integrations | ( | snowflake | guild_id | ) |
Get guild integrations.
Requires the MANAGE_GUILD
permission.
guild_id | Guild ID to get integrations for |
References guild_get_prune_counts().
async< confirmation_callback_t > dpp::cluster::co_guild_get_invites | ( | snowflake | guild_id | ) |
Get guild invites.
Returns a list of invite objects (with invite metadata) for the guild. Requires the MANAGE_GUILD
permission.
guild_id | Guild ID to get invites for |
References dpp::unicode_emoji::m, and message_create().
async< confirmation_callback_t > dpp::cluster::co_guild_get_member | ( | snowflake | guild_id, |
snowflake | user_id | ||
) |
Get a guild member.
guild_id | Guild ID to get member for |
user_id | User ID of member to get |
References guild_member_timeout().
Referenced by event_handler_test().
async< confirmation_callback_t > dpp::cluster::co_guild_get_members | ( | snowflake | guild_id, |
uint16_t | limit, | ||
snowflake | after | ||
) |
Get all guild members.
GUILD_MEMBERS
Privileged Intent is enabled for your application. guild_id | Guild ID to get all members for |
limit | max number of members to return (1-1000) |
after | the highest user id in the previous page |
References guild_member_timeout_remove().
async< confirmation_callback_t > dpp::cluster::co_guild_get_onboarding | ( | snowflake | guild_id | ) |
Get the guild's onboarding configuration.
guild_id | The guild to pull the onboarding configuration from. |
References guild_edit_member().
async< confirmation_callback_t > dpp::cluster::co_guild_get_prune_counts | ( | snowflake | guild_id, |
const struct prune & | pruneinfo | ||
) |
Get prune counts.
Returns a prune object indicating the number of members that would be removed in a prune operation. Requires the KICK_MEMBERS
permission. By default, prune will not remove users with roles. You can optionally include specific roles in your prune by providing the include_roles parameter. Any inactive user that has a subset of the provided role(s) will be counted in the prune and users with additional roles will not.
guild_id | Guild ID to count for pruning |
pruneinfo | Pruning info |
References guild_edit_onboarding(), and dpp::unicode_emoji::o.
async< confirmation_callback_t > dpp::cluster::co_guild_get_vanity | ( | snowflake | guild_id | ) |
Get guild vanity url, if enabled.
Returns a partial dpp::invite object for guilds with that feature enabled. Requires the MANAGE_GUILD
permission. code will be null if a vanity url for the guild is not set.
guild_id | Guild to get vanity URL for |
References guild_set_nickname().
async< confirmation_callback_t > dpp::cluster::co_guild_get_voice_regions | ( | snowflake | guild_id | ) |
Get guild voice regions.
Voice regions per guild are somewhat deprecated in preference of per-channel voice regions. Returns a list of voice region objects for the guild. Unlike the similar /voice route, this returns VIP servers when the guild is VIP-enabled.
guild_id | Guild ID to get voice regions for |
References edit_webhook().
async< confirmation_callback_t > dpp::cluster::co_guild_get_welcome_screen | ( | snowflake | guild_id | ) |
Get the guild's welcome screen.
If the welcome screen is not enabled, the MANAGE_GUILD
permission is required.
guild_id | The guild ID to get the welcome screen from |
References guild_get_members().
async< confirmation_callback_t > dpp::cluster::co_guild_get_widget | ( | snowflake | guild_id | ) |
Get guild widget.
Requires the MANAGE_GUILD
permission.
guild_id | Guild ID to get widget for |
References guild_sync_integration().
async< confirmation_callback_t > dpp::cluster::co_guild_member_add_role | ( | snowflake | guild_id, |
snowflake | user_id, | ||
snowflake | role_id | ||
) |
Add role to guild member.
Adds a role to a guild member. Requires the MANAGE_ROLES
permission. Fires a Guild Member Update
Gateway event.
guild_id | Guild ID to add a role to |
user_id | User ID to add role to |
role_id | Role ID to add to the user |
References guild_member_delete_role().
async< confirmation_callback_t > dpp::cluster::co_guild_member_delete | ( | snowflake | guild_id, |
snowflake | user_id | ||
) |
Remove (kick) a guild member.
Remove a member from a guild. Requires KICK_MEMBERS
permission. Fires a Guild Member Remove
Gateway event.
guild_id | Guild ID to kick member from |
user_id | User ID to kick |
References guild_member_remove_role().
async< confirmation_callback_t > dpp::cluster::co_guild_member_delete_role | ( | snowflake | guild_id, |
snowflake | user_id, | ||
snowflake | role_id | ||
) |
Remove role from guild member.
Removes a role from a guild member. Requires the MANAGE_ROLES
permission. Fires a Guild Member Update
Gateway event.
guild_id | Guild ID to remove role from user on |
user_id | User ID to remove role from |
role_id | Role to remove |
References invite_delete().
async< confirmation_callback_t > dpp::cluster::co_guild_member_kick | ( | snowflake | guild_id, |
snowflake | user_id | ||
) |
Remove (kick) a guild member.
Remove a member from a guild. Requires KICK_MEMBERS
permission. Fires a Guild Member Remove
Gateway event.
guild_id | Guild ID to kick member from |
user_id | User ID to kick |
References guild_member_move().
async< confirmation_callback_t > dpp::cluster::co_guild_member_move | ( | const snowflake | channel_id, |
const snowflake | guild_id, | ||
const snowflake | user_id | ||
) |
Moves the guild member to a other voice channel, if member is connected to one.
Set the channel_id
to 0
to disconnect the user.
Fires a Guild Member Update
Gateway event.
MOVE_MEMBERS
permission. channel_id | Id of the channel to which the user is used. Set to 0 to disconnect the user |
guild_id | Guild id to which the user is connected |
user_id | User id, who should be moved |
References dpp::unicode_emoji::m, and message_add_reaction().
async< confirmation_callback_t > dpp::cluster::co_guild_member_remove_role | ( | snowflake | guild_id, |
snowflake | user_id, | ||
snowflake | role_id | ||
) |
Remove role from guild member.
Removes a role from a guild member. Requires the MANAGE_ROLES
permission. Fires a Guild Member Update
Gateway event.
guild_id | Guild ID to remove role from user on |
user_id | User ID to remove role from |
role_id | Role to remove |
References invite_get().
async< confirmation_callback_t > dpp::cluster::co_guild_member_timeout | ( | snowflake | guild_id, |
snowflake | user_id, | ||
time_t | communication_disabled_until | ||
) |
Set the timeout of a guild member.
Fires a Guild Member Update
Gateway event.
guild_id | Guild ID to timeout the member in |
user_id | User ID to set the timeout for |
communication_disabled_until | The timestamp when the user's timeout will expire (up to 28 days in the future). Set to 0 to remove the timeout |
References guild_search_members().
async< confirmation_callback_t > dpp::cluster::co_guild_member_timeout_remove | ( | snowflake | guild_id, |
snowflake | user_id | ||
) |
Remove the timeout of a guild member.
A shortcut for guild_member_timeout(guild_id, user_id, 0, callback) Fires a Guild Member Update
Gateway event.
guild_id | Guild ID to remove the member timeout from |
user_id | User ID to remove the timeout for |
References guild_get_invites().
async< confirmation_callback_t > dpp::cluster::co_guild_modify_integration | ( | snowflake | guild_id, |
const class integration & | i | ||
) |
Modify guild integration.
guild_id | Guild ID to modify integration for |
i | Integration to modify |
References guild_get_onboarding().
async< confirmation_callback_t > dpp::cluster::co_guild_search_members | ( | snowflake | guild_id, |
const std::string & | query, | ||
uint16_t | limit | ||
) |
Search for guild members based on whether their username or nickname starts with the given string.
GUILD_MEMBERS
Privileged Intent is enabled for your application. guild_id | Guild ID to search in |
query | Query string to match username(s) and nickname(s) against |
limit | max number of members to return (1-1000) |
References message_add_reaction().
async< confirmation_callback_t > dpp::cluster::co_guild_set_nickname | ( | snowflake | guild_id, |
const std::string & | nickname | ||
) |
Change current user nickname.
Modifies the nickname of the current user in a guild. Fires a Guild Member Update
Gateway event.
guild_id | Guild ID to change nickname on |
nickname | New nickname, or empty string to clear nickname |
References guild_edit_welcome_screen().
async< confirmation_callback_t > dpp::cluster::co_guild_sticker_create | ( | const sticker & | s | ) |
Create a sticker in a guild.
s | Sticker to create. Must have its guild ID set. |
References nitro_sticker_get().
async< confirmation_callback_t > dpp::cluster::co_guild_sticker_delete | ( | snowflake | sticker_id, |
snowflake | guild_id | ||
) |
Delete a sticker from a guild.
sticker_id | sticker ID to delete |
guild_id | guild ID to delete from |
References sticker_packs_get().
async< confirmation_callback_t > dpp::cluster::co_guild_sticker_get | ( | snowflake | id, |
snowflake | guild_id | ||
) |
Get a guild sticker.
id | Id of sticker to get. |
guild_id | Guild ID of the guild where the sticker is |
References guild_create_from_template().
async< confirmation_callback_t > dpp::cluster::co_guild_sticker_modify | ( | const sticker & | s | ) |
Modify a sticker in a guild.
s | Sticker to modify. Must have its guild ID and sticker ID set. |
References guild_template_create().
async< confirmation_callback_t > dpp::cluster::co_guild_stickers_get | ( | snowflake | guild_id | ) |
Get all guild stickers.
guild_id | Guild ID of the guild where the sticker is |
References guild_template_delete().
async< confirmation_callback_t > dpp::cluster::co_guild_sync_integration | ( | snowflake | guild_id, |
snowflake | integration_id | ||
) |
Sync guild integration.
guild_id | Guild ID to sync integration on |
integration_id | Integration ID to synchronise |
References guild_add_member().
async< confirmation_callback_t > dpp::cluster::co_guild_template_create | ( | snowflake | guild_id, |
const std::string & | name, | ||
const std::string & | description | ||
) |
Creates a template for the guild.
guild_id | Guild to create template from |
name | Template name to create |
description | Description of template to create |
References template_get().
async< confirmation_callback_t > dpp::cluster::co_guild_template_delete | ( | snowflake | guild_id, |
const std::string & | code | ||
) |
Deletes the template.
guild_id | Guild ID of template to delete |
code | Template code to delete |
References current_user_join_thread().
async< confirmation_callback_t > dpp::cluster::co_guild_template_modify | ( | snowflake | guild_id, |
const std::string & | code, | ||
const std::string & | name, | ||
const std::string & | description | ||
) |
Modifies the template's metadata.
guild_id | Guild ID of template to modify |
code | Template code to modify |
name | New name of template |
description | New description of template |
References current_user_leave_thread().
async< confirmation_callback_t > dpp::cluster::co_guild_template_sync | ( | snowflake | guild_id, |
const std::string & | code | ||
) |
Syncs the template to the guild's current state.
guild_id | Guild to synchronise template for |
code | Code of template to synchronise |
References threads_get_joined_private_archived().
async< confirmation_callback_t > dpp::cluster::co_guild_templates_get | ( | snowflake | guild_id | ) |
Get guild templates.
guild_id | Guild ID to get templates for |
References threads_get_active().
async< confirmation_callback_t > dpp::cluster::co_interaction_followup_create | ( | const std::string & | token, |
const message & | m | ||
) |
Create a followup message to a slash command.
token | Token for the interaction webhook |
m | followup message to create |
References interaction_followup_get_original(), and token.
async< confirmation_callback_t > dpp::cluster::co_interaction_followup_delete | ( | const std::string & | token | ) |
Delete the initial interaction response.
token | Token for the interaction webhook |
References automod_rule_get().
async< confirmation_callback_t > dpp::cluster::co_interaction_followup_edit | ( | const std::string & | token, |
const message & | m | ||
) |
Edit followup message to a slash command The message ID in the message you pass should be correctly set to that of a followup message you previously sent.
token | Token for the interaction webhook |
m | message to edit, the ID should be set |
References automod_rule_create().
async< confirmation_callback_t > dpp::cluster::co_interaction_followup_edit_original | ( | const std::string & | token, |
const message & | m | ||
) |
Edit original followup message to a slash command This is an alias for cluster::interaction_response_edit.
token | Token for the interaction webhook |
m | message to edit, the ID should be set |
References automod_rules_get().
async< confirmation_callback_t > dpp::cluster::co_interaction_followup_get | ( | const std::string & | token, |
snowflake | message_id | ||
) |
Get the followup message to a slash command.
token | Token for the interaction webhook |
message_id | message to retrieve |
References automod_rule_edit().
async< confirmation_callback_t > dpp::cluster::co_interaction_followup_get_original | ( | const std::string & | token | ) |
Get the original followup message to a slash command This is an alias for cluster::interaction_response_get_original.
token | Token for the interaction webhook |
References automod_rule_delete().
async< confirmation_callback_t > dpp::cluster::co_interaction_response_create | ( | snowflake | interaction_id, |
const std::string & | token, | ||
const interaction_response & | r | ||
) |
Respond to a slash command.
interaction_id | Interaction id to respond to |
token | Token for the interaction webhook |
r | Response to send |
References interaction_followup_delete(), and token.
async< confirmation_callback_t > dpp::cluster::co_interaction_response_edit | ( | const std::string & | token, |
const message & | m | ||
) |
Edit response to a slash command.
token | Token for the interaction webhook |
m | Message to send |
References interaction_followup_edit(), dpp::unicode_emoji::m, and token.
async< confirmation_callback_t > dpp::cluster::co_interaction_response_get_original | ( | const std::string & | token | ) |
Get the original response to a slash command.
token | Token for the interaction webhook |
References interaction_followup_get(), and token.
async< confirmation_callback_t > dpp::cluster::co_invite_get | ( | const std::string & | invite_code | ) |
Get details about an invite.
invite_code | Invite code to get information on |
References dpp::unicode_emoji::m, and message_delete_all_reactions().
async< confirmation_callback_t > dpp::cluster::co_message_add_reaction | ( | const struct message & | m, |
const std::string & | reaction | ||
) |
Add a reaction to a message.
The reaction string must be either an emojiname:id
or a unicode character.
m | Message to add a reaction to |
reaction | Reaction to add. Emojis should be in the form emojiname:id |
References message_delete_all_reactions().
Referenced by event_handler_test().
async< confirmation_callback_t > dpp::cluster::co_message_add_reaction | ( | snowflake | message_id, |
snowflake | channel_id, | ||
const std::string & | reaction | ||
) |
Add a reaction to a message by id.
The reaction string must be either an emojiname:id
or a unicode character.
message_id | Message to add reactions to |
channel_id | Channel to add reactions to |
reaction | Reaction to add. Emojis should be in the form emojiname:id |
References message_delete_bulk().
async< confirmation_callback_t > dpp::cluster::co_message_create | ( | const struct message & | m | ) |
Send a message to a channel.
The callback function is called when the message has been sent
m | Message to send |
References message_delete().
Referenced by event_handler_test().
async< confirmation_callback_t > dpp::cluster::co_message_crosspost | ( | snowflake | message_id, |
snowflake | channel_id | ||
) |
Crosspost a message.
The callback function is called when the message has been sent
message_id | Message to crosspost |
channel_id | Channel ID to crosspost from |
References dpp::unicode_emoji::m, and message_delete_own_reaction().
async< confirmation_callback_t > dpp::cluster::co_message_delete | ( | snowflake | message_id, |
snowflake | channel_id | ||
) |
Delete a message from a channel.
The callback function is called when the message has been edited
message_id | Message ID to delete |
channel_id | Channel to delete from |
References dpp::unicode_emoji::m, and message_delete_reaction_emoji().
async< confirmation_callback_t > dpp::cluster::co_message_delete_all_reactions | ( | const struct message & | m | ) |
Delete all reactions on a message.
m | Message to delete reactions from |
References message_delete_own_reaction().
async< confirmation_callback_t > dpp::cluster::co_message_delete_all_reactions | ( | snowflake | message_id, |
snowflake | channel_id | ||
) |
Delete all reactions on a message by id.
message_id | Message to delete reactions from |
channel_id | Channel to delete reactions from |
References dpp::unicode_emoji::m, and message_delete_reaction().
async< confirmation_callback_t > dpp::cluster::co_message_delete_bulk | ( | const std::vector< snowflake > & | message_ids, |
snowflake | channel_id | ||
) |
Bulk delete messages from a channel.
The callback function is called when the message has been edited
message_ids | List of message IDs to delete (at least 2 and at most 100 message IDs) |
channel_id | Channel to delete from |
References message_delete_reaction().
async< confirmation_callback_t > dpp::cluster::co_message_delete_own_reaction | ( | const struct message & | m, |
const std::string & | reaction | ||
) |
Delete own reaction from a message.
The reaction string must be either an emojiname:id
or a unicode character.
m | Message to delete own reaction from |
reaction | Reaction to delete. The reaction should be in the form emojiname:id |
References message_delete_reaction_emoji().
async< confirmation_callback_t > dpp::cluster::co_message_delete_own_reaction | ( | snowflake | message_id, |
snowflake | channel_id, | ||
const std::string & | reaction | ||
) |
Delete own reaction from a message by id.
The reaction string must be either an emojiname:id
or a unicode character.
message_id | Message to delete reactions from |
channel_id | Channel to delete reactions from |
reaction | Reaction to delete. The reaction should be in the form emojiname:id |
References dpp::unicode_emoji::m, and message_edit().
async< confirmation_callback_t > dpp::cluster::co_message_delete_reaction | ( | const struct message & | m, |
snowflake | user_id, | ||
const std::string & | reaction | ||
) |
Delete a user's reaction from a message.
The reaction string must be either an emojiname:id
or a unicode character
m | Message to delete a user's reaction from |
user_id | User ID who's reaction you want to remove |
reaction | Reaction to remove. Reactions should be in the form emojiname:id |
References dpp::unicode_emoji::m, and message_edit_flags().
async< confirmation_callback_t > dpp::cluster::co_message_delete_reaction | ( | snowflake | message_id, |
snowflake | channel_id, | ||
snowflake | user_id, | ||
const std::string & | reaction | ||
) |
Delete a user's reaction from a message by id.
The reaction string must be either an emojiname:id
or a unicode character
message_id | Message to delete reactions from |
channel_id | Channel to delete reactions from |
user_id | User ID who's reaction you want to remove |
reaction | Reaction to remove. Reactions should be in the form emojiname:id |
References message_get().
async< confirmation_callback_t > dpp::cluster::co_message_delete_reaction_emoji | ( | const struct message & | m, |
const std::string & | reaction | ||
) |
Delete all reactions on a message using a particular emoji.
The reaction string must be either an emojiname:id
or a unicode character
m | Message to delete reactions from |
reaction | Reaction to delete, in the form emojiname:id or a unicode character |
References dpp::unicode_emoji::m, and message_get_reactions().
async< confirmation_callback_t > dpp::cluster::co_message_delete_reaction_emoji | ( | snowflake | message_id, |
snowflake | channel_id, | ||
const std::string & | reaction | ||
) |
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
message_id | Message to delete reactions from |
channel_id | Channel to delete reactions from |
reaction | Reaction to delete, in the form emojiname:id or a unicode character |
References message_get_reactions().
async< confirmation_callback_t > dpp::cluster::co_message_edit | ( | const struct message & | m | ) |
Edit a message on a channel.
The callback function is called when the message has been edited
m | Message to edit |
References message_pin().
Referenced by event_handler_test().
async< confirmation_callback_t > dpp::cluster::co_message_edit_flags | ( | const struct message & | m | ) |
Edit the flags of a message on a channel.
The callback function is called when the message has been edited
m | Message to edit the flags of |
References messages_get().
async< confirmation_callback_t > dpp::cluster::co_message_get | ( | snowflake | message_id, |
snowflake | channel_id | ||
) |
Get a message.
message_id | Message ID |
channel_id | Channel ID |
References message_unpin().
async< confirmation_callback_t > dpp::cluster::co_message_get_reactions | ( | const struct message & | m, |
const std::string & | reaction, | ||
snowflake | before, | ||
snowflake | after, | ||
snowflake | limit | ||
) |
Get reactions on a message for a particular emoji.
The reaction string must be either an emojiname:id
or a unicode character
m | Message to get reactions for |
reaction | Reaction should be in the form emojiname:id or a unicode character |
before | Reactions before this ID should be retrieved if this is set to non-zero |
after | Reactions before this ID should be retrieved if this is set to non-zero |
limit | This number of reactions maximum should be returned |
References dpp::unicode_emoji::m, and poll_get_answer_voters().
async< confirmation_callback_t > dpp::cluster::co_message_get_reactions | ( | snowflake | message_id, |
snowflake | channel_id, | ||
const std::string & | reaction, | ||
snowflake | before, | ||
snowflake | after, | ||
snowflake | limit | ||
) |
Get reactions on a message for a particular emoji by id.
The reaction string must be either an emojiname:id
or a unicode character
message_id | Message to get reactions for |
channel_id | Channel to get reactions for |
reaction | Reaction should be in the form emojiname:id or a unicode character |
before | Reactions before this ID should be retrieved if this is set to non-zero |
after | Reactions before this ID should be retrieved if this is set to non-zero |
limit | This number of reactions maximum should be returned |
References poll_get_answer_voters().
async< confirmation_callback_t > dpp::cluster::co_message_pin | ( | snowflake | channel_id, |
snowflake | message_id | ||
) |
Pin a message.
channel_id | Channel id to pin message on |
message_id | Message id to pin message on |
References dpp::unicode_emoji::m, and poll_end().
async< confirmation_callback_t > dpp::cluster::co_message_unpin | ( | snowflake | channel_id, |
snowflake | message_id | ||
) |
Unpin a message.
channel_id | Channel id to unpin message on |
message_id | Message id to unpin message on |
References channel_pins_get().
async< confirmation_callback_t > dpp::cluster::co_messages_get | ( | snowflake | channel_id, |
snowflake | around, | ||
snowflake | before, | ||
snowflake | after, | ||
uint64_t | limit | ||
) |
Get multiple messages.
This function will attempt to fetch as many messages as possible using multiple API calls if needed.
channel_id | Channel ID to retrieve messages for |
around | Messages should be retrieved around this ID if this is set to non-zero |
before | Messages before this ID should be retrieved if this is set to non-zero |
after | Messages after this ID should be retrieved if this is set to non-zero |
limit | This number of messages maximum should be returned, up to a maximum of 100. |
References poll_end().
async< confirmation_callback_t > dpp::cluster::co_nitro_sticker_get | ( | snowflake | id | ) |
Get a nitro sticker.
id | Id of sticker to get. |
References guild_template_modify().
async< confirmation_callback_t > dpp::cluster::co_poll_end | ( | const message & | m | ) |
Immediately end a poll.
m | Message that contains the poll |
References role_edit().
async< confirmation_callback_t > dpp::cluster::co_poll_end | ( | snowflake | message_id, |
snowflake | channel_id | ||
) |
Immediately end a poll.
message_id | ID of the message with the poll to end |
channel_id | ID of the channel with the poll to end |
References roles_edit_position().
async< confirmation_callback_t > dpp::cluster::co_poll_get_answer_voters | ( | const message & | m, |
uint32_t | answer_id, | ||
snowflake | after, | ||
uint64_t | limit | ||
) |
Get a list of users that voted for this specific answer.
m | Message that contains the poll to retrieve the answers from |
answer_id | ID of the answer to retrieve votes from (see poll_answer::answer_id) |
after | Users after this ID should be retrieved if this is set to non-zero |
limit | This number of users maximum should be returned, up to 100 |
References role_create().
async< confirmation_callback_t > dpp::cluster::co_poll_get_answer_voters | ( | snowflake | message_id, |
snowflake | channel_id, | ||
uint32_t | answer_id, | ||
snowflake | after, | ||
uint64_t | limit | ||
) |
Get a list of users that voted for this specific answer.
message_id | ID of the message with the poll to retrieve the answers from |
channel_id | ID of the channel with the poll to retrieve the answers from |
answer_id | ID of the answer to retrieve votes from (see poll_answer::answer_id) |
after | Users after this ID should be retrieved if this is set to non-zero |
limit | This number of users maximum should be returned, up to 100 |
References role_delete().
async< confirmation_callback_t > dpp::cluster::co_role_create | ( | const class role & | r | ) |
Create a role on a guild.
Create a new role for the guild. Requires the MANAGE_ROLES
permission. Returns the new role object on success. Fires a Guild Role Create
Gateway event.
r | Role to create (guild ID is encapsulated in the role object) |
References application_role_connection_get().
async< confirmation_callback_t > dpp::cluster::co_role_delete | ( | snowflake | guild_id, |
snowflake | role_id | ||
) |
Delete a role.
Requires the MANAGE_ROLES
permission. Fires a Guild Role Delete
Gateway event.
guild_id | Guild ID to delete the role on |
role_id | Role ID to delete |
References application_role_connection_update().
async< confirmation_callback_t > dpp::cluster::co_role_edit | ( | const class role & | r | ) |
Edit a role on a guild.
Requires the MANAGE_ROLES
permission. Returns the updated role on success. Fires a Guild Role Update
Gateway event.
r | Role to edit |
References user_application_role_connection_get().
async< confirmation_callback_t > dpp::cluster::co_roles_edit_position | ( | snowflake | guild_id, |
const std::vector< role > & | roles | ||
) |
Edit multiple role's position in a guild.
Returns a list of all roles of the guild on success.
Modify the positions of a set of role objects for the guild. Requires the MANAGE_ROLES
permission. Fires multiple Guild Role Update
Gateway events.
guild_id | Guild ID to change the roles position on |
roles | Vector of roles to change the positions of |
References user_application_role_connection_update().
async< confirmation_callback_t > dpp::cluster::co_roles_get | ( | snowflake | guild_id | ) |
Get a role for a guild.
guild_id | Guild ID to get role for |
References guild_events_get().
async< confirmation_callback_t > dpp::cluster::co_skus_get | ( | ) |
Returns all SKUs for a given application.
References guild_sticker_create().
Get an awaitable to wait a certain amount of seconds.
Use the co_await keyword on its return value to suspend the coroutine until the timer ends
seconds | How long to wait for |
async< confirmation_callback_t > dpp::cluster::co_stage_instance_delete | ( | const snowflake | channel_id | ) |
Delete a stage instance.
channel_id | ID of the associated channel |
References guild_stickers_get().
async< confirmation_callback_t > dpp::cluster::co_stage_instance_get | ( | const snowflake | channel_id | ) |
Get the stage instance associated with the channel id, if it exists.
channel_id | ID of the associated channel |
References guild_sticker_get().
async< confirmation_callback_t > dpp::cluster::co_sticker_packs_get | ( | ) |
Get a list of available sticker packs.
References guild_templates_get().
async< confirmation_callback_t > dpp::cluster::co_template_get | ( | const std::string & | code | ) |
Get a template.
code | Template code |
References threads_get_private_archived().
async< confirmation_callback_t > dpp::cluster::co_thread_create | ( | const std::string & | thread_name, |
snowflake | channel_id, | ||
uint16_t | auto_archive_duration, | ||
channel_type | thread_type, | ||
bool | invitable, | ||
uint16_t | rate_limit_per_user | ||
) |
Create a thread.
thread_name | Name of the thread |
channel_id | Channel in which thread to create |
auto_archive_duration | Duration after which thread auto-archives. Can be set to - 60, 1440 (for boosted guilds can also be: 4320, 10080) |
thread_type | Type of thread - CHANNEL_PUBLIC_THREAD, CHANNEL_ANNOUNCEMENT_THREAD, CHANNEL_PRIVATE_THREAD |
invitable | whether non-moderators can add other non-moderators to a thread; only available when creating a private thread |
rate_limit_per_user | amount of seconds a user has to wait before sending another message (0-21600); bots, as well as users with the permission manage_messages, manage_thread, or manage_channel, are unaffected |
References thread_get().
async< confirmation_callback_t > dpp::cluster::co_thread_create_in_forum | ( | const std::string & | thread_name, |
snowflake | channel_id, | ||
const message & | msg, | ||
auto_archive_duration_t | auto_archive_duration, | ||
uint16_t | rate_limit_per_user, | ||
std::vector< snowflake > | applied_tags = {} |
||
) |
Create a thread in a forum or media channel.
thread_name | Name of the forum thread |
channel_id | Forum channel in which thread to create |
msg | The message to start the thread with |
auto_archive_duration | Duration to automatically archive the thread after recent activity |
rate_limit_per_user | amount of seconds a user has to wait before sending another message (0-21600); bots, as well as users with the permission manage_messages, manage_thread, or manage_channel, are unaffected |
applied_tags | List of IDs of forum tags (dpp::forum_tag) to apply to this thread |
References thread_member_remove().
async< confirmation_callback_t > dpp::cluster::co_thread_create_with_message | ( | const std::string & | thread_name, |
snowflake | channel_id, | ||
snowflake | message_id, | ||
uint16_t | auto_archive_duration, | ||
uint16_t | rate_limit_per_user | ||
) |
Create a thread with a message (Discord: ID of a thread is same as message ID)
thread_name | Name of the thread |
channel_id | Channel in which thread to create |
message_id | message to start thread with |
auto_archive_duration | Duration after which thread auto-archives. Can be set to - 60, 1440 (for boosted guilds can also be: 4320, 10080) |
rate_limit_per_user | amount of seconds a user has to wait before sending another message (0-21600); bots, as well as users with the permission manage_messages, manage_thread, or manage_channel, are unaffected |
References current_application_get().
async< confirmation_callback_t > dpp::cluster::co_thread_edit | ( | const thread & | t | ) |
Edit a thread.
t | Thread to edit |
References current_user_edit().
async< confirmation_callback_t > dpp::cluster::co_thread_get | ( | snowflake | thread_id | ) |
Get the thread specified by thread_id.
This uses the same call as dpp::cluster::channel_get but returns a thread object.
thread_id | The id of the thread to obtain. |
References user_set_voice_state().
async< confirmation_callback_t > dpp::cluster::co_thread_member_add | ( | snowflake | thread_id, |
snowflake | user_id | ||
) |
Add a member to a thread.
thread_id | Thread ID to add to |
user_id | Member ID to add |
References current_user_get().
async< confirmation_callback_t > dpp::cluster::co_thread_member_get | ( | const snowflake | thread_id, |
const snowflake | user_id | ||
) |
Get a thread member.
thread_id | Thread to get member for |
user_id | ID of the user to get |
References thread_create_with_message().
async< confirmation_callback_t > dpp::cluster::co_thread_member_remove | ( | snowflake | thread_id, |
snowflake | user_id | ||
) |
Remove a member from a thread.
thread_id | Thread ID to remove from |
user_id | Member ID to remove |
References current_user_set_voice_state().
async< confirmation_callback_t > dpp::cluster::co_thread_members_get | ( | snowflake | thread_id | ) |
Get members of a thread.
thread_id | Thread to get members for |
References thread_member_add().
async< confirmation_callback_t > dpp::cluster::co_threads_get_active | ( | snowflake | guild_id | ) |
Get all active threads in the guild, including public and private threads.
Threads are ordered by their id, in descending order.
guild_id | Guild to get active threads for |
References thread_members_get().
async< confirmation_callback_t > dpp::cluster::co_threads_get_joined_private_archived | ( | snowflake | channel_id, |
snowflake | before_id, | ||
uint16_t | limit | ||
) |
Get private archived threads in a channel which current user has joined (Sorted by ID in descending order)
channel_id | Channel to get public archived threads for |
before_id | Get threads before this id |
limit | Number of threads to get |
References thread_create_in_forum().
async< confirmation_callback_t > dpp::cluster::co_threads_get_private_archived | ( | snowflake | channel_id, |
time_t | before_timestamp, | ||
uint16_t | limit | ||
) |
Get private archived threads in a channel (Sorted by archive_timestamp in descending order)
channel_id | Channel to get public archived threads for |
before_timestamp | Get threads archived before this timestamp |
limit | Number of threads to get |
References thread_create().
async< confirmation_callback_t > dpp::cluster::co_threads_get_public_archived | ( | snowflake | channel_id, |
time_t | before_timestamp, | ||
uint16_t | limit | ||
) |
Get public archived threads in a channel (Sorted by archive_timestamp in descending order)
channel_id | Channel to get public archived threads for |
before_timestamp | Get threads archived before this timestamp |
limit | Number of threads to get |
References thread_edit().
async< confirmation_callback_t > dpp::cluster::co_user_application_role_connection_get | ( | snowflake | application_id | ) |
Get user application role connection.
application_id | The application ID |
References guild_event_edit().
async< confirmation_callback_t > dpp::cluster::co_user_application_role_connection_update | ( | snowflake | application_id, |
const application_role_connection & | connection | ||
) |
Update user application role connection.
application_id | The application ID |
connection | The application role connection to update |
References guild_event_get().
async< confirmation_callback_t > dpp::cluster::co_user_get | ( | snowflake | user_id | ) |
Get a user by id, without using the cache.
user_id | User ID to retrieve |
dynamic_cast
. dpp::user_identified
or you've turned off caching, you have no need to call this. Call dpp::find_user
instead that looks up the user in the cache rather than a REST call. References delete_webhook().
async< confirmation_callback_t > dpp::cluster::co_user_get_cached | ( | snowflake | user_id | ) |
Get a user by id, checking in the cache first.
user_id | User ID to retrieve |
dynamic_cast
. dpp::user_identified
will be undefined. This call should be used where you want to for example resolve a user who may no longer be in the bot's guilds, for something like a ban log message. References delete_webhook_message().
Referenced by event_handler_test().
async< confirmation_callback_t > dpp::cluster::co_user_set_voice_state | ( | snowflake | user_id, |
snowflake | guild_id, | ||
snowflake | channel_id, | ||
bool | suppress = false |
||
) |
Set a user's voice state on a stage channel.
Caveats
There are currently several caveats for this endpoint:
channel_id
must currently point to a stage channel.channel_id
.MUTE_MEMBERS
permission. (Since suppression is the only thing that is available currently)request_to_speak_timestamp
set to the current time. Bot users will not.request_to_speak_timestamp
removed.user_id | The user to set the voice state of |
guild_id | Guild to set voice state on |
channel_id | Stage channel to set voice state on |
suppress | True if the user's audio should be suppressed, false if it should not |
References user_get_cached().
void dpp::cluster::create_dm_channel | ( | snowflake | user_id, |
command_completion_event_t | callback = utility::log_error() |
||
) |
Create a dm channel.
user_id | User ID to create DM channel with |
callback | Function 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(). |
Referenced by channel_invites_get_sync(), and co_channel_invites_get().
Create a dm channel.
user_id | User ID to create DM channel with |
dpp::rest_exception | upon failure to execute REST function |
References guild_emoji_create().
void dpp::cluster::create_webhook | ( | const class webhook & | w, |
command_completion_event_t | callback = utility::log_error() |
||
) |
Create a webhook.
w | Webhook to create |
callback | Function 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(). |
References API_PATH, dpp::json_interface< T >::build_json(), dpp::managed::id, and dpp::m_patch.
Referenced by co_current_user_leave_guild(), and current_user_leave_guild_sync().
void dpp::cluster::current_application_get | ( | command_completion_event_t | callback | ) |
Get current (bot) application.
callback | Function 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(). |
Referenced by co_thread_create_with_message(), and thread_create_with_message_sync().
application dpp::cluster::current_application_get_sync | ( | ) |
Get current (bot) application.
dpp::rest_exception | upon failure to execute REST function |
References current_user_get_guilds().
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.
callback | Function 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(). |
Referenced by co_current_user_edit(), and current_user_edit_sync().
connection_map dpp::cluster::current_user_connections_get_sync | ( | ) |
Get current user's connections (linked accounts, e.g.
steam, xbox). This call requires the oauth2 connections
scope and cannot be executed against a bot token.
dpp::rest_exception | upon failure to execute REST function |
References get_voice_regions().
void dpp::cluster::current_user_edit | ( | const std::string & | nickname, |
const std::string & | image_blob = "" , |
||
const image_type | type = i_png , |
||
command_completion_event_t | callback = utility::log_error() |
||
) |
Edit current (bot) user.
Modifies the current member in a guild. Returns the updated guild_member object on success. Fires a Guild Member Update
Gateway event.
nickname | Nickname to set |
image_blob | Avatar data to upload (NOTE: Very heavily rate limited!) |
type | Type of image for avatar. It can be one of i_gif , i_jpg or i_png . |
callback | Function 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(). |
dpp::length_exception | Image data is larger than the maximum size of 256 kilobytes |
References API_PATH, and dpp::m_get.
Referenced by co_thread_edit(), and thread_edit_sync().
user dpp::cluster::current_user_edit_sync | ( | const std::string & | nickname, |
const std::string & | image_blob = "" , |
||
const image_type | type = i_png |
||
) |
Edit current (bot) user.
Modifies the current member in a guild. Returns the updated guild_member object on success. Fires a Guild Member Update
Gateway event.
nickname | Nickname to set |
image_blob | Avatar data to upload (NOTE: Very heavily rate limited!) |
type | Type of image for avatar. It can be one of i_gif , i_jpg or i_png . |
dpp::length_exception | Image data is larger than the maximum size of 256 kilobytes |
dpp::rest_exception | upon failure to execute REST function |
References current_user_connections_get().
void dpp::cluster::current_user_get | ( | command_completion_event_t | callback | ) |
Get current (bot) user.
callback | Function to call when the API call completes. On success the callback will contain a dpp::user_identified object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error(). |
dynamic_cast
. Referenced by co_thread_member_add(), and thread_member_add_sync().
void dpp::cluster::current_user_get_dms | ( | command_completion_event_t | callback | ) |
Get current user DM channels.
callback | Function 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(). |
Referenced by channel_typing_sync(), and co_channel_typing().
channel_map dpp::cluster::current_user_get_dms_sync | ( | ) |
Get current user DM channels.
dpp::rest_exception | upon failure to execute REST function |
References guild_emoji_delete().
void dpp::cluster::current_user_get_guilds | ( | command_completion_event_t | callback | ) |
Get current (bot) user guilds.
callback | Function 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(). |
Referenced by co_current_application_get(), and current_application_get_sync().
guild_map dpp::cluster::current_user_get_guilds_sync | ( | ) |
Get current (bot) user guilds.
dpp::rest_exception | upon failure to execute REST function |
References guild_get_voice_regions().
user_identified dpp::cluster::current_user_get_sync | ( | ) |
Get current (bot) user.
dynamic_cast
.dpp::rest_exception | upon failure to execute REST function |
References current_user_leave_guild().
void dpp::cluster::current_user_join_thread | ( | snowflake | thread_id, |
command_completion_event_t | callback = utility::log_error() |
||
) |
Join a thread.
thread_id | Thread ID to join |
callback | Function 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(). |
References dpp::managed::id, me, and dpp::snowflake_not_null().
Referenced by co_guild_template_delete(), and guild_template_delete_sync().
confirmation dpp::cluster::current_user_join_thread_sync | ( | snowflake | thread_id | ) |
Join a thread.
thread_id | Thread ID to join |
dpp::rest_exception | upon failure to execute REST function |
References threads_get_public_archived().
void dpp::cluster::current_user_leave_guild | ( | snowflake | guild_id, |
command_completion_event_t | callback = utility::log_error() |
||
) |
Leave a guild.
guild_id | Guild ID to leave |
callback | Function 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(). |
Referenced by co_current_user_get(), and current_user_get_sync().
confirmation dpp::cluster::current_user_leave_guild_sync | ( | snowflake | guild_id | ) |
Leave a guild.
guild_id | Guild ID to leave |
dpp::rest_exception | upon failure to execute REST function |
References create_webhook().
void dpp::cluster::current_user_leave_thread | ( | snowflake | thread_id, |
command_completion_event_t | callback = utility::log_error() |
||
) |
Leave a thread.
thread_id | Thread ID to leave |
callback | Function 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(). |
Referenced by co_guild_template_modify(), and guild_template_modify_sync().
confirmation dpp::cluster::current_user_leave_thread_sync | ( | snowflake | thread_id | ) |
Leave a thread.
thread_id | Thread ID to leave |
dpp::rest_exception | upon failure to execute REST function |
References thread_member_get().
void dpp::cluster::current_user_set_voice_state | ( | snowflake | guild_id, |
snowflake | channel_id, | ||
bool | suppress = false , |
||
time_t | request_to_speak_timestamp = 0 , |
||
command_completion_event_t | callback = utility::log_error() |
||
) |
Set the bot's voice state on a stage channel.
Caveats
There are currently several caveats for this endpoint:
channel_id
must currently point to a stage channel.channel_id
.MUTE_MEMBERS
permission to unsuppress yourself. You can always suppress yourself.REQUEST_TO_SPEAK
permission to request to speak. You can always clear your own request to speak.request_to_speak_timestamp
to any present or future time.guild_id | Guild to set voice state on |
channel_id | Stage channel to set voice state on |
callback | Function to call when the API call completes. |
suppress | True if the user's audio should be suppressed, false if it should not |
request_to_speak_timestamp | The time at which we requested to speak, or 0 to clear the request. The time set here must be the current time or in the future. On success the callback will contain a dpp::scheduled_event object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error(). |
std::logic_exception | You attempted to set a request_to_speak_timestamp in the past which is not the value of 0. |
Referenced by co_thread_member_remove(), and thread_member_remove_sync().
confirmation dpp::cluster::current_user_set_voice_state_sync | ( | snowflake | guild_id, |
snowflake | channel_id, | ||
bool | suppress = false , |
||
time_t | request_to_speak_timestamp = 0 |
||
) |
Set the bot's voice state on a stage channel.
Caveats
There are currently several caveats for this endpoint:
channel_id
must currently point to a stage channel.channel_id
.MUTE_MEMBERS
permission to unsuppress yourself. You can always suppress yourself.REQUEST_TO_SPEAK
permission to request to speak. You can always clear your own request to speak.request_to_speak_timestamp
to any present or future time.guild_id | Guild to set voice state on |
channel_id | Stage channel to set voice state on |
suppress | True if the user's audio should be suppressed, false if it should not |
request_to_speak_timestamp | The time at which we requested to speak, or 0 to clear the request. The time set here must be the current time or in the future. |
std::logic_exception | You attempted to set a request_to_speak_timestamp in the past which is not the value of 0. |
dpp::rest_exception | upon failure to execute REST function |
References user_get().
void dpp::cluster::delete_webhook | ( | snowflake | webhook_id, |
command_completion_event_t | callback = utility::log_error() |
||
) |
Delete a webhook.
webhook_id | Webhook ID to delete |
callback | Function 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(). |
References dpp::utility::make_url_parameters().
Referenced by co_user_get(), and user_get_sync().
void dpp::cluster::delete_webhook_message | ( | const class webhook & | wh, |
snowflake | message_id, | ||
snowflake | thread_id = 0 , |
||
command_completion_event_t | callback = utility::log_error() |
||
) |
Delete webhook message.
wh | Webhook to delete message for |
message_id | Message ID to delete |
thread_id | ID of the thread the message is in |
callback | Function 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(). |
Referenced by co_user_get_cached(), and user_get_cached_sync().
confirmation dpp::cluster::delete_webhook_message_sync | ( | const class webhook & | wh, |
snowflake | message_id, | ||
snowflake | thread_id = 0 |
||
) |
Delete webhook message.
wh | Webhook to delete message for |
message_id | Message ID to delete |
thread_id | ID of the thread the message is in |
dpp::rest_exception | upon failure to execute REST function |
References execute_webhook(), and dpp::unicode_emoji::m.
confirmation dpp::cluster::delete_webhook_sync | ( | snowflake | webhook_id | ) |
Delete a webhook.
webhook_id | Webhook ID to delete |
dpp::rest_exception | upon failure to execute REST function |
References edit_webhook_with_token().
void dpp::cluster::delete_webhook_with_token | ( | snowflake | webhook_id, |
const std::string & | token, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Delete webhook with token.
webhook_id | Webhook ID to delete |
token | Token of webhook to delete |
callback | Function 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(). |
References dpp::json_interface< T >::to_json().
Referenced by co_get_voice_regions(), and get_voice_regions_sync().
confirmation dpp::cluster::delete_webhook_with_token_sync | ( | snowflake | webhook_id, |
const std::string & | token | ||
) |
Delete webhook with token.
webhook_id | Webhook ID to delete |
token | Token of webhook to delete |
dpp::rest_exception | upon failure to execute REST function |
References get_channel_webhooks().
void dpp::cluster::direct_message_create | ( | snowflake | user_id, |
const message & | m, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Create a direct message, also create the channel for the direct message if needed.
user_id | User ID of user to send message to |
m | Message object |
callback | Function 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(). |
Referenced by channel_typing_sync(), and co_channel_typing().
Create a direct message, also create the channel for the direct message if needed.
user_id | User ID of user to send message to |
m | Message object |
dpp::rest_exception | upon failure to execute REST function |
References guild_emoji_edit().
void dpp::cluster::edit_webhook | ( | const class webhook & | wh, |
command_completion_event_t | callback = utility::log_error() |
||
) |
Edit webhook.
wh | Webhook to edit |
callback | Function 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(). |
Referenced by co_guild_get_voice_regions(), and guild_get_voice_regions_sync().
void dpp::cluster::edit_webhook_message | ( | const class webhook & | wh, |
const struct message & | m, | ||
snowflake | thread_id = 0 , |
||
command_completion_event_t | callback = utility::log_error() |
||
) |
Edit webhook message.
When the content field is edited, the mentions array in the message object will be reconstructed from scratch based on the new content. The allowed_mentions field of the edit request controls how this happens. If there is no explicit allowed_mentions in the edit request, the content will be parsed with default allowances, that is, without regard to whether or not an allowed_mentions was present in the request that originally created the message.
wh | Webhook to edit message for |
m | New message |
thread_id | ID of the thread the message is in |
callback | Function 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(). |
References dpp::webhook::avatar, dpp::unicode_emoji::m, dpp::utility::make_url_parameters(), dpp::webhook::name, and dpp::utility::iconhash::to_string().
message dpp::cluster::edit_webhook_message_sync | ( | const class webhook & | wh, |
const struct message & | m, | ||
snowflake | thread_id = 0 |
||
) |
Edit webhook message.
When the content field is edited, the mentions array in the message object will be reconstructed from scratch based on the new content. The allowed_mentions field of the edit request controls how this happens. If there is no explicit allowed_mentions in the edit request, the content will be parsed with default allowances, that is, without regard to whether or not an allowed_mentions was present in the request that originally created the message.
wh | Webhook to edit message for |
m | New message |
thread_id | ID of the thread the message is in |
dpp::rest_exception | upon failure to execute REST function |
References get_webhook().
Edit webhook.
wh | Webhook to edit |
dpp::rest_exception | upon failure to execute REST function |
References get_guild_webhooks().
void dpp::cluster::edit_webhook_with_token | ( | const class webhook & | wh, |
command_completion_event_t | callback = utility::log_error() |
||
) |
Edit webhook with token (token is encapsulated in the webhook object)
wh | Webhook to edit (should include token) |
callback | Function 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(). |
References dpp::webhook::avatar, and dpp::utility::iconhash::to_string().
Referenced by co_delete_webhook(), and delete_webhook_sync().
Edit webhook with token (token is encapsulated in the webhook object)
wh | Webhook to edit (should include token) |
dpp::rest_exception | upon failure to execute REST function |
References get_webhook_message().
void dpp::cluster::entitlement_test_create | ( | const class entitlement & | new_entitlement, |
command_completion_event_t | callback = utility::log_error() |
||
) |
Creates a test entitlement to a given SKU for a given guild or user.
Discord will act as though that user or guild has entitlement to your premium offering.
new_entitlement | The entitlement to create. Make sure your dpp::entitlement_type (inside your dpp::entitlement object) matches the type of the owner_id (if type is guild, owner_id is a guild id), otherwise it won't work! |
callback | Function to call when the API call completes. On success the callback will contain a dpp::entitlement object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error(). |
Referenced by co_guild_emoji_delete(), and guild_emoji_delete_sync().
entitlement dpp::cluster::entitlement_test_create_sync | ( | const class entitlement & | new_entitlement | ) |
Creates a test entitlement to a given SKU for a given guild or user.
Discord will act as though that user or guild has entitlement to your premium offering.
new_entitlement | The entitlement to create. Make sure your dpp::entitlement_type (inside your dpp::entitlement object) matches the type of the owner_id (if type is guild, owner_id is a guild id), otherwise it won't work! |
dpp::rest_exception | upon failure to execute REST function |
References guild_ban_add().
void dpp::cluster::entitlement_test_delete | ( | snowflake | entitlement_id, |
command_completion_event_t | callback = utility::log_error() |
||
) |
Deletes a currently-active test entitlement.
Discord will act as though that user or guild no longer has entitlement to your premium offering.
entitlement_id | The test entitlement to delete. |
callback | Function 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(). |
Referenced by co_guild_emoji_edit(), and guild_emoji_edit_sync().
confirmation dpp::cluster::entitlement_test_delete_sync | ( | snowflake | entitlement_id | ) |
Deletes a currently-active test entitlement.
Discord will act as though that user or guild no longer has entitlement to your premium offering.
entitlement_id | The test entitlement to delete. |
dpp::rest_exception | upon failure to execute REST function |
References guild_ban_delete().
void dpp::cluster::entitlements_get | ( | snowflake | user_id = 0 , |
const std::vector< snowflake > & | sku_ids = {} , |
||
snowflake | before_id = 0 , |
||
snowflake | after_id = 0 , |
||
uint8_t | limit = 100 , |
||
snowflake | guild_id = 0 , |
||
bool | exclude_ended = false , |
||
command_completion_event_t | callback = utility::log_error() |
||
) |
Returns all entitlements for a given app, active and expired.
user_id | User ID to look up entitlements for. |
sku_ids | List of SKU IDs to check entitlements for. |
before_id | Retrieve entitlements before this entitlement ID. |
after_id | Retrieve entitlements after this entitlement ID. |
limit | Number of entitlements to return, 1-100 (default 100). |
guild_id | Guild ID to look up entitlements for. |
exclude_ended | Whether ended entitlements should be excluded from the search. |
callback | Function 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(). |
Referenced by co_guild_emoji_create(), and guild_emoji_create_sync().
entitlement_map dpp::cluster::entitlements_get_sync | ( | snowflake | user_id = 0 , |
const std::vector< snowflake > & | sku_ids = {} , |
||
snowflake | before_id = 0 , |
||
snowflake | after_id = 0 , |
||
uint8_t | limit = 100 , |
||
snowflake | guild_id = 0 , |
||
bool | exclude_ended = false |
||
) |
Returns all entitlements for a given app, active and expired.
user_id | User ID to look up entitlements for. |
sku_ids | List of SKU IDs to check entitlements for. |
before_id | Retrieve entitlements before this entitlement ID. |
after_id | Retrieve entitlements after this entitlement ID. |
limit | Number of entitlements to return, 1-100 (default 100). |
guild_id | Guild ID to look up entitlements for. |
exclude_ended | Whether ended entitlements should be excluded from the search. |
dpp::rest_exception | upon failure to execute REST function |
References guild_auditlog_get().
void dpp::cluster::execute_webhook | ( | const class webhook & | wh, |
const struct message & | m, | ||
bool | wait = false , |
||
snowflake | thread_id = 0 , |
||
const std::string & | thread_name = "" , |
||
command_completion_event_t | callback = utility::log_error() |
||
) |
Execute webhook.
wh | Webhook to execute |
m | Message to send |
wait | waits for server confirmation of message send before response, and returns the created message body |
thread_id | Send a message to the specified thread within a webhook's channel. The thread will automatically be unarchived |
thread_name | Name of thread to create (requires the webhook channel to be a forum channel) |
callback | Function to call when the API call completes. |
thread_id
or thread_name
. If thread_id
is provided, the message will send in that thread. If thread_name
is provided, a thread with that name will be created in the forum channel. 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(). Referenced by co_delete_webhook_message(), and delete_webhook_message_sync().
message dpp::cluster::execute_webhook_sync | ( | const class webhook & | wh, |
const struct message & | m, | ||
bool | wait = false , |
||
snowflake | thread_id = 0 , |
||
const std::string & | thread_name = "" |
||
) |
Execute webhook.
wh | Webhook to execute |
m | Message to send |
wait | waits for server confirmation of message send before response, and returns the created message body |
thread_id | Send a message to the specified thread within a webhook's channel. The thread will automatically be unarchived |
thread_name | Name of thread to create (requires the webhook channel to be a forum channel) |
thread_id
or thread_name
. If thread_id
is provided, the message will send in that thread. If thread_name
is provided, a thread with that name will be created in the forum channel.dpp::rest_exception | upon failure to execute REST function |
References get_webhook_with_token(), and token.
void dpp::cluster::gdm_add | ( | snowflake | channel_id, |
snowflake | user_id, | ||
const std::string & | access_token, | ||
const std::string & | nick, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Adds a recipient to a Group DM using their access token.
channel_id | Channel id to add group DM recipients to |
user_id | User ID to add |
access_token | Access token from OAuth2 |
nick | Nickname of user to apply to the chat |
callback | Function 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(). |
Referenced by channels_get_sync(), and co_channels_get().
confirmation dpp::cluster::gdm_add_sync | ( | snowflake | channel_id, |
snowflake | user_id, | ||
const std::string & | access_token, | ||
const std::string & | nick | ||
) |
Adds a recipient to a Group DM using their access token.
channel_id | Channel id to add group DM recipients to |
user_id | User ID to add |
access_token | Access token from OAuth2 |
nick | Nickname of user to apply to the chat |
dpp::rest_exception | upon failure to execute REST function |
References guild_emoji_get().
void dpp::cluster::gdm_remove | ( | snowflake | channel_id, |
snowflake | user_id, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Removes a recipient from a Group DM.
channel_id | Channel ID of group DM |
user_id | User ID to remove from group DM |
callback | Function 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(). |
Referenced by channel_set_voice_status_sync(), and co_channel_set_voice_status().
confirmation dpp::cluster::gdm_remove_sync | ( | snowflake | channel_id, |
snowflake | user_id | ||
) |
Removes a recipient from a Group DM.
channel_id | Channel ID of group DM |
user_id | User ID to remove from group DM |
dpp::rest_exception | upon failure to execute REST function |
References guild_emojis_get().
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.
void dpp::cluster::get_channel_webhooks | ( | snowflake | channel_id, |
command_completion_event_t | callback | ||
) |
Get channel webhooks.
channel_id | Channel ID to get webhooks for |
callback | Function 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(). |
References API_PATH, dpp::m_get, and dpp::utility::url_encode().
Referenced by co_delete_webhook_with_token(), and delete_webhook_with_token_sync().
webhook_map dpp::cluster::get_channel_webhooks_sync | ( | snowflake | channel_id | ) |
Get channel webhooks.
channel_id | Channel ID to get webhooks for |
dpp::rest_exception | upon failure to execute REST function |
Get the dm channel for a user id.
user_id | the user id to get the dm channel for |
void dpp::cluster::get_gateway_bot | ( | command_completion_event_t | callback | ) |
Get the gateway information for the bot using the token.
callback | Function 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(). |
Referenced by co_guild_emoji_get(), and guild_emoji_get_sync().
gateway dpp::cluster::get_gateway_bot_sync | ( | ) |
Get the gateway information for the bot using the token.
dpp::rest_exception | upon failure to execute REST function |
References guild_create().
void dpp::cluster::get_guild_webhooks | ( | snowflake | guild_id, |
command_completion_event_t | callback | ||
) |
Get guild webhooks.
guild_id | Guild ID to get webhooks for |
callback | Function 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(). |
Referenced by co_edit_webhook(), and edit_webhook_sync().
webhook_map dpp::cluster::get_guild_webhooks_sync | ( | snowflake | guild_id | ) |
Get guild webhooks.
guild_id | Guild ID to get webhooks for |
dpp::rest_exception | upon failure to execute REST function |
request_queue * dpp::cluster::get_raw_rest | ( | ) |
Get the raw rest_queue object which handles all HTTP(S) requests that are not directed at Discord.
request_queue * dpp::cluster::get_rest | ( | ) |
Get the rest_queue object which handles HTTPS requests to Discord.
discord_client * dpp::cluster::get_shard | ( | uint32_t | id | ) |
Get a shard by id, returning the discord_client.
id | Shard ID |
Referenced by main().
const shard_list & dpp::cluster::get_shards | ( | ) |
Get the list of shards.
Referenced by dpp::discord_client::one_second_timer().
void dpp::cluster::get_voice_regions | ( | command_completion_event_t | callback | ) |
Get all voice regions.
callback | Function 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(). |
Referenced by co_current_user_connections_get(), and current_user_connections_get_sync().
voiceregion_map dpp::cluster::get_voice_regions_sync | ( | ) |
Get all voice regions.
dpp::rest_exception | upon failure to execute REST function |
References delete_webhook_with_token(), and token.
void dpp::cluster::get_webhook | ( | snowflake | webhook_id, |
command_completion_event_t | callback | ||
) |
Get webhook.
webhook_id | Webhook ID to get |
callback | Function 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(). |
Referenced by co_edit_webhook_message(), and edit_webhook_message_sync().
void dpp::cluster::get_webhook_message | ( | const class webhook & | wh, |
snowflake | message_id, | ||
snowflake | thread_id = 0 , |
||
command_completion_event_t | callback = utility::log_error() |
||
) |
Get webhook message.
wh | Webhook to get the original message for |
message_id | The message ID |
thread_id | ID of the thread the message is in |
callback | Function 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(). |
Referenced by co_edit_webhook_with_token(), and edit_webhook_with_token_sync().
message dpp::cluster::get_webhook_message_sync | ( | const class webhook & | wh, |
snowflake | message_id, | ||
snowflake | thread_id = 0 |
||
) |
Get webhook message.
wh | Webhook to get the original message for |
message_id | The message ID |
thread_id | ID of the thread the message is in |
dpp::rest_exception | upon failure to execute REST function |
Get webhook.
webhook_id | Webhook ID to get |
dpp::rest_exception | upon failure to execute REST function |
void dpp::cluster::get_webhook_with_token | ( | snowflake | webhook_id, |
const std::string & | token, | ||
command_completion_event_t | callback | ||
) |
Get webhook using token.
webhook_id | Webhook ID to retrieve |
token | Token of webhook |
callback | Function 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(). |
Referenced by co_execute_webhook(), and execute_webhook_sync().
webhook dpp::cluster::get_webhook_with_token_sync | ( | snowflake | webhook_id, |
const std::string & | token | ||
) |
Get webhook using token.
webhook_id | Webhook ID to retrieve |
token | Token of webhook |
dpp::rest_exception | upon failure to execute REST function |
void dpp::cluster::global_bulk_command_create | ( | const std::vector< slashcommand > & | commands, |
command_completion_event_t | callback = utility::log_error() |
||
) |
Create/overwrite global slash commands.
Any existing global slash commands will be deleted and replaced with these.
commands | Vector of slash commands to create/update. overwriting existing commands that are registered globally for this application. Commands that do not already exist will count toward daily application command create limits. |
callback | Function 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(). |
References API_PATH, dpp::managed::id, dpp::m_delete, me, and dpp::rest_request< confirmation >().
slashcommand_map dpp::cluster::global_bulk_command_create_sync | ( | const std::vector< slashcommand > & | commands | ) |
Create/overwrite global slash commands.
Any existing global slash commands will be deleted and replaced with these.
commands | Vector of slash commands to create/update. overwriting existing commands that are registered globally for this application. Commands that do not already exist will count toward daily application command create limits. |
dpp::rest_exception | upon failure to execute REST function |
References global_command_edit().
void dpp::cluster::global_bulk_command_delete | ( | command_completion_event_t | callback = utility::log_error() | ) |
Delete all existing global slash commands.
callback | Function to call when the API call completes. On success the callback will contain a dpp::slashcommand_map object in confirmation_callback_t::value which will be empty, meaning there are no commands. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error(). |
References API_PATH, dpp::managed::id, dpp::m_get, and me.
slashcommand_map dpp::cluster::global_bulk_command_delete_sync | ( | ) |
Delete all existing global slash commands.
dpp::rest_exception | upon failure to execute REST function |
References global_commands_get().
void dpp::cluster::global_command_create | ( | const slashcommand & | s, |
command_completion_event_t | callback = utility::log_error() |
||
) |
Create a global slash command (a bot can have a maximum of 100 of these).
s | Slash command to create |
callback | Function to call when the API call completes. On success the callback will contain a dpp::slashcommand object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error(). |
slashcommand dpp::cluster::global_command_create_sync | ( | const slashcommand & | s | ) |
Create a global slash command (a bot can have a maximum of 100 of these).
s | Slash command to create |
dpp::rest_exception | upon failure to execute REST function |
References guild_bulk_command_create().
void dpp::cluster::global_command_delete | ( | snowflake | id, |
command_completion_event_t | callback = utility::log_error() |
||
) |
Delete a global slash command (a bot can have a maximum of 100 of these)
id | Slash command to delete |
callback | Function 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(). |
References API_PATH, dpp::managed::id, dpp::m_put, and me.
confirmation dpp::cluster::global_command_delete_sync | ( | snowflake | id | ) |
Delete a global slash command (a bot can have a maximum of 100 of these)
id | Slash command to delete |
dpp::rest_exception | upon failure to execute REST function |
References guild_commands_get_permissions().
void dpp::cluster::global_command_edit | ( | const slashcommand & | s, |
command_completion_event_t | callback = utility::log_error() |
||
) |
Edit a global slash command (a bot can have a maximum of 100 of these)
s | Slash command to change |
callback | Function 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(). |
References API_PATH, dpp::managed::id, dpp::m_get, and me.
Referenced by co_global_bulk_command_create(), and global_bulk_command_create_sync().
confirmation dpp::cluster::global_command_edit_sync | ( | const slashcommand & | s | ) |
Edit a global slash command (a bot can have a maximum of 100 of these)
s | Slash command to change |
dpp::rest_exception | upon failure to execute REST function |
References guild_bulk_command_edit_permissions().
void dpp::cluster::global_command_get | ( | snowflake | id, |
command_completion_event_t | callback = utility::log_error() |
||
) |
Get a global slash command.
id | The ID of the slash command |
callback | Function to call when the API call completes. On success the callback will contain a dpp::slashcommand object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error(). |
slashcommand dpp::cluster::global_command_get_sync | ( | snowflake | id | ) |
Get a global slash command.
id | The ID of the slash command |
dpp::rest_exception | upon failure to execute REST function |
References guild_bulk_command_delete().
void dpp::cluster::global_commands_get | ( | command_completion_event_t | callback | ) |
Get the application's global slash commands.
callback | Function 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(). |
Referenced by co_global_bulk_command_delete(), and global_bulk_command_delete_sync().
slashcommand_map dpp::cluster::global_commands_get_sync | ( | ) |
Get the application's global slash commands.
dpp::rest_exception | upon failure to execute REST function |
References guild_command_create().
void dpp::cluster::guild_add_member | ( | const guild_member & | gm, |
const std::string & | access_token, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Add guild member.
Needs a specific oauth2 scope, from which you get the access_token.
Adds a user to the guild, provided you have a valid oauth2 access token for the user with the guilds.join scope. Returns the guild_member, which is defaulted if the user is already a member of the guild. Fires a Guild Member Add
Gateway event.
For guilds with Membership Screening enabled, this endpoint will default to adding new members as pending in the guild member object. Members that are pending will have to complete membership screening before they become full members that can talk.
CREATE_INSTANT_INVITE
permission. gm | Guild member to add |
access_token | Access token from Oauth2 scope |
callback | Function 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(). |
Referenced by co_guild_sync_integration(), and guild_sync_integration_sync().
confirmation dpp::cluster::guild_add_member_sync | ( | const guild_member & | gm, |
const std::string & | access_token | ||
) |
Add guild member.
Needs a specific oauth2 scope, from which you get the access_token.
Adds a user to the guild, provided you have a valid oauth2 access token for the user with the guilds.join scope. Returns the guild_member, which is defaulted if the user is already a member of the guild. Fires a Guild Member Add
Gateway event.
For guilds with Membership Screening enabled, this endpoint will default to adding new members as pending in the guild member object. Members that are pending will have to complete membership screening before they become full members that can talk.
CREATE_INSTANT_INVITE
permission. gm | Guild member to add |
access_token | Access token from Oauth2 scope |
dpp::rest_exception | upon failure to execute REST function |
References guild_member_delete().
void dpp::cluster::guild_auditlog_get | ( | snowflake | guild_id, |
snowflake | user_id, | ||
uint32_t | action_type, | ||
snowflake | before, | ||
snowflake | after, | ||
uint32_t | limit, | ||
command_completion_event_t | callback | ||
) |
Get the audit log for a guild.
guild_id | Guild to get the audit log of |
user_id | Entries from a specific user ID. Set this to 0 will fetch any user |
action_type | Entries for a specific dpp::audit_type. Set this to 0 will fetch any type |
before | Entries with ID less than a specific audit log entry ID. Used for paginating |
after | Entries with ID greater than a specific audit log entry ID. Used for paginating |
limit | Maximum number of entries (between 1-100) to return |
callback | Function 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(). |
Referenced by co_entitlements_get(), and entitlements_get_sync().
auditlog dpp::cluster::guild_auditlog_get_sync | ( | snowflake | guild_id, |
snowflake | user_id, | ||
uint32_t | action_type, | ||
snowflake | before, | ||
snowflake | after, | ||
uint32_t | limit | ||
) |
Get the audit log for a guild.
guild_id | Guild to get the audit log of |
user_id | Entries from a specific user ID. Set this to 0 will fetch any user |
action_type | Entries for a specific dpp::audit_type. Set this to 0 will fetch any type |
before | Entries with ID less than a specific audit log entry ID. Used for paginating |
after | Entries with ID greater than a specific audit log entry ID. Used for paginating |
limit | Maximum number of entries (between 1-100) to return |
dpp::rest_exception | upon failure to execute REST function |
References guild_delete_integration().
void dpp::cluster::guild_ban_add | ( | snowflake | guild_id, |
snowflake | user_id, | ||
uint32_t | delete_message_seconds = 0 , |
||
command_completion_event_t | callback = utility::log_error() |
||
) |
Add guild ban.
Create a guild ban, and optionally delete previous messages sent by the banned user. Requires the BAN_MEMBERS
permission. Fires a Guild Ban Add
Gateway event.
guild_id | Guild ID to add ban to |
user_id | User ID to ban |
delete_message_seconds | How many seconds to delete messages for, between 0 and 604800 (7 days). Defaults to 0 |
callback | Function 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(). |
References API_PATH, dpp::json_interface< T >::build_json(), and dpp::m_post.
Referenced by co_entitlement_test_create(), and entitlement_test_create_sync().
confirmation dpp::cluster::guild_ban_add_sync | ( | snowflake | guild_id, |
snowflake | user_id, | ||
uint32_t | delete_message_seconds = 0 |
||
) |
Add guild ban.
Create a guild ban, and optionally delete previous messages sent by the banned user. Requires the BAN_MEMBERS
permission. Fires a Guild Ban Add
Gateway event.
guild_id | Guild ID to add ban to |
user_id | User ID to ban |
delete_message_seconds | How many seconds to delete messages for, between 0 and 604800 (7 days). Defaults to 0 |
dpp::rest_exception | upon failure to execute REST function |
References guild_edit().
void dpp::cluster::guild_ban_delete | ( | snowflake | guild_id, |
snowflake | user_id, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Delete guild ban.
Remove the ban for a user. Requires the BAN_MEMBERS
permissions. Fires a Guild Ban Remove Gateway event.
guild_id | Guild to delete ban from |
user_id | User ID to delete ban for |
callback | Function 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(). |
References API_PATH, dpp::json_interface< T >::build_json(), dpp::managed::id, and dpp::m_patch.
Referenced by co_entitlement_test_delete(), and entitlement_test_delete_sync().
confirmation dpp::cluster::guild_ban_delete_sync | ( | snowflake | guild_id, |
snowflake | user_id | ||
) |
Delete guild ban.
Remove the ban for a user. Requires the BAN_MEMBERS
permissions. Fires a Guild Ban Remove Gateway event.
guild_id | Guild to delete ban from |
user_id | User ID to delete ban for |
dpp::rest_exception | upon failure to execute REST function |
References guild_edit_widget().
void dpp::cluster::guild_begin_prune | ( | snowflake | guild_id, |
const struct prune & | pruneinfo, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Begin guild prune.
Begin a prune operation. Requires the KICK_MEMBERS
permission. Returns a prune object indicating the number of members that were removed in the prune operation. For large guilds it's recommended to set the compute_prune_count
option to false, forcing 'pruned' to 0. Fires multiple Guild Member Remove
Gateway events. By default, prune will not remove users with roles. You can optionally include specific roles in your prune by providing the include_roles
parameter. Any inactive user that has a subset of the provided role(s) will be included in the prune and users with additional roles will not.
guild_id | Guild ID to prune |
pruneinfo | Pruning info |
callback | Function 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(). |
References API_PATH, dpp::m_put, and dpp::unicode_emoji::o.
Begin guild prune.
Begin a prune operation. Requires the KICK_MEMBERS
permission. Returns a prune object indicating the number of members that were removed in the prune operation. For large guilds it's recommended to set the compute_prune_count
option to false, forcing 'pruned' to 0. Fires multiple Guild Member Remove
Gateway events. By default, prune will not remove users with roles. You can optionally include specific roles in your prune by providing the include_roles
parameter. Any inactive user that has a subset of the provided role(s) will be included in the prune and users with additional roles will not.
guild_id | Guild ID to prune |
pruneinfo | Pruning info |
dpp::rest_exception | upon failure to execute REST function |
References guild_get_welcome_screen().
void dpp::cluster::guild_bulk_command_create | ( | const std::vector< slashcommand > & | commands, |
snowflake | guild_id, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Create/overwrite guild slash commands.
Any existing guild slash commands on this guild will be deleted and replaced with these.
commands | Vector 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_id | Guild ID to create/update the slash commands in |
callback | Function 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(). |
Referenced by co_global_command_create(), and global_command_create_sync().
slashcommand_map dpp::cluster::guild_bulk_command_create_sync | ( | const std::vector< slashcommand > & | commands, |
snowflake | guild_id | ||
) |
Create/overwrite guild slash commands.
Any existing guild slash commands on this guild will be deleted and replaced with these.
commands | Vector 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_id | Guild ID to create/update the slash commands in |
dpp::rest_exception | upon failure to execute REST function |
References guild_command_delete().
void dpp::cluster::guild_bulk_command_delete | ( | snowflake | guild_id, |
command_completion_event_t | callback = utility::log_error() |
||
) |
Delete all existing guild slash commands.
guild_id | Guild ID to delete the slash commands in. |
callback | Function to call when the API call completes. On success the callback will contain a dpp::slashcommand_map object in confirmation_callback_t::value which will be empty, meaning there are no commands. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error(). |
Referenced by co_global_command_get(), and global_command_get_sync().
slashcommand_map dpp::cluster::guild_bulk_command_delete_sync | ( | snowflake | guild_id | ) |
Delete all existing guild slash commands.
guild_id | Guild ID to delete the slash commands in. |
dpp::rest_exception | upon failure to execute REST function |
References guild_command_edit_permissions().
void dpp::cluster::guild_bulk_command_edit_permissions | ( | const std::vector< slashcommand > & | commands, |
snowflake | guild_id, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Edit/Overwrite the permissions of all existing slash commands in a guild.
commands | A vector of slash commands to edit/overwrite the permissions for |
guild_id | Guild ID to edit permissions of the slash commands in |
callback | Function to call when the API call completes. On success the callback will contain a dpp::guild_command_permissions_map object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error(). |
Referenced by co_global_command_edit(), and global_command_edit_sync().
guild_command_permissions_map dpp::cluster::guild_bulk_command_edit_permissions_sync | ( | const std::vector< slashcommand > & | commands, |
snowflake | guild_id | ||
) |
Edit/Overwrite the permissions of all existing slash commands in a guild.
commands | A vector of slash commands to edit/overwrite the permissions for |
guild_id | Guild ID to edit permissions of the slash commands in |
dpp::rest_exception | upon failure to execute REST function |
References guild_command_get_permissions().
void dpp::cluster::guild_command_create | ( | const slashcommand & | s, |
snowflake | guild_id, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Create a slash command local to a guild.
s | Slash command to create |
guild_id | Guild ID to create the slash command in |
callback | Function to call when the API call completes. On success the callback will contain a dpp::slashcommand object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error(). |
References API_PATH, dpp::slashcommand::application_id, dpp::managed::id, dpp::m_put, dpp::slashcommand::permissions, and dpp::rest_request< confirmation >().
Referenced by co_global_commands_get(), and global_commands_get_sync().
slashcommand dpp::cluster::guild_command_create_sync | ( | const slashcommand & | s, |
snowflake | guild_id | ||
) |
Create a slash command local to a guild.
s | Slash command to create |
guild_id | Guild ID to create the slash command in |
dpp::rest_exception | upon failure to execute REST function |
References guild_command_edit().
void dpp::cluster::guild_command_delete | ( | snowflake | id, |
snowflake | guild_id, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Delete a slash command local to a guild.
id | Slash command to delete |
guild_id | Guild ID to delete the slash command in |
callback | Function 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(). |
References API_PATH, and dpp::m_get.
Referenced by co_guild_bulk_command_create(), and guild_bulk_command_create_sync().
confirmation dpp::cluster::guild_command_delete_sync | ( | snowflake | id, |
snowflake | guild_id | ||
) |
Delete a slash command local to a guild.
id | Slash command to delete |
guild_id | Guild ID to delete the slash command in |
dpp::rest_exception | upon failure to execute REST function |
References guild_commands_get().
void dpp::cluster::guild_command_edit | ( | const slashcommand & | s, |
snowflake | guild_id, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Edit a slash command local to a guild.
s | Slash command to edit |
guild_id | Guild ID to edit the slash command in |
callback | Function 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(). |
Referenced by co_guild_command_create(), and guild_command_create_sync().
void dpp::cluster::guild_command_edit_permissions | ( | const slashcommand & | s, |
snowflake | guild_id, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Edit slash command permissions of a guild.
s | Slash command to edit the permissions for |
guild_id | Guild ID to edit the slash command in |
callback | Function 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(). |
References API_PATH, dpp::slashcommand::application_id, dpp::json_interface< T >::build_json(), dpp::managed::id, dpp::m_patch, and dpp::rest_request< confirmation >().
Referenced by co_guild_bulk_command_delete(), and guild_bulk_command_delete_sync().
confirmation dpp::cluster::guild_command_edit_permissions_sync | ( | const slashcommand & | s, |
snowflake | guild_id | ||
) |
Edit slash command permissions of a guild.
s | Slash command to edit the permissions for |
guild_id | Guild ID to edit the slash command in |
dpp::rest_exception | upon failure to execute REST function |
References interaction_response_create(), and token.
confirmation dpp::cluster::guild_command_edit_sync | ( | const slashcommand & | s, |
snowflake | guild_id | ||
) |
Edit a slash command local to a guild.
s | Slash command to edit |
guild_id | Guild ID to edit the slash command in |
dpp::rest_exception | upon failure to execute REST function |
References interaction_followup_create(), dpp::unicode_emoji::m, and token.
void dpp::cluster::guild_command_get | ( | snowflake | id, |
snowflake | guild_id, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Get a slash command of a guild.
id | The ID of the slash command |
guild_id | Guild ID to get the slash command from |
callback | Function to call when the API call completes. On success the callback will contain a dpp::slashcommand object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error(). |
Referenced by co_guild_commands_get_permissions(), and guild_commands_get_permissions_sync().
void dpp::cluster::guild_command_get_permissions | ( | snowflake | id, |
snowflake | guild_id, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Get the permissions for a slash command of a guild.
id | The ID of the slash command to get the permissions for |
guild_id | Guild ID to get the permissions of |
callback | Function to call when the API call completes. On success the callback will contain a dpp::guild_command_permissions object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error(). |
References API_PATH, dpp::unicode_emoji::m, dpp::m_patch, and dpp::utility::url_encode().
Referenced by co_guild_bulk_command_edit_permissions(), and guild_bulk_command_edit_permissions_sync().
guild_command_permissions dpp::cluster::guild_command_get_permissions_sync | ( | snowflake | id, |
snowflake | guild_id | ||
) |
Get the permissions for a slash command of a guild.
id | The ID of the slash command to get the permissions for |
guild_id | Guild ID to get the permissions of |
dpp::rest_exception | upon failure to execute REST function |
References interaction_response_get_original(), and token.
slashcommand dpp::cluster::guild_command_get_sync | ( | snowflake | id, |
snowflake | guild_id | ||
) |
Get a slash command of a guild.
id | The ID of the slash command |
guild_id | Guild ID to get the slash command from |
dpp::rest_exception | upon failure to execute REST function |
References interaction_response_edit(), dpp::unicode_emoji::m, and token.
void dpp::cluster::guild_commands_get | ( | snowflake | guild_id, |
command_completion_event_t | callback | ||
) |
Get the application's slash commands for a guild.
guild_id | Guild ID to get the slash commands for |
callback | Function 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(). |
References API_PATH, dpp::m_get, dpp::rest_request< message >(), and dpp::utility::url_encode().
Referenced by co_guild_command_delete(), and guild_command_delete_sync().
void dpp::cluster::guild_commands_get_permissions | ( | snowflake | guild_id, |
command_completion_event_t | callback | ||
) |
Get all slash command permissions of a guild.
guild_id | Guild ID to get the slash commands permissions for |
callback | Function to call when the API call completes. On success the callback will contain a dpp::guild_command_permissions_map object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error(). |
Referenced by co_global_command_delete(), and global_command_delete_sync().
guild_command_permissions_map dpp::cluster::guild_commands_get_permissions_sync | ( | snowflake | guild_id | ) |
Get all slash command permissions of a guild.
guild_id | Guild ID to get the slash commands permissions for |
dpp::rest_exception | upon failure to execute REST function |
References guild_command_get().
slashcommand_map dpp::cluster::guild_commands_get_sync | ( | snowflake | guild_id | ) |
Get the application's slash commands for a guild.
guild_id | Guild ID to get the slash commands for |
dpp::rest_exception | upon failure to execute REST function |
References interaction_followup_edit_original(), dpp::unicode_emoji::m, and token.
void dpp::cluster::guild_create | ( | const class guild & | g, |
command_completion_event_t | callback = utility::log_error() |
||
) |
Create a guild.
Create a new guild. Returns a guild object on success. Fires a Guild Create Gateway
event.
When using the roles parameter, the first member of the array is used to change properties of the guild's everyone role. If you are trying to bootstrap a guild with additional roles, keep this in mind. The required id field within each role object is an integer placeholder, and will be replaced by the API upon consumption. Its purpose is to allow you to overwrite a role's permissions in a channel when also passing in channels with the channels array. When using the channels parameter, the position field is ignored, and none of the default channels are created. The id field within each channel object may be set to an integer placeholder, and will be replaced by the API upon consumption. Its purpose is to allow you to create GUILD_CATEGORY
channels by setting the parent_id
field on any children to the category's id field. Category channels must be listed before any children.
g | Guild to create |
callback | Function 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(). |
References API_PATH, dpp::json_interface< T >::build_json(), and dpp::m_patch.
Referenced by co_get_gateway_bot(), and get_gateway_bot_sync().
void dpp::cluster::guild_create_from_template | ( | const std::string & | code, |
const std::string & | name, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Create a new guild based on a template.
code | Template code to create guild from |
name | Guild name to create |
callback | Function 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(). |
Referenced by co_guild_sticker_get(), and guild_sticker_get_sync().
guild dpp::cluster::guild_create_from_template_sync | ( | const std::string & | code, |
const std::string & | name | ||
) |
Create a new guild based on a template.
code | Template code to create guild from |
name | Guild name to create |
dpp::rest_exception | upon failure to execute REST function |
References guild_template_sync().
Create a guild.
Create a new guild. Returns a guild object on success. Fires a Guild Create Gateway
event.
When using the roles parameter, the first member of the array is used to change properties of the guild's everyone role. If you are trying to bootstrap a guild with additional roles, keep this in mind. The required id field within each role object is an integer placeholder, and will be replaced by the API upon consumption. Its purpose is to allow you to overwrite a role's permissions in a channel when also passing in channels with the channels array. When using the channels parameter, the position field is ignored, and none of the default channels are created. The id field within each channel object may be set to an integer placeholder, and will be replaced by the API upon consumption. Its purpose is to allow you to create GUILD_CATEGORY
channels by setting the parent_id
field on any children to the category's id field. Category channels must be listed before any children.
g | Guild to create |
dpp::rest_exception | upon failure to execute REST function |
References guild_get_ban().
void dpp::cluster::guild_current_member_edit | ( | snowflake | guild_id, |
const std::string & | nickname, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Modify current member.
Modifies the current member in a guild. Fires a Guild Member Update
Gateway event.
guild_id | Guild ID to change on |
nickname | New nickname, or empty string to clear nickname |
callback | Function 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(). |
Referenced by co_guild_emojis_get(), and guild_emojis_get_sync().
confirmation dpp::cluster::guild_current_member_edit_sync | ( | snowflake | guild_id, |
const std::string & | nickname | ||
) |
Modify current member.
Modifies the current member in a guild. Fires a Guild Member Update
Gateway event.
guild_id | Guild ID to change on |
nickname | New nickname, or empty string to clear nickname |
dpp::rest_exception | upon failure to execute REST function |
References guild_delete().
void dpp::cluster::guild_delete | ( | snowflake | guild_id, |
command_completion_event_t | callback = utility::log_error() |
||
) |
Delete a guild.
Delete a guild permanently. User must be owner. Fires a Guild Delete Gateway
event.
guild_id | Guild ID to delete |
callback | Function 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(). |
References API_PATH, and dpp::m_get.
Referenced by co_guild_current_member_edit(), and guild_current_member_edit_sync().
void dpp::cluster::guild_delete_integration | ( | snowflake | guild_id, |
snowflake | integration_id, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Delete guild integration.
Delete the attached integration object for the guild. Deletes any associated webhooks and kicks the associated bot if there is one. Requires the MANAGE_GUILD
permission. Fires a Guild Integrations Update Gateway event.
guild_id | Guild ID to delete integration for |
integration_id | Integration ID to delete |
callback | Function 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(). |
References dpp::utility::make_url_parameters().
Referenced by co_guild_auditlog_get(), and guild_auditlog_get_sync().
confirmation dpp::cluster::guild_delete_integration_sync | ( | snowflake | guild_id, |
snowflake | integration_id | ||
) |
Delete guild integration.
Delete the attached integration object for the guild. Deletes any associated webhooks and kicks the associated bot if there is one. Requires the MANAGE_GUILD
permission. Fires a Guild Integrations Update Gateway event.
guild_id | Guild ID to delete integration for |
integration_id | Integration ID to delete |
dpp::rest_exception | upon failure to execute REST function |
References guild_get().
confirmation dpp::cluster::guild_delete_sync | ( | snowflake | guild_id | ) |
Delete a guild.
Delete a guild permanently. User must be owner. Fires a Guild Delete Gateway
event.
guild_id | Guild ID to delete |
dpp::rest_exception | upon failure to execute REST function |
References guild_get_bans().
void dpp::cluster::guild_edit | ( | const class guild & | g, |
command_completion_event_t | callback = utility::log_error() |
||
) |
Edit a guild.
Modify a guild's settings. Requires the MANAGE_GUILD
permission. Returns the updated guild object on success. Fires a Guild Update Gateway
event.
g | Guild to edit |
callback | Function 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(). |
Referenced by co_guild_ban_add(), and guild_ban_add_sync().
void dpp::cluster::guild_edit_member | ( | const guild_member & | gm, |
command_completion_event_t | callback = utility::log_error() |
||
) |
Edit the properties of an existing guild member.
Modify attributes of a guild member. Returns the guild_member. Fires a Guild Member Update
Gateway event. To remove a timeout, set the communication_disabled_until
to a non-zero time in the past, e.g. 1. When moving members to channels, the API user must have permissions to both connect to the channel and have the MOVE_MEMBERS
permission. For moving and disconnecting users from voice, use dpp::cluster::guild_member_move.
gm | Guild member to edit |
callback | Function 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(). |
Referenced by co_guild_get_onboarding(), and guild_get_onboarding_sync().
guild_member dpp::cluster::guild_edit_member_sync | ( | const guild_member & | gm | ) |
Edit the properties of an existing guild member.
Modify attributes of a guild member. Returns the guild_member. Fires a Guild Member Update
Gateway event. To remove a timeout, set the communication_disabled_until
to a non-zero time in the past, e.g. 1. When moving members to channels, the API user must have permissions to both connect to the channel and have the MOVE_MEMBERS
permission. For moving and disconnecting users from voice, use dpp::cluster::guild_member_move.
gm | Guild member to edit |
dpp::rest_exception | upon failure to execute REST function |
References guild_member_kick().
void dpp::cluster::guild_edit_onboarding | ( | const struct onboarding & | o, |
command_completion_event_t | callback = utility::log_error() |
||
) |
Edit the guild's onboarding configuration.
Requires the MANAGE_GUILD
and MANAGE_ROLES
permissions.
onboarding::mode
field modifies what is considered when enforcing these constraints.o | The onboarding object |
callback | Function to call when the API call completes. On success the callback will contain a dpp::onboarding 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(). |
Referenced by co_guild_get_prune_counts(), and guild_get_prune_counts_sync().
onboarding dpp::cluster::guild_edit_onboarding_sync | ( | const struct onboarding & | o | ) |
Edit the guild's onboarding configuration.
Requires the MANAGE_GUILD
and MANAGE_ROLES
permissions.
onboarding::mode
field modifies what is considered when enforcing these constraints.o | The onboarding object |
dpp::rest_exception | upon failure to execute REST function |
References guild_get_member().
Edit a guild.
Modify a guild's settings. Requires the MANAGE_GUILD
permission. Returns the updated guild object on success. Fires a Guild Update Gateway
event.
g | Guild to edit |
dpp::rest_exception | upon failure to execute REST function |
References guild_get_integrations().
void dpp::cluster::guild_edit_welcome_screen | ( | snowflake | guild_id, |
const struct welcome_screen & | welcome_screen, | ||
bool | enabled, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Edit the guild's welcome screen.
Requires the MANAGE_GUILD
permission. May fire a Guild Update
Gateway event.
guild_id | The guild ID to edit the welcome screen for |
welcome_screen | The welcome screen |
enabled | Whether the welcome screen should be enabled or disabled |
callback | Function to call when the API call completes. On success the callback will contain a dpp::welcome_screen 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(). |
Referenced by co_guild_set_nickname(), and guild_set_nickname_sync().
dpp::welcome_screen dpp::cluster::guild_edit_welcome_screen_sync | ( | snowflake | guild_id, |
const struct welcome_screen & | welcome_screen, | ||
bool | enabled | ||
) |
Edit the guild's welcome screen.
Requires the MANAGE_GUILD
permission. May fire a Guild Update
Gateway event.
guild_id | The guild ID to edit the welcome screen for |
welcome_screen | The welcome screen |
enabled | Whether the welcome screen should be enabled or disabled |
dpp::rest_exception | upon failure to execute REST function |
References guild_member_add_role().
void dpp::cluster::guild_edit_widget | ( | snowflake | guild_id, |
const class guild_widget & | gw, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Edit guild widget.
Requires the MANAGE_GUILD
permission.
guild_id | Guild ID to edit widget for |
gw | New guild widget information |
callback | Function 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(). |
References API_PATH, and dpp::m_get.
Referenced by co_guild_ban_delete(), and guild_ban_delete_sync().
guild_widget dpp::cluster::guild_edit_widget_sync | ( | snowflake | guild_id, |
const class guild_widget & | gw | ||
) |
Edit guild widget.
Requires the MANAGE_GUILD
permission.
guild_id | Guild ID to edit widget for |
gw | New guild widget information |
dpp::rest_exception | upon failure to execute REST function |
References guild_get_preview().
void dpp::cluster::guild_emoji_create | ( | snowflake | guild_id, |
const class emoji & | newemoji, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Create single emoji.
You must ensure that the emoji passed contained image data using the emoji::load_image() method.
guild_id | Guild ID to create emoji om |
newemoji | Emoji to create |
callback | Function 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(). |
Referenced by co_create_dm_channel(), and create_dm_channel_sync().
Create single emoji.
You must ensure that the emoji passed contained image data using the emoji::load_image() method.
guild_id | Guild ID to create emoji om |
newemoji | Emoji to create |
dpp::rest_exception | upon failure to execute REST function |
References entitlements_get().
void dpp::cluster::guild_emoji_delete | ( | snowflake | guild_id, |
snowflake | emoji_id, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Delete a guild emoji.
guild_id | Guild ID to delete emoji on |
emoji_id | Emoji ID to delete |
callback | Function 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(). |
Referenced by co_current_user_get_dms(), and current_user_get_dms_sync().
confirmation dpp::cluster::guild_emoji_delete_sync | ( | snowflake | guild_id, |
snowflake | emoji_id | ||
) |
Delete a guild emoji.
guild_id | Guild ID to delete emoji on |
emoji_id | Emoji ID to delete |
dpp::rest_exception | upon failure to execute REST function |
References entitlement_test_create().
void dpp::cluster::guild_emoji_edit | ( | snowflake | guild_id, |
const class emoji & | newemoji, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Edit a single emoji.
You must ensure that the emoji passed contained image data using the emoji::load_image() method.
guild_id | Guild ID to edit emoji on |
newemoji | Emoji to edit |
callback | Function 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(). |
Referenced by co_direct_message_create(), and direct_message_create_sync().
Edit a single emoji.
You must ensure that the emoji passed contained image data using the emoji::load_image() method.
guild_id | Guild ID to edit emoji on |
newemoji | Emoji to edit |
dpp::rest_exception | upon failure to execute REST function |
References entitlement_test_delete().
void dpp::cluster::guild_emoji_get | ( | snowflake | guild_id, |
snowflake | emoji_id, | ||
command_completion_event_t | callback | ||
) |
Get a single emoji.
guild_id | Guild ID to get emoji for |
emoji_id | Emoji ID to get |
callback | Function 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(). |
Referenced by co_gdm_add(), and gdm_add_sync().
Get a single emoji.
guild_id | Guild ID to get emoji for |
emoji_id | Emoji ID to get |
dpp::rest_exception | upon failure to execute REST function |
References get_gateway_bot().
void dpp::cluster::guild_emojis_get | ( | snowflake | guild_id, |
command_completion_event_t | callback | ||
) |
Get all emojis for a guild.
guild_id | Guild ID to get emojis for |
callback | Function 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(). |
Referenced by co_gdm_remove(), and gdm_remove_sync().
Get all emojis for a guild.
guild_id | Guild ID to get emojis for |
dpp::rest_exception | upon failure to execute REST function |
References guild_current_member_edit().
void dpp::cluster::guild_event_create | ( | const scheduled_event & | event, |
command_completion_event_t | callback = utility::log_error() |
||
) |
Create a scheduled event on a guild.
event | Event to create (guild ID must be populated) |
callback | Function to call when the API call completes. On success the callback will contain a dpp::scheduled_event_map object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error(). |
Referenced by application_role_connection_get_sync(), and co_application_role_connection_get().
scheduled_event dpp::cluster::guild_event_create_sync | ( | const scheduled_event & | event | ) |
Create a scheduled event on a guild.
event | Event to create (guild ID must be populated) |
dpp::rest_exception | upon failure to execute REST function |
References stage_instance_create().
void dpp::cluster::guild_event_delete | ( | snowflake | event_id, |
snowflake | guild_id, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Delete a scheduled event from a guild.
event_id | Event ID to delete |
guild_id | Guild ID of event to delete |
callback | Function 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(). |
Referenced by application_role_connection_update_sync(), and co_application_role_connection_update().
confirmation dpp::cluster::guild_event_delete_sync | ( | snowflake | event_id, |
snowflake | guild_id | ||
) |
Delete a scheduled event from a guild.
event_id | Event ID to delete |
guild_id | Guild ID of event to delete |
dpp::rest_exception | upon failure to execute REST function |
References stage_instance_get().
void dpp::cluster::guild_event_edit | ( | const scheduled_event & | event, |
command_completion_event_t | callback = utility::log_error() |
||
) |
Edit/modify a scheduled event on a guild.
event | Event to create (event ID and guild ID must be populated) |
callback | Function to call when the API call completes. On success the callback will contain a dpp::scheduled_event_map object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error(). |
Referenced by co_user_application_role_connection_get(), and user_application_role_connection_get_sync().
scheduled_event dpp::cluster::guild_event_edit_sync | ( | const scheduled_event & | event | ) |
Edit/modify a scheduled event on a guild.
event | Event to create (event ID and guild ID must be populated) |
dpp::rest_exception | upon failure to execute REST function |
References stage_instance_edit().
void dpp::cluster::guild_event_get | ( | snowflake | guild_id, |
snowflake | event_id, | ||
command_completion_event_t | callback | ||
) |
Get a scheduled event for a guild.
guild_id | Guild to get event for |
event_id | Event ID to get |
callback | Function to call when the API call completes. On success the callback will contain a dpp::scheduled_event object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error(). |
Referenced by co_user_application_role_connection_update(), and user_application_role_connection_update_sync().
scheduled_event dpp::cluster::guild_event_get_sync | ( | snowflake | guild_id, |
snowflake | event_id | ||
) |
Get a scheduled event for a guild.
guild_id | Guild to get event for |
event_id | Event ID to get |
dpp::rest_exception | upon failure to execute REST function |
References stage_instance_delete().
void dpp::cluster::guild_event_users_get | ( | snowflake | guild_id, |
snowflake | event_id, | ||
command_completion_event_t | callback, | ||
uint8_t | limit = 100 , |
||
snowflake | before = 0 , |
||
snowflake | after = 0 |
||
) |
Get users RSVP'd to an event.
guild_id | Guild to get user list for |
event_id | Guild to get user list for |
limit | Maximum number of results to return |
before | Return user IDs that fall before this ID, if provided |
after | Return user IDs that fall after this ID, if provided |
callback | Function to call when the API call completes. On success the callback will contain a dpp::event_member_map object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error(). |
void dpp::cluster::guild_events_get | ( | snowflake | guild_id, |
command_completion_event_t | callback | ||
) |
Get all scheduled events for a guild.
guild_id | Guild to get events for |
callback | Function to call when the API call completes. On success the callback will contain a dpp::scheduled_event_map object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error(). |
Referenced by co_roles_get(), and roles_get_sync().
scheduled_event_map dpp::cluster::guild_events_get_sync | ( | snowflake | guild_id | ) |
Get all scheduled events for a guild.
guild_id | Guild to get events for |
dpp::rest_exception | upon failure to execute REST function |
References skus_get().
void dpp::cluster::guild_get | ( | snowflake | g, |
command_completion_event_t | callback | ||
) |
Get a guild.
Returns the guild object for the given id. This endpoint will also return approximate_member_count and approximate_presence_count for the guild.
g | Guild ID to retrieve |
callback | Function 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(). |
References API_PATH, and dpp::m_get.
Referenced by co_guild_delete_integration(), and guild_delete_integration_sync().
void dpp::cluster::guild_get_ban | ( | snowflake | guild_id, |
snowflake | user_id, | ||
command_completion_event_t | callback | ||
) |
Get single guild ban.
Requires the BAN_MEMBERS
permission.
guild_id | Guild ID to get ban for |
user_id | User ID of ban to retrieve |
callback | Function 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(). |
References API_PATH, and dpp::m_get.
Referenced by co_guild_create(), and guild_create_sync().
Get single guild ban.
Requires the BAN_MEMBERS
permission.
guild_id | Guild ID to get ban for |
user_id | User ID of ban to retrieve |
dpp::rest_exception | upon failure to execute REST function |
References guild_get_vanity().
void dpp::cluster::guild_get_bans | ( | snowflake | guild_id, |
snowflake | before, | ||
snowflake | after, | ||
snowflake | limit, | ||
command_completion_event_t | callback | ||
) |
Get guild ban list.
Requires the BAN_MEMBERS
permission.
before
and after
for pagination. Users will always be returned in ascending order by the user ID. If both before and after are provided, only before is respected. guild_id | Guild ID to get bans for |
before | If non-zero, all bans for user ids before this user id will be returned up to the limit |
after | if non-zero, all bans for user ids after this user id will be returned up to the limit |
limit | the maximum number of bans to retrieve in this call up to a maximum of 1000 |
callback | Function 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(). |
References API_PATH, and dpp::m_get.
Referenced by co_guild_delete(), and guild_delete_sync().
ban_map dpp::cluster::guild_get_bans_sync | ( | snowflake | guild_id, |
snowflake | before, | ||
snowflake | after, | ||
snowflake | limit | ||
) |
Get guild ban list.
Requires the BAN_MEMBERS
permission.
before
and after
for pagination. Users will always be returned in ascending order by the user ID. If both before and after are provided, only before is respected. guild_id | Guild ID to get bans for |
before | If non-zero, all bans for user ids before this user id will be returned up to the limit |
after | if non-zero, all bans for user ids after this user id will be returned up to the limit |
limit | the maximum number of bans to retrieve in this call up to a maximum of 1000 |
dpp::rest_exception | upon failure to execute REST function |
References guild_get_widget().
void dpp::cluster::guild_get_integrations | ( | snowflake | guild_id, |
command_completion_event_t | callback | ||
) |
Get guild integrations.
Requires the MANAGE_GUILD
permission.
guild_id | Guild ID to get integrations for |
callback | Function 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(). |
References API_PATH, dpp::json_interface< T >::build_json(), dpp::managed::id, dpp::m_patch, and dpp::rest_request< confirmation >().
Referenced by co_guild_edit(), and guild_edit_sync().
integration_map dpp::cluster::guild_get_integrations_sync | ( | snowflake | guild_id | ) |
Get guild integrations.
Requires the MANAGE_GUILD
permission.
guild_id | Guild ID to get integrations for |
dpp::rest_exception | upon failure to execute REST function |
References guild_get_prune_counts().
void dpp::cluster::guild_get_invites | ( | snowflake | guild_id, |
command_completion_event_t | callback | ||
) |
Get guild invites.
Returns a list of invite objects (with invite metadata) for the guild. Requires the MANAGE_GUILD
permission.
guild_id | Guild ID to get invites for |
callback | Function 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(). |
Referenced by co_guild_member_timeout_remove(), and guild_member_timeout_remove_sync().
invite_map dpp::cluster::guild_get_invites_sync | ( | snowflake | guild_id | ) |
Get guild invites.
Returns a list of invite objects (with invite metadata) for the guild. Requires the MANAGE_GUILD
permission.
guild_id | Guild ID to get invites for |
dpp::rest_exception | upon failure to execute REST function |
References dpp::unicode_emoji::m, and message_create().
void dpp::cluster::guild_get_member | ( | snowflake | guild_id, |
snowflake | user_id, | ||
command_completion_event_t | callback | ||
) |
Get a guild member.
guild_id | Guild ID to get member for |
user_id | User ID of member to get |
callback | Function 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(). |
References dpp::guild_member::fill_from_json(), and dpp::snowflake_not_null().
Referenced by co_guild_edit_onboarding(), and guild_edit_onboarding_sync().
guild_member dpp::cluster::guild_get_member_sync | ( | snowflake | guild_id, |
snowflake | user_id | ||
) |
Get a guild member.
guild_id | Guild ID to get member for |
user_id | User ID of member to get |
dpp::rest_exception | upon failure to execute REST function |
References guild_member_timeout().
void dpp::cluster::guild_get_members | ( | snowflake | guild_id, |
uint16_t | limit, | ||
snowflake | after, | ||
command_completion_event_t | callback | ||
) |
Get all guild members.
GUILD_MEMBERS
Privileged Intent is enabled for your application. guild_id | Guild ID to get all members for |
limit | max number of members to return (1-1000) |
after | the highest user id in the previous page |
callback | Function 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(). |
Referenced by co_guild_get_welcome_screen(), and guild_get_welcome_screen_sync().
guild_member_map dpp::cluster::guild_get_members_sync | ( | snowflake | guild_id, |
uint16_t | limit, | ||
snowflake | after | ||
) |
Get all guild members.
GUILD_MEMBERS
Privileged Intent is enabled for your application. guild_id | Guild ID to get all members for |
limit | max number of members to return (1-1000) |
after | the highest user id in the previous page |
dpp::rest_exception | upon failure to execute REST function |
References guild_member_timeout_remove().
void dpp::cluster::guild_get_onboarding | ( | snowflake | guild_id, |
command_completion_event_t | callback | ||
) |
Get the guild's onboarding configuration.
guild_id | The guild to pull the onboarding configuration from. |
callback | Function to call when the API call completes. On success the callback will contain a dpp::onboarding 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(). |
Referenced by co_guild_modify_integration(), and guild_modify_integration_sync().
onboarding dpp::cluster::guild_get_onboarding_sync | ( | snowflake | guild_id | ) |
Get the guild's onboarding configuration.
guild_id | The guild to pull the onboarding configuration from. |
dpp::rest_exception | upon failure to execute REST function |
References guild_edit_member().
void dpp::cluster::guild_get_preview | ( | snowflake | g, |
command_completion_event_t | callback | ||
) |
Get a guild preview.
Returns a guild object but only a subset of the fields will be populated.
Returns the guild preview object for the given id g
. If the user is not in the guild, then the guild must be lurkable (it must be Discoverable or have a live public stage).
g | Guild ID to retrieve |
callback | Function 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(). |
References API_PATH, dpp::json_interface< T >::build_json(), and dpp::m_get.
Referenced by co_guild_edit_widget(), and guild_edit_widget_sync().
void dpp::cluster::guild_get_prune_counts | ( | snowflake | guild_id, |
const struct prune & | pruneinfo, | ||
command_completion_event_t | callback | ||
) |
Get prune counts.
Returns a prune object indicating the number of members that would be removed in a prune operation. Requires the KICK_MEMBERS
permission. By default, prune will not remove users with roles. You can optionally include specific roles in your prune by providing the include_roles parameter. Any inactive user that has a subset of the provided role(s) will be counted in the prune and users with additional roles will not.
guild_id | Guild ID to count for pruning |
pruneinfo | Pruning info |
callback | Function 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(). |
References API_PATH, and dpp::m_get.
Referenced by co_guild_get_integrations(), and guild_get_integrations_sync().
prune dpp::cluster::guild_get_prune_counts_sync | ( | snowflake | guild_id, |
const struct prune & | pruneinfo | ||
) |
Get prune counts.
Returns a prune object indicating the number of members that would be removed in a prune operation. Requires the KICK_MEMBERS
permission. By default, prune will not remove users with roles. You can optionally include specific roles in your prune by providing the include_roles parameter. Any inactive user that has a subset of the provided role(s) will be counted in the prune and users with additional roles will not.
guild_id | Guild ID to count for pruning |
pruneinfo | Pruning info |
dpp::rest_exception | upon failure to execute REST function |
References guild_edit_onboarding(), and dpp::unicode_emoji::o.
void dpp::cluster::guild_get_vanity | ( | snowflake | guild_id, |
command_completion_event_t | callback | ||
) |
Get guild vanity url, if enabled.
Returns a partial dpp::invite object for guilds with that feature enabled. Requires the MANAGE_GUILD
permission. code will be null if a vanity url for the guild is not set.
guild_id | Guild to get vanity URL for |
callback | Function 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(). |
References API_PATH, dpp::json_interface< T >::build_json(), and dpp::m_post.
Referenced by co_guild_get_ban(), and guild_get_ban_sync().
Get guild vanity url, if enabled.
Returns a partial dpp::invite object for guilds with that feature enabled. Requires the MANAGE_GUILD
permission. code will be null if a vanity url for the guild is not set.
guild_id | Guild to get vanity URL for |
dpp::rest_exception | upon failure to execute REST function |
References guild_set_nickname().
void dpp::cluster::guild_get_voice_regions | ( | snowflake | guild_id, |
command_completion_event_t | callback | ||
) |
Get guild voice regions.
Voice regions per guild are somewhat deprecated in preference of per-channel voice regions. Returns a list of voice region objects for the guild. Unlike the similar /voice route, this returns VIP servers when the guild is VIP-enabled.
guild_id | Guild ID to get voice regions for |
callback | Function 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(). |
Referenced by co_current_user_get_guilds(), and current_user_get_guilds_sync().
voiceregion_map dpp::cluster::guild_get_voice_regions_sync | ( | snowflake | guild_id | ) |
Get guild voice regions.
Voice regions per guild are somewhat deprecated in preference of per-channel voice regions. Returns a list of voice region objects for the guild. Unlike the similar /voice route, this returns VIP servers when the guild is VIP-enabled.
guild_id | Guild ID to get voice regions for |
dpp::rest_exception | upon failure to execute REST function |
References edit_webhook().
void dpp::cluster::guild_get_welcome_screen | ( | snowflake | guild_id, |
command_completion_event_t | callback | ||
) |
Get the guild's welcome screen.
If the welcome screen is not enabled, the MANAGE_GUILD
permission is required.
guild_id | The guild ID to get the welcome screen from |
callback | Function to call when the API call completes. On success the callback will contain a dpp::welcome_screen 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(). |
Referenced by co_guild_begin_prune(), and guild_begin_prune_sync().
dpp::welcome_screen dpp::cluster::guild_get_welcome_screen_sync | ( | snowflake | guild_id | ) |
Get the guild's welcome screen.
If the welcome screen is not enabled, the MANAGE_GUILD
permission is required.
guild_id | The guild ID to get the welcome screen from |
dpp::rest_exception | upon failure to execute REST function |
References guild_get_members().
void dpp::cluster::guild_get_widget | ( | snowflake | guild_id, |
command_completion_event_t | callback | ||
) |
Get guild widget.
Requires the MANAGE_GUILD
permission.
guild_id | Guild ID to get widget for |
callback | Function 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(). |
References API_PATH, dpp::m_patch, dpp::unicode_emoji::o, and dpp::rest_request< confirmation >().
Referenced by co_guild_get_bans(), and guild_get_bans_sync().
guild_widget dpp::cluster::guild_get_widget_sync | ( | snowflake | guild_id | ) |
Get guild widget.
Requires the MANAGE_GUILD
permission.
guild_id | Guild ID to get widget for |
dpp::rest_exception | upon failure to execute REST function |
References guild_sync_integration().
void dpp::cluster::guild_member_add_role | ( | snowflake | guild_id, |
snowflake | user_id, | ||
snowflake | role_id, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Add role to guild member.
Adds a role to a guild member. Requires the MANAGE_ROLES
permission. Fires a Guild Member Update
Gateway event.
guild_id | Guild ID to add a role to |
user_id | User ID to add role to |
role_id | Role ID to add to the user |
callback | Function 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(). |
Referenced by co_guild_edit_welcome_screen(), and guild_edit_welcome_screen_sync().
confirmation dpp::cluster::guild_member_add_role_sync | ( | snowflake | guild_id, |
snowflake | user_id, | ||
snowflake | role_id | ||
) |
Add role to guild member.
Adds a role to a guild member. Requires the MANAGE_ROLES
permission. Fires a Guild Member Update
Gateway event.
guild_id | Guild ID to add a role to |
user_id | User ID to add role to |
role_id | Role ID to add to the user |
dpp::rest_exception | upon failure to execute REST function |
References guild_member_delete_role().
void dpp::cluster::guild_member_delete | ( | snowflake | guild_id, |
snowflake | user_id, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Remove (kick) a guild member.
Remove a member from a guild. Requires KICK_MEMBERS
permission. Fires a Guild Member Remove
Gateway event.
guild_id | Guild ID to kick member from |
user_id | User ID to kick |
callback | Function 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(). |
Referenced by co_guild_add_member(), and guild_add_member_sync().
void dpp::cluster::guild_member_delete_role | ( | snowflake | guild_id, |
snowflake | user_id, | ||
snowflake | role_id, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Remove role from guild member.
Removes a role from a guild member. Requires the MANAGE_ROLES
permission. Fires a Guild Member Update
Gateway event.
guild_id | Guild ID to remove role from user on |
user_id | User ID to remove role from |
role_id | Role to remove |
callback | Function 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(). |
Referenced by co_guild_member_add_role(), and guild_member_add_role_sync().
confirmation dpp::cluster::guild_member_delete_role_sync | ( | snowflake | guild_id, |
snowflake | user_id, | ||
snowflake | role_id | ||
) |
Remove role from guild member.
Removes a role from a guild member. Requires the MANAGE_ROLES
permission. Fires a Guild Member Update
Gateway event.
guild_id | Guild ID to remove role from user on |
user_id | User ID to remove role from |
role_id | Role to remove |
dpp::rest_exception | upon failure to execute REST function |
References invite_delete().
confirmation dpp::cluster::guild_member_delete_sync | ( | snowflake | guild_id, |
snowflake | user_id | ||
) |
Remove (kick) a guild member.
Remove a member from a guild. Requires KICK_MEMBERS
permission. Fires a Guild Member Remove
Gateway event.
guild_id | Guild ID to kick member from |
user_id | User ID to kick |
dpp::rest_exception | upon failure to execute REST function |
References guild_member_remove_role().
void dpp::cluster::guild_member_kick | ( | snowflake | guild_id, |
snowflake | user_id, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Remove (kick) a guild member.
Remove a member from a guild. Requires KICK_MEMBERS
permission. Fires a Guild Member Remove
Gateway event.
guild_id | Guild ID to kick member from |
user_id | User ID to kick |
callback | Function 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(). |
Referenced by co_guild_edit_member(), and guild_edit_member_sync().
confirmation dpp::cluster::guild_member_kick_sync | ( | snowflake | guild_id, |
snowflake | user_id | ||
) |
Remove (kick) a guild member.
Remove a member from a guild. Requires KICK_MEMBERS
permission. Fires a Guild Member Remove
Gateway event.
guild_id | Guild ID to kick member from |
user_id | User ID to kick |
dpp::rest_exception | upon failure to execute REST function |
References guild_member_move().
void dpp::cluster::guild_member_move | ( | const snowflake | channel_id, |
const snowflake | guild_id, | ||
const snowflake | user_id, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Moves the guild member to a other voice channel, if member is connected to one.
Set the channel_id
to 0
to disconnect the user.
Fires a Guild Member Update
Gateway event.
MOVE_MEMBERS
permission. channel_id | Id of the channel to which the user is used. Set to 0 to disconnect the user |
guild_id | Guild id to which the user is connected |
user_id | User id, who should be moved |
callback | Function 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(). |
Referenced by co_guild_member_kick(), and guild_member_kick_sync().
guild_member dpp::cluster::guild_member_move_sync | ( | const snowflake | channel_id, |
const snowflake | guild_id, | ||
const snowflake | user_id | ||
) |
Moves the guild member to a other voice channel, if member is connected to one.
Set the channel_id
to 0
to disconnect the user.
Fires a Guild Member Update
Gateway event.
MOVE_MEMBERS
permission. channel_id | Id of the channel to which the user is used. Set to 0 to disconnect the user |
guild_id | Guild id to which the user is connected |
user_id | User id, who should be moved |
dpp::rest_exception | upon failure to execute REST function |
References dpp::unicode_emoji::m, and message_add_reaction().
void dpp::cluster::guild_member_remove_role | ( | snowflake | guild_id, |
snowflake | user_id, | ||
snowflake | role_id, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Remove role from guild member.
Removes a role from a guild member. Requires the MANAGE_ROLES
permission. Fires a Guild Member Update
Gateway event.
guild_id | Guild ID to remove role from user on |
user_id | User ID to remove role from |
role_id | Role to remove |
callback | Function 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(). |
Referenced by co_guild_member_delete(), and guild_member_delete_sync().
confirmation dpp::cluster::guild_member_remove_role_sync | ( | snowflake | guild_id, |
snowflake | user_id, | ||
snowflake | role_id | ||
) |
Remove role from guild member.
Removes a role from a guild member. Requires the MANAGE_ROLES
permission. Fires a Guild Member Update
Gateway event.
guild_id | Guild ID to remove role from user on |
user_id | User ID to remove role from |
role_id | Role to remove |
dpp::rest_exception | upon failure to execute REST function |
References invite_get().
void dpp::cluster::guild_member_timeout | ( | snowflake | guild_id, |
snowflake | user_id, | ||
time_t | communication_disabled_until, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Set the timeout of a guild member.
Fires a Guild Member Update
Gateway event.
guild_id | Guild ID to timeout the member in |
user_id | User ID to set the timeout for |
communication_disabled_until | The timestamp when the user's timeout will expire (up to 28 days in the future). Set to 0 to remove the timeout |
callback | Function 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(). |
Referenced by co_guild_get_member(), and guild_get_member_sync().
void dpp::cluster::guild_member_timeout_remove | ( | snowflake | guild_id, |
snowflake | user_id, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Remove the timeout of a guild member.
A shortcut for guild_member_timeout(guild_id, user_id, 0, callback) Fires a Guild Member Update
Gateway event.
guild_id | Guild ID to remove the member timeout from |
user_id | User ID to remove the timeout for |
callback | Function 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(). |
Referenced by co_guild_get_members(), and guild_get_members_sync().
confirmation dpp::cluster::guild_member_timeout_remove_sync | ( | snowflake | guild_id, |
snowflake | user_id | ||
) |
Remove the timeout of a guild member.
A shortcut for guild_member_timeout(guild_id, user_id, 0, callback) Fires a Guild Member Update
Gateway event.
guild_id | Guild ID to remove the member timeout from |
user_id | User ID to remove the timeout for |
dpp::rest_exception | upon failure to execute REST function |
References guild_get_invites().
confirmation dpp::cluster::guild_member_timeout_sync | ( | snowflake | guild_id, |
snowflake | user_id, | ||
time_t | communication_disabled_until | ||
) |
Set the timeout of a guild member.
Fires a Guild Member Update
Gateway event.
guild_id | Guild ID to timeout the member in |
user_id | User ID to set the timeout for |
communication_disabled_until | The timestamp when the user's timeout will expire (up to 28 days in the future). Set to 0 to remove the timeout |
dpp::rest_exception | upon failure to execute REST function |
References guild_search_members().
void dpp::cluster::guild_modify_integration | ( | snowflake | guild_id, |
const class integration & | i, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Modify guild integration.
guild_id | Guild ID to modify integration for |
i | Integration to modify |
callback | Function 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(). |
References API_PATH, dpp::m_post, and dpp::rest_request< confirmation >().
confirmation dpp::cluster::guild_modify_integration_sync | ( | snowflake | guild_id, |
const class integration & | i | ||
) |
Modify guild integration.
guild_id | Guild ID to modify integration for |
i | Integration to modify |
dpp::rest_exception | upon failure to execute REST function |
References guild_get_onboarding().
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.
GUILD_MEMBERS
Privileged Intent is enabled for your application. guild_id | Guild ID to search in |
query | Query string to match username(s) and nickname(s) against |
limit | max number of members to return (1-1000) |
callback | Function 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(). |
Referenced by co_guild_member_timeout(), and guild_member_timeout_sync().
guild_member_map dpp::cluster::guild_search_members_sync | ( | snowflake | guild_id, |
const std::string & | query, | ||
uint16_t | limit | ||
) |
Search for guild members based on whether their username or nickname starts with the given string.
GUILD_MEMBERS
Privileged Intent is enabled for your application. guild_id | Guild ID to search in |
query | Query string to match username(s) and nickname(s) against |
limit | max number of members to return (1-1000) |
dpp::rest_exception | upon failure to execute REST function |
References message_add_reaction().
void dpp::cluster::guild_set_nickname | ( | snowflake | guild_id, |
const std::string & | nickname, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Change current user nickname.
Modifies the nickname of the current user in a guild. Fires a Guild Member Update
Gateway event.
guild_id | Guild ID to change nickname on |
nickname | New nickname, or empty string to clear nickname |
callback | Function 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(). |
References API_PATH, and dpp::m_get.
Referenced by co_guild_get_vanity(), and guild_get_vanity_sync().
confirmation dpp::cluster::guild_set_nickname_sync | ( | snowflake | guild_id, |
const std::string & | nickname | ||
) |
Change current user nickname.
Modifies the nickname of the current user in a guild. Fires a Guild Member Update
Gateway event.
guild_id | Guild ID to change nickname on |
nickname | New nickname, or empty string to clear nickname |
dpp::rest_exception | upon failure to execute REST function |
References guild_edit_welcome_screen().
void dpp::cluster::guild_sticker_create | ( | const sticker & | s, |
command_completion_event_t | callback = utility::log_error() |
||
) |
Create a sticker in a guild.
s | Sticker to create. Must have its guild ID set. |
callback | Function 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(). |
References API_PATH, and dpp::m_get.
Referenced by co_skus_get(), and skus_get_sync().
Create a sticker in a guild.
s | Sticker to create. Must have its guild ID set. |
dpp::rest_exception | upon failure to execute REST function |
References nitro_sticker_get().
void dpp::cluster::guild_sticker_delete | ( | snowflake | sticker_id, |
snowflake | guild_id, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Delete a sticker from a guild.
sticker_id | sticker ID to delete |
guild_id | guild ID to delete from |
callback | Function 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(). |
References API_PATH, dpp::m_get, and dpp::rest_request_list< sticker_pack >().
confirmation dpp::cluster::guild_sticker_delete_sync | ( | snowflake | sticker_id, |
snowflake | guild_id | ||
) |
Delete a sticker from a guild.
sticker_id | sticker ID to delete |
guild_id | guild ID to delete from |
dpp::rest_exception | upon failure to execute REST function |
References sticker_packs_get().
void dpp::cluster::guild_sticker_get | ( | snowflake | id, |
snowflake | guild_id, | ||
command_completion_event_t | callback | ||
) |
Get a guild sticker.
id | Id of sticker to get. |
guild_id | Guild ID of the guild where the sticker is |
callback | Function 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(). |
Referenced by co_stage_instance_get(), and stage_instance_get_sync().
Get a guild sticker.
id | Id of sticker to get. |
guild_id | Guild ID of the guild where the sticker is |
dpp::rest_exception | upon failure to execute REST function |
References guild_create_from_template().
void dpp::cluster::guild_sticker_modify | ( | const sticker & | s, |
command_completion_event_t | callback = utility::log_error() |
||
) |
Modify a sticker in a guild.
s | Sticker to modify. Must have its guild ID and sticker ID set. |
callback | Function 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(). |
Modify a sticker in a guild.
s | Sticker to modify. Must have its guild ID and sticker ID set. |
dpp::rest_exception | upon failure to execute REST function |
References guild_template_create().
void dpp::cluster::guild_stickers_get | ( | snowflake | guild_id, |
command_completion_event_t | callback | ||
) |
Get all guild stickers.
guild_id | Guild ID of the guild where the sticker is |
callback | Function to call when the API call completes. On success the callback will contain a dpp::sticker_map object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error(). |
Referenced by co_stage_instance_delete(), and stage_instance_delete_sync().
sticker_map dpp::cluster::guild_stickers_get_sync | ( | snowflake | guild_id | ) |
Get all guild stickers.
guild_id | Guild ID of the guild where the sticker is |
dpp::rest_exception | upon failure to execute REST function |
References guild_template_delete().
void dpp::cluster::guild_sync_integration | ( | snowflake | guild_id, |
snowflake | integration_id, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Sync guild integration.
guild_id | Guild ID to sync integration on |
integration_id | Integration ID to synchronise |
callback | Function 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(). |
Referenced by co_guild_get_widget(), and guild_get_widget_sync().
confirmation dpp::cluster::guild_sync_integration_sync | ( | snowflake | guild_id, |
snowflake | integration_id | ||
) |
Sync guild integration.
guild_id | Guild ID to sync integration on |
integration_id | Integration ID to synchronise |
dpp::rest_exception | upon failure to execute REST function |
References guild_add_member().
void dpp::cluster::guild_template_create | ( | snowflake | guild_id, |
const std::string & | name, | ||
const std::string & | description, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Creates a template for the guild.
guild_id | Guild to create template from |
name | Template name to create |
description | Description of template to create |
callback | Function to call when the API call completes. On success the callback will contain a dpp::dtemplate object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error(). |
Referenced by co_guild_sticker_modify(), and guild_sticker_modify_sync().
dtemplate dpp::cluster::guild_template_create_sync | ( | snowflake | guild_id, |
const std::string & | name, | ||
const std::string & | description | ||
) |
Creates a template for the guild.
guild_id | Guild to create template from |
name | Template name to create |
description | Description of template to create |
dpp::rest_exception | upon failure to execute REST function |
References template_get().
void dpp::cluster::guild_template_delete | ( | snowflake | guild_id, |
const std::string & | code, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Deletes the template.
guild_id | Guild ID of template to delete |
code | Template code to delete |
callback | Function 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(). |
References API_PATH, and dpp::m_get.
Referenced by co_guild_stickers_get(), and guild_stickers_get_sync().
confirmation dpp::cluster::guild_template_delete_sync | ( | snowflake | guild_id, |
const std::string & | code | ||
) |
Deletes the template.
guild_id | Guild ID of template to delete |
code | Template code to delete |
dpp::rest_exception | upon failure to execute REST function |
References current_user_join_thread().
void dpp::cluster::guild_template_modify | ( | snowflake | guild_id, |
const std::string & | code, | ||
const std::string & | name, | ||
const std::string & | description, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Modifies the template's metadata.
guild_id | Guild ID of template to modify |
code | Template code to modify |
name | New name of template |
description | New description of template |
callback | Function to call when the API call completes. On success the callback will contain a dpp::dtemplate object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error(). |
Referenced by co_nitro_sticker_get(), and nitro_sticker_get_sync().
dtemplate dpp::cluster::guild_template_modify_sync | ( | snowflake | guild_id, |
const std::string & | code, | ||
const std::string & | name, | ||
const std::string & | description | ||
) |
Modifies the template's metadata.
guild_id | Guild ID of template to modify |
code | Template code to modify |
name | New name of template |
description | New description of template |
dpp::rest_exception | upon failure to execute REST function |
References current_user_leave_thread().
void dpp::cluster::guild_template_sync | ( | snowflake | guild_id, |
const std::string & | code, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Syncs the template to the guild's current state.
guild_id | Guild to synchronise template for |
code | Code of template to synchronise |
callback | Function to call when the API call completes. On success the callback will contain a dpp::dtemplate object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error(). |
Referenced by co_guild_create_from_template(), and guild_create_from_template_sync().
Syncs the template to the guild's current state.
guild_id | Guild to synchronise template for |
code | Code of template to synchronise |
dpp::rest_exception | upon failure to execute REST function |
References threads_get_joined_private_archived().
void dpp::cluster::guild_templates_get | ( | snowflake | guild_id, |
command_completion_event_t | callback | ||
) |
Get guild templates.
guild_id | Guild ID to get templates for |
callback | Function to call when the API call completes. On success the callback will contain a dpp::dtemplate_map object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error(). |
Referenced by co_sticker_packs_get(), and sticker_packs_get_sync().
dtemplate_map dpp::cluster::guild_templates_get_sync | ( | snowflake | guild_id | ) |
Get guild templates.
guild_id | Guild ID to get templates for |
dpp::rest_exception | upon failure to execute REST function |
References threads_get_active().
void dpp::cluster::interaction_followup_create | ( | const std::string & | token, |
const message & | m, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Create a followup message to a slash command.
token | Token for the interaction webhook |
m | followup message to create |
callback | Function 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(). |
References API_PATH, dpp::unicode_emoji::m, dpp::m_patch, and dpp::utility::url_encode().
Referenced by co_guild_command_edit(), and guild_command_edit_sync().
confirmation dpp::cluster::interaction_followup_create_sync | ( | const std::string & | token, |
const message & | m | ||
) |
Create a followup message to a slash command.
token | Token for the interaction webhook |
m | followup message to create |
dpp::rest_exception | upon failure to execute REST function |
References interaction_followup_get_original(), and token.
void dpp::cluster::interaction_followup_delete | ( | const std::string & | token, |
command_completion_event_t | callback = utility::log_error() |
||
) |
Delete the initial interaction response.
token | Token for the interaction webhook |
callback | Function 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(). |
Referenced by co_interaction_response_create(), and interaction_response_create_sync().
confirmation dpp::cluster::interaction_followup_delete_sync | ( | const std::string & | token | ) |
Delete the initial interaction response.
token | Token for the interaction webhook |
dpp::rest_exception | upon failure to execute REST function |
References automod_rule_get().
void dpp::cluster::interaction_followup_edit | ( | const std::string & | token, |
const message & | m, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Edit followup message to a slash command The message ID in the message you pass should be correctly set to that of a followup message you previously sent.
token | Token for the interaction webhook |
m | message to edit, the ID should be set |
callback | Function 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(). |
Referenced by co_interaction_response_edit(), and interaction_response_edit_sync().
void dpp::cluster::interaction_followup_edit_original | ( | const std::string & | token, |
const message & | m, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Edit original followup message to a slash command This is an alias for cluster::interaction_response_edit.
token | Token for the interaction webhook |
m | message to edit, the ID should be set |
callback | Function 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(). |
References API_PATH, dpp::m_get, dpp::rest_request< message >(), and dpp::utility::url_encode().
Referenced by co_guild_commands_get(), and guild_commands_get_sync().
confirmation dpp::cluster::interaction_followup_edit_original_sync | ( | const std::string & | token, |
const message & | m | ||
) |
Edit original followup message to a slash command This is an alias for cluster::interaction_response_edit.
token | Token for the interaction webhook |
m | message to edit, the ID should be set |
dpp::rest_exception | upon failure to execute REST function |
References automod_rules_get().
confirmation dpp::cluster::interaction_followup_edit_sync | ( | const std::string & | token, |
const message & | m | ||
) |
Edit followup message to a slash command The message ID in the message you pass should be correctly set to that of a followup message you previously sent.
token | Token for the interaction webhook |
m | message to edit, the ID should be set |
dpp::rest_exception | upon failure to execute REST function |
References automod_rule_create().
void dpp::cluster::interaction_followup_get | ( | const std::string & | token, |
snowflake | message_id, | ||
command_completion_event_t | callback | ||
) |
Get the followup message to a slash command.
token | Token for the interaction webhook |
message_id | message to retrieve |
callback | Function 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(). |
Referenced by co_interaction_response_get_original(), and interaction_response_get_original_sync().
void dpp::cluster::interaction_followup_get_original | ( | const std::string & | token, |
command_completion_event_t | callback = utility::log_error() |
||
) |
Get the original followup message to a slash command This is an alias for cluster::interaction_response_get_original.
token | Token for the interaction webhook |
callback | Function 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(). |
Referenced by co_interaction_followup_create(), and interaction_followup_create_sync().
message dpp::cluster::interaction_followup_get_original_sync | ( | const std::string & | token | ) |
Get the original followup message to a slash command This is an alias for cluster::interaction_response_get_original.
token | Token for the interaction webhook |
dpp::rest_exception | upon failure to execute REST function |
References automod_rule_delete().
message dpp::cluster::interaction_followup_get_sync | ( | const std::string & | token, |
snowflake | message_id | ||
) |
Get the followup message to a slash command.
token | Token for the interaction webhook |
message_id | message to retrieve |
dpp::rest_exception | upon failure to execute REST function |
References automod_rule_edit().
void dpp::cluster::interaction_response_create | ( | snowflake | interaction_id, |
const std::string & | token, | ||
const interaction_response & | r, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Respond to a slash command.
interaction_id | Interaction id to respond to |
token | Token for the interaction webhook |
r | Response to send |
callback | Function 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(). |
References API_PATH, dpp::unicode_emoji::m, dpp::m_post, and dpp::utility::url_encode().
Referenced by co_guild_command_edit_permissions(), and guild_command_edit_permissions_sync().
confirmation dpp::cluster::interaction_response_create_sync | ( | snowflake | interaction_id, |
const std::string & | token, | ||
const interaction_response & | r | ||
) |
Respond to a slash command.
interaction_id | Interaction id to respond to |
token | Token for the interaction webhook |
r | Response to send |
dpp::rest_exception | upon failure to execute REST function |
References interaction_followup_delete(), and token.
void dpp::cluster::interaction_response_edit | ( | const std::string & | token, |
const message & | m, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Edit response to a slash command.
token | Token for the interaction webhook |
m | Message to send |
callback | Function 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(). |
References API_PATH, dpp::unicode_emoji::m, dpp::m_patch, and dpp::utility::url_encode().
Referenced by co_guild_command_get(), and guild_command_get_sync().
confirmation dpp::cluster::interaction_response_edit_sync | ( | const std::string & | token, |
const message & | m | ||
) |
Edit response to a slash command.
token | Token for the interaction webhook |
m | Message to send |
dpp::rest_exception | upon failure to execute REST function |
References interaction_followup_edit(), dpp::unicode_emoji::m, and token.
void dpp::cluster::interaction_response_get_original | ( | const std::string & | token, |
command_completion_event_t | callback = utility::log_error() |
||
) |
Get the original response to a slash command.
token | Token for the interaction webhook |
callback | Function 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(). |
References API_PATH, dpp::m_delete, dpp::rest_request< confirmation >(), and dpp::utility::url_encode().
Referenced by co_guild_command_get_permissions(), and guild_command_get_permissions_sync().
message dpp::cluster::interaction_response_get_original_sync | ( | const std::string & | token | ) |
Get the original response to a slash command.
token | Token for the interaction webhook |
dpp::rest_exception | upon failure to execute REST function |
References interaction_followup_get(), and token.
void dpp::cluster::invite_delete | ( | const std::string & | invite, |
command_completion_event_t | callback = utility::log_error() |
||
) |
Delete an invite.
invite | Invite code to delete |
callback | Function 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(). |
Referenced by co_guild_member_delete_role(), and guild_member_delete_role_sync().
void dpp::cluster::invite_get | ( | const std::string & | invite_code, |
command_completion_event_t | callback | ||
) |
Get details about an invite.
invite_code | Invite code to get information on |
callback | Function 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(). |
Referenced by co_guild_member_remove_role(), and guild_member_remove_role_sync().
invite dpp::cluster::invite_get_sync | ( | const std::string & | invite_code | ) |
Get details about an invite.
invite_code | Invite code to get information on |
dpp::rest_exception | upon failure to execute REST function |
References dpp::unicode_emoji::m, and message_delete_all_reactions().
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.
severity | The log level from dpp::loglevel |
msg | The log message to output |
Referenced by dpp::discord_voice_client::log().
void dpp::cluster::message_add_reaction | ( | const struct message & | m, |
const std::string & | reaction, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Add a reaction to a message.
The reaction string must be either an emojiname:id
or a unicode character.
m | Message to add a reaction to |
reaction | Reaction to add. Emojis should be in the form emojiname:id |
callback | Function 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(). |
References API_PATH, dpp::m_post, and dpp::rest_request< message >().
Referenced by co_guild_member_move(), co_guild_search_members(), guild_member_move_sync(), and guild_search_members_sync().
void dpp::cluster::message_add_reaction | ( | snowflake | message_id, |
snowflake | channel_id, | ||
const std::string & | reaction, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Add a reaction to a message by id.
The reaction string must be either an emojiname:id
or a unicode character.
message_id | Message to add reactions to |
channel_id | Channel to add reactions to |
reaction | Reaction to add. Emojis should be in the form emojiname:id |
callback | Function 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(). |
confirmation dpp::cluster::message_add_reaction_sync | ( | const struct message & | m, |
const std::string & | reaction | ||
) |
Add a reaction to a message.
The reaction string must be either an emojiname:id
or a unicode character.
m | Message to add a reaction to |
reaction | Reaction to add. Emojis should be in the form emojiname:id |
dpp::rest_exception | upon failure to execute REST function |
References message_delete_all_reactions().
confirmation dpp::cluster::message_add_reaction_sync | ( | snowflake | message_id, |
snowflake | channel_id, | ||
const std::string & | reaction | ||
) |
Add a reaction to a message by id.
The reaction string must be either an emojiname:id
or a unicode character.
message_id | Message to add reactions to |
channel_id | Channel to add reactions to |
reaction | Reaction to add. Emojis should be in the form emojiname:id |
dpp::rest_exception | upon failure to execute REST function |
References message_delete_bulk().
void dpp::cluster::message_create | ( | const struct message & | m, |
command_completion_event_t | callback = utility::log_error() |
||
) |
Send a message to a channel.
The callback function is called when the message has been sent
m | Message to send |
callback | Function 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(). |
Referenced by co_guild_get_invites(), and guild_get_invites_sync().
Send a message to a channel.
The callback function is called when the message has been sent
m | Message to send |
dpp::rest_exception | upon failure to execute REST function |
References message_delete().
void dpp::cluster::message_crosspost | ( | snowflake | message_id, |
snowflake | channel_id, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Crosspost a message.
The callback function is called when the message has been sent
message_id | Message to crosspost |
channel_id | Channel ID to crosspost from |
callback | Function 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(). |
References dpp::unicode_emoji::m.
Crosspost a message.
The callback function is called when the message has been sent
message_id | Message to crosspost |
channel_id | Channel ID to crosspost from |
dpp::rest_exception | upon failure to execute REST function |
References dpp::unicode_emoji::m, and message_delete_own_reaction().
void dpp::cluster::message_delete | ( | snowflake | message_id, |
snowflake | channel_id, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Delete a message from a channel.
The callback function is called when the message has been edited
message_id | Message ID to delete |
channel_id | Channel to delete from |
callback | Function 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(). |
Referenced by co_message_create(), event_handler_test(), and message_create_sync().
void dpp::cluster::message_delete_all_reactions | ( | const struct message & | m, |
command_completion_event_t | callback = utility::log_error() |
||
) |
Delete all reactions on a message.
m | Message to delete reactions from |
callback | Function 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(). |
References API_PATH, dpp::m_delete, and dpp::rest_request< confirmation >().
Referenced by co_invite_get(), co_message_add_reaction(), invite_get_sync(), and message_add_reaction_sync().
void dpp::cluster::message_delete_all_reactions | ( | snowflake | message_id, |
snowflake | channel_id, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Delete all reactions on a message by id.
message_id | Message to delete reactions from |
channel_id | Channel to delete reactions from |
callback | Function 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(). |
confirmation dpp::cluster::message_delete_all_reactions_sync | ( | const struct message & | m | ) |
Delete all reactions on a message.
m | Message to delete reactions from |
dpp::rest_exception | upon failure to execute REST function |
References message_delete_own_reaction().
confirmation dpp::cluster::message_delete_all_reactions_sync | ( | snowflake | message_id, |
snowflake | channel_id | ||
) |
Delete all reactions on a message by id.
message_id | Message to delete reactions from |
channel_id | Channel to delete reactions from |
dpp::rest_exception | upon failure to execute REST function |
References dpp::unicode_emoji::m, and message_delete_reaction().
void dpp::cluster::message_delete_bulk | ( | const std::vector< snowflake > & | message_ids, |
snowflake | channel_id, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Bulk delete messages from a channel.
The callback function is called when the message has been edited
message_ids | List of message IDs to delete (at least 2 and at most 100 message IDs) |
channel_id | Channel to delete from |
callback | Function 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(). |
Referenced by co_message_add_reaction(), and message_add_reaction_sync().
confirmation dpp::cluster::message_delete_bulk_sync | ( | const std::vector< snowflake > & | message_ids, |
snowflake | channel_id | ||
) |
Bulk delete messages from a channel.
The callback function is called when the message has been edited
message_ids | List of message IDs to delete (at least 2 and at most 100 message IDs) |
channel_id | Channel to delete from |
dpp::rest_exception | upon failure to execute REST function |
References message_delete_reaction().
void dpp::cluster::message_delete_own_reaction | ( | const struct message & | m, |
const std::string & | reaction, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Delete own reaction from a message.
The reaction string must be either an emojiname:id
or a unicode character.
m | Message to delete own reaction from |
reaction | Reaction to delete. The reaction should be in the form emojiname:id |
callback | Function 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(). |
Referenced by co_message_crosspost(), co_message_delete_all_reactions(), message_crosspost_sync(), and message_delete_all_reactions_sync().
void dpp::cluster::message_delete_own_reaction | ( | snowflake | message_id, |
snowflake | channel_id, | ||
const std::string & | reaction, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Delete own reaction from a message by id.
The reaction string must be either an emojiname:id
or a unicode character.
message_id | Message to delete reactions from |
channel_id | Channel to delete reactions from |
reaction | Reaction to delete. The reaction should be in the form emojiname:id |
callback | Function 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(). |
References API_PATH, dpp::unicode_emoji::m, dpp::m_delete, dpp::rest_request< confirmation >(), and dpp::utility::url_encode().
confirmation dpp::cluster::message_delete_own_reaction_sync | ( | const struct message & | m, |
const std::string & | reaction | ||
) |
Delete own reaction from a message.
The reaction string must be either an emojiname:id
or a unicode character.
m | Message to delete own reaction from |
reaction | Reaction to delete. The reaction should be in the form emojiname:id |
dpp::rest_exception | upon failure to execute REST function |
References message_delete_reaction_emoji().
confirmation dpp::cluster::message_delete_own_reaction_sync | ( | snowflake | message_id, |
snowflake | channel_id, | ||
const std::string & | reaction | ||
) |
Delete own reaction from a message by id.
The reaction string must be either an emojiname:id
or a unicode character.
message_id | Message to delete reactions from |
channel_id | Channel to delete reactions from |
reaction | Reaction to delete. The reaction should be in the form emojiname:id |
dpp::rest_exception | upon failure to execute REST function |
References dpp::unicode_emoji::m, and message_edit().
void dpp::cluster::message_delete_reaction | ( | const struct message & | m, |
snowflake | user_id, | ||
const std::string & | reaction, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Delete a user's reaction from a message.
The reaction string must be either an emojiname:id
or a unicode character
m | Message to delete a user's reaction from |
user_id | User ID who's reaction you want to remove |
reaction | Reaction to remove. Reactions should be in the form emojiname:id |
callback | Function 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(). |
Referenced by co_message_delete_all_reactions(), co_message_delete_bulk(), message_delete_all_reactions_sync(), and message_delete_bulk_sync().
void dpp::cluster::message_delete_reaction | ( | snowflake | message_id, |
snowflake | channel_id, | ||
snowflake | user_id, | ||
const std::string & | reaction, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Delete a user's reaction from a message by id.
The reaction string must be either an emojiname:id
or a unicode character
message_id | Message to delete reactions from |
channel_id | Channel to delete reactions from |
user_id | User ID who's reaction you want to remove |
reaction | Reaction to remove. Reactions should be in the form emojiname:id |
callback | Function 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(). |
References API_PATH, dpp::unicode_emoji::m, and dpp::m_patch.
void dpp::cluster::message_delete_reaction_emoji | ( | const struct message & | m, |
const std::string & | reaction, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Delete all reactions on a message using a particular emoji.
The reaction string must be either an emojiname:id
or a unicode character
m | Message to delete reactions from |
reaction | Reaction to delete, in the form emojiname:id or a unicode character |
callback | Function 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(). |
References API_PATH, dpp::unicode_emoji::m, and dpp::m_patch.
Referenced by co_message_delete(), co_message_delete_own_reaction(), message_delete_own_reaction_sync(), and message_delete_sync().
void dpp::cluster::message_delete_reaction_emoji | ( | snowflake | message_id, |
snowflake | channel_id, | ||
const std::string & | reaction, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Delete all reactions on a message using a particular emoji by id.
The reaction string must be either an emojiname:id
or a unicode character
message_id | Message to delete reactions from |
channel_id | Channel to delete reactions from |
reaction | Reaction to delete, in the form emojiname:id or a unicode character |
callback | Function 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(). |
confirmation dpp::cluster::message_delete_reaction_emoji_sync | ( | const struct message & | m, |
const std::string & | reaction | ||
) |
Delete all reactions on a message using a particular emoji.
The reaction string must be either an emojiname:id
or a unicode character
m | Message to delete reactions from |
reaction | Reaction to delete, in the form emojiname:id or a unicode character |
dpp::rest_exception | upon failure to execute REST function |
References dpp::unicode_emoji::m, and message_get_reactions().
confirmation dpp::cluster::message_delete_reaction_emoji_sync | ( | snowflake | message_id, |
snowflake | channel_id, | ||
const std::string & | reaction | ||
) |
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
message_id | Message to delete reactions from |
channel_id | Channel to delete reactions from |
reaction | Reaction to delete, in the form emojiname:id or a unicode character |
dpp::rest_exception | upon failure to execute REST function |
References message_get_reactions().
confirmation dpp::cluster::message_delete_reaction_sync | ( | const struct message & | m, |
snowflake | user_id, | ||
const std::string & | reaction | ||
) |
Delete a user's reaction from a message.
The reaction string must be either an emojiname:id
or a unicode character
m | Message to delete a user's reaction from |
user_id | User ID who's reaction you want to remove |
reaction | Reaction to remove. Reactions should be in the form emojiname:id |
dpp::rest_exception | upon failure to execute REST function |
References dpp::unicode_emoji::m, and message_edit_flags().
confirmation dpp::cluster::message_delete_reaction_sync | ( | snowflake | message_id, |
snowflake | channel_id, | ||
snowflake | user_id, | ||
const std::string & | reaction | ||
) |
Delete a user's reaction from a message by id.
The reaction string must be either an emojiname:id
or a unicode character
message_id | Message to delete reactions from |
channel_id | Channel to delete reactions from |
user_id | User ID who's reaction you want to remove |
reaction | Reaction to remove. Reactions should be in the form emojiname:id |
dpp::rest_exception | upon failure to execute REST function |
References message_get().
confirmation dpp::cluster::message_delete_sync | ( | snowflake | message_id, |
snowflake | channel_id | ||
) |
Delete a message from a channel.
The callback function is called when the message has been edited
message_id | Message ID to delete |
channel_id | Channel to delete from |
dpp::rest_exception | upon failure to execute REST function |
References dpp::unicode_emoji::m, and message_delete_reaction_emoji().
void dpp::cluster::message_edit | ( | const struct message & | m, |
command_completion_event_t | callback = utility::log_error() |
||
) |
Edit a message on a channel.
The callback function is called when the message has been edited
m | Message to edit |
callback | Function 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(). |
References API_PATH, dpp::m_get, and dpp::rest_request< message >().
Referenced by co_message_delete_own_reaction(), and message_delete_own_reaction_sync().
void dpp::cluster::message_edit_flags | ( | const struct message & | m, |
command_completion_event_t | callback = utility::log_error() |
||
) |
Edit the flags of a message on a channel.
The callback function is called when the message has been edited
m | Message to edit the flags of |
callback | Function 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(). |
Referenced by co_message_delete_reaction(), and message_delete_reaction_sync().
Edit the flags of a message on a channel.
The callback function is called when the message has been edited
m | Message to edit the flags of |
dpp::rest_exception | upon failure to execute REST function |
References messages_get().
Edit a message on a channel.
The callback function is called when the message has been edited
m | Message to edit |
dpp::rest_exception | upon failure to execute REST function |
References message_pin().
void dpp::cluster::message_get | ( | snowflake | message_id, |
snowflake | channel_id, | ||
command_completion_event_t | callback | ||
) |
Get a message.
message_id | Message ID |
channel_id | Channel ID |
callback | Function 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(). |
Referenced by co_message_delete_reaction(), and message_delete_reaction_sync().
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
m | Message to get reactions for |
reaction | Reaction should be in the form emojiname:id or a unicode character |
before | Reactions before this ID should be retrieved if this is set to non-zero |
after | Reactions before this ID should be retrieved if this is set to non-zero |
limit | This number of reactions maximum should be returned |
callback | Function 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(). |
Referenced by co_message_delete_reaction_emoji(), and message_delete_reaction_emoji_sync().
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
message_id | Message to get reactions for |
channel_id | Channel to get reactions for |
reaction | Reaction should be in the form emojiname:id or a unicode character |
before | Reactions before this ID should be retrieved if this is set to non-zero |
after | Reactions before this ID should be retrieved if this is set to non-zero |
limit | This number of reactions maximum should be returned |
callback | Function 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(). |
user_map dpp::cluster::message_get_reactions_sync | ( | const struct message & | m, |
const std::string & | reaction, | ||
snowflake | before, | ||
snowflake | after, | ||
snowflake | limit | ||
) |
Get reactions on a message for a particular emoji.
The reaction string must be either an emojiname:id
or a unicode character
m | Message to get reactions for |
reaction | Reaction should be in the form emojiname:id or a unicode character |
before | Reactions before this ID should be retrieved if this is set to non-zero |
after | Reactions before this ID should be retrieved if this is set to non-zero |
limit | This number of reactions maximum should be returned |
dpp::rest_exception | upon failure to execute REST function |
References dpp::unicode_emoji::m, and poll_get_answer_voters().
emoji_map dpp::cluster::message_get_reactions_sync | ( | snowflake | message_id, |
snowflake | channel_id, | ||
const std::string & | reaction, | ||
snowflake | before, | ||
snowflake | after, | ||
snowflake | limit | ||
) |
Get reactions on a message for a particular emoji by id.
The reaction string must be either an emojiname:id
or a unicode character
message_id | Message to get reactions for |
channel_id | Channel to get reactions for |
reaction | Reaction should be in the form emojiname:id or a unicode character |
before | Reactions before this ID should be retrieved if this is set to non-zero |
after | Reactions before this ID should be retrieved if this is set to non-zero |
limit | This number of reactions maximum should be returned |
dpp::rest_exception | upon failure to execute REST function |
References poll_get_answer_voters().
Get a message.
message_id | Message ID |
channel_id | Channel ID |
dpp::rest_exception | upon failure to execute REST function |
References message_unpin().
void dpp::cluster::message_pin | ( | snowflake | channel_id, |
snowflake | message_id, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Pin a message.
channel_id | Channel id to pin message on |
message_id | Message id to pin message on |
callback | Function 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(). |
Referenced by co_message_edit(), and message_edit_sync().
confirmation dpp::cluster::message_pin_sync | ( | snowflake | channel_id, |
snowflake | message_id | ||
) |
Pin a message.
channel_id | Channel id to pin message on |
message_id | Message id to pin message on |
dpp::rest_exception | upon failure to execute REST function |
References dpp::unicode_emoji::m, and poll_end().
void dpp::cluster::message_unpin | ( | snowflake | channel_id, |
snowflake | message_id, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Unpin a message.
channel_id | Channel id to unpin message on |
message_id | Message id to unpin message on |
callback | Function 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(). |
Referenced by co_message_get(), and message_get_sync().
confirmation dpp::cluster::message_unpin_sync | ( | snowflake | channel_id, |
snowflake | message_id | ||
) |
Unpin a message.
channel_id | Channel id to unpin message on |
message_id | Message id to unpin message on |
dpp::rest_exception | upon failure to execute REST function |
References channel_pins_get().
void dpp::cluster::messages_get | ( | snowflake | channel_id, |
snowflake | around, | ||
snowflake | before, | ||
snowflake | after, | ||
uint64_t | limit, | ||
command_completion_event_t | callback | ||
) |
Get multiple messages.
This function will attempt to fetch as many messages as possible using multiple API calls if needed.
channel_id | Channel ID to retrieve messages for |
around | Messages should be retrieved around this ID if this is set to non-zero |
before | Messages before this ID should be retrieved if this is set to non-zero |
after | Messages after this ID should be retrieved if this is set to non-zero |
limit | This number of messages maximum should be returned, up to a maximum of 100. |
callback | Function 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(). |
Referenced by co_message_edit_flags(), and message_edit_flags_sync().
message_map dpp::cluster::messages_get_sync | ( | snowflake | channel_id, |
snowflake | around, | ||
snowflake | before, | ||
snowflake | after, | ||
uint64_t | limit | ||
) |
Get multiple messages.
This function will attempt to fetch as many messages as possible using multiple API calls if needed.
channel_id | Channel ID to retrieve messages for |
around | Messages should be retrieved around this ID if this is set to non-zero |
before | Messages before this ID should be retrieved if this is set to non-zero |
after | Messages after this ID should be retrieved if this is set to non-zero |
limit | This number of messages maximum should be returned, up to a maximum of 100. |
dpp::rest_exception | upon failure to execute REST function |
References poll_end().
void dpp::cluster::nitro_sticker_get | ( | snowflake | id, |
command_completion_event_t | callback | ||
) |
Get a nitro sticker.
id | Id of sticker to get. |
callback | Function 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(). |
Referenced by co_guild_sticker_create(), and guild_sticker_create_sync().
Get a nitro sticker.
id | Id of sticker to get. |
dpp::rest_exception | upon failure to execute REST function |
References guild_template_modify().
dpp::cluster is non-moveable
dpp::cluster is non-copyable
void dpp::cluster::poll_end | ( | const message & | m, |
command_completion_event_t | callback = utility::log_error() |
||
) |
Immediately end a poll.
m | Message that contains the poll |
callback | Function to call when the API call completes. |
Referenced by co_message_pin(), co_messages_get(), message_pin_sync(), and messages_get_sync().
void dpp::cluster::poll_end | ( | snowflake | message_id, |
snowflake | channel_id, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Immediately end a poll.
message_id | ID of the message with the poll to end |
channel_id | ID of the channel with the poll to end |
callback | Function to call when the API call completes. |
Immediately end a poll.
m | Message that contains the poll |
dpp::rest_exception | upon failure to execute REST function |
References role_edit().
Immediately end a poll.
message_id | ID of the message with the poll to end |
channel_id | ID of the channel with the poll to end |
dpp::rest_exception | upon failure to execute REST function |
References roles_edit_position().
void dpp::cluster::poll_get_answer_voters | ( | const message & | m, |
uint32_t | answer_id, | ||
snowflake | after, | ||
uint64_t | limit, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Get a list of users that voted for this specific answer.
m | Message that contains the poll to retrieve the answers from |
answer_id | ID of the answer to retrieve votes from (see poll_answer::answer_id) |
after | Users after this ID should be retrieved if this is set to non-zero |
limit | This number of users maximum should be returned, up to 100 |
callback | Function to call when the API call completes. |
Referenced by co_message_get_reactions(), and message_get_reactions_sync().
void dpp::cluster::poll_get_answer_voters | ( | snowflake | message_id, |
snowflake | channel_id, | ||
uint32_t | answer_id, | ||
snowflake | after, | ||
uint64_t | limit, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Get a list of users that voted for this specific answer.
message_id | ID of the message with the poll to retrieve the answers from |
channel_id | ID of the channel with the poll to retrieve the answers from |
answer_id | ID of the answer to retrieve votes from (see poll_answer::answer_id) |
after | Users after this ID should be retrieved if this is set to non-zero |
limit | This number of users maximum should be returned, up to 100 |
callback | Function to call when the API call completes. |
References API_PATH, and dpp::m_get.
user_map dpp::cluster::poll_get_answer_voters_sync | ( | const message & | m, |
uint32_t | answer_id, | ||
snowflake | after, | ||
uint64_t | limit | ||
) |
Get a list of users that voted for this specific answer.
m | Message that contains the poll to retrieve the answers from |
answer_id | ID of the answer to retrieve votes from (see poll_answer::answer_id) |
after | Users after this ID should be retrieved if this is set to non-zero |
limit | This number of users maximum should be returned, up to 100 |
dpp::rest_exception | upon failure to execute REST function |
References role_create().
user_map dpp::cluster::poll_get_answer_voters_sync | ( | snowflake | message_id, |
snowflake | channel_id, | ||
uint32_t | answer_id, | ||
snowflake | after, | ||
uint64_t | limit | ||
) |
Get a list of users that voted for this specific answer.
message_id | ID of the message with the poll to retrieve the answers from |
channel_id | ID of the channel with the poll to retrieve the answers from |
answer_id | ID of the answer to retrieve votes from (see poll_answer::answer_id) |
after | Users after this ID should be retrieved if this is set to non-zero |
limit | This number of users maximum should be returned, up to 100 |
dpp::rest_exception | upon failure to execute REST function |
References role_delete().
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 = "" , |
||
const std::string & | filemimetype = "" , |
||
const std::string & | protocol = "1.1" |
||
) |
Post a REST request.
Where possible use a helper method instead like message_create
endpoint | Endpoint to post to, e.g. /api/guilds |
major_parameters | Major parameters for the endpoint e.g. a guild id |
parameters | Minor parameters for the API request |
method | Method, e.g. GET, POST |
postdata | Post data (usually JSON encoded) |
callback | Function to call when the HTTP call completes. The callback parameter will contain amongst other things, the decoded json. |
filename | Filename to post for POST requests (for uploading files) |
filecontent | File content to post for POST requests (for uploading files) |
filemimetype | File content to post for POST requests (for uploading files) |
protocol | HTTP protocol to use (1.0 and 1.1 are supported) |
Referenced by dpp::interaction_create_t::dialog().
void dpp::cluster::post_rest_multipart | ( | const std::string & | endpoint, |
const std::string & | major_parameters, | ||
const std::string & | parameters, | ||
http_method | method, | ||
const std::string & | postdata, | ||
json_encode_t | callback, | ||
const std::vector< message_file_data > & | file_data = {} |
||
) |
Post a multipart REST request.
Where possible use a helper method instead like message_create
endpoint | Endpoint to post to, e.g. /api/guilds |
major_parameters | Major parameters for the endpoint e.g. a guild id |
parameters | Minor parameters for the API request |
method | Method, e.g. GET, POST |
postdata | Post data (usually JSON encoded) |
callback | Function to call when the HTTP call completes. The callback parameter will contain amongst other things, the decoded json. |
file_data | List of files to post for POST requests (for uploading files) |
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 = {} , |
||
const std::string & | protocol = "1.1" |
||
) |
Make a HTTP(S) request.
For use when wanting asynchronous access to HTTP APIs outside of Discord.
url | Full URL to post to, e.g. https://api.somewhere.com/v1/foo/ |
method | Method, e.g. GET, POST |
callback | Function to call when the HTTP call completes. No processing is done on the returned data. |
postdata | POST data |
mimetype | MIME type of POST data |
headers | Headers to send with the request |
protocol | HTTP protocol to use (1.1 and 1.0 are supported) |
Referenced by co_get_guild_webhooks().
void dpp::cluster::role_create | ( | const class role & | r, |
command_completion_event_t | callback = utility::log_error() |
||
) |
Create a role on a guild.
Create a new role for the guild. Requires the MANAGE_ROLES
permission. Returns the new role object on success. Fires a Guild Role Create
Gateway event.
r | Role to create (guild ID is encapsulated in the role object) |
callback | Function 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(). |
Referenced by co_poll_get_answer_voters(), and poll_get_answer_voters_sync().
Create a role on a guild.
Create a new role for the guild. Requires the MANAGE_ROLES
permission. Returns the new role object on success. Fires a Guild Role Create
Gateway event.
r | Role to create (guild ID is encapsulated in the role object) |
dpp::rest_exception | upon failure to execute REST function |
References application_role_connection_get().
void dpp::cluster::role_delete | ( | snowflake | guild_id, |
snowflake | role_id, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Delete a role.
Requires the MANAGE_ROLES
permission. Fires a Guild Role Delete
Gateway event.
guild_id | Guild ID to delete the role on |
role_id | Role ID to delete |
callback | Function 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(). |
References API_PATH, and dpp::m_get.
Referenced by co_poll_get_answer_voters(), and poll_get_answer_voters_sync().
confirmation dpp::cluster::role_delete_sync | ( | snowflake | guild_id, |
snowflake | role_id | ||
) |
Delete a role.
Requires the MANAGE_ROLES
permission. Fires a Guild Role Delete
Gateway event.
guild_id | Guild ID to delete the role on |
role_id | Role ID to delete |
dpp::rest_exception | upon failure to execute REST function |
References application_role_connection_update().
void dpp::cluster::role_edit | ( | const class role & | r, |
command_completion_event_t | callback = utility::log_error() |
||
) |
Edit a role on a guild.
Requires the MANAGE_ROLES
permission. Returns the updated role on success. Fires a Guild Role Update
Gateway event.
r | Role to edit |
callback | Function 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(). |
References API_PATH, and dpp::m_get.
Referenced by co_poll_end(), and poll_end_sync().
Edit a role on a guild.
Requires the MANAGE_ROLES
permission. Returns the updated role on success. Fires a Guild Role Update
Gateway event.
r | Role to edit |
dpp::rest_exception | upon failure to execute REST function |
References user_application_role_connection_get().
void dpp::cluster::roles_edit_position | ( | snowflake | guild_id, |
const std::vector< role > & | roles, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Edit multiple role's position in a guild.
Returns a list of all roles of the guild on success.
Modify the positions of a set of role objects for the guild. Requires the MANAGE_ROLES
permission. Fires multiple Guild Role Update
Gateway events.
guild_id | Guild ID to change the roles position on |
roles | Vector of roles to change the positions of |
callback | Function 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(). |
References API_PATH, and dpp::m_put.
Referenced by co_poll_end(), and poll_end_sync().
role_map dpp::cluster::roles_edit_position_sync | ( | snowflake | guild_id, |
const std::vector< role > & | roles | ||
) |
Edit multiple role's position in a guild.
Returns a list of all roles of the guild on success.
Modify the positions of a set of role objects for the guild. Requires the MANAGE_ROLES
permission. Fires multiple Guild Role Update
Gateway events.
guild_id | Guild ID to change the roles position on |
roles | Vector of roles to change the positions of |
dpp::rest_exception | upon failure to execute REST function |
References user_application_role_connection_update().
void dpp::cluster::roles_get | ( | snowflake | guild_id, |
command_completion_event_t | callback | ||
) |
Get a role for a guild.
guild_id | Guild ID to get role for |
callback | Function 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(). |
References API_PATH, dpp::json_interface< T >::build_json(), and dpp::m_put.
Referenced by channel_pins_get_sync(), and co_channel_pins_get().
Get a role for a guild.
guild_id | Guild ID to get role for |
dpp::rest_exception | upon failure to execute REST function |
References guild_events_get().
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:
reason | The reason to set for the next REST call on this thread |
cluster & dpp::cluster::set_default_gateway | ( | std::string & | default_gateway | ) |
Sets the address of the default gateway, for connecting the websockets.
Set the dm channel id for a user id.
user_id | user id to set the dm channel for |
channel_id | dm channel to set |
void dpp::cluster::set_presence | ( | const class dpp::presence & | p | ) |
Set the presence for all shards on the cluster.
p | The presence to set. Only the online status and the first activity are sent. |
References dpp::audit_reason.
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.
mode | websocket protocol to use, either ws_json or ws_etf. |
dpp::logic_exception | If called after the cluster is started (this is not supported) |
Referenced by main().
void dpp::cluster::shutdown | ( | ) |
End cluster execution without destructing it.
To restart the cluster, call cluster::start() again.
void dpp::cluster::skus_get | ( | command_completion_event_t | callback = utility::log_error() | ) |
Returns all SKUs for a given application.
callback | Function 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(). |
Referenced by co_guild_events_get(), and guild_events_get_sync().
sku_map dpp::cluster::skus_get_sync | ( | ) |
Returns all SKUs for a given application.
dpp::rest_exception | upon failure to execute REST function |
References guild_sticker_create().
void dpp::cluster::stage_instance_create | ( | const stage_instance & | instance, |
command_completion_event_t | callback = utility::log_error() |
||
) |
Create a stage instance on a stage channel.
instance | Stage instance to create |
callback | User 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(). |
Referenced by co_guild_event_create(), and guild_event_create_sync().
void dpp::cluster::stage_instance_delete | ( | const snowflake | channel_id, |
command_completion_event_t | callback = utility::log_error() |
||
) |
Delete a stage instance.
channel_id | ID of the associated channel |
callback | User 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(). |
Referenced by co_guild_event_get(), and guild_event_get_sync().
confirmation dpp::cluster::stage_instance_delete_sync | ( | const snowflake | channel_id | ) |
Delete a stage instance.
channel_id | ID of the associated channel |
dpp::rest_exception | upon failure to execute REST function |
References guild_stickers_get().
void dpp::cluster::stage_instance_edit | ( | const stage_instance & | instance, |
command_completion_event_t | callback = utility::log_error() |
||
) |
Edit a stage instance.
instance | Stage instance to edit |
callback | User 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(). |
Referenced by co_guild_event_edit(), and guild_event_edit_sync().
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.
channel_id | ID of the associated channel |
callback | User 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(). |
Referenced by co_guild_event_delete(), and guild_event_delete_sync().
stage_instance dpp::cluster::stage_instance_get_sync | ( | const snowflake | channel_id | ) |
Get the stage instance associated with the channel id, if it exists.
channel_id | ID of the associated channel |
dpp::rest_exception | upon failure to execute REST function |
References guild_sticker_get().
void dpp::cluster::start | ( | bool | return_after = true | ) |
Start the cluster, connecting all its shards.
Returns once all shards are connected if return_after is true, otherwise enters an infinite loop while the shards run.
return_after | If true the bot will return to your program after starting shards, if false this function will never return. |
References dpp::err_auto_shard, dpp::ll_info, and dpp::gateway::shards.
Referenced by main().
timer dpp::cluster::start_timer | ( | timer_callback_t | on_tick, |
uint64_t | frequency, | ||
timer_callback_t | on_stop = {} |
||
) |
Start a timer.
Every frequency
seconds, the callback is called.
on_tick | The callback lambda to call for this timer when ticked |
on_stop | The callback lambda to call for this timer when it is stopped |
frequency | How often to tick the timer in seconds |
References dpp::timer_t::next_tick, and dpp::timer_t::on_stop.
void dpp::cluster::sticker_packs_get | ( | command_completion_event_t | callback | ) |
Get a list of available sticker packs.
callback | Function to call when the API call completes. On success the callback will contain a dpp::sticker_pack_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(). |
Referenced by co_guild_sticker_delete(), and guild_sticker_delete_sync().
sticker_pack_map dpp::cluster::sticker_packs_get_sync | ( | ) |
Get a list of available sticker packs.
dpp::rest_exception | upon failure to execute REST function |
References guild_templates_get().
bool dpp::cluster::stop_timer | ( | timer | t | ) |
Stop a ticking timer.
t | Timer handle received from cluster::start_timer |
void dpp::cluster::template_get | ( | const std::string & | code, |
command_completion_event_t | callback | ||
) |
Get a template.
code | Template code |
callback | Function to call when the API call completes. On success the callback will contain a dpp::dtemplate object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error(). |
Referenced by co_guild_template_create(), and guild_template_create_sync().
dtemplate dpp::cluster::template_get_sync | ( | const std::string & | code | ) |
Get a template.
code | Template code |
dpp::rest_exception | upon failure to execute REST function |
References threads_get_private_archived().
void dpp::cluster::thread_create | ( | const std::string & | thread_name, |
snowflake | channel_id, | ||
uint16_t | auto_archive_duration, | ||
channel_type | thread_type, | ||
bool | invitable, | ||
uint16_t | rate_limit_per_user, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Create a thread.
thread_name | Name of the thread |
channel_id | Channel in which thread to create |
auto_archive_duration | Duration after which thread auto-archives. Can be set to - 60, 1440 (for boosted guilds can also be: 4320, 10080) |
thread_type | Type of thread - CHANNEL_PUBLIC_THREAD, CHANNEL_ANNOUNCEMENT_THREAD, CHANNEL_PRIVATE_THREAD |
invitable | whether non-moderators can add other non-moderators to a thread; only available when creating a private thread |
rate_limit_per_user | amount of seconds a user has to wait before sending another message (0-21600); bots, as well as users with the permission manage_messages, manage_thread, or manage_channel, are unaffected |
callback | Function to call when the API call completes. On success the callback will contain a dpp::thread object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error(). |
Referenced by co_threads_get_private_archived(), and threads_get_private_archived_sync().
void dpp::cluster::thread_create_in_forum | ( | const std::string & | thread_name, |
snowflake | channel_id, | ||
const message & | msg, | ||
auto_archive_duration_t | auto_archive_duration, | ||
uint16_t | rate_limit_per_user, | ||
std::vector< snowflake > | applied_tags = {} , |
||
command_completion_event_t | callback = utility::log_error() |
||
) |
Create a thread in a forum or media channel.
thread_name | Name of the forum thread |
channel_id | Forum channel in which thread to create |
msg | The message to start the thread with |
auto_archive_duration | Duration to automatically archive the thread after recent activity |
rate_limit_per_user | amount of seconds a user has to wait before sending another message (0-21600); bots, as well as users with the permission manage_messages, manage_thread, or manage_channel, are unaffected |
applied_tags | List of IDs of forum tags (dpp::forum_tag) to apply to this thread |
callback | Function to call when the API call completes. On success the callback will contain a dpp::thread object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error(). |
Referenced by co_threads_get_joined_private_archived(), and threads_get_joined_private_archived_sync().
thread dpp::cluster::thread_create_in_forum_sync | ( | const std::string & | thread_name, |
snowflake | channel_id, | ||
const message & | msg, | ||
auto_archive_duration_t | auto_archive_duration, | ||
uint16_t | rate_limit_per_user, | ||
std::vector< snowflake > | applied_tags = {} |
||
) |
Create a thread in a forum or media channel.
thread_name | Name of the forum thread |
channel_id | Forum channel in which thread to create |
msg | The message to start the thread with |
auto_archive_duration | Duration to automatically archive the thread after recent activity |
rate_limit_per_user | amount of seconds a user has to wait before sending another message (0-21600); bots, as well as users with the permission manage_messages, manage_thread, or manage_channel, are unaffected |
applied_tags | List of IDs of forum tags (dpp::forum_tag) to apply to this thread |
dpp::rest_exception | upon failure to execute REST function |
References thread_member_remove().
thread dpp::cluster::thread_create_sync | ( | const std::string & | thread_name, |
snowflake | channel_id, | ||
uint16_t | auto_archive_duration, | ||
channel_type | thread_type, | ||
bool | invitable, | ||
uint16_t | rate_limit_per_user | ||
) |
Create a thread.
thread_name | Name of the thread |
channel_id | Channel in which thread to create |
auto_archive_duration | Duration after which thread auto-archives. Can be set to - 60, 1440 (for boosted guilds can also be: 4320, 10080) |
thread_type | Type of thread - CHANNEL_PUBLIC_THREAD, CHANNEL_ANNOUNCEMENT_THREAD, CHANNEL_PRIVATE_THREAD |
invitable | whether non-moderators can add other non-moderators to a thread; only available when creating a private thread |
rate_limit_per_user | amount of seconds a user has to wait before sending another message (0-21600); bots, as well as users with the permission manage_messages, manage_thread, or manage_channel, are unaffected |
dpp::rest_exception | upon failure to execute REST function |
References thread_get().
void dpp::cluster::thread_create_with_message | ( | const std::string & | thread_name, |
snowflake | channel_id, | ||
snowflake | message_id, | ||
uint16_t | auto_archive_duration, | ||
uint16_t | rate_limit_per_user, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Create a thread with a message (Discord: ID of a thread is same as message ID)
thread_name | Name of the thread |
channel_id | Channel in which thread to create |
message_id | message to start thread with |
auto_archive_duration | Duration after which thread auto-archives. Can be set to - 60, 1440 (for boosted guilds can also be: 4320, 10080) |
rate_limit_per_user | amount of seconds a user has to wait before sending another message (0-21600); bots, as well as users with the permission manage_messages, manage_thread, or manage_channel, are unaffected |
callback | Function to call when the API call completes. On success the callback will contain a dpp::thread object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error(). |
Referenced by co_thread_member_get(), and thread_member_get_sync().
thread dpp::cluster::thread_create_with_message_sync | ( | const std::string & | thread_name, |
snowflake | channel_id, | ||
snowflake | message_id, | ||
uint16_t | auto_archive_duration, | ||
uint16_t | rate_limit_per_user | ||
) |
Create a thread with a message (Discord: ID of a thread is same as message ID)
thread_name | Name of the thread |
channel_id | Channel in which thread to create |
message_id | message to start thread with |
auto_archive_duration | Duration after which thread auto-archives. Can be set to - 60, 1440 (for boosted guilds can also be: 4320, 10080) |
rate_limit_per_user | amount of seconds a user has to wait before sending another message (0-21600); bots, as well as users with the permission manage_messages, manage_thread, or manage_channel, are unaffected |
dpp::rest_exception | upon failure to execute REST function |
References current_application_get().
void dpp::cluster::thread_edit | ( | const thread & | t, |
command_completion_event_t | callback = utility::log_error() |
||
) |
Edit a thread.
t | Thread to edit |
callback | Function to call when the API call completes. On success the callback will contain a dpp::thread object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error(). |
References API_PATH, dpp::m_delete, and dpp::rest_request< confirmation >().
Referenced by co_threads_get_public_archived(), and threads_get_public_archived_sync().
Edit a thread.
t | Thread to edit |
dpp::rest_exception | upon failure to execute REST function |
References current_user_edit().
void dpp::cluster::thread_get | ( | snowflake | thread_id, |
command_completion_event_t | callback | ||
) |
Get the thread specified by thread_id.
This uses the same call as dpp::cluster::channel_get but returns a thread object.
thread_id | The id of the thread to obtain. |
callback | Function to call when the API call completes On success the callback will contain a dpp::thread object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error(). |
Referenced by co_thread_create(), and thread_create_sync().
Get the thread specified by thread_id.
This uses the same call as dpp::cluster::channel_get but returns a thread object.
thread_id | The id of the thread to obtain. |
dpp::rest_exception | upon failure to execute REST function |
References user_set_voice_state().
void dpp::cluster::thread_member_add | ( | snowflake | thread_id, |
snowflake | user_id, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Add a member to a thread.
thread_id | Thread ID to add to |
user_id | Member ID to add |
callback | Function 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(). |
Referenced by co_thread_members_get(), and thread_members_get_sync().
confirmation dpp::cluster::thread_member_add_sync | ( | snowflake | thread_id, |
snowflake | user_id | ||
) |
Add a member to a thread.
thread_id | Thread ID to add to |
user_id | Member ID to add |
dpp::rest_exception | upon failure to execute REST function |
References current_user_get().
void dpp::cluster::thread_member_get | ( | const snowflake | thread_id, |
const snowflake | user_id, | ||
command_completion_event_t | callback | ||
) |
Get a thread member.
thread_id | Thread to get member for |
user_id | ID of the user to get |
callback | Function 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(). |
Referenced by co_current_user_leave_thread(), and current_user_leave_thread_sync().
thread_member dpp::cluster::thread_member_get_sync | ( | const snowflake | thread_id, |
const snowflake | user_id | ||
) |
Get a thread member.
thread_id | Thread to get member for |
user_id | ID of the user to get |
dpp::rest_exception | upon failure to execute REST function |
References thread_create_with_message().
void dpp::cluster::thread_member_remove | ( | snowflake | thread_id, |
snowflake | user_id, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Remove a member from a thread.
thread_id | Thread ID to remove from |
user_id | Member ID to remove |
callback | Function 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(). |
Referenced by co_thread_create_in_forum(), and thread_create_in_forum_sync().
confirmation dpp::cluster::thread_member_remove_sync | ( | snowflake | thread_id, |
snowflake | user_id | ||
) |
Remove a member from a thread.
thread_id | Thread ID to remove from |
user_id | Member ID to remove |
dpp::rest_exception | upon failure to execute REST function |
References current_user_set_voice_state().
void dpp::cluster::thread_members_get | ( | snowflake | thread_id, |
command_completion_event_t | callback | ||
) |
Get members of a thread.
thread_id | Thread to get members for |
callback | Function 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(). |
Referenced by co_threads_get_active(), and threads_get_active_sync().
thread_member_map dpp::cluster::thread_members_get_sync | ( | snowflake | thread_id | ) |
Get members of a thread.
thread_id | Thread to get members for |
dpp::rest_exception | upon failure to execute REST function |
References thread_member_add().
void dpp::cluster::threads_get_active | ( | snowflake | guild_id, |
command_completion_event_t | callback | ||
) |
Get all active threads in the guild, including public and private threads.
Threads are ordered by their id, in descending order.
guild_id | Guild to get active threads for |
callback | Function to call when the API call completes On success the callback will contain a dpp::active_threads object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error(). |
Referenced by co_guild_templates_get(), and guild_templates_get_sync().
active_threads dpp::cluster::threads_get_active_sync | ( | snowflake | guild_id | ) |
Get all active threads in the guild, including public and private threads.
Threads are ordered by their id, in descending order.
guild_id | Guild to get active threads for |
dpp::rest_exception | upon failure to execute REST function |
References thread_members_get().
void dpp::cluster::threads_get_joined_private_archived | ( | snowflake | channel_id, |
snowflake | before_id, | ||
uint16_t | limit, | ||
command_completion_event_t | callback | ||
) |
Get private archived threads in a channel which current user has joined (Sorted by ID in descending order)
channel_id | Channel to get public archived threads for |
before_id | Get threads before this id |
limit | Number of threads to get |
callback | Function to call when the API call completes On success the callback will contain a dpp::thread_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(). |
Referenced by co_guild_template_sync(), and guild_template_sync_sync().
thread_map dpp::cluster::threads_get_joined_private_archived_sync | ( | snowflake | channel_id, |
snowflake | before_id, | ||
uint16_t | limit | ||
) |
Get private archived threads in a channel which current user has joined (Sorted by ID in descending order)
channel_id | Channel to get public archived threads for |
before_id | Get threads before this id |
limit | Number of threads to get |
dpp::rest_exception | upon failure to execute REST function |
References thread_create_in_forum().
void dpp::cluster::threads_get_private_archived | ( | snowflake | channel_id, |
time_t | before_timestamp, | ||
uint16_t | limit, | ||
command_completion_event_t | callback | ||
) |
Get private archived threads in a channel (Sorted by archive_timestamp in descending order)
channel_id | Channel to get public archived threads for |
before_timestamp | Get threads archived before this timestamp |
limit | Number of threads to get |
callback | Function to call when the API call completes On success the callback will contain a dpp::thread_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(). |
Referenced by co_template_get(), and template_get_sync().
thread_map dpp::cluster::threads_get_private_archived_sync | ( | snowflake | channel_id, |
time_t | before_timestamp, | ||
uint16_t | limit | ||
) |
Get private archived threads in a channel (Sorted by archive_timestamp in descending order)
channel_id | Channel to get public archived threads for |
before_timestamp | Get threads archived before this timestamp |
limit | Number of threads to get |
dpp::rest_exception | upon failure to execute REST function |
References thread_create().
void dpp::cluster::threads_get_public_archived | ( | snowflake | channel_id, |
time_t | before_timestamp, | ||
uint16_t | limit, | ||
command_completion_event_t | callback | ||
) |
Get public archived threads in a channel (Sorted by archive_timestamp in descending order)
channel_id | Channel to get public archived threads for |
before_timestamp | Get threads archived before this timestamp |
limit | Number of threads to get |
callback | Function to call when the API call completes On success the callback will contain a dpp::thread_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(). |
Referenced by co_current_user_join_thread(), and current_user_join_thread_sync().
thread_map dpp::cluster::threads_get_public_archived_sync | ( | snowflake | channel_id, |
time_t | before_timestamp, | ||
uint16_t | limit | ||
) |
Get public archived threads in a channel (Sorted by archive_timestamp in descending order)
channel_id | Channel to get public archived threads for |
before_timestamp | Get threads archived before this timestamp |
limit | Number of threads to get |
dpp::rest_exception | upon failure to execute REST function |
References thread_edit().
dpp::utility::uptime dpp::cluster::uptime | ( | ) |
Returns the uptime of the cluster.
void dpp::cluster::user_application_role_connection_get | ( | snowflake | application_id, |
command_completion_event_t | callback | ||
) |
Get user application role connection.
application_id | The application ID |
callback | Function to call when the API call completes. On success the callback will contain a dpp::application_role_connection object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error(). |
Referenced by co_role_edit(), and role_edit_sync().
application_role_connection dpp::cluster::user_application_role_connection_get_sync | ( | snowflake | application_id | ) |
Get user application role connection.
application_id | The application ID |
dpp::rest_exception | upon failure to execute REST function |
References guild_event_edit().
void dpp::cluster::user_application_role_connection_update | ( | snowflake | application_id, |
const application_role_connection & | connection, | ||
command_completion_event_t | callback = utility::log_error() |
||
) |
Update user application role connection.
application_id | The application ID |
connection | The application role connection to update |
callback | Function to call when the API call completes. On success the callback will contain a dpp::application_role_connection object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error(). |
Referenced by co_roles_edit_position(), and roles_edit_position_sync().
application_role_connection dpp::cluster::user_application_role_connection_update_sync | ( | snowflake | application_id, |
const application_role_connection & | connection | ||
) |
Update user application role connection.
application_id | The application ID |
connection | The application role connection to update |
dpp::rest_exception | upon failure to execute REST function |
References guild_event_get().
void dpp::cluster::user_get | ( | snowflake | user_id, |
command_completion_event_t | callback | ||
) |
Get a user by id, without using the cache.
user_id | User ID to retrieve |
callback | Function to call when the API call completes. On success the callback will contain a dpp::user_identified object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error(). |
dynamic_cast
. dpp::user_identified
or you've turned off caching, you have no need to call this. Call dpp::find_user
instead that looks up the user in the cache rather than a REST call. Referenced by co_current_user_set_voice_state(), and current_user_set_voice_state_sync().
void dpp::cluster::user_get_cached | ( | snowflake | user_id, |
command_completion_event_t | callback | ||
) |
Get a user by id, checking in the cache first.
user_id | User ID to retrieve |
callback | Function to call when the API call completes. On success the callback will contain a dpp::user_identified object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error(). |
dynamic_cast
. dpp::user_identified
will be undefined. This call should be used where you want to for example resolve a user who may no longer be in the bot's guilds, for something like a ban log message. Referenced by co_user_set_voice_state(), and user_set_voice_state_sync().
user_identified dpp::cluster::user_get_cached_sync | ( | snowflake | user_id | ) |
Get a user by id, checking in the cache first.
user_id | User ID to retrieve |
dynamic_cast
. dpp::user_identified
will be undefined. This call should be used where you want to for example resolve a user who may no longer be in the bot's guilds, for something like a ban log message.dpp::rest_exception | upon failure to execute REST function |
References delete_webhook_message().
user_identified dpp::cluster::user_get_sync | ( | snowflake | user_id | ) |
Get a user by id, without using the cache.
user_id | User ID to retrieve |
dynamic_cast
. dpp::user_identified
or you've turned off caching, you have no need to call this. Call dpp::find_user
instead that looks up the user in the cache rather than a REST call.dpp::rest_exception | upon failure to execute REST function |
References delete_webhook().
void dpp::cluster::user_set_voice_state | ( | snowflake | user_id, |
snowflake | guild_id, | ||
snowflake | channel_id, | ||
bool | suppress = false , |
||
command_completion_event_t | callback = utility::log_error() |
||
) |
Set a user's voice state on a stage channel.
Caveats
There are currently several caveats for this endpoint:
channel_id
must currently point to a stage channel.channel_id
.MUTE_MEMBERS
permission. (Since suppression is the only thing that is available currently)request_to_speak_timestamp
set to the current time. Bot users will not.request_to_speak_timestamp
removed.user_id | The user to set the voice state of |
guild_id | Guild to set voice state on |
channel_id | Stage channel to set voice state on |
callback | Function to call when the API call completes. |
suppress | True if the user's audio should be suppressed, false if it should not On success the callback will contain a dpp::scheduled_event object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error(). |
References API_PATH, and dpp::m_get.
Referenced by co_thread_get(), and thread_get_sync().
confirmation dpp::cluster::user_set_voice_state_sync | ( | snowflake | user_id, |
snowflake | guild_id, | ||
snowflake | channel_id, | ||
bool | suppress = false |
||
) |
Set a user's voice state on a stage channel.
Caveats
There are currently several caveats for this endpoint:
channel_id
must currently point to a stage channel.channel_id
.MUTE_MEMBERS
permission. (Since suppression is the only thing that is available currently)request_to_speak_timestamp
set to the current time. Bot users will not.request_to_speak_timestamp
removed.user_id | The user to set the voice state of |
guild_id | Guild to set voice state on |
channel_id | Stage channel to set voice state on |
suppress | True if the user's audio should be suppressed, false if it should not |
dpp::rest_exception | upon failure to execute REST function |
References user_get_cached().
|
friend |
|
friend |
cache_policy_t dpp::cluster::cache_policy |
Current cache policy for the cluster.
Referenced by dpp::discord_client::get_member_count().
uint32_t dpp::cluster::cluster_id |
ID of this cluster, between 0 and MAXCLUSTERS-1 inclusive.
uint32_t dpp::cluster::intents |
Current bitmask of gateway intents.
time_t dpp::cluster::last_identify |
Last time the bot sent an IDENTIFY.
Referenced by dpp::discord_client::handle_frame().
uint32_t dpp::cluster::maxclusters |
Total number of clusters that are active.
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.
Referenced by current_user_join_thread(), global_bulk_command_create(), global_bulk_command_delete(), global_command_delete(), global_command_edit(), and dpp::discord_voice_client::handle_frame().
uint32_t dpp::cluster::numshards |
Total number of shards across all clusters.
event_router_t<autocomplete_t> dpp::cluster::on_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.
const
reference of type autocomplete_t&, and returns void. event_router_t<automod_rule_create_t> dpp::cluster::on_automod_rule_create |
Called when a new automod rule is created.
const
reference of type automod_rule_create_t&, and returns void. event_router_t<automod_rule_delete_t> dpp::cluster::on_automod_rule_delete |
Called when an automod rule is deleted.
const
reference of type automod_rule_delete_t&, and returns void. event_router_t<automod_rule_execute_t> dpp::cluster::on_automod_rule_execute |
Called when an automod rule is triggered/executed.
const
reference of type automod_rule_execute_t&, and returns void. event_router_t<automod_rule_update_t> dpp::cluster::on_automod_rule_update |
Called when an automod rule is updated.
const
reference of type automod_rule_update_t&, and returns void. event_router_t<button_click_t> dpp::cluster::on_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.
const
reference of type button_click_t&, and returns void. event_router_t<channel_create_t> dpp::cluster::on_channel_create |
Called when a new channel is created on a guild.
const
reference of type channel_create_t&, and returns void. event_router_t<channel_delete_t> dpp::cluster::on_channel_delete |
Called when a channel is deleted from a guild.
The channel will still be temporarily available in the cache. Pointers to the channel should not be retained long-term as they will be deleted by the garbage collector.
const
reference of type channel_delete_t&, and returns void. event_router_t<channel_pins_update_t> dpp::cluster::on_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.
const
reference of type channel_pins_update_t&, and returns void. event_router_t<channel_update_t> dpp::cluster::on_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.
const
reference of type channel_update_t&, and returns void. event_router_t<entitlement_create_t> dpp::cluster::on_entitlement_create |
Called when a user subscribes to an SKU.
const
reference of type channel_delete_t&, and returns void. event_router_t<entitlement_delete_t> dpp::cluster::on_entitlement_delete |
Called when a user's entitlement is deleted.
These events are infrequent and only occur if Discord issues a refund, or Discord removes an entitlement via "internal tooling". Entitlements are not deleted when they expire.
const
reference of type channel_update_t&, and returns void. event_router_t<entitlement_update_t> dpp::cluster::on_entitlement_update |
Called when a user's subscription renews for the next billing period.
The ends_at
field will have an updated value with the new expiration date.
const
reference of type channel_update_t&, and returns void. event_router_t<form_submit_t> dpp::cluster::on_form_submit |
Called when a modal dialog is submitted.
Form submits are triggered by discord when modal dialogs are submitted which you have associated with a slash command using dpp::interaction_modal_response.
const
reference of type form_submit_t&, and returns void. event_router_t<guild_audit_log_entry_create_t> dpp::cluster::on_guild_audit_log_entry_create |
Called when a guild audit log entry is created.
const
reference of type guild_audit_log_entry_create_t&, and returns void. event_router_t<guild_ban_add_t> dpp::cluster::on_guild_ban_add |
Called when a ban is added to a guild.
const
reference of type guild_ban_add_t&, and returns void. event_router_t<guild_ban_remove_t> dpp::cluster::on_guild_ban_remove |
Called when a ban is removed from a guild.
const
reference of type guild_ban_remove_t&, and returns void. event_router_t<guild_create_t> dpp::cluster::on_guild_create |
Called when a new guild is created.
D++ will request members for the guild for its cache using guild_members_chunk.
const
reference of type guild_create_t&, and returns void. event_router_t<guild_delete_t> dpp::cluster::on_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::cluster::guild_delete, or via the guild being unavailable due to an outage.
const
reference of type guild_delete_t&, and returns void. event_router_t<guild_emojis_update_t> dpp::cluster::on_guild_emojis_update |
Called when new emojis are added to a guild.
The complete set of emojis is sent every time.
const
reference of type guild_emojis_update_t&, and returns void. event_router_t<guild_integrations_update_t> dpp::cluster::on_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.
const
reference of type guild_integrations_update_t&, and returns void. event_router_t<guild_join_request_delete_t> dpp::cluster::on_guild_join_request_delete |
on guild join request delete.
Triggered when a user declines the membership screening questionnaire for a guild.
const
reference of type guild_join_request_delete_t&, and returns void. event_router_t<guild_member_add_t> dpp::cluster::on_guild_member_add |
Called when a new member joins a guild.
const
reference of type guild_member_add_t&, and returns void. event_router_t<guild_member_remove_t> dpp::cluster::on_guild_member_remove |
Called when a user leaves a guild (either through being kicked, or choosing to leave)
const
reference of type guild_member_remove_t&, and returns void. event_router_t<guild_member_update_t> dpp::cluster::on_guild_member_update |
Called when details of a guild member (e.g.
their roles or nickname) are updated.
const
reference of type guild_member_update_t&, and returns void. event_router_t<guild_members_chunk_t> dpp::cluster::on_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 cluster::on_guild_create events.
const
reference of type guild_members_chunk_t&, and returns void. event_router_t<guild_role_create_t> dpp::cluster::on_guild_role_create |
Called when a new role is created on a guild.
const
reference of type guild_role_create_t&, and returns void. event_router_t<guild_role_delete_t> dpp::cluster::on_guild_role_delete |
Called when a role is deleted in a guild.
const
reference of type guild_role_delete_t&, and returns void. event_router_t<guild_role_update_t> dpp::cluster::on_guild_role_update |
Called when an existing role is updated on a guild.
const
reference of type guild_role_update_t&, and returns void. event_router_t<guild_scheduled_event_create_t> dpp::cluster::on_guild_scheduled_event_create |
Called when a new scheduled event is created.
const
reference of type guild_scheduled_event_create_t&, and returns void. event_router_t<guild_scheduled_event_delete_t> dpp::cluster::on_guild_scheduled_event_delete |
Called when a new scheduled event is deleted.
const
reference of type guild_scheduled_event_delete_t&, and returns void. event_router_t<guild_scheduled_event_update_t> dpp::cluster::on_guild_scheduled_event_update |
Called when a new scheduled event is updated.
const
reference of type guild_scheduled_event_update_t&, and returns void. event_router_t<guild_scheduled_event_user_add_t> dpp::cluster::on_guild_scheduled_event_user_add |
Called when a user is added to a scheduled event.
const
reference of type guild_scheduled_event_user_add_t&, and returns void. event_router_t<guild_scheduled_event_user_remove_t> dpp::cluster::on_guild_scheduled_event_user_remove |
Called when a user is removed from a scheduled event.
const
reference of type guild_scheduled_event_user_remove_t&, and returns void. event_router_t<guild_stickers_update_t> dpp::cluster::on_guild_stickers_update |
Called when new stickers are added to a guild.
The complete set of stickers is sent every time.
const
reference of type guild_stickers_update_t&, and returns void. event_router_t<guild_update_t> dpp::cluster::on_guild_update |
Called when details of a guild are updated.
const
reference of type guild_update_t&, and returns void. event_router_t<integration_create_t> dpp::cluster::on_integration_create |
Called when a new integration is attached to a guild by a user.
An integration is a connection to a guild of a user's associated accounts, e.g. youtube or twitch, for automatic assignment of roles etc.
const
reference of type integration_create_t&, and returns void. event_router_t<integration_delete_t> dpp::cluster::on_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.
const
reference of type integration_delete_t&, and returns void. event_router_t<integration_update_t> dpp::cluster::on_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.
const
reference of type integration_update_t&, and returns void. event_router_t<interaction_create_t> dpp::cluster::on_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
const
reference of type interaction_create_t&, and returns void.event_router_t<invite_create_t> dpp::cluster::on_invite_create |
Called when a new invite is created for a guild.
const
reference of type invite_create_t&, and returns void. event_router_t<invite_delete_t> dpp::cluster::on_invite_delete |
Called when an invite is deleted from a guild.
const
reference of type invite_delete_t&, and returns void. event_router_t<log_t> dpp::cluster::on_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.
const
reference of type log_t&, and returns void. Referenced by dpp::discord_client::log(), and main().
event_router_t<message_context_menu_t> dpp::cluster::on_message_context_menu |
Called when a user right-clicks or long-presses on a message, where a slash command is bound to the dpp::ctxm_message command type.
const
reference of type message_context_menu_t&, and returns void. event_router_t<message_create_t> dpp::cluster::on_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. For an example for caching of messages, please see Caching Messages
const
reference of type message_create_t&, and returns void. Referenced by event_handler_test().
event_router_t<message_delete_t> dpp::cluster::on_message_delete |
Called when a message is deleted.
The message has already been deleted from Discord when you receive this event.
const
reference of type message_delete_t&, and returns void. event_router_t<message_delete_bulk_t> dpp::cluster::on_message_delete_bulk |
Called when multiple messages are deleted from a channel or DM.
const
reference of type message_delete_bulk_t&, and returns void. event_router_t<message_poll_vote_add_t> dpp::cluster::on_message_poll_vote_add |
Called when a vote is added to a message poll.
const
reference of type message_poll_vote_add_t&, and returns void. event_router_t<message_poll_vote_remove_t> dpp::cluster::on_message_poll_vote_remove |
Called when a vote is removed from a message poll.
const
reference of type message_poll_vote_remove_t&, and returns void. event_router_t<message_reaction_add_t> dpp::cluster::on_message_reaction_add |
Called when a new reaction is added to a message.
const
reference of type message_reaction_add_t&, and returns void. event_router_t<message_reaction_remove_t> dpp::cluster::on_message_reaction_remove |
Called when a single reaction is removed from a message.
const
reference of type message_reaction_remove_t&, and returns void. event_router_t<message_reaction_remove_all_t> dpp::cluster::on_message_reaction_remove_all |
Called when all reactions are removed from a message.
const
reference of type message_reaction_remove_all_t&, and returns void. event_router_t<message_reaction_remove_emoji_t> dpp::cluster::on_message_reaction_remove_emoji |
Called when all reactions for a particular emoji are removed from a message.
const
reference of type message_reaction_remove_emoji_t&, and returns void. event_router_t<message_update_t> dpp::cluster::on_message_update |
Called when a message is updated (edited).
const
reference of type message_update_t&, and returns void. event_router_t<presence_update_t> dpp::cluster::on_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.
const
reference of type presence_update_t&, and returns void. event_router_t<ready_t> dpp::cluster::on_ready |
Called when a shard is connected and ready.
A set of cluster::on_guild_create events will follow this event.
const
reference of type ready_t&, and returns void. event_router_t<resumed_t> dpp::cluster::on_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.
const
reference of type resumed_t&, and returns void. event_router_t<select_click_t> dpp::cluster::on_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.
const
reference of type select_click_t&, and returns void. event_router_t<slashcommand_t> dpp::cluster::on_slashcommand |
Called when a slash command is issued.
Only dpp::ctxm_chat_input types of interaction are routed to this event. For an example of this in action please see Using Slash Commands and Interactions
const
reference of type slashcommand_t&, and returns void. event_router_t<stage_instance_create_t> dpp::cluster::on_stage_instance_create |
Called when a new stage instance is created on a stage channel.
const
reference of type stage_instance_create_t&, and returns void. event_router_t<stage_instance_delete_t> dpp::cluster::on_stage_instance_delete |
Called when an existing stage instance is deleted from a stage channel.
const
reference of type stage_instance_delete_t&, and returns void. event_router_t<stage_instance_update_t> dpp::cluster::on_stage_instance_update |
Called when a stage instance is updated.
const
reference of type stage_instance_update_t&, and returns void. event_router_t<thread_create_t> dpp::cluster::on_thread_create |
Called when a thread is created.
Note that threads are not cached by D++, but a list of thread IDs is accessible in a guild object
const
reference of type thread_create_t&, and returns void. event_router_t<thread_delete_t> dpp::cluster::on_thread_delete |
Called when a thread is deleted.
const
reference of type thread_delete_t&, and returns void. event_router_t<thread_list_sync_t> dpp::cluster::on_thread_list_sync |
Called when thread list is synced (upon gaining access to a channel).
Note that threads are not cached by D++, but a list of thread IDs is accessible in a guild object
const
reference of type thread_list_sync_t&, and returns void. event_router_t<thread_member_update_t> dpp::cluster::on_thread_member_update |
Called when current user's thread member object is updated.
const
reference of type thread_member_update_t&, and returns void. event_router_t<thread_members_update_t> dpp::cluster::on_thread_members_update |
Called when a thread's member list is updated (without GUILD_MEMBERS intent, is only called for current user)
const
reference of type thread_members_update_t&, and returns void. event_router_t<thread_update_t> dpp::cluster::on_thread_update |
Called when a thread is updated.
const
reference of type thread_update_t&, and returns void. event_router_t<typing_start_t> dpp::cluster::on_typing_start |
Called when a user is typing on a channel.
const
reference of type typing_start_t&, and returns void. event_router_t<user_context_menu_t> dpp::cluster::on_user_context_menu |
Called when a user right-clicks or long-presses on a user, where a slash command is bound to the dpp::ctxm_user command type.
const
reference of type user_context_menu_t&, and returns void. event_router_t<user_update_t> dpp::cluster::on_user_update |
Called when a user is updated.
This is separate to cluster::on_guild_member_update and includes things such as an avatar change, username change, discriminator change or change in subscription status for nitro.
const
reference of type user_update_t&, and returns void. event_router_t<voice_buffer_send_t> dpp::cluster::on_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.
const
reference of type voice_buffer_send_t&, and returns void. event_router_t<voice_client_disconnect_t> dpp::cluster::on_voice_client_disconnect |
on voice client disconnect event
const
reference of type voice_client_disconnect_t&, and returns void. Referenced by dpp::discord_voice_client::handle_frame().
event_router_t<voice_client_speaking_t> dpp::cluster::on_voice_client_speaking |
on voice client speaking event
const
reference of type voice_client_speaking_t&, and returns void. Referenced by dpp::discord_voice_client::handle_frame().
event_router_t<voice_ready_t> dpp::cluster::on_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.
const
reference of type voice_ready_t&, and returns void. Referenced by dpp::discord_voice_client::handle_frame().
event_router_t<voice_receive_t> dpp::cluster::on_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.
const
reference of type voice_receive_t&, and returns void. event_router_t<voice_receive_t> dpp::cluster::on_voice_receive_combined |
Called when new audio data is received, combined and mixed for all speaking users.
const
reference of type voice_receive_t&, and returns void. event_router_t<voice_server_update_t> dpp::cluster::on_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.
const
reference of type voice_server_update_t&, and returns void. event_router_t<voice_state_update_t> dpp::cluster::on_voice_state_update |
on voice state update event
const
reference of type voice_state_update_t&, and returns void. event_router_t<voice_track_marker_t> dpp::cluster::on_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.
const
reference of type voice_track_marker_t&, and returns void. event_router_t<voice_user_talking_t> dpp::cluster::on_voice_user_talking |
Called when a user is talking on a voice channel.
const
reference of type voice_user_talking_t&, and returns void. event_router_t<webhooks_update_t> dpp::cluster::on_webhooks_update |
Called when the webhooks for a guild are updated.
const
reference of type webhooks_update_t&, and returns void. double dpp::cluster::rest_ping |
REST latency (HTTPS ping) in seconds.
std::condition_variable dpp::cluster::terminating |
Condition variable notified when the cluster is terminating.
std::string dpp::cluster::token |
Current bot token for all shards on this cluster and all commands sent via HTTP.
Referenced by co_execute_webhook(), co_get_voice_regions(), co_guild_command_edit(), co_guild_command_edit_permissions(), co_guild_command_get(), co_guild_command_get_permissions(), co_guild_commands_get(), co_interaction_followup_create(), co_interaction_response_create(), co_interaction_response_edit(), co_interaction_response_get_original(), execute_webhook_sync(), get_voice_regions_sync(), guild_command_edit_permissions_sync(), guild_command_edit_sync(), guild_command_get_permissions_sync(), guild_command_get_sync(), guild_commands_get_sync(), interaction_followup_create_sync(), interaction_response_create_sync(), interaction_response_edit_sync(), and interaction_response_get_original_sync().
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.