D++ (DPP)
C++ Discord API Bot Library
dpp Namespace Reference

The main namespace for D++ functions. classes and types. More...

Namespaces

namespace  cache_policy
 Contains a set of predefined cache policies for use when constructing a dpp::cluster.
 
namespace  colors
 predefined color constants.
 
namespace  dave
 
namespace  detail
 Implementation details for internal use only.
 
namespace  embed_type
 Represents possible values for the dpp::embed type field. These are loosely defined by the API docs and do not influence how the client renders embeds.
 
namespace  events
 The events namespace holds the internal event handlers for each websocket event. These are handled internally and also dispatched to the user code if the event is hooked.
 
namespace  unicode_emoji
 Emoji unicodes.
 
namespace  utility
 Utility helper functions, generally for logging, running programs, time/date manipulation, etc.
 

Classes

struct  active_thread_info
 A thread alongside the bot's optional thread_member object tied to it. More...
 
class  activity
 An activity is a representation of what a user is doing. It might be a game, or a website, or a movie. Whatever. More...
 
struct  activity_assets
 An activity asset are the images and the hover text displayed in the rich presence. More...
 
struct  activity_button
 An activity button is a custom button shown in the rich presence. Can be to join a game or whatever. More...
 
struct  activity_party
 Information for the current party of the player. More...
 
struct  activity_secrets
 Secrets for Rich Presence joining and spectating. More...
 
class  address_t
 Represents an IPv4 address for use with socket functions such as bind(). More...
 
class  app_team
 Represents a team of users who maintain a bot/application. More...
 
class  application
 The application class represents details of a bot application. More...
 
struct  application_install_params
 Represents the settings for the bot/application's in-app authorization link. More...
 
class  application_role_connection
 The application role connection that an application has attached to a user. More...
 
class  application_role_connection_metadata
 Application Role Connection Metadata. Represents a role connection metadata for an dpp::application. More...
 
class  async
 A co_await-able object handling an API call in parallel with the caller. More...
 
struct  async_dummy
 
struct  attachment
 Represents an attachment in a dpp::message. More...
 
class  audio_mixer
 A class for audio mixing operations using x64 instructions. More...
 
struct  audit_change
 Defines audit log changes. More...
 
struct  audit_entry
 An individual audit log entry. More...
 
struct  audit_extra
 Extra information for an audit log entry. More...
 
class  auditlog
 The auditlog class represents the audit log entries of a guild. More...
 
struct  autocomplete_interaction
 An auto complete interaction. More...
 
struct  autocomplete_t
 Discord requests that we fill a list of auto completion choices for a command option. More...
 
struct  automod_action
 Represents an automod action. More...
 
struct  automod_metadata
 Metadata associated with an automod action. Different fields are relevant based on the value of dpp::automod_rule::trigger_type. More...
 
class  automod_rule
 Represents an automod rule. More...
 
struct  automod_rule_create_t
 Create automod rule. More...
 
struct  automod_rule_delete_t
 Delete automod rule. More...
 
struct  automod_rule_execute_t
 Execute/trigger automod rule. More...
 
struct  automod_rule_update_t
 Update automod rule. More...
 
class  awaitable
 Generic awaitable class, represents a future value that can be co_await-ed on. More...
 
struct  awaitable_dummy
 
class  ban
 The ban class represents a ban on a guild. More...
 
class  basic_awaitable
 
class  basic_promise
 Generic promise class, represents the owning potion of an asynchronous value. More...
 
class  bignumber
 An arbitrary length integer number. Officially, the Discord documentation says that permission values can be any arbitrary number of digits. At time of writing there are only 50 bits of permissions, but this is set to grow larger and potentially past 64 bits. They will continue to send this data as a huge single integer at that point, because this is obviously sensible. /s. More...
 
struct  bucket_t
 A rate limit bucket. The library builds one of these for each endpoint. More...
 
struct  button_click_t
 Click on button. More...
 
class  cache
 A cache object maintains a cache of dpp::managed objects. More...
 
class  cache_exception
 Represents invalid access to dpp's cache or its members, which may or may not exist. More...
 
struct  cache_policy_t
 Represents the caching policy of the cluster. More...
 
class  channel
 A definition of a discord channel. There are one of these for every channel type except threads. Threads are special snowflakes. Get it? A Discord pun. Hahaha. .... I'll get my coat. More...
 
class  channel_collector
 Channel collector. Collects channels during a set timeframe and returns them in a list via the completed() method. More...
 
struct  channel_create_t
 Create channel. More...
 
struct  channel_delete_t
 Delete channel. More...
 
struct  channel_pins_update_t
 Channel pins update. More...
 
struct  channel_update_t
 Update channel. More...
 
class  cluster
 The cluster class represents a group of shards and a command queue for sending and receiving commands from discord via HTTP. You should usually instantiate a cluster object at the very least to make use of the library. More...
 
class  collected_reaction
 Represents a reaction. Can be filled for use in a collector. More...
 
class  collector
 Collects objects from events during a specified time period. More...
 
struct  command_data_option
 Values in the command interaction. These are the values specified by the user when actually issuing the command on a channel or in DM. More...
 
struct  command_info_t
 Represents the details of a command added to the command handler class. More...
 
struct  command_interaction
 Details of a command within an interaction. This subobject represents the application command associated with the interaction. More...
 
struct  command_option
 Each command option is a command line parameter. It can have a type (see dpp::command_option_type), a name, a description, can be required or optional, and can have zero or more choices (for multiple choice), plus options. Adding options acts like sub-commands and can contain more options. More...
 
struct  command_option_choice
 This struct represents choices in a multiple choice option for a command parameter. It has both a string name, and a value parameter which is a variant, meaning it can hold different potential types (see dpp::command_value) that you can retrieve with std::get(). More...
 
class  command_permission
 Application command permissions allow you to enable or disable commands for specific users or roles within a guild. More...
 
struct  command_resolved
 Resolved snowflake ids to users, guild members, roles and channels. You can use the interaction::get_resolved_* methods to easily get a resolved set. More...
 
struct  command_source
 Represents the sending source of a command. This is passed to any command handler and should be passed back to commandhandler::reply(), allowing the reply method to route any replies back to the origin, which may be a slash command or a message. Both require different response facilities but we want this to be transparent if you use the command handler class. More...
 
class  component
 Represents the component object. A component is a clickable button or drop down list within a discord message, where the buttons emit on_button_click events when the user interacts with them. More...
 
struct  component_default_value
 A Default value structure for components. More...
 
struct  component_interaction
 A button click for a button component. More...
 
struct  confirmation
 Confirmation object represents any true or false simple REST request. More...
 
struct  confirmation_callback_t
 The results of a REST call wrapped in a convenient struct. More...
 
class  connection
 The connection object that the user has attached. More...
 
class  connection_exception
 Represents an error establishing or maintaining a connection. More...
 
struct  context_menu_t
 Base class for context menu interactions, e.g. right click on user or message. More...
 
class  coroutine
 Base type for a coroutine, starts on co_await. More...
 
struct  coroutine_dummy
 
struct  dave_binary_header_t
 DAVE E2EE Binary frame header. More...
 
class  discord_client
 Implements a discord client. Each discord_client connects to one shard and derives from a websocket client. More...
 
class  discord_voice_client
 Implements a discord voice connection. Each discord_voice_client connects to one voice channel and derives from a websocket client. More...
 
struct  dns_cache_entry
 Represents a cached DNS result. Used by the ssl_client class to store cached copies of dns lookups. More...
 
class  dtemplate
 Represents a guild template. More...
 
struct  embed
 A rich embed for display within a dpp::message. More...
 
struct  embed_author
 Author within a dpp::embed object. More...
 
struct  embed_field
 A dpp::embed may contain zero or more fields. More...
 
struct  embed_footer
 A footer in a dpp::embed. More...
 
struct  embed_image
 An video, image or thumbnail in a dpp::embed. More...
 
struct  embed_provider
 Embed provider in a dpp::embed. Received from discord but cannot be sent. More...
 
class  emoji
 Represents an emoji for a dpp::guild. More...
 
class  entitlement
 A definition of a discord entitlement. More...
 
struct  entitlement_create_t
 Delete stage instance. More...
 
struct  entitlement_delete_t
 Delete stage instance. More...
 
struct  entitlement_update_t
 Delete stage instance. More...
 
struct  error_detail
 The details of a field in an error response. More...
 
struct  error_info
 The full details of an error from a REST response. More...
 
struct  etf_buffer
 Represents a buffer of bytes being encoded into ETF. More...
 
class  etf_parser
 The etf_parser class can serialise and deserialise ETF (Erlang Term Format) into and out of an nlohmann::json object, so that layers above the websocket don't have to be any different for handling ETF. More...
 
struct  event_dispatch_t
 Base event parameter struct. Each event you receive from the library will have its parameter derived from this class. The class contains the raw event data, and a pointer to the current shard's dpp::discord_client object. You can also use this object to cancel the current event, meaning that any listeners after yours do not get notified of the current event if you call it. More...
 
struct  event_entities
 Entities for the event. More...
 
struct  event_member
 Represents a guild member/user who has registered interest in an event. More...
 
class  event_router_t
 Handles routing of an event to multiple listeners. Multiple listeners may attach to the event_router_t by means of operator(). Passing a lambda into operator() attaches to the event. More...
 
class  exception
 The dpp::exception class derives from std::exception and supports some other ways of passing in error details such as via std::string. More...
 
class  file_exception
 Represents an error reading or writing to a file. More...
 
struct  form_submit_t
 On form submitted. More...
 
struct  forum_tag
 Represents a tag that is able to be applied to a thread in a forum or media channel. More...
 
struct  gateway
 Represents the various information from the 'get gateway bot' api call. More...
 
class  guild
 Represents a guild on Discord (AKA a server) More...
 
struct  guild_audit_log_entry_create_t
 Guild audit log entry create. More...
 
struct  guild_ban_add_t
 Guild ban add. More...
 
struct  guild_ban_remove_t
 Guild ban remove. More...
 
class  guild_command_permissions
 Returned when fetching the permissions for a command in a guild. More...
 
struct  guild_create_t
 Create guild. More...
 
struct  guild_delete_t
 Delete guild. More...
 
struct  guild_emojis_update_t
 Guild emojis update. More...
 
struct  guild_integrations_update_t
 Guild integrations update. More...
 
struct  guild_join_request_delete_t
 Guild join request delete (user declined membership screening) More...
 
class  guild_member
 Represents dpp::user membership upon a dpp::guild. This contains the user's nickname, guild roles, and any other guild-specific flags. More...
 
struct  guild_member_add_t
 Guild member add. More...
 
struct  guild_member_remove_t
 Guild member remove. More...
 
struct  guild_member_update_t
 Guild member update. More...
 
struct  guild_members_chunk_t
 Guild members chunk. More...
 
struct  guild_role_create_t
 Guild role create. More...
 
struct  guild_role_delete_t
 Guild role delete. More...
 
struct  guild_role_update_t
 Guild role update. More...
 
struct  guild_scheduled_event_create_t
 Create scheduled event. More...
 
struct  guild_scheduled_event_delete_t
 Delete scheduled event. More...
 
struct  guild_scheduled_event_update_t
 Create scheduled event. More...
 
struct  guild_scheduled_event_user_add_t
 Add user to scheduled event. More...
 
struct  guild_scheduled_event_user_remove_t
 Delete user from scheduled event. More...
 
struct  guild_stickers_update_t
 Update guild stickers. More...
 
struct  guild_update_t
 Guild update. More...
 
class  guild_widget
 Represents a guild widget, simple web widget of member list. More...
 
struct  http_connect_info
 Represents a HTTP scheme, hostname and port split into parts for easy use in https_client. More...
 
class  http_request
 A HTTP request. More...
 
struct  http_request_completion_t
 The result of any HTTP request. Contains the headers, vital rate limit figures, and returned request body. More...
 
class  https_client
 Implements a HTTPS socket client based on the SSL client. More...
 
class  in_thread
 Represents a thread in the thread pool handling requests to HTTP(S) servers. There are several of these, the total defined by a constant in queues.cpp, and each one will always receive requests for the same rate limit bucket based on its endpoint portion of the url. This makes rate limit handling reliable and easy to manage. Each of these also has its own mutex, so that requests are less likely to block while waiting for internal containers to be usable. More...
 
class  integration
 Represents an integration on a guild, e.g. a connection to twitch. More...
 
struct  integration_account
 The account information for an integration. More...
 
struct  integration_app
 An application that has been integrated. More...
 
struct  integration_configuration
 Configuration object for an app installation. More...
 
struct  integration_create_t
 Integration create. More...
 
struct  integration_delete_t
 Integration delete. More...
 
struct  integration_update_t
 Integration update. More...
 
class  interaction
 An interaction represents a user running a command and arrives via the dpp::cluster::on_interaction_create event. This is further split into the events on_form_submit, on_slashcommand, on_user_context_menu, on_button_click, on_select_menu, etc. More...
 
struct  interaction_create_t
 Create interaction. More...
 
struct  interaction_metadata_type
 Metadata about the interaction, including the source of the interaction and relevant server and user IDs. More...
 
struct  interaction_modal_response
 Represents a modal dialog box response to an interaction. More...
 
struct  interaction_response
 A response to an interaction, used to reply to a command and initiate a message, which can be hidden from others (ephemeral) or visible to all. More...
 
class  invalid_token_exception
 Represents an attempt to construct a cluster with an invalid bot token. More...
 
class  invite
 Represents an invite to a discord guild or channel. More...
 
struct  invite_create_t
 Invite create. More...
 
struct  invite_delete_t
 Invite delete. More...
 
class  job
 Extremely light coroutine object designed to send off a coroutine to execute on its own. Can be used in conjunction with coroutine events via event routers, or on its own. More...
 
struct  job_dummy
 
struct  json_interface
 Represents an interface for an object that can optionally implement functions for converting to and from nlohmann::json. The methods are only present if the actual object also has those methods. More...
 
class  length_exception
 Represents invalid length of argument being passed to a function. More...
 
struct  log_t
 Log messages. More...
 
class  logic_exception
 Represents an error in logic, e.g. you asked the library to do something the Discord API does not support. More...
 
class  managed
 The managed class is the base class for various types that can be stored in a cache that are identified by a dpp::snowflake id. More...
 
struct  message
 Represents messages sent and received on Discord. More...
 
class  message_collector
 Message collector. Collects messages during a set timeframe and returns them in a list via the completed() method. More...
 
struct  message_context_menu_t
 Event parameter for context menu interactions for messages. More...
 
struct  message_create_t
 Create message. More...
 
struct  message_delete_bulk_t
 Message delete bulk. More...
 
struct  message_delete_t
 Message Deleted. More...
 
struct  message_file_data
 The data for a file attached to a message. More...
 
struct  message_poll_vote_add_t
 Message poll vote add. More...
 
struct  message_poll_vote_remove_t
 Message poll vote remove. More...
 
struct  message_reaction_add_t
 Message reaction add. More...
 
struct  message_reaction_remove_all_t
 Message remove all reactions. More...
 
struct  message_reaction_remove_emoji_t
 Message remove emoji. More...
 
struct  message_reaction_remove_t
 Message reaction remove. More...
 
struct  message_snapshot
 
struct  message_update_t
 Message update. More...
 
class  moveable_promise
 Generic promise class, represents the owning potion of an asynchronous value. More...
 
struct  moving_averager
 
struct  multipart_content
 Represents a multipart mime body and the correct top-level mime type If a non-multipart request is passed in, this is represented as a plain body and the application/json mime type. More...
 
struct  onboarding
 Represents a guild's onboarding flow. More...
 
struct  onboarding_prompt
 Represents an onboarding prompt. More...
 
struct  onboarding_prompt_option
 Represents an onboarding prompt option. More...
 
class  oneshot_timer
 Trigger a timed event once. The provided callback is called only once. More...
 
struct  param_info
 Details of a command parameter used in registration. Note that for non-slash commands optional parameters can only be at the end of the list of parameters. More...
 
class  parse_exception
 Represents inability to parse data, usually caused by malformed JSON or ETF. More...
 
struct  partial_emoji
 An emoji reference for a component (select menus included) or a poll. More...
 
class  permission
 Represents a permission bitmask (refer to enum dpp::permissions) which are held in an uint64_t. More...
 
struct  permission_overwrite
 Channel permission overwrites. More...
 
struct  poll
 Represents a poll. More...
 
struct  poll_answer
 Represents an answer in a poll. More...
 
struct  poll_media
 Structure representing a poll media, for example the poll question or a possible poll answer. More...
 
struct  poll_results
 Represents the results of a poll. More...
 
class  presence
 Represents user presence, e.g. what game they are playing and if they are online. More...
 
struct  presence_update_t
 Presence update. More...
 
struct  prune
 Defines a request to count prunable users, or start a prune operation. More...
 
struct  raii_socket
 Allocates a dpp::socket, closing it on destruction. More...
 
struct  reaction
 Represents a reaction to a dpp::message. More...
 
class  reaction_collector
 Reaction collector. Collects message reactions during a set timeframe and returns them in a list via the completed() method. More...
 
struct  ready_t
 Session ready. More...
 
class  request_queue
 The request_queue class manages rate limits and marshalls HTTP requests that have been built as http_request objects. More...
 
struct  resolved_user
 dpp::resolved_user contains both a dpp::guild_member and a dpp::user. The user can be used to obtain in-depth user details such as if they are nitro, and the guild member information to check their roles on a guild etc. The Discord API provides both if a parameter is a user ping, so we offer both in a combined structure. More...
 
class  rest_exception
 Represents an error on a REST API call, e.g. a HTTPS request. More...
 
struct  resumed_t
 Session resumed. More...
 
class  role
 Represents a role within a dpp::guild. Roles are combined via logical OR of the permission bitmasks, then channel-specific overrides can be applied on top, deny types apply a logic NOT to the bit mask, and allows apply a logical OR. More...
 
class  role_collector
 Role collector. Collects guild roles during a set timeframe and returns them in a list via the completed() method. More...
 
struct  scheduled_event
 A scheduled event. More...
 
class  scheduled_event_collector
 Scheduled event collector. Collects messages during a set timeframe and returns them in a list via the completed() method. More...
 
struct  select_click_t
 Click on select. More...
 
struct  select_option
 An option for a select component. More...
 
class  sku
 A definition of a discord SKU. More...
 
class  slashcommand
 Represents an application command, created by your bot either globally, or on a guild. More...
 
struct  slashcommand_t
 User has issued a slash command. More...
 
class  snowflake
 A container for a 64 bit unsigned value representing many things on discord. This value is known in distributed computing as a snowflake value. More...
 
class  ssl_client
 Implements a simple non-blocking SSL stream client. More...
 
struct  stage_instance
 A stage instance. Stage instances are like a conference facility, with moderators/speakers and listeners. More...
 
struct  stage_instance_create_t
 Create stage instance. More...
 
struct  stage_instance_delete_t
 Delete stage instance. More...
 
struct  stage_instance_update_t
 Update stage instance. More...
 
struct  sticker
 Represents stickers received in messages. More...
 
struct  sticker_pack
 Represents a sticker pack (the built in groups of stickers that all nitro users get to use) More...
 
class  task
 A coroutine task. It starts immediately on construction and can be co_await-ed, making it perfect for parallel coroutines returning a value. More...
 
class  task_cancelled_exception
 Represents the cancellation of a task. Will be thrown to the awaiter of a cancelled task. More...
 
struct  task_dummy
 
class  team_member
 Represents a team member on a team who maintain a bot/application. More...
 
class  thread
 A definition of a discord thread. A thread is a superset of a channel. Not to be confused with std::thread! More...
 
class  thread_collector
 Thread collector. Collects threads during a set timeframe and returns them in a list via the completed() method. More...
 
struct  thread_create_t
 Thread Create. More...
 
struct  thread_delete_t
 Thread Delete. More...
 
struct  thread_list_sync_t
 Thread List Sync. More...
 
struct  thread_member
 represents membership of a user with a thread More...
 
struct  thread_member_update_t
 Thread Member Update. More...
 
struct  thread_members_update_t
 Thread Members Update. More...
 
struct  thread_metadata
 metadata for threads More...
 
struct  thread_update_t
 Thread Update. More...
 
class  timed_listener
 A timed_listener is a way to temporarily attach to an event for a specific timeframe, then detach when complete. A lambda may also be optionally called when the timeout is reached. Destructing the timed_listener detaches any attached event listeners, and cancels any created timers, but does not call any timeout lambda. More...
 
struct  timer_t
 Used internally to store state of active timers. More...
 
struct  typing_start_t
 Typing start. More...
 
class  user
 Represents a user on discord. May or may not be a member of a dpp::guild. More...
 
struct  user_context_menu_t
 Event parameter for context menu interactions for users. More...
 
class  user_identified
 A user with additional fields only available via the oauth2 identify scope. These are not included in dpp::user as additional scopes are needed to fetch them which bots do not normally have. More...
 
struct  user_update_t
 User update. More...
 
struct  voice_buffer_send_t
 voice buffer send More...
 
struct  voice_client_disconnect_t
 voice client disconnect event More...
 
struct  voice_client_platform_t
 voice client platform type notification event More...
 
struct  voice_client_speaking_t
 voice client speaking event More...
 
class  voice_exception
 Represents an error with voice processing. More...
 
struct  voice_out_packet
 An opus-encoded RTP packet to be sent out to a voice channel. More...
 
struct  voice_ready_t
 voice ready More...
 
struct  voice_receive_t
 voice receive packet More...
 
struct  voice_server_update_t
 Voice server update. More...
 
struct  voice_state_update_t
 Voice state update. More...
 
struct  voice_track_marker_t
 Voice state update. More...
 
class  voiceconn
 Represents a connection to a voice channel. A client can only connect to one voice channel per guild at a time, so these are stored in a map in the dpp::discord_client keyed by guild_id. More...
 
class  voiceregion
 Represents a voice region on discord. More...
 
class  voicestate
 Represents the voice state of a user on a guild These are stored in the dpp::guild object, and accessible there, or via dpp::channel::get_voice_members. More...
 
class  webhook
 Represents a discord webhook. More...
 
struct  webhooks_update_t
 Webhooks update. More...
 
class  websocket_client
 Implements a websocket client based on the SSL client. More...
 
struct  welcome_channel
 Defines a channel on a server's welcome screen. More...
 
struct  welcome_screen
 Defines a server's welcome screen. More...
 
class  when_any
 Experimental class to co_await on a bunch of awaitable objects, resuming when the first one completes. On completion, returns a result object that contains the index of the awaitable that finished first. A user can call result::index() and result::get<N>() on the result object to get the result, similar to std::variant. More...
 

Concepts

concept  awaitable_type
 Concept to check if a type can be used with co_await.
 

Typedefs

typedef std::variant< std::monostate, std::string, int64_t, bool, snowflake, double > command_value
 This type is a variant that can hold any of the potential native data types represented by the enum dpp::command_option_type. It is used in interactions. More...
 
typedef std::variant< std::monostate, int64_t, double > command_option_range
 A minimum or maximum value/length for dpp::co_number, dpp::co_integer and dpp::co_string types of a dpp::command_option. The int64_t is for the integer range or string length that can be entered. The double is for the decimal range that can be entered. More...
 
typedef std::unordered_map< snowflake, slashcommandslashcommand_map
 A group of application slash commands. More...
 
typedef std::unordered_map< snowflake, guild_command_permissionsguild_command_permissions_map
 A group of guild command permissions. More...
 
typedef std::unordered_map< snowflake, applicationapplication_map
 A group of applications. More...
 
typedef std::unordered_map< snowflake, automod_ruleautomod_rule_map
 
typedef std::unordered_map< snowflake, banban_map
 A group of bans. The key is the user ID. More...
 
typedef std::unordered_map< snowflake, channelchannel_map
 A group of channels. More...
 
typedef dpp::collector< dpp::channel_create_t, dpp::channelchannel_collector_t
 Template type for base class of channel collector. More...
 
typedef dpp::collector< dpp::thread_create_t, dpp::threadthread_collector_t
 Template type for base class of thread collector. More...
 
typedef dpp::collector< dpp::guild_role_create_t, dpp::rolerole_collector_t
 Template type for base class of role collector. More...
 
typedef dpp::collector< dpp::guild_scheduled_event_create_t, dpp::scheduled_eventscheduled_event_collector_t
 Template type for base class of scheduled event collector. More...
 
typedef dpp::collector< dpp::message_create_t, dpp::messagemessage_collector_t
 Template type for base class of message collector. More...
 
typedef dpp::collector< dpp::message_reaction_add_t, dpp::collected_reactionreaction_collector_t
 Template type for base class of message reaction collector. More...
 
typedef std::variant< std::monostate, std::string, dpp::role, dpp::channel, dpp::resolved_user, int64_t, bool, double > command_parameter
 Represents a received parameter. We use variant so that multiple non-related types can be contained within. More...
 
typedef std::vector< std::pair< std::string, param_info > > parameter_registration_t
 Parameter list used during registration. Note that use of vector/pair is important here to preserve parameter order, as opposed to unordered_map (which doesn't guarantee any order at all) and std::map, which reorders keys alphabetically. More...
 
typedef std::vector< std::pair< std::string, command_parameter > > parameter_list_t
 Parameter list for a called command. See dpp::parameter_registration_t for an explanation as to why vector is used. More...
 
typedef std::function< void(const std::string &, const parameter_list_t &, command_source)> command_handler
 The function definition for a command handler. Expects a command name string, and a list of command parameters. More...
 
template<typename T >
using promise = moveable_promise< T >
 
using privacy_code_callback_t = std::function< void(const std::string &)>
 A callback for obtaining a user's privacy code. The privacy code is returned as the parameter to the function. More...
 
using command_completion_event_t = std::function< void(const confirmation_callback_t &)>
 A function used as a callback for any REST based command. More...
 
using dns_cache_t = std::unordered_map< std::string, dns_cache_entry * >
 Cache container type. More...
 
typedef std::unordered_map< snowflake, dtemplatedtemplate_map
 A container of invites. More...
 
typedef std::unordered_map< snowflake, emojiemoji_map
 Group of emojis. More...
 
typedef std::unordered_map< snowflake, entitlemententitlement_map
 Group of entitlements. More...
 
typedef size_t event_handle
 A returned event handle for an event which was attached. More...
 
typedef std::unordered_map< snowflake, guild_membermembers_container
 Guild members container. More...
 
typedef std::unordered_map< snowflake, guildguild_map
 A container of guilds. More...
 
typedef std::unordered_map< snowflake, guild_memberguild_member_map
 A container of guild members. More...
 
typedef std::multimap< std::string, std::string > http_headers
 Request headers. More...
 
typedef std::unordered_map< snowflake, integrationintegration_map
 A group of integrations. More...
 
typedef std::unordered_map< snowflake, connectionconnection_map
 A group of connections. More...
 
typedef std::unordered_map< std::string, inviteinvite_map
 A container of invites. More...
 
using json = nlohmann::json
 
using component_emoji = partial_emoji
 An emoji for a component. Alias to partial_emoji, for backwards compatibility. More...
 
typedef std::unordered_map< snowflake, messagemessage_map
 A group of messages. More...
 
typedef std::unordered_map< snowflake, stickersticker_map
 A group of stickers. More...
 
typedef std::unordered_map< snowflake, sticker_packsticker_pack_map
 A group of sticker packs. More...
 
using role_permissions = permissions
 Represents the various discord permissions. More...
 
typedef std::unordered_map< snowflake, presencepresence_map
 A container of presences. More...
 
typedef std::function< void(const http_request_completion_t &)> http_completion_event
 Results of HTTP requests are called back to these std::function types. More...
 
typedef std::map< uint32_t, class discord_client * > shard_list
 A list of shards. More...
 
typedef std::variant< active_threads, application_role_connection, application_role_connection_metadata_list, confirmation, message, message_map, user, user_identified, user_map, guild_member, guild_member_map, channel, channel_map, thread_member, thread_member_map, guild, guild_map, guild_command_permissions, guild_command_permissions_map, role, role_map, invite, invite_map, dtemplate, dtemplate_map, emoji, emoji_map, ban, ban_map, voiceregion, voiceregion_map, voicestate, integration, integration_map, webhook, webhook_map, prune, guild_widget, gateway, interaction, interaction_response, auditlog, slashcommand, slashcommand_map, stage_instance, sticker, sticker_map, sticker_pack, sticker_pack_map, application, application_map, connection, connection_map, thread, thread_map, scheduled_event, scheduled_event_map, event_member, event_member_map, automod_rule, automod_rule_map, onboarding, welcome_screen, entitlement, entitlement_map, sku, sku_mapconfirmable_t
 A container for types that can be returned for a REST API call. More...
 
typedef std::function< void(json &, const http_request_completion_t &)> json_encode_t
 Automatically JSON encoded HTTP result. More...
 
typedef std::unordered_map< snowflake, rolerole_map
 A group of roles. More...
 
typedef std::vector< application_role_connection_metadataapplication_role_connection_metadata_list
 A group of dpp::application_role_connection_metadata objects. More...
 
typedef std::unordered_map< snowflake, scheduled_eventscheduled_event_map
 A group of scheduled events. More...
 
typedef std::unordered_map< snowflake, event_memberevent_member_map
 A group of scheduled event members. More...
 
typedef std::unordered_map< snowflake, skusku_map
 Group of SKUs. More...
 
using socket = int
 Represents a socket file descriptor. This is used to ensure parity between windows and unix-like systems. More...
 
typedef std::function< dpp::socket()> socket_callback_t
 A callback for socket status. More...
 
typedef std::function< void()> socket_notification_t
 A socket notification callback. More...
 
typedef std::unordered_map< snowflake, stage_instancestage_instance_map
 A group of stage instances. More...
 
typedef std::unordered_map< snowflake, thread_memberthread_member_map
 A group of thread member objects. the key is the user_id of the dpp::thread_member. More...
 
typedef std::unordered_map< snowflake, threadthread_map
 A group of threads. More...
 
using active_threads = std::map< snowflake, active_thread_info >
 A map of threads alongside optionally the thread_member tied to the bot if it is in the thread. The map's key is the thread id. Returned from the cluster::threads_get_active method. More...
 
typedef size_t timer
 Represents a timer handle. Returned from cluster::start_timer and used by cluster::stop_timer. This is obtained from a simple incrementing value, internally. More...
 
typedef std::function< void(timer)> timer_callback_t
 The type for a timer callback. More...
 
typedef std::multimap< time_t, timer_t * > timer_next_t
 A map of timers, ordered by earliest first so that map::begin() is always the soonest to be due. More...
 
typedef std::unordered_map< timer, timer_t * > timer_reg_t
 A map of timers stored by handle. More...
 
typedef std::unordered_map< snowflake, useruser_map
 A group of users. More...
 
typedef std::unordered_map< std::string, voiceregionvoiceregion_map
 A group of voice regions. More...
 
typedef std::unordered_map< std::string, voicestatevoicestate_map
 
typedef std::unordered_map< snowflake, webhookwebhook_map
 A group of webhooks. More...
 

Enumerations

enum  command_option_type : uint8_t {
  co_sub_command = 1 , co_sub_command_group = 2 , co_string = 3 , co_integer = 4 ,
  co_boolean = 5 , co_user = 6 , co_channel = 7 , co_role = 8 ,
  co_mentionable = 9 , co_number = 10 , co_attachment = 11
}
 Represents command option types. These are the possible parameter value types. More...
 
enum  interaction_response_type {
  ir_pong = 1 , ir_channel_message_with_source = 4 , ir_deferred_channel_message_with_source = 5 , ir_deferred_update_message = 6 ,
  ir_update_message = 7 , ir_autocomplete_reply = 8 , ir_modal_dialog = 9 , ir_premium_required = 10
}
 Response types when responding to an interaction within on_interaction_create. More...
 
enum  interaction_type {
  it_ping = 1 , it_application_command = 2 , it_component_button = 3 , it_autocomplete = 4 ,
  it_modal_submit = 5
}
 
enum  interaction_context_type { itc_guild = 0 , itc_bot_dm = 1 , itc_private_channel = 2 }
 
enum  slashcommand_contextmenu_type { ctxm_none = 0 , ctxm_chat_input = 1 , ctxm_user = 2 , ctxm_message = 3 }
 Right-click context menu types. More...
 
enum  command_permission_type { cpt_role = 1 , cpt_user = 2 }
 type of permission in the dpp::command_permission class More...
 
enum  team_member_status : uint8_t { tms_invited = 1 , tms_accepted = 2 }
 status of a member of a team who maintain a bot/application More...
 
enum  application_flags : uint32_t {
  apf_application_automod_rule_create_badge = (1 << 6) , apf_gateway_presence = (1 << 12) , apf_gateway_presence_limited = (1 << 13) , apf_gateway_guild_members = (1 << 14) ,
  apf_gateway_guild_members_limited = (1 << 15) , apf_verification_pending_guild_limit = (1 << 16) , apf_embedded = (1 << 17) , apf_gateway_message_content = (1 << 18) ,
  apf_gateway_message_content_limited = (1 << 19) , apf_application_command_badge = (1 << 23)
}
 Flags for a bot or application. More...
 
enum  team_member_role_t : uint8_t { tmr_owner , tmr_admin , tmr_developer , tmr_readonly }
 Team member role types for application team members. More...
 
enum  audit_type {
  aut_guild_update = 1 , aut_channel_create = 10 , aut_channel_update = 11 , aut_channel_delete = 12 ,
  aut_channel_overwrite_create = 13 , aut_channel_overwrite_update = 14 , aut_channel_overwrite_delete = 15 , aut_member_kick = 20 ,
  aut_member_prune = 21 , aut_member_ban_add = 22 , aut_member_ban_remove = 23 , aut_member_update = 24 ,
  aut_member_role_update = 25 , aut_member_move = 26 , aut_member_disconnect = 27 , aut_bot_add = 28 ,
  aut_role_create = 30 , aut_role_update = 31 , aut_role_delete = 32 , aut_invite_create = 40 ,
  aut_invite_update = 41 , aut_invite_delete = 42 , aut_webhook_create = 50 , aut_webhook_update = 51 ,
  aut_webhook_delete = 52 , aut_emoji_create = 60 , aut_emoji_update = 61 , aut_emoji_delete = 62 ,
  aut_message_delete = 72 , aut_message_bulk_delete = 73 , aut_message_pin = 74 , aut_message_unpin = 75 ,
  aut_integration_create = 80 , aut_integration_update = 81 , aut_integration_delete = 82 , aut_stage_instance_create = 83 ,
  aut_stage_instance_update = 84 , aut_stage_instance_delete = 85 , aut_sticker_create = 90 , aut_sticker_update = 91 ,
  aut_sticker_delete = 92 , aut_guild_scheduled_event_create = 100 , aut_guild_scheduled_event_update = 101 , aut_guild_scheduled_event_delete = 102 ,
  aut_thread_create = 110 , aut_thread_update = 111 , aut_thread_delete = 112 , aut_appcommand_permission_update = 121 ,
  aut_automod_rule_create = 140 , aut_automod_rule_update = 141 , aut_automod_rule_delete = 142 , aut_automod_block_message = 143 ,
  aut_automod_flag_to_channel = 144 , aut_automod_user_communication_disabled = 145 , aut_creator_monetization_request_created = 150 , aut_creator_monetization_terms_accepted = 151
}
 Defines types of audit log entry. More...
 
enum  automod_preset_type : uint8_t { amod_preset_profanity = 1 , amod_preset_sexual_content = 2 , amod_preset_slurs = 3 }
 Possible types of preset filter lists. More...
 
enum  automod_action_type : uint8_t { amod_action_block_message = 1 , amod_action_send_alert = 2 , amod_action_timeout = 3 }
 Action types to perform on filtering. More...
 
enum  automod_event_type : uint8_t { amod_message_send = 1 }
 Event types, only message send is currently supported. More...
 
enum  automod_trigger_type : uint8_t {
  amod_type_keyword = 1 , amod_type_harmful_link = 2 , amod_type_spam = 3 , amod_type_keyword_preset = 4 ,
  amod_type_mention_spam = 5
}
 Types of moderation to trigger. More...
 
enum  channel_type : uint8_t {
  CHANNEL_TEXT = 0 , DM = 1 , CHANNEL_VOICE = 2 , GROUP_DM = 3 ,
  CHANNEL_CATEGORY = 4 , CHANNEL_ANNOUNCEMENT = 5 , CHANNEL_STORE = 6 , CHANNEL_ANNOUNCEMENT_THREAD = 10 ,
  CHANNEL_PUBLIC_THREAD = 11 , CHANNEL_PRIVATE_THREAD = 12 , CHANNEL_STAGE = 13 , CHANNEL_DIRECTORY = 14 ,
  CHANNEL_FORUM = 15 , CHANNEL_MEDIA = 16
}
 Flag integers as received from and sent to discord. More...
 
enum  channel_flags : uint16_t {
  c_nsfw = 0b0000000000010000 , c_video_quality_720p = 0b0000000000100000 , c_lock_permissions = 0b0000000001000000 , c_pinned_thread = 0b0000000010000000 ,
  c_require_tag = 0b0000000100000000 , c_hide_media_download_options = 0b0001000000000000
}
 Our flags as stored in the object. More...
 
enum  default_forum_sort_order_t : uint8_t { so_latest_activity = 0 , so_creation_date = 1 }
 Types for sort posts in a forum channel. More...
 
enum  forum_layout_type : uint8_t { fl_not_set = 0 , fl_list_view = 1 , fl_gallery_view = 2 }
 Types of forum layout views that indicates how the threads in a forum channel will be displayed for users by default. More...
 
enum  overwrite_type : uint8_t { ot_role = 0 , ot_member = 1 }
 channel permission overwrite types More...
 
enum  auto_archive_duration_t : uint8_t { arc_1_hour = 1 , arc_1_day = 2 , arc_3_days = 3 , arc_1_week = 4 }
 Auto archive duration of threads which will stop showing in the channel list after the specified period of inactivity. Defined as an enum to fit into 1 byte. Internally it'll be translated to minutes to match the API. More...
 
enum  start_type : bool { st_wait = false , st_return = true }
 Types of startup for cluster::start() More...
 
enum  parameter_type {
  pt_string , pt_role , pt_channel , pt_user ,
  pt_integer , pt_double , pt_boolean
}
 Parameter types when registering a command. We don't pass these in when triggering the command in the handler, because it is expected the developer added the command so they know what types to expect for each named parameter. More...
 
enum  dave_version_t : uint8_t { dave_version_none = 0 , dave_version_1 = 1 }
 Supported DAVE (Discord Audio Visual Encryption) protocol versions. More...
 
enum  voice_websocket_opcode_t : uint8_t {
  voice_opcode_connection_identify = 0 , voice_opcode_connection_select_protocol = 1 , voice_opcode_connection_ready = 2 , voice_opcode_connection_heartbeat = 3 ,
  voice_opcode_connection_description = 4 , voice_opcode_client_speaking = 5 , voice_opcode_connection_heartbeat_ack = 6 , voice_opcode_connection_resume = 7 ,
  voice_opcode_connection_hello = 8 , voice_opcode_connection_resumed = 9 , voice_opcode_multiple_clients_connect = 11 , voice_opcode_client_disconnect = 13 ,
  voice_opcode_media_sink = 15 , voice_client_flags = 18 , voice_client_platform = 20 , voice_client_dave_prepare_transition = 21 ,
  voice_client_dave_execute_transition = 22 , voice_client_dave_transition_ready = 23 , voice_client_dave_prepare_epoch = 24 , voice_client_dave_mls_external_sender = 25 ,
  voice_client_dave_mls_key_package = 26 , voice_client_dave_mls_proposals = 27 , voice_client_dave_mls_commit_message = 28 , voice_client_dave_announce_commit_transition = 29 ,
  voice_client_dave_mls_welcome = 30 , voice_client_dave_mls_invalid_commit_welcome = 31
}
 Discord voice websocket opcode types. More...
 
enum  client_platform_t : uint8_t { client_platform_desktop = 0 , client_platform_mobile = 1 }
 Discord voice platform types. More...
 
enum  emoji_flags : uint8_t { e_require_colons = 0b00000001 , e_managed = 0b00000010 , e_animated = 0b00000100 , e_available = 0b00001000 }
 Flags for dpp::emoji. More...
 
enum  entitlement_type : uint8_t {
  PURCHASE = 1 , PREMIUM_SUBSCRIPTION = 2 , DEVELOPER_GIFT = 3 , TEST_MODE_PURCHASE = 4 ,
  FREE_PURCHASE = 5 , USER_GIFT = 6 , PREMIUM_PURCHASE = 7 , APPLICATION_SUBSCRIPTION = 8
}
 The type of entitlement. More...
 
enum  entitlement_flags : uint8_t { ent_deleted = 0b0000001 , ent_consumed = 0b0000010 }
 Entitlement flags. More...
 
enum  etf_token_type : uint8_t {
  ett_distribution = 'D' , ett_new_float = 'F' , ett_bit_binary = 'M' , ett_compressed = 'P' ,
  ett_smallint = 'a' , ett_integer = 'b' , ett_float = 'c' , ett_atom = 'd' ,
  ett_reference = 'e' , ett_port = 'f' , ett_pid = 'g' , ett_small_tuple = 'h' ,
  ett_large_tuple = 'i' , ett_nil = 'j' , ett_string = 'k' , ett_list = 'l' ,
  ett_binary = 'm' , ett_bigint_small = 'n' , ett_bigint_large = 'o' , ett_new_function = 'p' ,
  ett_export = 'q' , ett_new_reference = 'r' , ett_atom_small = 's' , ett_map = 't' ,
  ett_function = 'u' , ett_atom_utf8 = 'v' , ett_atom_utf8_small = 'w'
}
 Represents a token which identifies the type of value which follows it in the ETF binary structure. More...
 
enum  exception_error_code {
  err_no_code_specified = 0 , err_zlib_see_errno = -1 , err_zlib_init_stream = -2 , err_zlib_init_data = -3 ,
  err_zlib_init_mem = -4 , err_zlib_init_buffer = -5 , err_zlib_init_version = -6 , err_opus_bad_arg = -11 ,
  err_opus_buffer_too_small = -12 , err_opus_internal_error = -13 , err_opus_invalid_packet = -14 , err_opus_unimplemented = -15 ,
  err_opus_invalid_state = -16 , err_opus_alloc_fail = -17 , err_dns_bad_flags = -21 , err_name_or_service_unknown = -22 ,
  err_dns_again = -23 , err_dns_fail = -24 , err_dns_family = -26 , err_dns_socket_type = -27 ,
  err_dns_service = -28 , err_dns_memory = -30 , err_dns_system_error = -31 , err_dns_overflow = -32 ,
  err_ssl_new = 1 , err_ssl_connect = 2 , err_write = 3 , err_ssl_write = 4 ,
  err_no_sessions_left = 5 , err_auto_shard = 6 , err_reconnection = 7 , err_bind_failure = 8 ,
  err_nonblocking_failure = 9 , err_voice_terminating = 10 , err_connect_failure = 11 , err_ssl_context = 12 ,
  err_ssl_version = 13 , err_invalid_socket = 14 , err_socket_error = 15 , err_websocket_proto_already_set = 16 ,
  err_command_handler_not_ready = 17 , err_no_owning_message = 18 , err_cancelled_event = 19 , err_event_status = 20 ,
  err_event_start_time = 21 , err_event_end_time = 22 , err_command_has_caps = 23 , err_choice_autocomplete = 24 ,
  err_interaction = 25 , err_too_many_component_rows = 26 , err_invalid_webhook = 27 , err_voice_state_timestamp = 28 ,
  err_no_voice_support = 29 , err_invalid_voice_packet_length = 30 , err_opus = 31 , err_etf = 33 ,
  err_cache = 34 , err_icon_size = 35 , err_massive_audio = 36 , err_unknown = 37 ,
  err_bad_request = 400 , err_unauthorized = 401 , err_payment_required = 402 , err_forbidden = 403 ,
  err_not_found = 404 , err_method_not_allowed = 405 , err_not_acceptable = 406 , err_proxy_auth_required = 407 ,
  err_request_timeout = 408 , err_conflict = 409 , err_gone = 410 , err_length_required = 411 ,
  err_precondition_failed = 412 , err_payload_too_large = 413 , err_uri_too_long = 414 , err_unsupported_media_type = 415 ,
  err_range_not_satisfiable = 416 , err_expectation_failed = 417 , err_im_a_teapot = 418 , err_page_expired = 419 ,
  err_twitter_rate_limited = 420 , err_misdirected_request = 421 , err_unprocessable_content = 422 , err_webdav_locked = 423 ,
  err_webdav_failed_dependency = 424 , err_too_early = 425 , err_upgrade_required = 426 , err_precondition_required = 428 ,
  err_rate_limited = 429 , err_request_headers_too_large = 431 , err_page_blocked = 450 , err_unavailable_for_legal_reasons = 451 ,
  err_http_request_on_https_port = 497 , err_internal_server_error = 500 , err_not_implemented = 501 , err_bad_gateway = 502 ,
  err_service_unavailable = 503 , err_gateway_timeout = 504 , err_http_version_not_supported = 505 , err_variant_also_negotiates = 506 ,
  err_webdav_insufficient_storage = 507 , err_webdav_loop_detected = 508 , err_bandwidth_limit_exceeded = 509 , err_not_extended = 510 ,
  err_network_auth_required = 511 , err_web_server_down = 521 , err_connection_timed_out = 522 , err_origin_unreachable = 523 ,
  err_timeout = 524 , err_ssl_handshake_failed = 525 , err_invalid_ssl_certificate = 526 , err_railgun = 527 ,
  err_cloudflare = 530 , err_websocket_unknown = 4000 , err_websocket_bad_opcode = 4001 , err_websocket_decode = 4002 ,
  err_websocket_not_authenticated = 4003 , err_websocket_authentication_failed = 4004 , err_websocket_already_authenticated = 4005 , err_websocket_invalid_seq_number = 4007 ,
  err_websocket_rate_limited = 4008 , err_websocket_session_timeout = 4009 , err_websocket_invalid_shard = 4010 , err_websocket_sharding_required = 4011 ,
  err_websocket_invalid_api_version = 4012 , err_websocket_invalid_intents = 4013 , err_websocket_disallowed_intents = 4014 , err_websocket_voice_disconnected = 4014 ,
  err_websocket_voice_server_crashed = 4015 , err_websocket_voice_unknown_encryption = 4016 , err_compression_stream = 6000 , err_compression_data = 6001 ,
  err_compression_memory = 6002 , err_unknown_account = 10001 , err_unknown_application = 10002 , err_unknown_channel = 10003 ,
  err_unknown_guild = 10004 , err_unknown_integration = 10005 , err_unknown_invite = 10006 , err_unknown_member = 10007 ,
  err_unknown_message = 10008 , err_unknown_permission_overwrite = 10009 , err_unknown_provider = 10010 , err_unknown_role = 10011 ,
  err_unknown_token = 10012 , err_unknown_user = 10013 , err_unknown_emoji = 10014 , err_unknown_webhook = 10015 ,
  err_unknown_webhook_service = 10016 , err_unknown_session = 10020 , err_unknown_ban = 10026 , err_unknown_sku = 10027 ,
  err_unknown_store_listing = 10028 , err_unknown_entitlement = 10029 , err_unknown_build = 10030 , err_unknown_lobby = 10031 ,
  err_unknown_branch = 10032 , err_unknown_store_directory_layout = 10033 , err_unknown_redistributable = 10036 , err_unknown_gift_code = 10038 ,
  err_unknown_stream = 10049 , err_unknown_premium_server_subscribe_cooldown = 10050 , err_unknown_guild_template = 10057 , err_unknown_discoverable_server_category = 10059 ,
  err_unknown_sticker = 10060 , err_unknown_interaction = 10062 , err_unknown_application_command = 10063 , err_unknown_voice_state = 10065 ,
  err_unknown_application_command_permissions = 10066 , err_unknown_stage_instance = 10067 , err_unknown_guild_member_verification_form = 10068 , err_unknown_guild_welcome_screen = 10069 ,
  err_unknown_guild_scheduled_event = 10070 , err_unknown_guild_scheduled_event_user = 10071 , err_unknown_tag = 10087 , err_bots_cannot_use_this_endpoint = 20001 ,
  err_only_bots_can_use_this_endpoint = 20002 , err_explicit_content = 20009 , err_unauthorized_for_application = 20012 , err_slowmode_rate_limit = 20016 ,
  err_owner_only = 20018 , err_announcement_rate_limit = 20022 , err_under_minimum_age = 20024 , err_write_rate_limit = 20029 ,
  err_stage_banned_words = 20031 , err_guild_premium_subscription_level_too_low = 20035 , err_guilds = 30001 , err_friends = 30002 ,
  err_pins_for_the_channel = 30003 , err_recipients = 30004 , err_guild_roles = 30005 , err_webhooks = 30007 ,
  err_emojis = 30008 , err_reactions = 30010 , err_group_dms = 30011 , err_guild_channels = 30013 ,
  err_attachments_in_a_message = 30015 , err_invites = 30016 , err_animated_emojis = 30018 , err_server_members = 30019 ,
  err_server_categories = 30030 , err_guild_already_has_a_template = 30031 , err_application_commands = 30032 , err_thread_participants = 30033 ,
  err_daily_application_command_creates = 30034 , err_bans_for_non_guild_members_have_been_exceeded = 30035 , err_bans_fetches = 30037 , err_uncompleted_guild_scheduled_events = 30038 ,
  err_stickers = 30039 , err_prune_requests = 30040 , err_guild_widget_settings_updates = 30042 , err_edits_to_messages_older_than_1_hour = 30046 ,
  err_pinned_threads_in_a_forum_channel = 30047 , err_tags_in_a_forum_channel = 30048 , err_bitrate_is_too_high_for_channel_of_this_type = 30052 , err_premium_emojis = 30056 ,
  err_webhooks_per_guild = 30058 , err_channel_permission_overwrites = 30060 , err_the_channels_for_this_guild_are_too_large = 30061 , err_unauthorized_invalid_token = 40001 ,
  err_verify_your_account = 40002 , err_you_are_opening_direct_messages_too_fast = 40003 , err_send_messages_has_been_temporarily_disabled = 40004 , err_request_entity_too_large = 40005 ,
  err_this_feature_has_been_temporarily_disabled_server_side = 40006 , err_the_user_is_banned_from_this_guild = 40007 , err_connection_has_been_revoked = 40012 , err_target_user_is_not_connected_to_voice = 40032 ,
  err_this_message_has_already_been_crossposted = 40033 , err_an_application_command_with_that_name_already_exists = 40041 , err_application_interaction_failed_to_send = 40043 , err_cannot_send_a_message_in_a_forum_channel = 40058 ,
  err_interaction_has_already_been_acknowledged = 40060 , err_tag_names_must_be_unique = 40061 , err_service_resource_is_being_rate_limited = 40062 , err_no_tags_available = 40066 ,
  err_tag_required = 40067 , err_entitlement_already_granted = 40074 , err_missing_access = 50001 , err_invalid_account_type = 50002 ,
  err_cannot_execute_action_on_a_dm_channel = 50003 , err_guild_widget_disabled = 50004 , err_cannot_edit_a_message_by_other_user = 50005 , err_cannot_send_empty_message = 50006 ,
  err_cannot_send_messages_to_this_user = 50007 , err_cannot_send_messages_in_a_non_text_channel = 50008 , err_channel_verification_level_too_high = 50009 , err_oauth2_application_does_not_have_a_bot = 50010 ,
  err_oauth2_application_limit = 50011 , err_invalid_oauth2_state = 50012 , err_permissions = 50013 , err_invalid_authentication_token = 50014 ,
  err_note_was_too_long = 50015 , err_too_few_or_too_many_messages = 50016 , err_invalid_mfa_level = 50017 , err_invalid_pin = 50019 ,
  err_invite_code_invalid = 50020 , err_system_message = 50021 , err_channel_type = 50024 , err_invalid_oauth2_access_token = 50025 ,
  err_missing_required_oauth2_scope = 50026 , err_invalid_webhook_token = 50027 , err_invalid_role = 50028 , err_invalid_recipients = 50033 ,
  err_too_old_to_bulk_delete = 50034 , err_invalid_form_body = 50035 , err_invite_error = 50036 , err_invalid_activity_action = 50039 ,
  err_invalid_api_version_provided = 50041 , err_file_uploaded_exceeds_the_maximum_size = 50045 , err_invalid_file_uploaded = 50046 , err_cannot_self_redeem_this_gift = 50054 ,
  err_invalid_guild = 50055 , err_invalid_sku = 50057 , err_invalid_request_origin = 50067 , err_invalid_message_type = 50068 ,
  err_payment_source_required = 50070 , err_cannot_modify_a_system_webhook = 50073 , err_cannot_delete_a_channel_required_for_community_guilds = 50074 , err_cannot_edit_stickers_within_a_message = 50080 ,
  err_invalid_sticker_sent = 50081 , err_tried_to_perform_an_operation_on_an_archived_thread = 50083 , err_invalid_thread_notification_settings = 50084 , err_before_value_is_earlier_than_the_thread_creation_date = 50085 ,
  err_community_server_channels_must_be_text_channels = 50086 , err_bad_event_entity_type = 50091 , err_this_server_is_not_available_in_your_location = 50095 , err_monetization_enabled_in_order_to_perform_this_action = 50097 ,
  err_more_boosts_to_perform_this_action = 50101 , err_the_request_body_contains_invalid_json = 50109 , err_owner_cannot_be_pending_member = 50131 , err_ownership_cannot_be_transferred_to_a_bot_user = 50132 ,
  err_failed_to_resize_asset_below_the_maximum_size = 50138 , err_cannot_mix_subscription_and_non_subscription_roles_for_an_emoji = 50144 , err_cannot_convert_between_premium_emoji_and_normal_emoji = 50145 , err_uploaded_file_not_found = 50146 ,
  err_voice_messages_do_not_support_additional_content = 50159 , err_voice_messages_must_have_a_single_audio_attachment = 50160 , err_voice_messages_must_have_supporting_metadata = 50161 , err_voice_messages_cannot_be_edited = 50162 ,
  err_cannot_delete_guild_subscription_integration = 50163 , err_you_cannot_send_voice_messages_in_this_channel = 50173 , err_the_user_account_must_first_be_verified = 50178 , err_you_do_not_have_permission_to_send_this_sticker = 50600 ,
  err_two_factor_is_required_for_this_operation = 60003 , err_no_users_with_discordtag_exist = 80004 , err_reaction_was_blocked = 90001 , err_user_cannot_use_burst_reactions = 90002 ,
  err_application_not_yet_available = 110001 , err_api_resource_is_currently_overloaded = 130000 , err_the_stage_is_already_open = 150006 , err_cannot_reply_without_permission_to_read_message_history = 160002 ,
  err_a_thread_has_already_been_created_for_this_message = 160004 , err_thread_is_locked = 160005 , err_active_threads = 160006 , err_active_announcement_threads = 160007 ,
  err_invalid_json_for_uploaded_lottie_file = 170001 , err_uploaded_lotties_cannot_contain_rasterized_images = 170002 , err_sticker_maximum_framerate = 170003 , err_sticker_frame_count = 170004 ,
  err_lottie_animation_dimensions = 170005 , err_sticker_frame_rate = 170006 , err_sticker_animation_duration = 170007 , err_cannot_update_a_finished_event = 180000 ,
  err_failed_to_create_stage_needed_for_stage_event = 180002 , err_message_was_blocked_by_automatic_moderation = 200000 , err_title_was_blocked_by_automatic_moderation = 200001 , err_webhooks_posted_to_forum_channels_must_have_a_thread_name_or_thread_id = 220001 ,
  err_webhooks_posted_to_forum_channels_cannot_have_both_a_thread_name_and_thread_id = 220002 , err_webhooks_can_only_create_threads_in_forum_channels = 220003 , err_webhook_services_cannot_be_used_in_forum_channels = 220004 , err_message_blocked_links = 240000 ,
  err_cannot_enable_onboarding_requirements_are_not_met = 350000 , err_cannot_update_onboarding_below_requirements = 350001
}
 Exception error codes possible for dpp::exception::code() More...
 
enum class  build_type { universal , debug , release }
 Represents a build configuration. On some platforms (e.g. Windows) release isn't compatible with debug, so we use this enum to detect it. More...
 
enum  region : uint8_t {
  r_brazil , r_central_europe , r_hong_kong , r_india ,
  r_japan , r_russia , r_singapore , r_south_africa ,
  r_sydney , r_us_central , r_us_east , r_us_south ,
  r_us_west , r_western_europe
}
 Represents voice regions for guilds and channels. More...
 
enum  guild_flags : uint32_t {
  g_large = 0b00000000000000000000000000000001 , g_unavailable = 0b00000000000000000000000000000010 , g_widget_enabled = 0b00000000000000000000000000000100 , g_invite_splash = 0b00000000000000000000000000001000 ,
  g_vip_regions = 0b00000000000000000000000000010000 , g_vanity_url = 0b00000000000000000000000000100000 , g_verified = 0b00000000000000000000000001000000 , g_partnered = 0b00000000000000000000000010000000 ,
  g_community = 0b00000000000000000000000100000000 , g_role_subscription_enabled = 0b00000000000000000000001000000000 , g_news = 0b00000000000000000000010000000000 , g_discoverable = 0b00000000000000000000100000000000 ,
  g_featureable = 0b00000000000000000001000000000000 , g_animated_icon = 0b00000000000000000010000000000000 , g_banner = 0b00000000000000000100000000000000 , g_welcome_screen_enabled = 0b00000000000000001000000000000000 ,
  g_member_verification_gate = 0b00000000000000010000000000000000 , g_preview_enabled = 0b00000000000000100000000000000000 , g_no_join_notifications = 0b00000000000001000000000000000000 , g_no_boost_notifications = 0b00000000000010000000000000000000 ,
  g_has_animated_icon = 0b00000000000100000000000000000000 , g_has_animated_banner = 0b00000000001000000000000000000000 , g_no_setup_tips = 0b00000000010000000000000000000000 , g_no_sticker_greeting = 0b00000000100000000000000000000000 ,
  g_monetization_enabled = 0b00000001000000000000000000000000 , g_more_stickers = 0b00000010000000000000000000000000 , g_creator_store_page_enabled = 0b00000100000000000000000000000000 , g_role_icons = 0b00001000000000000000000000000000 ,
  g_seven_day_thread_archive = 0b00010000000000000000000000000000 , g_three_day_thread_archive = 0b00100000000000000000000000000000 , g_ticketed_events = 0b01000000000000000000000000000000 , g_channel_banners = 0b10000000000000000000000000000000
}
 The various flags that represent the status of a dpp::guild object. More...
 
enum  guild_flags_extra : uint16_t {
  g_premium_progress_bar_enabled = 0b0000000000000001 , g_animated_banner = 0b0000000000000010 , g_auto_moderation = 0b0000000000000100 , g_invites_disabled = 0b0000000000001000 ,
  g_developer_support_server = 0b0000000000010000 , g_no_role_subscription_notifications = 0b0000000000100000 , g_no_role_subscription_notification_replies = 0b0000000001000000 , g_role_subscriptions_available_for_purchase = 0b0000000010000000 ,
  g_raid_alerts_disabled = 0b0000000100000000
}
 Additional boolean flag values for guild, as guild_flags is full. More...
 
enum  guild_member_flags : uint16_t {
  gm_deaf = 0b0000000000000001 , gm_mute = 0b0000000000000010 , gm_pending = 0b0000000000000100 , gm_animated_avatar = 0b0000000000001000 ,
  gm_voice_action = 0b0000000000010000 , gm_did_rejoin = 0b0000000000100000 , gm_completed_onboarding = 0b0000000001000000 , gm_bypasses_verification = 0b0000000010000000 ,
  gm_started_onboarding = 0b0000000100000000 , gm_roles_action = 0b0000001000000000 , gm_nickname_action = 0b0000010000000000
}
 Various flags that can be used to indicate the status of a guild member. More...
 
enum  guild_nsfw_level_t : uint8_t { nsfw_default = 0 , nsfw_explicit = 1 , nsfw_safe = 2 , nsfw_age_restricted = 3 }
 Guild NSFW level. Used to represent just how naughty this guild is. Naughty guild, go sit in the corner. More...
 
enum  guild_explicit_content_t : uint8_t { expl_disabled = 0 , expl_members_without_roles = 1 , expl_all_members = 2 }
 explicit content filter level. This is set by a guild admin, but can be forced to a setting if the server is verified, partnered, official etc. More...
 
enum  mfa_level_t : uint8_t { mfa_none = 0 , mfa_elevated = 1 }
 MFA level for server. If set to elevated all moderators need MFA to perform specific actions such as kick or ban. More...
 
enum  verification_level_t : uint8_t {
  ver_none = 0 , ver_low = 1 , ver_medium = 2 , ver_high = 3 ,
  ver_very_high = 4
}
 Guild verification level. More...
 
enum  default_message_notification_t : uint8_t { dmn_all = 0 , dmn_only_mentions = 1 }
 Default message notification level. More...
 
enum  guild_premium_tier_t : uint8_t { tier_none = 0 , tier_1 = 1 , tier_2 = 2 , tier_3 = 3 }
 The guild's premium tier. More...
 
enum  guild_afk_timeout_t : uint8_t {
  afk_off , afk_60 , afk_300 , afk_900 ,
  afk_1800 , afk_3600
}
 Voice AFK timeout values for guild::afk_timeout. More...
 
enum  onboarding_mode : uint8_t { gom_default = 0 , gom_advanced = 1 }
 The onboarding mode for the dpp::onboarding object. Defines the criteria used to satisfy Onboarding constraints that are required for enabling. More...
 
enum  onboarding_prompt_type : uint8_t { opt_multiple_choice = 0 , opt_dropdown = 1 }
 The various types of dpp::onboarding_prompt. More...
 
enum  onboarding_prompt_flags : uint8_t { opf_single_select = 1 << 0 , opf_required = 1 << 1 , opf_in_onboarding = 1 << 2 }
 Various flags for dpp::onboarding_prompt. More...
 
enum  http_state : uint8_t {
  HTTPS_HEADERS , HTTPS_CONTENT , HTTPS_DONE , HTTPS_CHUNK_LEN ,
  HTTPS_CHUNK_TRAILER , HTTPS_CHUNK_LAST , HTTPS_CHUNK_CONTENT
}
 HTTP connection status. More...
 
enum  application_integration_types { ait_guild_install = 0 , ait_user_install = 1 }
 Where an app can be installed, also called its supported installation contexts. More...
 
enum  integration_type { i_twitch , i_youtube , i_discord , i_guild_subscription }
 Integration types. More...
 
enum  integration_flags {
  if_enabled = 0b00000001 , if_syncing = 0b00000010 , if_emoticons = 0b00000100 , if_revoked = 0b00001000 ,
  if_expire_kick = 0b00010000
}
 Integration flags. More...
 
enum  intents {
  i_guilds = (1 << 0) , i_guild_members = (1 << 1) , i_guild_bans = (1 << 2) , i_guild_emojis = (1 << 3) ,
  i_guild_integrations = (1 << 4) , i_guild_webhooks = (1 << 5) , i_guild_invites = (1 << 6) , i_guild_voice_states = (1 << 7) ,
  i_guild_presences = (1 << 8) , i_guild_messages = (1 << 9) , i_guild_message_reactions = (1 << 10) , i_guild_message_typing = (1 << 11) ,
  i_direct_messages = (1 << 12) , i_direct_message_reactions = (1 << 13) , i_direct_message_typing = (1 << 14) , i_message_content = (1 << 15) ,
  i_guild_scheduled_events = (1 << 16) , i_auto_moderation_configuration = (1 << 20) , i_auto_moderation_execution = (1 << 21) , i_default_intents ,
  i_privileged_intents = dpp::i_guild_members | dpp::i_guild_presences | dpp::i_message_content , i_all_intents = dpp::i_default_intents | dpp::i_privileged_intents , i_unverified_default_intents = dpp::i_default_intents | dpp::i_message_content
}
 intents are a bitmask of allowed events on your websocket. More...
 
enum  invite_target_t : uint8_t { itt_none = 0 , itt_stream = 1 , itt_embedded_application = 2 }
 Invite target types for dpp::invite. More...
 
enum  component_type : uint8_t {
  cot_action_row = 1 , cot_button = 2 , cot_selectmenu = 3 , cot_text = 4 ,
  cot_user_selectmenu = 5 , cot_role_selectmenu = 6 , cot_mentionable_selectmenu = 7 , cot_channel_selectmenu = 8
}
 Represents the type of a component. More...
 
enum  text_style_type : uint8_t { text_short = 1 , text_paragraph = 2 }
 Types of text input. More...
 
enum  component_style : uint8_t {
  cos_primary = 1 , cos_secondary , cos_success , cos_danger ,
  cos_link , cos_premium
}
 Represents the style of a button. More...
 
enum  component_default_value_type : uint8_t { cdt_user = 0 , cdt_role = 1 , cdt_channel = 2 }
 
enum  attachment_flags : uint8_t { a_is_remix = 1 << 2 }
 Bitmask flags for a dpp::attachment. More...
 
enum  sticker_type : uint8_t { st_standard = 1 , st_guild = 2 }
 Represents the type of a sticker. More...
 
enum  sticker_format : uint8_t { sf_png = 1 , sf_apng = 2 , sf_lottie = 3 , sf_gif = 4 }
 The file format (png, apng, lottie) of a sticker. More...
 
enum  poll_layout_type { pl_default = 1 }
 Poll layout types. More...
 
enum  message_flags : uint16_t {
  m_crossposted = 1 << 0 , m_is_crosspost = 1 << 1 , m_suppress_embeds = 1 << 2 , m_source_message_deleted = 1 << 3 ,
  m_urgent = 1 << 4 , m_has_thread = 1 << 5 , m_ephemeral = 1 << 6 , m_loading = 1 << 7 ,
  m_thread_mention_failed = 1 << 8 , m_suppress_notifications = 1 << 12 , m_is_voice_message = 1 << 13
}
 Bitmask flags for a dpp::message. More...
 
enum  message_type {
  mt_default = 0 , mt_recipient_add = 1 , mt_recipient_remove = 2 , mt_call = 3 ,
  mt_channel_name_change = 4 , mt_channel_icon_change = 5 , mt_channel_pinned_message = 6 , mt_guild_member_join = 7 ,
  mt_user_premium_guild_subscription = 8 , mt_user_premium_guild_subscription_tier_1 = 9 , mt_user_premium_guild_subscription_tier_2 = 10 , mt_user_premium_guild_subscription_tier_3 = 11 ,
  mt_channel_follow_add = 12 , mt_guild_discovery_disqualified = 14 , mt_guild_discovery_requalified = 15 , mt_guild_discovery_grace_period_initial_warning = 16 ,
  mt_guild_discovery_grace_period_final_warning = 17 , mt_thread_created = 18 , mt_reply = 19 , mt_application_command = 20 ,
  mt_thread_starter_message = 21 , mt_guild_invite_reminder = 22 , mt_context_menu_command = 23 , mt_auto_moderation_action = 24 ,
  mt_role_subscription_purchase = 25 , mt_interaction_premium_upsell = 26 , mt_stage_start = 27 , mt_stage_end = 28 ,
  mt_stage_speaker = 29 , mt_stage_topic = 31 , mt_application_premium_subscription = 32
}
 Message types for dpp::message::type. More...
 
enum  cache_policy_setting_t { cp_aggressive = 0 , cp_lazy = 1 , cp_none = 2 }
 Represents the caching policy of a cache in the library. More...
 
enum  image_type : uint8_t { i_png , i_jpg , i_gif , i_webp }
 Supported image types for profile pictures and CDN endpoints. More...
 
enum  loglevel {
  ll_trace = 0 , ll_debug , ll_info , ll_warning ,
  ll_error , ll_critical
}
 Log levels. More...
 
enum  permissions : uint64_t {
  p_create_instant_invite = 0x00000000001 , p_kick_members = 0x00000000002 , p_ban_members = 0x00000000004 , p_administrator = 0x00000000008 ,
  p_manage_channels = 0x00000000010 , p_manage_guild = 0x00000000020 , p_add_reactions = 0x00000000040 , p_view_audit_log = 0x00000000080 ,
  p_priority_speaker = 0x00000000100 , p_stream = 0x00000000200 , p_view_channel = 0x00000000400 , p_send_messages = 0x00000000800 ,
  p_send_tts_messages = 0x00000001000 , p_manage_messages = 0x00000002000 , p_embed_links = 0x00000004000 , p_attach_files = 0x00000008000 ,
  p_read_message_history = 0x00000010000 , p_mention_everyone = 0x00000020000 , p_use_external_emojis = 0x00000040000 , p_view_guild_insights = 0x00000080000 ,
  p_connect = 0x00000100000 , p_speak = 0x00000200000 , p_mute_members = 0x00000400000 , p_deafen_members = 0x00000800000 ,
  p_move_members = 0x00001000000 , p_use_vad = 0x00002000000 , p_change_nickname = 0x00004000000 , p_manage_nicknames = 0x00008000000 ,
  p_manage_roles = 0x00010000000 , p_manage_webhooks = 0x00020000000 , p_manage_emojis_and_stickers = 0x00040000000 , p_use_application_commands = 0x00080000000 ,
  p_request_to_speak = 0x00100000000 , p_manage_events = 0x00200000000 , p_manage_threads = 0x00400000000 , p_create_public_threads = 0x00800000000 ,
  p_create_private_threads = 0x01000000000 , p_use_external_stickers = 0x02000000000 , p_send_messages_in_threads = 0x04000000000 , p_use_embedded_activities = 0x08000000000 ,
  p_moderate_members = 0x10000000000 , p_view_creator_monetization_analytics = 0x20000000000 , p_use_soundboard = 0x40000000000 , p_use_external_sounds = 0x0000200000000000 ,
  p_send_voice_messages = 0x0000400000000000 , p_use_clyde_ai = 0x0000800000000000
}
 Represents the various discord permissions. More...
 
enum  presence_flags {
  p_desktop_online = 0b00000001 , p_desktop_dnd = 0b00000010 , p_desktop_idle = 0b00000011 , p_web_online = 0b00000100 ,
  p_web_dnd = 0b00001000 , p_web_idle = 0b00001100 , p_mobile_online = 0b00010000 , p_mobile_dnd = 0b00100000 ,
  p_mobile_idle = 0b00110000 , p_status_online = 0b01000000 , p_status_dnd = 0b10000000 , p_status_idle = 0b11000000
}
 Presence flags bitmask. More...
 
enum  presence_status : uint8_t {
  ps_offline = 0 , ps_online = 1 , ps_dnd = 2 , ps_idle = 3 ,
  ps_invisible = 4
}
 Online presence status values. More...
 
enum  activity_type : uint8_t {
  at_game = 0 , at_streaming = 1 , at_listening = 2 , at_watching = 3 ,
  at_custom = 4 , at_competing = 5
}
 Game types. More...
 
enum  activity_flags {
  af_instance = 0b000000001 , af_join = 0b000000010 , af_spectate = 0b000000100 , af_join_request = 0b000001000 ,
  af_sync = 0b000010000 , af_play = 0b000100000 , af_party_privacy_friends = 0b001000000 , af_party_privacy_voice_channel = 0b010000000 ,
  af_embedded = 0b100000000
}
 Activity types for rich presence. More...
 
enum  http_error {
  h_success = 0 , h_unknown , h_connection , h_bind_ip_address ,
  h_read , h_write , h_exceed_redirect_count , h_canceled ,
  h_ssl_connection , h_ssl_loading_certs , h_ssl_server_verification , h_unsupported_multipart_boundary_chars ,
  h_compression
}
 Error values. Most of these are currently unused in https_client. More...
 
enum  http_method {
  m_get , m_post , m_put , m_patch ,
  m_delete
}
 Various types of http method supported by the Discord API. More...
 
enum  role_flags : uint8_t {
  r_hoist = 0b00000001 , r_managed = 0b00000010 , r_mentionable = 0b00000100 , r_premium_subscriber = 0b00001000 ,
  r_available_for_purchase = 0b00010000 , r_guild_connections = 0b00100000 , r_in_prompt = 0b01000000
}
 Various flags related to dpp::role. More...
 
enum  application_role_connection_metadata_type : uint8_t {
  rc_integer_less_than_or_equal = 1 , rc_integer_greater_than_or_equal = 2 , rc_integer_equal = 3 , rc_integer_not_equal = 4 ,
  rc_datetime_less_than_or_equal = 5 , rc_datetime_greater_than_or_equal = 6 , rc_boolean_equal = 7 , rc_boolean_not_equal = 8
}
 Application Role Connection Metadata Type. More...
 
enum  event_privacy_level : uint8_t { ep_guild_only = 2 }
 Represents the privacy of an event. More...
 
enum  event_entity_type : uint8_t { eet_stage_instance = 1 , eet_voice = 2 , eet_external = 3 }
 Event entity types. More...
 
enum  event_status : uint8_t { es_scheduled = 1 , es_active = 2 , es_completed = 3 , es_cancelled = 4 }
 Event status types. More...
 
enum  sku_type : uint8_t { DURABLE = 2 , CONSUMABLE = 3 , SUBSCRIPTION = 5 , SUBSCRIPTION_GROUP = 6 }
 The type of SKU. More...
 
enum  sku_flags : uint16_t { sku_available = 0b000000000000100 , sku_guild_subscription = 0b000000010000000 , sku_user_subscription = 0b000000100000000 }
 SKU flags. More...
 
enum  stage_privacy_level : uint8_t { sp_public = 1 , sp_guild_only = 2 }
 Represents the privacy of a stage instance. More...
 
enum  user_flags : uint32_t {
  u_bot = 0b00000000000000000000000000000001 , u_system = 0b00000000000000000000000000000010 , u_mfa_enabled = 0b00000000000000000000000000000100 , u_verified = 0b00000000000000000000000000001000 ,
  u_nitro_full = 0b00000000000000000000000000010000 , u_nitro_classic = 0b00000000000000000000000000100000 , u_discord_employee = 0b00000000000000000000000001000000 , u_partnered_owner = 0b00000000000000000000000010000000 ,
  u_hypesquad_events = 0b00000000000000000000000100000000 , u_bughunter_1 = 0b00000000000000000000001000000000 , u_house_bravery = 0b00000000000000000000010000000000 , u_house_brilliance = 0b00000000000000000000100000000000 ,
  u_house_balance = 0b00000000000000000001000000000000 , u_early_supporter = 0b00000000000000000010000000000000 , u_team_user = 0b00000000000000000100000000000000 , u_bughunter_2 = 0b00000000000000001000000000000000 ,
  u_verified_bot = 0b00000000000000010000000000000000 , u_verified_bot_dev = 0b00000000000000100000000000000000 , u_animated_icon = 0b00000000000001000000000000000000 , u_certified_moderator = 0b00000000000010000000000000000000 ,
  u_bot_http_interactions = 0b00000000000100000000000000000000 , u_nitro_basic = 0b00000000001000000000000000000000 , u_active_developer = 0b00000000010000000000000000000000 , u_animated_banner = 0b00000000100000000000000000000000
}
 Various bitmask flags used to represent information about a dpp::user. More...
 
enum  voiceregion_flags { v_optimal = 0x00000001 , v_deprecated = 0x00000010 , v_custom = 0x00000100 }
 Flags related to a voice region. More...
 
enum  voicestate_flags {
  vs_deaf = 0b00000001 , vs_mute = 0b00000010 , vs_self_mute = 0b00000100 , vs_self_deaf = 0b00001000 ,
  vs_self_stream = 0b00010000 , vs_self_video = 0b00100000 , vs_suppress = 0b01000000
}
 Bit mask flags relating to voice states. More...
 
enum  webhook_type { w_incoming = 1 , w_channel_follower = 2 , w_application = 3 }
 Defines types of webhook. More...
 
enum  websocket_protocol_t : uint8_t { ws_json = 0 , ws_etf = 1 }
 Websocket protocol types available on Discord. More...
 
enum  ws_state : uint8_t { HTTP_HEADERS , CONNECTED }
 Websocket connection status. More...
 
enum  ws_opcode : uint8_t {
  OP_CONTINUATION = 0x00 , OP_TEXT = 0x01 , OP_BINARY = 0x02 , OP_CLOSE = 0x08 ,
  OP_PING = 0x09 , OP_PONG = 0x0a , OP_AUTO = 0xff
}
 Low-level websocket opcodes for frames. More...
 

Functions

void to_json (nlohmann::json &j, const command_option_choice &choice)
 helper function to serialize a command_option_choice to json More...
 
void to_json (nlohmann::json &j, const command_option &opt)
 helper function to serialize a command_option to json More...
 
void from_json (const nlohmann::json &j, command_data_option &cdo)
 helper function to deserialize a command_data_option from json More...
 
void from_json (const nlohmann::json &j, command_interaction &ci)
 helper function to deserialize a command_interaction from json More...
 
void from_json (const nlohmann::json &j, component_interaction &bi)
 helper function to deserialize a component_interaction from json More...
 
void from_json (const nlohmann::json &j, autocomplete_interaction &ai)
 helper function to deserialize an autocomplete_interaction from json More...
 
void from_json (const nlohmann::json &j, interaction &i)
 helper function to deserialize an interaction from json More...
 
void to_json (nlohmann::json &j, const command_permission &cp)
 helper function to serialize a command_permission to json More...
 
void to_json (nlohmann::json &j, const guild_command_permissions &gcp)
 helper function to serialize a guild_command_permissions to json More...
 
void to_json (nlohmann::json &j, const slashcommand &cmd)
 helper function to serialize a slashcommand to json More...
 
void DPP_EXPORT garbage_collection ()
 
DPP_EXPORT class userfind_user (snowflake id)
 
DPP_EXPORT cache< class user > * get_user_cache ()
 
DPP_EXPORT uint64_t get_user_count ()
 
DPP_EXPORT class guildfind_guild (snowflake id)
 
DPP_EXPORT cache< class guild > * get_guild_cache ()
 
DPP_EXPORT uint64_t get_guild_count ()
 
DPP_EXPORT class rolefind_role (snowflake id)
 
DPP_EXPORT cache< class role > * get_role_cache ()
 
DPP_EXPORT uint64_t get_role_count ()
 
DPP_EXPORT class channelfind_channel (snowflake id)
 
DPP_EXPORT cache< class channel > * get_channel_cache ()
 
DPP_EXPORT uint64_t get_channel_count ()
 
DPP_EXPORT class emojifind_emoji (snowflake id)
 
DPP_EXPORT cache< class emoji > * get_emoji_cache ()
 
DPP_EXPORT uint64_t get_emoji_count ()
 
void to_json (nlohmann::json &j, const permission_overwrite &po)
 Serialize a permission_overwrite object to json. More...
 
class DPP_EXPORT DPP_DEPRECATED ("commandhandler should not be used. Please consider using dpp::cluster::register_command instead.") commandhandler
 The commandhandler class represents a group of commands, prefixed or slash commands with handling functions. More...
 
 DPP_CHECK_ABI_COMPAT (async<>, async_dummy)
 
 DPP_CHECK_ABI_COMPAT (coroutine< void >, coroutine_dummy) DPP_CHECK_ABI_COMPAT(coroutine< uint64_t >
 
 DPP_CHECK_ABI_COMPAT (task< void >, task_dummy) DPP_CHECK_ABI_COMPAT(task< uint64_t >
 
template<typename... Args>
 when_any (Args...) -> when_any< detail::when_any::awaitable_type< Args >... >
 
uint64_t DPP_EXPORT snowflake_not_null (const nlohmann::json *j, const char *keyname)
 Returns a snowflake id from a json field value, if defined, else returns 0. More...
 
void DPP_EXPORT set_snowflake_not_null (const nlohmann::json *j, const char *keyname, uint64_t &v)
 Sets a snowflake id from a json field value, if defined, else does nothing. More...
 
void DPP_EXPORT set_snowflake_array_not_null (const nlohmann::json *j, const char *keyname, std::vector< class snowflake > &v)
 Sets an array of snowflakes from a json field value, if defined, else does nothing. More...
 
void DPP_EXPORT for_each_json (nlohmann::json *parent, std::string_view key, const std::function< void(nlohmann::json *)> &fn)
 Applies a function to each element of a json array. More...
 
template<class T >
void set_object_array_not_null (nlohmann::json *j, std::string_view key, std::vector< T > &v)
 Sets an array of objects from a json field value, if defined, else does nothing. More...
 
std::string DPP_EXPORT string_not_null (const nlohmann::json *j, const char *keyname)
 Returns a string from a json field value, if defined, else returns an empty string. More...
 
void DPP_EXPORT set_string_not_null (const nlohmann::json *j, const char *keyname, std::string &v)
 Sets a string from a json field value, if defined, else does nothing. More...
 
void DPP_EXPORT set_iconhash_not_null (const nlohmann::json *j, const char *keyname, utility::iconhash &v)
 This is a repeat of set_string_not_null, but takes in a iconhash. More...
 
double DPP_EXPORT double_not_null (const nlohmann::json *j, const char *keyname)
 Returns a double from a json field value, if defined, else returns 0. More...
 
void DPP_EXPORT set_double_not_null (const nlohmann::json *j, const char *keyname, double &v)
 Sets a double from a json field value, if defined, else does nothing. More...
 
uint64_t DPP_EXPORT int64_not_null (const nlohmann::json *j, const char *keyname)
 Returns a 64 bit unsigned integer from a json field value, if defined, else returns 0. DO NOT use this for snowflakes, as usually snowflakes are wrapped in a string! More...
 
void DPP_EXPORT set_int64_not_null (const nlohmann::json *j, const char *keyname, uint64_t &v)
 Sets an unsigned 64 bit integer from a json field value, if defined, else does nothing. More...
 
uint32_t DPP_EXPORT int32_not_null (const nlohmann::json *j, const char *keyname)
 Returns a 32 bit unsigned integer from a json field value, if defined, else returns 0. More...
 
void DPP_EXPORT set_int32_not_null (const nlohmann::json *j, const char *keyname, uint32_t &v)
 Sets an unsigned 32 bit integer from a json field value, if defined, else does nothing. More...
 
uint16_t DPP_EXPORT int16_not_null (const nlohmann::json *j, const char *keyname)
 Returns a 16 bit unsigned integer from a json field value, if defined, else returns 0. More...
 
void DPP_EXPORT set_int16_not_null (const nlohmann::json *j, const char *keyname, uint16_t &v)
 Sets an unsigned 16 bit integer from a json field value, if defined, else does nothing. More...
 
uint8_t DPP_EXPORT int8_not_null (const nlohmann::json *j, const char *keyname)
 Returns an 8 bit unsigned integer from a json field value, if defined, else returns 0. More...
 
void DPP_EXPORT set_int8_not_null (const nlohmann::json *j, const char *keyname, uint8_t &v)
 Sets an unsigned 8 bit integer from a json field value, if defined, else does nothing. More...
 
bool DPP_EXPORT bool_not_null (const nlohmann::json *j, const char *keyname)
 Returns a boolean value from a json field value, if defined, else returns false. More...
 
void DPP_EXPORT set_bool_not_null (const nlohmann::json *j, const char *keyname, bool &v)
 Sets a boolean from a json field value, if defined, else does nothing. More...
 
time_t DPP_EXPORT ts_not_null (const nlohmann::json *j, const char *keyname)
 Returns a time_t from an ISO8601 timestamp field in a json value, if defined, else returns epoch value of 0. More...
 
void DPP_EXPORT set_ts_not_null (const nlohmann::json *j, const char *keyname, time_t &v)
 Sets an timestamp from a json field value containing an ISO8601 string, if defined, else does nothing. More...
 
std::string DPP_EXPORT base64_encode (unsigned char const *buf, unsigned int buffer_length)
 Base64 encode data into a string. More...
 
std::string DPP_EXPORT ts_to_string (time_t ts)
 Convert time_t unix epoch to std::string ISO date/time. More...
 
const dns_cache_entryresolve_hostname (const std::string &hostname, const std::string &port)
 Resolve a hostname to an addrinfo. More...
 
template<build_type >
bool validate_configuration ()
 
void from_json (const nlohmann::json &j, guild_member &gm)
 helper function to deserialize a guild_member from json More...
 
guild_member DPP_EXPORT find_guild_member (const snowflake guild_id, const snowflake user_id)
 Get the guild_member from cache of given IDs. More...
 
template<typename T >
auto run_once ()
 Run some code within an if() statement only once. More...
 
template<class T >
void rest_request (dpp::cluster *c, const char *basepath, const std::string &major, const std::string &minor, http_method method, const std::string &postdata, command_completion_event_t callback)
 Templated REST request helper to save on typing. More...
 
template<>
void rest_request< message > (dpp::cluster *c, const char *basepath, const std::string &major, const std::string &minor, http_method method, const std::string &postdata, command_completion_event_t callback)
 Templated REST request helper to save on typing (specialised for message) More...
 
template<>
void rest_request< confirmation > (dpp::cluster *c, const char *basepath, const std::string &major, const std::string &minor, http_method method, const std::string &postdata, command_completion_event_t callback)
 Templated REST request helper to save on typing (specialised for confirmation) More...
 
template<class T >
void rest_request_list (dpp::cluster *c, const char *basepath, const std::string &major, const std::string &minor, http_method method, const std::string &postdata, command_completion_event_t callback, const std::string &key="id")
 Templated REST request helper to save on typing (for returned lists) More...
 
template<>
void rest_request_list< invite > (dpp::cluster *c, const char *basepath, const std::string &major, const std::string &minor, http_method method, const std::string &postdata, command_completion_event_t callback, const std::string &key)
 Templated REST request helper to save on typing (for returned lists, specialised for invites) More...
 
template<>
void rest_request_list< voiceregion > (dpp::cluster *c, const char *basepath, const std::string &major, const std::string &minor, http_method method, const std::string &postdata, command_completion_event_t callback, const std::string &key)
 Templated REST request helper to save on typing (for returned lists, specialised for voiceregions) More...
 
template<>
void rest_request_list< ban > (dpp::cluster *c, const char *basepath, const std::string &major, const std::string &minor, http_method method, const std::string &postdata, command_completion_event_t callback, const std::string &key)
 Templated REST request helper to save on typing (for returned lists, specialised for bans) More...
 
template<>
void rest_request_list< sticker_pack > (dpp::cluster *c, const char *basepath, const std::string &major, const std::string &minor, http_method method, const std::string &postdata, command_completion_event_t callback, const std::string &key)
 Templated REST request helper to save on typing (for returned lists, specialised for sticker packs) More...
 
template<class T >
void rest_request_list (dpp::cluster *c, const char *basepath, const std::string &major, const std::string &minor, http_method method, const std::string &postdata, command_completion_event_t callback, const std::string &key, const std::string &root)
 Templated REST request helper to save on typing (for returned lists) More...
 
template<class T >
void rest_request_vector (dpp::cluster *c, const char *basepath, const std::string &major, const std::string &minor, http_method method, const std::string &postdata, command_completion_event_t callback)
 Templated REST request helper to save on typing (for returned lists, specialised for objects which doesn't have ids) More...
 
bool close_socket (dpp::socket sfd)
 Close a socket. More...
 
bool set_nonblocking (dpp::socket sockfd, bool non_blocking)
 Set a socket to blocking or non-blocking IO. More...
 
template<typename T >
std::basic_string< T > lowercase (const std::basic_string< T > &s)
 Convert a string to lowercase using tolower() More...
 
template<typename T >
std::basic_string< T > uppercase (const std::basic_string< T > &s)
 Convert a string to uppercase using toupper() More...
 
std::string rtrim (std::string s)
 trim from end of string (right) More...
 
std::string ltrim (std::string s)
 trim from beginning of string (left) More...
 
std::string trim (std::string s)
 Trim from both ends of string (right then left) More...
 
template<class T >
std::string comma (T value)
 Add commas to a string (or dots) based on current locale server-side. More...
 
template<typename T >
from_string (const std::string &s, std::ios_base &(*f)(std::ios_base &))
 Convert any value from a string to another type using stringstream. The optional second parameter indicates the format of the input string, e.g. std::dec for decimal, std::hex for hex, std::oct for octal. More...
 
template<typename T >
from_string (const std::string &s)
 Convert any value from a string to another type using stringstream. More...
 
template<uint64_t >
uint64_t from_string (const std::string &s)
 Specialised conversion of uint64_t from string. More...
 
template<uint32_t >
uint32_t from_string (const std::string &s)
 Specialised conversion of uint32_t from string. More...
 
template<int >
int from_string (const std::string &s)
 Specialised conversion of int from string. More...
 
template<typename T >
std::string to_hex (T i, bool leading_zeroes=true)
 Convert a numeric value to hex. More...
 
template<typename T >
std::string leading_zeroes (T i, size_t width)
 Format a numeric type as a string with leading zeroes. More...
 
template<typename T , class F , class... Ts>
sync (class cluster *c, F func, Ts &&... args)
 Call a D++ REST function synchronously. More...
 
void to_json (nlohmann::json &j, const thread_metadata &tmdata)
 Serialize a thread_metadata object to json. More...
 
void from_json (const nlohmann::json &j, user &u)
 helper function to deserialize a user from json More...
 
void from_json (const nlohmann::json &j, user_identified &u)
 helper function to deserialize a user_identified from json More...
 

Variables

DPP_EXPORT std::unordered_map< managed *, time_t > deletion_queue
 
DPP_EXPORT std::mutex deletion_mutex
 
constexpr int32_t opus_sample_rate_hz = 48000
 Sample rate for OPUS (48khz) More...
 
constexpr int32_t opus_channel_count = 2
 Channel count for OPUS (stereo) More...
 
constexpr uint8_t voice_protocol_version = 8
 Discord voice protocol version. More...
 
constexpr size_t send_audio_raw_max_length = 11520
 
constexpr size_t secret_key_size = 32
 
const uint8_t FORMAT_VERSION = 131
 Current ETF format version in use. More...
 
const bool is_valid_config = validate_configuration<build_type::universal>()
 
static const std::string http_version
 
static constexpr const char * DISCORD_HOST = "https://discord.com"
 
enum DPP_EXPORT message_ref_type
 Message Reference type. More...
 
enum DPP_EXPORT mrt_forward = 1
 
constexpr uint32_t MAX_AVATAR_SIZE = 10240 * 1000
 

Detailed Description

The main namespace for D++ functions. classes and types.

The main namespace for D++ functions, classes and types.

Typedef Documentation

◆ active_threads

using dpp::active_threads = typedef std::map<snowflake, active_thread_info>

A map of threads alongside optionally the thread_member tied to the bot if it is in the thread. The map's key is the thread id. Returned from the cluster::threads_get_active method.

◆ application_map

typedef std::unordered_map<snowflake, application> dpp::application_map

A group of applications.

This is not currently ever sent by Discord API but the DPP standard setup for objects that can be received by REST has the possibility for this, so this exists. Don't ever expect to see one at present.

◆ application_role_connection_metadata_list

◆ automod_rule_map

typedef std::unordered_map<snowflake, automod_rule> dpp::automod_rule_map

A group of automod rules.

◆ ban_map

typedef std::unordered_map<snowflake, ban> dpp::ban_map

A group of bans. The key is the user ID.

◆ channel_collector_t

Template type for base class of channel collector.

◆ channel_map

typedef std::unordered_map<snowflake, channel> dpp::channel_map

A group of channels.

◆ command_completion_event_t

typedef std::function< void(const confirmation_callback_t &)> dpp::command_completion_event_t

A function used as a callback for any REST based command.

A callback upon command completion.

◆ command_handler

typedef std::function<void(const std::string&, const parameter_list_t&, command_source)> dpp::command_handler

The function definition for a command handler. Expects a command name string, and a list of command parameters.

Deprecated:
commandhandler and message commands are deprecated and dpp::slashcommand is encouraged as a replacement.

◆ command_option_range

typedef std::variant<std::monostate, int64_t, double> dpp::command_option_range

A minimum or maximum value/length for dpp::co_number, dpp::co_integer and dpp::co_string types of a dpp::command_option. The int64_t is for the integer range or string length that can be entered. The double is for the decimal range that can be entered.

◆ command_parameter

typedef std::variant<std::monostate, std::string, dpp::role, dpp::channel, dpp::resolved_user, int64_t, bool, double> dpp::command_parameter

Represents a received parameter. We use variant so that multiple non-related types can be contained within.

◆ command_value

typedef std::variant<std::monostate, std::string, int64_t, bool, snowflake, double> dpp::command_value

This type is a variant that can hold any of the potential native data types represented by the enum dpp::command_option_type. It is used in interactions.

std::monostate indicates an invalid parameter value, e.g. an unfilled optional parameter. std::int64_t will be for all integer options, double for decimal numbers and dpp::snowflake for anything ID related.

You can retrieve them with std::get().

◆ component_emoji

An emoji for a component. Alias to partial_emoji, for backwards compatibility.

See also
partial_emoji

◆ confirmable_t

◆ connection_map

typedef std::unordered_map<snowflake, connection> dpp::connection_map

A group of connections.

◆ dns_cache_t

using dpp::dns_cache_t = typedef std::unordered_map<std::string, dns_cache_entry*>

Cache container type.

◆ dtemplate_map

typedef std::unordered_map<snowflake, dtemplate> dpp::dtemplate_map

A container of invites.

◆ emoji_map

typedef std::unordered_map<snowflake, emoji> dpp::emoji_map

Group of emojis.

◆ entitlement_map

typedef std::unordered_map<snowflake, entitlement> dpp::entitlement_map

Group of entitlements.

◆ event_handle

typedef size_t dpp::event_handle

A returned event handle for an event which was attached.

◆ event_member_map

typedef std::unordered_map<snowflake, event_member> dpp::event_member_map

A group of scheduled event members.

◆ guild_command_permissions_map

A group of guild command permissions.

◆ guild_map

typedef std::unordered_map<snowflake, guild> dpp::guild_map

A container of guilds.

◆ guild_member_map

typedef std::unordered_map<snowflake, guild_member> dpp::guild_member_map

A container of guild members.

◆ http_completion_event

typedef std::function<void(const http_request_completion_t&)> dpp::http_completion_event

Results of HTTP requests are called back to these std::function types.

Note
Returned http_completion_events are called ASYNCHRONOUSLY in your code which means they execute in a separate thread. The completion events arrive in order.

◆ http_headers

typedef std::multimap<std::string, std::string> dpp::http_headers

Request headers.

◆ integration_map

typedef std::unordered_map<snowflake, integration> dpp::integration_map

A group of integrations.

◆ invite_map

typedef std::unordered_map<std::string, invite> dpp::invite_map

A container of invites.

◆ json

typedef nlohmann::json dpp::json

◆ json_encode_t

typedef std::function<void(json&, const http_request_completion_t&)> dpp::json_encode_t

Automatically JSON encoded HTTP result.

◆ members_container

typedef std::unordered_map<snowflake, guild_member> dpp::members_container

Guild members container.

◆ message_collector_t

Template type for base class of message collector.

◆ message_map

typedef std::unordered_map<snowflake, message> dpp::message_map

A group of messages.

◆ parameter_list_t

typedef std::vector<std::pair<std::string, command_parameter> > dpp::parameter_list_t

Parameter list for a called command. See dpp::parameter_registration_t for an explanation as to why vector is used.

◆ parameter_registration_t

typedef std::vector<std::pair<std::string, param_info> > dpp::parameter_registration_t

Parameter list used during registration. Note that use of vector/pair is important here to preserve parameter order, as opposed to unordered_map (which doesn't guarantee any order at all) and std::map, which reorders keys alphabetically.

◆ presence_map

typedef std::unordered_map<snowflake, presence> dpp::presence_map

A container of presences.

◆ privacy_code_callback_t

using dpp::privacy_code_callback_t = typedef std::function<void(const std::string&)>

A callback for obtaining a user's privacy code. The privacy code is returned as the parameter to the function.

This is a callback function because DAVE requires use of a very resource intensive SCRYPT call, which uses lots of ram and cpu and take significant time.

◆ promise

template<typename T >
using dpp::promise = typedef moveable_promise<T>

◆ reaction_collector_t

Template type for base class of message reaction collector.

◆ role_collector_t

Template type for base class of role collector.

◆ role_map

typedef std::unordered_map<snowflake, role> dpp::role_map

A group of roles.

◆ role_permissions

Represents the various discord permissions.

Deprecated:
Use dpp::permissions instead.

◆ scheduled_event_collector_t

Template type for base class of scheduled event collector.

◆ scheduled_event_map

typedef std::unordered_map<snowflake, scheduled_event> dpp::scheduled_event_map

A group of scheduled events.

◆ shard_list

typedef std::map<uint32_t, class discord_client*> dpp::shard_list

A list of shards.

◆ sku_map

typedef std::unordered_map<snowflake, sku> dpp::sku_map

Group of SKUs.

◆ slashcommand_map

typedef std::unordered_map<snowflake, slashcommand> dpp::slashcommand_map

A group of application slash commands.

◆ socket

using dpp::socket = typedef int

Represents a socket file descriptor. This is used to ensure parity between windows and unix-like systems.

◆ socket_callback_t

typedef std::function<dpp::socket()> dpp::socket_callback_t

A callback for socket status.

◆ socket_notification_t

typedef std::function<void()> dpp::socket_notification_t

A socket notification callback.

◆ stage_instance_map

typedef std::unordered_map<snowflake, stage_instance> dpp::stage_instance_map

A group of stage instances.

◆ sticker_map

typedef std::unordered_map<snowflake, sticker> dpp::sticker_map

A group of stickers.

◆ sticker_pack_map

typedef std::unordered_map<snowflake, sticker_pack> dpp::sticker_pack_map

A group of sticker packs.

◆ thread_collector_t

Template type for base class of thread collector.

◆ thread_map

typedef std::unordered_map<snowflake, thread> dpp::thread_map

A group of threads.

◆ thread_member_map

typedef std::unordered_map<snowflake, thread_member> dpp::thread_member_map

A group of thread member objects. the key is the user_id of the dpp::thread_member.

◆ timer

typedef size_t dpp::timer

Represents a timer handle. Returned from cluster::start_timer and used by cluster::stop_timer. This is obtained from a simple incrementing value, internally.

◆ timer_callback_t

typedef std::function<void(timer)> dpp::timer_callback_t

The type for a timer callback.

◆ timer_next_t

typedef std::multimap<time_t, timer_t*> dpp::timer_next_t

A map of timers, ordered by earliest first so that map::begin() is always the soonest to be due.

◆ timer_reg_t

typedef std::unordered_map<timer, timer_t*> dpp::timer_reg_t

A map of timers stored by handle.

◆ user_map

typedef std::unordered_map<snowflake, user> dpp::user_map

A group of users.

◆ voiceregion_map

typedef std::unordered_map<std::string, voiceregion> dpp::voiceregion_map

A group of voice regions.

◆ voicestate_map

typedef std::unordered_map<std::string, voicestate> dpp::voicestate_map

A container of voicestates

◆ webhook_map

typedef std::unordered_map<snowflake, webhook> dpp::webhook_map

A group of webhooks.

Enumeration Type Documentation

◆ activity_flags

Activity types for rich presence.

Enumerator
af_instance 

In an instance.

af_join 

Joining.

af_spectate 

Spectating.

af_join_request 

Sending join request.

af_sync 

Synchronising.

af_play 

Playing.

af_party_privacy_friends 

Party privacy friends.

af_party_privacy_voice_channel 

Party privacy voice channel.

af_embedded 

Embedded.

◆ activity_type

enum dpp::activity_type : uint8_t

Game types.

Enumerator
at_game 

"Playing ..."

at_streaming 

"Streaming ..."

at_listening 

"Listening to..."

at_watching 

"Watching..."

at_custom 

"Emoji..."

at_competing 

"Competing in..."

◆ application_flags

enum dpp::application_flags : uint32_t

Flags for a bot or application.

Enumerator
apf_application_automod_rule_create_badge 

Indicates if an app uses the Auto Moderation API.

apf_gateway_presence 

Has gateway presence intent.

apf_gateway_presence_limited 

Has gateway presence intent for <100 guilds.

apf_gateway_guild_members 

Has guild members intent.

apf_gateway_guild_members_limited 

Has guild members intent for <100 guilds.

apf_verification_pending_guild_limit 

Verification is pending.

apf_embedded 

Embedded.

apf_gateway_message_content 

Has approval for message content.

apf_gateway_message_content_limited 

Has message content, but <100 guilds.

apf_application_command_badge 

Indicates if the app has registered global application commands.

◆ application_integration_types

Where an app can be installed, also called its supported installation contexts.

Enumerator
ait_guild_install 

Installable to servers.

ait_user_install 

Installable to users.

◆ application_role_connection_metadata_type

Application Role Connection Metadata Type.

Note
Each metadata type offers a comparison operation that allows guilds to configure role requirements based on metadata values stored by the bot. Bots specify a metadata value for each user and guilds specify the required guild's configured value within the guild role settings.
Enumerator
rc_integer_less_than_or_equal 

The metadata value (integer) is less than or equal to the guild's configured value (integer).

rc_integer_greater_than_or_equal 

The metadata value (integer) is greater than or equal to the guild's configured value (integer).

rc_integer_equal 

The metadata value (integer) is equal to the guild's configured value (integer).

rc_integer_not_equal 

The metadata value (integer) is not equal to the guild's configured value (integer).

rc_datetime_less_than_or_equal 

The metadata value (ISO8601 string) is less than or equal to the guild's configured value (integer; days before current date).

rc_datetime_greater_than_or_equal 

The metadata value (ISO8601 string) is greater than or equal to the guild's configured value (integer; days before current date).

rc_boolean_equal 

The metadata value (integer) is equal to the guild's configured value (integer; 1).

rc_boolean_not_equal 

The metadata value (integer) is not equal to the guild's configured value (integer; 1).

◆ attachment_flags

enum dpp::attachment_flags : uint8_t

Bitmask flags for a dpp::attachment.

Enumerator
a_is_remix 

This attachment has been edited using the remix feature on mobile.

◆ audit_type

Defines types of audit log entry.

Enumerator
aut_guild_update 

Guild update.

aut_channel_create 

Channel create.

aut_channel_update 

Channel update.

aut_channel_delete 

Channel delete.

aut_channel_overwrite_create 

Channel overwrite create.

aut_channel_overwrite_update 

Channel overwrite update.

aut_channel_overwrite_delete 

Channel overwrite delete.

aut_member_kick 

Channel member kick.

aut_member_prune 

Channel member prune.

aut_member_ban_add 

Channel member ban add.

aut_member_ban_remove 

Channel member ban remove.

aut_member_update 

Guild member update.

aut_member_role_update 

Guild member role update.

aut_member_move 

Guild member move.

aut_member_disconnect 

Guild member voice disconnect.

aut_bot_add 

Guild bot add.

aut_role_create 

Guild role create.

aut_role_update 

Guild role update.

aut_role_delete 

Guild role delete.

aut_invite_create 

Guild invite create.

aut_invite_update 

Guild invite update.

aut_invite_delete 

Guild invite delete.

aut_webhook_create 

Guild webhook create.

aut_webhook_update 

Guild webhook update.

aut_webhook_delete 

Guild webhook delete.

aut_emoji_create 

Guild emoji create.

aut_emoji_update 

Guild emoji update.

aut_emoji_delete 

Guild emoji delete.

aut_message_delete 

Guild message delete.

aut_message_bulk_delete 

Guild message bulk delete.

aut_message_pin 

Guild message pin.

aut_message_unpin 

Guild message unpin.

aut_integration_create 

Guild integration create.

aut_integration_update 

Guild integration update.

aut_integration_delete 

Guild integration delete.

aut_stage_instance_create 

Stage instance create.

aut_stage_instance_update 

Stage instance update.

aut_stage_instance_delete 

stage instance delete

aut_sticker_create 

Sticker create.

aut_sticker_update 

Sticker update.

aut_sticker_delete 

Sticker delete.

aut_guild_scheduled_event_create 

Scheduled event creation.

aut_guild_scheduled_event_update 

Scheduled event update.

aut_guild_scheduled_event_delete 

Scheduled event deletion.

aut_thread_create 

Thread create.

aut_thread_update 

Thread update.

aut_thread_delete 

Thread delete.

aut_appcommand_permission_update 

Application command permissions update.

aut_automod_rule_create 

Auto moderation rule creation.

aut_automod_rule_update 

Auto moderation rule update.

aut_automod_rule_delete 

Auto moderation rule deletion.

aut_automod_block_message 

Message was blocked by Auto Moderation.

aut_automod_flag_to_channel 

Message was flagged by Auto Moderation.

aut_automod_user_communication_disabled 

Member was timed out by Auto Moderation.

aut_creator_monetization_request_created 

Creator monetization request was created.

aut_creator_monetization_terms_accepted 

Creator monetization terms were accepted.

◆ auto_archive_duration_t

Auto archive duration of threads which will stop showing in the channel list after the specified period of inactivity. Defined as an enum to fit into 1 byte. Internally it'll be translated to minutes to match the API.

Enumerator
arc_1_hour 

Auto archive duration of 1 hour (60 minutes).

arc_1_day 

Auto archive duration of 1 day (1440 minutes).

arc_3_days 

Auto archive duration of 3 days (4320 minutes).

arc_1_week 

Auto archive duration of 1 week (10080 minutes).

◆ automod_action_type

enum dpp::automod_action_type : uint8_t

Action types to perform on filtering.

Enumerator
amod_action_block_message 

Blocks the message and prevents it from being posted. A custom explanation can be specified and shown to members whenever their message is blocked.

amod_action_send_alert 

Send an alert to a given channel.

amod_action_timeout 

timeout the user

Note
Can only be set up for rules with trigger types of dpp::amod_type_keyword and dpp::amod_type_mention_spam

◆ automod_event_type

enum dpp::automod_event_type : uint8_t

Event types, only message send is currently supported.

Enumerator
amod_message_send 

Trigger on message send or edit.

◆ automod_preset_type

enum dpp::automod_preset_type : uint8_t

Possible types of preset filter lists.

Enumerator
amod_preset_profanity 

Strong swearing.

amod_preset_sexual_content 

Sexual phrases and words.

amod_preset_slurs 

Racial and other slurs, hate speech.

◆ automod_trigger_type

enum dpp::automod_trigger_type : uint8_t

Types of moderation to trigger.

Enumerator
amod_type_keyword 

Check if content contains words from a user defined list of keywords (max 6 of this type per guild)

amod_type_harmful_link 

Harmful/malware links.

Deprecated:
Removed by Discord
amod_type_spam 

Check if content represents generic spam (max 1 of this type per guild)

amod_type_keyword_preset 

Check if content contains words from discord pre-defined wordsets (max 1 of this type per guild)

amod_type_mention_spam 

Check if content contains more mentions than allowed (max 1 of this type per guild)

◆ build_type

enum class dpp::build_type
strong

Represents a build configuration. On some platforms (e.g. Windows) release isn't compatible with debug, so we use this enum to detect it.

Enumerator
universal 

Universal build, works with both debug and release.

debug 

Debug build.

release 

Release build.

◆ cache_policy_setting_t

Represents the caching policy of a cache in the library.

Enumerator
cp_aggressive 

request aggressively on seeing new guilds, and also store missing data from messages. This is the default behaviour and the least memory-efficient option. Memory usage will increase over time, initially quite rapidly, and then linearly over time. It is the least cpu-intensive setting.

cp_lazy 

only cache when there is relevant activity, e.g. a message to the bot. This is a good middle-ground, memory usage will increase linearly over time.

cp_none 

Don't cache anything. Fill details when we see them. This is the most memory-efficient option but consumes more CPU time.

◆ channel_flags

enum dpp::channel_flags : uint16_t

Our flags as stored in the object.

Note
The bottom four bits of this flag are reserved to contain the channel_type values listed above as provided by Discord. If discord add another value > 15, we will have to shuffle these values upwards by one bit.
Enumerator
c_nsfw 

NSFW Gated Channel.

c_video_quality_720p 

Video quality forced to 720p.

c_lock_permissions 

Lock permissions (only used when updating channel positions)

c_pinned_thread 

Thread is pinned to the top of its parent forum or media channel.

c_require_tag 

Whether a tag is required to be specified when creating a thread in a forum or media channel. Tags are specified in the thread::applied_tags field.

c_hide_media_download_options 

When set hides the embedded media download options. Available only for media channels.

◆ channel_type

enum dpp::channel_type : uint8_t

Flag integers as received from and sent to discord.

Enumerator
CHANNEL_TEXT 

A text channel within a server.

DM 

A direct message between users.

CHANNEL_VOICE 

A voice channel within a server.

GROUP_DM 

a direct message between multiple users

Deprecated:
this channel type was intended to be used with the now deprecated GameBridge SDK. Existing group dms with bots will continue to function, but newly created channels will be unusable.
CHANNEL_CATEGORY 

An organizational category that contains up to 50 channels.

CHANNEL_ANNOUNCEMENT 

A channel that users can follow and cross-post into their own server.

CHANNEL_STORE 

A channel in which game developers can sell their game on Discord.

Deprecated:
Store channels are deprecated by Discord.
CHANNEL_ANNOUNCEMENT_THREAD 

A temporary sub-channel within a GUILD_ANNOUNCEMENT channel.

CHANNEL_PUBLIC_THREAD 

A temporary sub-channel within a GUILD_TEXT or GUILD_FORUM channel.

CHANNEL_PRIVATE_THREAD 

A temporary sub-channel within a GUILD_TEXT channel that is only viewable by those invited and those with the MANAGE_THREADS permission.

CHANNEL_STAGE 

A "stage" channel, like a voice channel with one authorised speaker.

CHANNEL_DIRECTORY 

The channel in a hub containing the listed servers.

See also
https://support.discord.com/hc/en-us/articles/4406046651927-Discord-Student-Hubs-FAQ
CHANNEL_FORUM 

Forum channel that can only contain threads.

CHANNEL_MEDIA 

Media channel that can only contain threads, similar to forum channels.

◆ client_platform_t

enum dpp::client_platform_t : uint8_t

Discord voice platform types.

Enumerator
client_platform_desktop 

Web, Desktop.

client_platform_mobile 

Mobile device.

◆ command_option_type

enum dpp::command_option_type : uint8_t

Represents command option types. These are the possible parameter value types.

Enumerator
co_sub_command 

A sub-command.

co_sub_command_group 

A sub-command group.

co_string 

A string value.

co_integer 

An integer value.

co_boolean 

A boolean value.

co_user 

A user snowflake id.

co_channel 

A channel snowflake id. Includes all channel types and categories.

co_role 

A role id (snowflake).

co_mentionable 

A mentionable (users and roles).

co_number 

Any double between -2^53 and 2^53.

co_attachment 

File attachment type.

◆ command_permission_type

type of permission in the dpp::command_permission class

Enumerator
cpt_role 

Role permission.

cpt_user 

User permission.

◆ component_default_value_type

Represents the type of a dpp::component_default_value

Note
They're different to discord's value types
Enumerator
cdt_user 
cdt_role 
cdt_channel 

◆ component_style

enum dpp::component_style : uint8_t

Represents the style of a button.

Enumerator
cos_primary 

Blurple; Primary.

cos_secondary 

Grey; Secondary.

cos_success 

Green; Success.

cos_danger 

Red; danger.

cos_link 

An external hyperlink to a website, requires url to be set.

Note
Will not work unless url is set
cos_premium 

Premium upsell button, requires sku_id to be set.

Note
Will not work unless sku is set

◆ component_type

enum dpp::component_type : uint8_t

Represents the type of a component.

Enumerator
cot_action_row 

Action row, a container for other components.

cot_button 

Clickable button.

cot_selectmenu 

Select menu for picking from defined text options.

cot_text 

Text input.

cot_user_selectmenu 

Select menu for users.

cot_role_selectmenu 

Select menu for roles.

cot_mentionable_selectmenu 

Select menu for mentionables (users and roles).

cot_channel_selectmenu 

Select menu for channels.

◆ dave_version_t

enum dpp::dave_version_t : uint8_t

Supported DAVE (Discord Audio Visual Encryption) protocol versions.

Enumerator
dave_version_none 

DAVE disabled (default for now)

dave_version_1 

DAVE enabled, version 1 (E2EE encryption on top of openssl)

◆ default_forum_sort_order_t

Types for sort posts in a forum channel.

Enumerator
so_latest_activity 

Sort forum posts by activity (default)

so_creation_date 

Sort forum posts by creation time (from most recent to oldest)

◆ default_message_notification_t

Default message notification level.

Enumerator
dmn_all 

Members will receive notifications for all messages by default.

dmn_only_mentions 

Members will receive notifications only for messages that @mention them by default.

◆ emoji_flags

enum dpp::emoji_flags : uint8_t

Flags for dpp::emoji.

Enumerator
e_require_colons 

Emoji requires colons.

e_managed 

Managed (introduced by application)

e_animated 

Animated emoji.

e_available 

Available (false if the guild doesn't meet boosting criteria, etc)

◆ entitlement_flags

enum dpp::entitlement_flags : uint8_t

Entitlement flags.

Enumerator
ent_deleted 

Entitlement was deleted.

Note
Only discord staff can delete an entitlement via their internal tooling. It should rarely happen except in cases of fraud or chargeback.
ent_consumed 

Entitlement was consumed.

Note
A consumed entitlement is a used-up one-off purchase.

◆ entitlement_type

enum dpp::entitlement_type : uint8_t

The type of entitlement.

Enumerator
PURCHASE 

Entitlement was purchased by user.

PREMIUM_SUBSCRIPTION 

Entitlement for Discord Nitro subscription.

DEVELOPER_GIFT 

Entitlement was gifted by developer.

TEST_MODE_PURCHASE 

Entitlement was purchased by a dev in application test mode.

FREE_PURCHASE 

Entitlement was granted when the SKU was free.

USER_GIFT 

Entitlement was gifted by another user.

PREMIUM_PURCHASE 

Entitlement was claimed by user for free as a Nitro Subscriber.

APPLICATION_SUBSCRIPTION 

Entitlement was purchased as an app subscription.

◆ etf_token_type

enum dpp::etf_token_type : uint8_t

Represents a token which identifies the type of value which follows it in the ETF binary structure.

Enumerator
ett_distribution 

68 [Distribution header]

ett_new_float 

70 [Float64:IEEE float]

ett_bit_binary 

77 [UInt32:Len, UInt8:Bits, Len:Data]

ett_compressed 

80 [UInt4:UncompressedSize, N:ZlibCompressedData]

ett_smallint 

97 [UInt8:Int]

ett_integer 

98 [Int32:Int]

ett_float 

99 [31:Float String] Float in string format (formatted "%.20e", sscanf "%lf").

Note
Superseded by ett_new_float.
ett_atom 

100 [UInt16:Len, Len:AtomName] max Len is 255

ett_reference 

101 [atom:Node, UInt32:ID, UInt8:Creation]

ett_port 

102 [atom:Node, UInt32:ID, UInt8:Creation]

ett_pid 

103 [atom:Node, UInt32:ID, UInt32:Serial, UInt8:Creation]

ett_small_tuple 

104 [UInt8:Arity, N:Elements]

ett_large_tuple 

105 [UInt32:Arity, N:Elements]

ett_nil 

106 empty list

ett_string 

107 [UInt16:Len, Len:Characters]

ett_list 

108 [UInt32:Len, Elements, Tail]

ett_binary 

109 [UInt32:Len, Len:Data]

ett_bigint_small 

110 [UInt8:n, UInt8:Sign, n:nums]

ett_bigint_large 

111 [UInt32:n, UInt8:Sign, n:nums]

ett_new_function 

112 [UInt32:Size, UInt8:Arity, 16*Uint6-MD5:Uniq, UInt32:Index, UInt32:NumFree, atom:Module, int:OldIndex, int:OldUniq, pid:Pid, NunFree*ext:FreeVars]

ett_export 

113 [atom:Module, atom:Function, smallint:Arity]

ett_new_reference 

114 [UInt16:Len, atom:Node, UInt8:Creation, Len*UInt32:ID]

ett_atom_small 

115 [UInt8:Len, Len:AtomName]

ett_map 

116 [UInt32:Airty, N:Pairs]

ett_function 

117 [UInt4:NumFree, pid:Pid, atom:Module, int:Index, int:Uniq, NumFree*ext:FreeVars]

ett_atom_utf8 

118 [UInt16:Len, Len:AtomName] max Len is 255 characters (up to 4 bytes per)

ett_atom_utf8_small 

119 [UInt8:Len, Len:AtomName]

◆ event_entity_type

enum dpp::event_entity_type : uint8_t

Event entity types.

Enumerator
eet_stage_instance 

A stage instance.

eet_voice 

A voice channel.

eet_external 

External to discord, or a text channel etc.

◆ event_privacy_level

enum dpp::event_privacy_level : uint8_t

Represents the privacy of an event.

Enumerator
ep_guild_only 

The event is visible to only guild members.

◆ event_status

enum dpp::event_status : uint8_t

Event status types.

Enumerator
es_scheduled 

Scheduled.

es_active 

Active now.

es_completed 

Completed.

es_cancelled 

Cancelled.

◆ exception_error_code

Exception error codes possible for dpp::exception::code()

This list is a combined list of Discord's error codes, HTTP error codes, zlib, opus and C library codes (e.g. DNS, socket etc). You may use these to easily identify a type of exception without having to resort to string comparison against dpp::exception::what()

For detailed descriptions of each error code, see the text description returned in what().

Note
Some exceptions MAY have error codes which are NOT in this list in the event a C library is updated and adds new codes we did not document here. In this case, or where the code is not specific, refer to what().
Enumerator
err_no_code_specified 
err_zlib_see_errno 
err_zlib_init_stream 
err_zlib_init_data 
err_zlib_init_mem 
err_zlib_init_buffer 
err_zlib_init_version 
err_opus_bad_arg 
err_opus_buffer_too_small 
err_opus_internal_error 
err_opus_invalid_packet 
err_opus_unimplemented 
err_opus_invalid_state 
err_opus_alloc_fail 
err_dns_bad_flags 
err_name_or_service_unknown 
err_dns_again 
err_dns_fail 
err_dns_family 
err_dns_socket_type 
err_dns_service 
err_dns_memory 
err_dns_system_error 
err_dns_overflow 
err_ssl_new 
err_ssl_connect 
err_write 
err_ssl_write 
err_no_sessions_left 
err_auto_shard 
err_reconnection 
err_bind_failure 
err_nonblocking_failure 
err_voice_terminating 
err_connect_failure 
err_ssl_context 
err_ssl_version 
err_invalid_socket 
err_socket_error 
err_websocket_proto_already_set 
err_command_handler_not_ready 
err_no_owning_message 
err_cancelled_event 
err_event_status 
err_event_start_time 
err_event_end_time 
err_command_has_caps 
err_choice_autocomplete 
err_interaction 
err_too_many_component_rows 
err_invalid_webhook 
err_voice_state_timestamp 
err_no_voice_support 
err_invalid_voice_packet_length 
err_opus 
err_etf 
err_cache 
err_icon_size 
err_massive_audio 
err_unknown 
err_bad_request 
err_unauthorized 
err_payment_required 
err_forbidden 
err_not_found 
err_method_not_allowed 
err_not_acceptable 
err_proxy_auth_required 
err_request_timeout 
err_conflict 
err_gone 
err_length_required 
err_precondition_failed 
err_payload_too_large 
err_uri_too_long 
err_unsupported_media_type 
err_range_not_satisfiable 
err_expectation_failed 
err_im_a_teapot 
err_page_expired 
err_twitter_rate_limited 
err_misdirected_request 
err_unprocessable_content 
err_webdav_locked 
err_webdav_failed_dependency 
err_too_early 
err_upgrade_required 
err_precondition_required 
err_rate_limited 
err_request_headers_too_large 
err_page_blocked 
err_unavailable_for_legal_reasons 
err_http_request_on_https_port 
err_internal_server_error 
err_not_implemented 
err_bad_gateway 
err_service_unavailable 
err_gateway_timeout 
err_http_version_not_supported 
err_variant_also_negotiates 
err_webdav_insufficient_storage 
err_webdav_loop_detected 
err_bandwidth_limit_exceeded 
err_not_extended 
err_network_auth_required 
err_web_server_down 
err_connection_timed_out 
err_origin_unreachable 
err_timeout 
err_ssl_handshake_failed 
err_invalid_ssl_certificate 
err_railgun 
err_cloudflare 
err_websocket_unknown 
err_websocket_bad_opcode 
err_websocket_decode 
err_websocket_not_authenticated 
err_websocket_authentication_failed 
err_websocket_already_authenticated 
err_websocket_invalid_seq_number 
err_websocket_rate_limited 
err_websocket_session_timeout 
err_websocket_invalid_shard 
err_websocket_sharding_required 
err_websocket_invalid_api_version 
err_websocket_invalid_intents 
err_websocket_disallowed_intents 
err_websocket_voice_disconnected 
err_websocket_voice_server_crashed 
err_websocket_voice_unknown_encryption 
err_compression_stream 
err_compression_data 
err_compression_memory 
err_unknown_account 
err_unknown_application 
err_unknown_channel 
err_unknown_guild 
err_unknown_integration 
err_unknown_invite 
err_unknown_member 
err_unknown_message 
err_unknown_permission_overwrite 
err_unknown_provider 
err_unknown_role 
err_unknown_token 
err_unknown_user 
err_unknown_emoji 
err_unknown_webhook 
err_unknown_webhook_service 
err_unknown_session 
err_unknown_ban 
err_unknown_sku 
err_unknown_store_listing 
err_unknown_entitlement 
err_unknown_build 
err_unknown_lobby 
err_unknown_branch 
err_unknown_store_directory_layout 
err_unknown_redistributable 
err_unknown_gift_code 
err_unknown_stream 
err_unknown_premium_server_subscribe_cooldown 
err_unknown_guild_template 
err_unknown_discoverable_server_category 
err_unknown_sticker 
err_unknown_interaction 
err_unknown_application_command 
err_unknown_voice_state 
err_unknown_application_command_permissions 
err_unknown_stage_instance 
err_unknown_guild_member_verification_form 
err_unknown_guild_welcome_screen 
err_unknown_guild_scheduled_event 
err_unknown_guild_scheduled_event_user 
err_unknown_tag 
err_bots_cannot_use_this_endpoint 
err_only_bots_can_use_this_endpoint 
err_explicit_content 
err_unauthorized_for_application 
err_slowmode_rate_limit 
err_owner_only 
err_announcement_rate_limit 
err_under_minimum_age 
err_write_rate_limit 
err_stage_banned_words 
err_guild_premium_subscription_level_too_low 
err_guilds 
err_friends 
err_pins_for_the_channel 
err_recipients 
err_guild_roles 
err_webhooks 
err_emojis 
err_reactions 
err_group_dms 
err_guild_channels 
err_attachments_in_a_message 
err_invites 
err_animated_emojis 
err_server_members 
err_server_categories 
err_guild_already_has_a_template 
err_application_commands 
err_thread_participants 
err_daily_application_command_creates 
err_bans_for_non_guild_members_have_been_exceeded 
err_bans_fetches 
err_uncompleted_guild_scheduled_events 
err_stickers 
err_prune_requests 
err_guild_widget_settings_updates 
err_edits_to_messages_older_than_1_hour 
err_pinned_threads_in_a_forum_channel 
err_tags_in_a_forum_channel 
err_bitrate_is_too_high_for_channel_of_this_type 
err_premium_emojis 
err_webhooks_per_guild 
err_channel_permission_overwrites 
err_the_channels_for_this_guild_are_too_large 
err_unauthorized_invalid_token 
err_verify_your_account 
err_you_are_opening_direct_messages_too_fast 
err_send_messages_has_been_temporarily_disabled 
err_request_entity_too_large 
err_this_feature_has_been_temporarily_disabled_server_side 
err_the_user_is_banned_from_this_guild 
err_connection_has_been_revoked 
err_target_user_is_not_connected_to_voice 
err_this_message_has_already_been_crossposted 
err_an_application_command_with_that_name_already_exists 
err_application_interaction_failed_to_send 
err_cannot_send_a_message_in_a_forum_channel 
err_interaction_has_already_been_acknowledged 
err_tag_names_must_be_unique 
err_service_resource_is_being_rate_limited 
err_no_tags_available 
err_tag_required 
err_entitlement_already_granted 
err_missing_access 
err_invalid_account_type 
err_cannot_execute_action_on_a_dm_channel 
err_guild_widget_disabled 
err_cannot_edit_a_message_by_other_user 
err_cannot_send_empty_message 
err_cannot_send_messages_to_this_user 
err_cannot_send_messages_in_a_non_text_channel 
err_channel_verification_level_too_high 
err_oauth2_application_does_not_have_a_bot 
err_oauth2_application_limit 
err_invalid_oauth2_state 
err_permissions 
err_invalid_authentication_token 
err_note_was_too_long 
err_too_few_or_too_many_messages 
err_invalid_mfa_level 
err_invalid_pin 
err_invite_code_invalid 
err_system_message 
err_channel_type 
err_invalid_oauth2_access_token 
err_missing_required_oauth2_scope 
err_invalid_webhook_token 
err_invalid_role 
err_invalid_recipients 
err_too_old_to_bulk_delete 
err_invalid_form_body 
err_invite_error 
err_invalid_activity_action 
err_invalid_api_version_provided 
err_file_uploaded_exceeds_the_maximum_size 
err_invalid_file_uploaded 
err_cannot_self_redeem_this_gift 
err_invalid_guild 
err_invalid_sku 
err_invalid_request_origin 
err_invalid_message_type 
err_payment_source_required 
err_cannot_modify_a_system_webhook 
err_cannot_delete_a_channel_required_for_community_guilds 
err_cannot_edit_stickers_within_a_message 
err_invalid_sticker_sent 
err_tried_to_perform_an_operation_on_an_archived_thread 
err_invalid_thread_notification_settings 
err_before_value_is_earlier_than_the_thread_creation_date 
err_community_server_channels_must_be_text_channels 
err_bad_event_entity_type 
err_this_server_is_not_available_in_your_location 
err_monetization_enabled_in_order_to_perform_this_action 
err_more_boosts_to_perform_this_action 
err_the_request_body_contains_invalid_json 
err_owner_cannot_be_pending_member 
err_ownership_cannot_be_transferred_to_a_bot_user 
err_failed_to_resize_asset_below_the_maximum_size 
err_cannot_mix_subscription_and_non_subscription_roles_for_an_emoji 
err_cannot_convert_between_premium_emoji_and_normal_emoji 
err_uploaded_file_not_found 
err_voice_messages_do_not_support_additional_content 
err_voice_messages_must_have_a_single_audio_attachment 
err_voice_messages_must_have_supporting_metadata 
err_voice_messages_cannot_be_edited 
err_cannot_delete_guild_subscription_integration 
err_you_cannot_send_voice_messages_in_this_channel 
err_the_user_account_must_first_be_verified 
err_you_do_not_have_permission_to_send_this_sticker 
err_two_factor_is_required_for_this_operation 
err_no_users_with_discordtag_exist 
err_reaction_was_blocked 
err_user_cannot_use_burst_reactions 
err_application_not_yet_available 
err_api_resource_is_currently_overloaded 
err_the_stage_is_already_open 
err_cannot_reply_without_permission_to_read_message_history 
err_a_thread_has_already_been_created_for_this_message 
err_thread_is_locked 
err_active_threads 
err_active_announcement_threads 
err_invalid_json_for_uploaded_lottie_file 
err_uploaded_lotties_cannot_contain_rasterized_images 
err_sticker_maximum_framerate 
err_sticker_frame_count 
err_lottie_animation_dimensions 
err_sticker_frame_rate 
err_sticker_animation_duration 
err_cannot_update_a_finished_event 
err_failed_to_create_stage_needed_for_stage_event 
err_message_was_blocked_by_automatic_moderation 
err_title_was_blocked_by_automatic_moderation 
err_webhooks_posted_to_forum_channels_must_have_a_thread_name_or_thread_id 
err_webhooks_posted_to_forum_channels_cannot_have_both_a_thread_name_and_thread_id 
err_webhooks_can_only_create_threads_in_forum_channels 
err_webhook_services_cannot_be_used_in_forum_channels 
err_message_blocked_links 
err_cannot_enable_onboarding_requirements_are_not_met 
err_cannot_update_onboarding_below_requirements 

◆ forum_layout_type

enum dpp::forum_layout_type : uint8_t

Types of forum layout views that indicates how the threads in a forum channel will be displayed for users by default.

Enumerator
fl_not_set 

No default has been set for the forum channel.

fl_list_view 

Display posts as a list.

fl_gallery_view 

Display posts as a collection of tiles.

◆ guild_afk_timeout_t

enum dpp::guild_afk_timeout_t : uint8_t

Voice AFK timeout values for guild::afk_timeout.

Enumerator
afk_off 

AFK timeout disabled.

afk_60 

AFK timeout of 1 Minute.

afk_300 

AFK timeout of 5 Minutes.

afk_900 

AFK timeout of 15 Minutes.

afk_1800 

AFK timeout of 30 Minutes.

afk_3600 

AFK timeout of 1 Hour.

◆ guild_explicit_content_t

explicit content filter level. This is set by a guild admin, but can be forced to a setting if the server is verified, partnered, official etc.

Enumerator
expl_disabled 

Media content will not be scanned.

expl_members_without_roles 

Media content sent by members without roles will be scanned.

expl_all_members 

Media content sent by all members will be scanned.

◆ guild_flags

enum dpp::guild_flags : uint32_t

The various flags that represent the status of a dpp::guild object.

Enumerator
g_large 

Large guild.

g_unavailable 

Unavailable guild (inaccessible due to an outage)

g_widget_enabled 

Guild has widget enabled.

g_invite_splash 

Guild can have an invite splash image.

g_vip_regions 

Guild can have VIP regions.

g_vanity_url 

Guild can have a vanity url.

g_verified 

Guild is verified.

g_partnered 

Guild is partnered.

g_community 

Community features enabled.

g_role_subscription_enabled 

Guild has enabled role subscriptions.

g_news 

Guild has access to create announcement channels.

g_discoverable 

Guild is discoverable in discovery.

g_featureable 

Guild is featureable.

g_animated_icon 

Guild can have an animated icon (doesn't mean it actually has one though)

g_banner 

Guild can have a banner image.

g_welcome_screen_enabled 

Guild has a welcome screen.

g_member_verification_gate 

Guild has a member verification gate.

g_preview_enabled 

Guild has a preview.

g_no_join_notifications 

Guild join notifications are off.

g_no_boost_notifications 

Guild boost notifications are off.

g_has_animated_icon 

Guild has an actual animated icon (set by the icon hash starting with 'a_')

g_has_animated_banner 

Guild has an actual animated banner (set by the icon hash starting with 'a_')

g_no_setup_tips 

Guild setup tips are off.

g_no_sticker_greeting 

"Wave to say hi" sticker prompt buttons are off

g_monetization_enabled 

Guild has enabled monetization.

g_more_stickers 

Guild has increased custom sticker slots.

g_creator_store_page_enabled 

Guild has enabled the role subscription promo page.

g_role_icons 

Guild is able to set role icons.

g_seven_day_thread_archive 

Guild has access to the seven day archive time for threads.

Deprecated:
Removed by Discord
g_three_day_thread_archive 

Guild has access to the three day archive time for threads.

Deprecated:
Removed by Discord
g_ticketed_events 

Guild has enabled ticketed events.

g_channel_banners 

Guild can have channel banners.

Deprecated:
Removed by Discord

◆ guild_flags_extra

enum dpp::guild_flags_extra : uint16_t

Additional boolean flag values for guild, as guild_flags is full.

Enumerator
g_premium_progress_bar_enabled 

Guild has premium progress bar enabled.

g_animated_banner 

Guild can have an animated banner (doesn't mean it actually has one though)

g_auto_moderation 

Guild has auto moderation.

g_invites_disabled 

Guild has paused invites, preventing new users from joining.

g_developer_support_server 

Guild has been set as support server of an app in the App Directory.

g_no_role_subscription_notifications 

Guild role subscription purchase and renewal notifications are off.

g_no_role_subscription_notification_replies 

Guild role subscription sticker reply buttons are off.

g_role_subscriptions_available_for_purchase 

Guild has role subscriptions that can be purchased.

g_raid_alerts_disabled 

Guild has disabled alerts for join raids in the configured safety alerts channel.

◆ guild_member_flags

enum dpp::guild_member_flags : uint16_t

Various flags that can be used to indicate the status of a guild member.

Note
Use the setter functions in dpp::guild_member and do not toggle the bits yourself.
Enumerator
gm_deaf 

Member deafened in voice channel.

gm_mute 

Member muted in voice channels.

gm_pending 

Member pending verification by membership screening.

gm_animated_avatar 

Member has animated guild-specific avatar.

gm_voice_action 

gm_deaf or gm_mute has been toggled

gm_did_rejoin 

Member has left and rejoined the guild.

gm_completed_onboarding 

Member has completed onboarding.

gm_bypasses_verification 

Member is exempt from guild verification requirements.

gm_started_onboarding 

Member has started onboarding.

gm_roles_action 

Should change roles on next call to edit guild_member?

Warning
This is set by dpp::guild_member::add_role, dpp::guild_member::remove_role, and dpp::guild_member::set_roles. You should only ever use this value if you know what you're doing, otherwise stick to the three functions listed.
gm_nickname_action 

Should nicknames on next call to edit guild_member?

Warning
This is set by dpp::guild_member::set_nickname. You should only ever use this value if you know what you're doing, otherwise stick to the function listed.

◆ guild_nsfw_level_t

enum dpp::guild_nsfw_level_t : uint8_t

Guild NSFW level. Used to represent just how naughty this guild is. Naughty guild, go sit in the corner.

Note
This is set by Discord, and cannot be set by any bot or user on the guild.
Enumerator
nsfw_default 

Default setting, not configured.

nsfw_explicit 

Explicit content may be in this guild.

nsfw_safe 

Safe for work content only.

nsfw_age_restricted 

Age restricted, 18+.

◆ guild_premium_tier_t

enum dpp::guild_premium_tier_t : uint8_t

The guild's premium tier.

Enumerator
tier_none 

Guild has not unlocked any Server Boost perks.

tier_1 

Guild has unlocked Server Boost level 1 perks.

tier_2 

Guild has unlocked Server Boost level 2 perks.

tier_3 

Guild has unlocked Server Boost level 3 perks.

◆ http_error

Error values. Most of these are currently unused in https_client.

Enumerator
h_success 

Request successful.

h_unknown 

Status unknown.

h_connection 

Connect failed.

h_bind_ip_address 

Invalid local ip address.

h_read 

Read error.

h_write 

Write error.

h_exceed_redirect_count 

Too many 30x redirects.

h_canceled 

Request cancelled.

h_ssl_connection 

SSL connection error.

h_ssl_loading_certs 

SSL cert loading error.

h_ssl_server_verification 

SSL server verification error.

h_unsupported_multipart_boundary_chars 

Unsupported multipart boundary characters.

h_compression 

Compression error.

◆ http_method

Various types of http method supported by the Discord API.

Enumerator
m_get 

GET.

m_post 

POST.

m_put 

PUT.

m_patch 

PATCH.

m_delete 

DELETE.

◆ http_state

enum dpp::http_state : uint8_t

HTTP connection status.

Enumerator
HTTPS_HEADERS 

Sending/receiving HTTP headers and request body.

HTTPS_CONTENT 

Receiving body content.

HTTPS_DONE 

Completed connection, as it was closed or the body is >= Content-Length.

HTTPS_CHUNK_LEN 

Received chunk length.

HTTPS_CHUNK_TRAILER 

Received chunk trailing CRLF.

HTTPS_CHUNK_LAST 

The last received chunk is the final chunk.

HTTPS_CHUNK_CONTENT 

Receiving contents of a chunk.

◆ image_type

enum dpp::image_type : uint8_t

Supported image types for profile pictures and CDN endpoints.

Enumerator
i_png 

image/png

i_jpg 

image/jpeg.

i_gif 

image/gif.

i_webp 

Webp.

◆ integration_flags

Integration flags.

Enumerator
if_enabled 

Is this integration enabled?

if_syncing 

Is this integration syncing?

Warning
This is not provided for discord bot integrations.
if_emoticons 

Whether emoticons should be synced for this integration (twitch only currently).

Warning
This is not provided for discord bot integrations.
if_revoked 

Has this integration been revoked?

Warning
This is not provided for discord bot integrations.
if_expire_kick 

Kick user when their subscription expires, otherwise only remove the role that is specified by role_id.

Warning
This is not provided for discord bot integrations.

◆ integration_type

Integration types.

Enumerator
i_twitch 

Twitch integration.

i_youtube 

YouTube integration.

i_discord 

Discord integration.

i_guild_subscription 

Subscription.

◆ intents

intents are a bitmask of allowed events on your websocket.

Some of these are known as Privileged intents (GUILD_MEMBERS and GUILD_PRESENCES) and require verification of a bot over 100 servers by discord via submission of your real life ID.

Enumerator
i_guilds 

Intent for receipt of guild information.

i_guild_members 

Intent for receipt of guild members.

i_guild_bans 

Intent for receipt of guild bans.

i_guild_emojis 

Intent for receipt of guild emojis.

i_guild_integrations 

Intent for receipt of guild integrations.

i_guild_webhooks 

Intent for receipt of guild webhooks.

i_guild_invites 

Intent for receipt of guild invites.

i_guild_voice_states 

Intent for receipt of guild voice states.

i_guild_presences 

Intent for receipt of guild presences.

i_guild_messages 

Intent for receipt of guild messages.

i_guild_message_reactions 

Intent for receipt of guild message reactions.

i_guild_message_typing 

Intent for receipt of guild message typing notifications.

i_direct_messages 

Intent for receipt of direct messages (DMs).

i_direct_message_reactions 

Intent for receipt of direct message reactions.

i_direct_message_typing 

Intent for receipt of direct message typing notifications.

i_message_content 

Intent for receipt of message content.

i_guild_scheduled_events 

Scheduled events.

i_auto_moderation_configuration 

Auto moderation configuration.

i_auto_moderation_execution 

Auto moderation configuration.

i_default_intents 

Default D++ intents (all non-privileged intents).

i_privileged_intents 

Privileged intents requiring ID.

i_all_intents 

Every single intent (dpp::i_default_intents and dpp::i_privileged_intents).

i_unverified_default_intents 

Unverified bots default intents.

◆ interaction_context_type

Enumerator
itc_guild 

Interaction can be used within servers.

itc_bot_dm 

Interaction can be used within DMs with the app's bot user.

itc_private_channel 

Interaction can be used within Group DMs and DMs other than the app's bot user.

◆ interaction_response_type

Response types when responding to an interaction within on_interaction_create.

Enumerator
ir_pong 

Acknowledge a Ping.

ir_channel_message_with_source 

Respond to an interaction with a message.

ir_deferred_channel_message_with_source 

Acknowledge an interaction and edit a response later, the user sees a loading state.

ir_deferred_update_message 

For components, acknowledge an interaction and edit the original message later; the user does not see a loading state.

ir_update_message 

For components, edit the message the component was attached to.

ir_autocomplete_reply 

Reply to autocomplete interaction.

Note
Be sure to do this within 500ms of the interaction!
ir_modal_dialog 

A modal dialog box.

Note
Not available for modal submit and ping interactions.
ir_premium_required 

Acknowledge a interaction with an upgrade button, only available for apps with monetization enabled.

See also
https://discord.com/developers/docs/monetization/entitlements#premiumrequired-interaction-response
Note
Not available for autocomplete and ping interactions.
Warning
This response does not support using content, embeds, or attachments, so reply with no data when using this!

@depreciated Replaced with buttons with a style of cos_premium This interaction type may stop working at any point

◆ interaction_type

Types of interaction in the dpp::interaction class

Enumerator
it_ping 

A ping interaction.

it_application_command 

Application command (slash command) interaction.

it_component_button 

Button click or select menu chosen (component interaction)

it_autocomplete 

Autocomplete interaction.

it_modal_submit 

Modal form submission.

◆ invite_target_t

enum dpp::invite_target_t : uint8_t

Invite target types for dpp::invite.

Enumerator
itt_none 

Undefined invite target type.

itt_stream 

Stream target type.

itt_embedded_application 

Embedded Application target type.

◆ loglevel

Log levels.

Enumerator
ll_trace 

Trace.

ll_debug 

Debug.

ll_info 

Information.

ll_warning 

Warning.

ll_error 

Error.

ll_critical 

Critical.

◆ message_flags

enum dpp::message_flags : uint16_t

Bitmask flags for a dpp::message.

Enumerator
m_crossposted 

This message has been published to subscribed channels (via Channel Following).

m_is_crosspost 

This message originated from a message in another channel (via Channel Following).

m_suppress_embeds 

Do not include any embeds when serializing this message.

m_source_message_deleted 

The source message for this crosspost has been deleted (via Channel Following).

m_urgent 

This message came from the urgent message system.

m_has_thread 

This message has an associated thread, with the same id as the message.

m_ephemeral 

This message is only visible to the user who invoked the Interaction.

m_loading 

This message is an Interaction Response and the bot is "thinking".

m_thread_mention_failed 

This message failed to mention some roles and add their members to the thread.

m_suppress_notifications 

This message will not trigger push and desktop notifications.

m_is_voice_message 

This message is a voice message.

◆ message_type

Message types for dpp::message::type.

Enumerator
mt_default 

Default.

mt_recipient_add 

Add recipient.

mt_recipient_remove 

Remove recipient.

mt_call 

Call.

mt_channel_name_change 

Channel name change.

mt_channel_icon_change 

Channel icon change.

mt_channel_pinned_message 

Message pinned.

mt_guild_member_join 

Member joined.

mt_user_premium_guild_subscription 

Boost.

mt_user_premium_guild_subscription_tier_1 

Boost level 1.

mt_user_premium_guild_subscription_tier_2 

Boost level 2.

mt_user_premium_guild_subscription_tier_3 

Boost level 3.

mt_channel_follow_add 

Follow channel.

mt_guild_discovery_disqualified 

Disqualified from discovery.

mt_guild_discovery_requalified 

Re-qualified for discovery.

mt_guild_discovery_grace_period_initial_warning 

Discovery grace period warning 1.

mt_guild_discovery_grace_period_final_warning 

Discovery grace period warning 2.

mt_thread_created 

Thread Created.

mt_reply 

Reply.

mt_application_command 

Application command.

mt_thread_starter_message 

Thread starter message.

mt_guild_invite_reminder 

Invite reminder.

mt_context_menu_command 

Context Menu Command.

mt_auto_moderation_action 

Auto moderation action.

mt_role_subscription_purchase 

Role subscription purchase.

mt_interaction_premium_upsell 

Interaction premium upsell @depreciated Replaced with buttons with a style of cos_premium This message type may stop working at any point.

mt_stage_start 

Stage start.

mt_stage_end 

Stage end.

mt_stage_speaker 

Stage speaker.

mt_stage_topic 

Stage topic.

mt_application_premium_subscription 

Guild application premium subscription.

◆ mfa_level_t

enum dpp::mfa_level_t : uint8_t

MFA level for server. If set to elevated all moderators need MFA to perform specific actions such as kick or ban.

Enumerator
mfa_none 

MFA not elevated.

mfa_elevated 

MFA elevated.

◆ onboarding_mode

enum dpp::onboarding_mode : uint8_t

The onboarding mode for the dpp::onboarding object. Defines the criteria used to satisfy Onboarding constraints that are required for enabling.

Enumerator
gom_default 

Counts only Default Channels towards constraints.

gom_advanced 

Counts Default Channels and Questions towards constraints.

◆ onboarding_prompt_flags

Various flags for dpp::onboarding_prompt.

Enumerator
opf_single_select 

Indicates whether users are limited to selecting one option for the prompt.

opf_required 

Indicates whether the prompt is required before a user completes the onboarding flow.

opf_in_onboarding 

Indicates whether the prompt is present in the onboarding flow. If set, the prompt will only appear in the Channels & Roles tab.

◆ onboarding_prompt_type

The various types of dpp::onboarding_prompt.

Enumerator
opt_multiple_choice 

Multiple choice.

opt_dropdown 

Dropdown.

◆ overwrite_type

enum dpp::overwrite_type : uint8_t

channel permission overwrite types

Enumerator
ot_role 

Role.

ot_member 

Member.

◆ parameter_type

Parameter types when registering a command. We don't pass these in when triggering the command in the handler, because it is expected the developer added the command so they know what types to expect for each named parameter.

Enumerator
pt_string 

String parameter.

pt_role 

Role object parameter.

pt_channel 

Channel object parameter.

pt_user 

User object parameter.

pt_integer 

64 bit signed integer parameter.

pt_double 

double floating point parameter.

pt_boolean 

Boolean parameter.

◆ permissions

enum dpp::permissions : uint64_t

Represents the various discord permissions.

Enumerator
p_create_instant_invite 

Allows creation of instant invites.

p_kick_members 

Allows kicking members.

p_ban_members 

Allows banning members.

p_administrator 

Allows all permissions and bypasses channel permission overwrites.

p_manage_channels 

Allows management and editing of channels.

p_manage_guild 

Allows management and editing of the guild.

p_add_reactions 

Allows for the addition of reactions to messages.

p_view_audit_log 

Allows for viewing of audit logs.

p_priority_speaker 

Allows for using priority speaker in a voice channel.

p_stream 

Allows the user to go live.

p_view_channel 

Allows guild members to view a channel, which includes reading messages in text channels and joining voice channels.

p_send_messages 

Allows for sending messages in a channel.

p_send_tts_messages 

Allows for sending of /tts messages.

p_manage_messages 

Allows for deletion of other users messages.

p_embed_links 

Links sent by users with this permission will be auto-embedded.

p_attach_files 

Allows for uploading images and files.

p_read_message_history 

Allows for reading of message history.

p_mention_everyone 

Allows for using the everyone and the here tag to notify users in a channel.

p_use_external_emojis 

Allows the usage of custom emojis from other servers.

p_view_guild_insights 

Allows for viewing guild insights.

p_connect 

Allows for joining of a voice channel.

p_speak 

Allows for speaking in a voice channel.

p_mute_members 

Allows for muting members in a voice channel.

p_deafen_members 

Allows for deafening of members in a voice channel.

p_move_members 

Allows for moving of members between voice channels.

p_use_vad 

Allows for using voice-activity-detection in a voice channel.

p_change_nickname 

Allows for modification of own nickname.

p_manage_nicknames 

Allows for modification of other users nicknames.

p_manage_roles 

Allows management and editing of roles.

p_manage_webhooks 

Allows management and editing of webhooks.

p_manage_emojis_and_stickers 

Allows management and editing of emojis and stickers.

p_use_application_commands 

Allows members to use application commands, including slash commands and context menus.

p_request_to_speak 

Allows for requesting to speak in stage channels.

Warning
Discord: This permission is under active development and may be changed or removed.
p_manage_events 

Allows for management (creation, updating, deleting, starting) of scheduled events.

p_manage_threads 

Allows for deleting and archiving threads, and viewing all private threads.

p_create_public_threads 

Allows for creating public and announcement threads.

p_create_private_threads 

Allows for creating private threads.

p_use_external_stickers 

Allows the usage of custom stickers from other servers.

p_send_messages_in_threads 

Allows for sending messages in threads.

p_use_embedded_activities 

Allows for using activities (applications with the EMBEDDED flag) in a voice channel.

p_moderate_members 

Allows for timing out users to prevent them from sending or reacting to messages in chat and threads, and from speaking in voice and stage channels.

p_view_creator_monetization_analytics 

Allows for viewing role subscription insights.

p_use_soundboard 

Allows for using soundboard in a voice channel.

p_use_external_sounds 

Allows the usage of custom soundboard sounds from other servers.

p_send_voice_messages 

Allows sending voice messages.

p_use_clyde_ai 

Allows use of Clyde AI.

◆ poll_layout_type

Poll layout types.

Note
At the time of writing Discord only has 1, "The, uhm, default layout type."
See also
https://discord.com/developers/docs/resources/poll#layout-type
Enumerator
pl_default 

According to Discord, quote, "The, uhm, default layout type.".

◆ presence_flags

Presence flags bitmask.

Enumerator
p_desktop_online 

Desktop: Online.

p_desktop_dnd 

Desktop: DND.

p_desktop_idle 

Desktop: Idle.

p_web_online 

Web: Online.

p_web_dnd 

Web: DND.

p_web_idle 

Web: Idle.

p_mobile_online 

Mobile: Online.

p_mobile_dnd 

Mobile: DND.

p_mobile_idle 

Mobile: Idle.

p_status_online 

General: Online.

p_status_dnd 

General: DND.

p_status_idle 

General: Idle.

◆ presence_status

enum dpp::presence_status : uint8_t

Online presence status values.

Enumerator
ps_offline 

Offline.

ps_online 

Online.

ps_dnd 

DND.

ps_idle 

Idle.

ps_invisible 

Invisible (show as offline).

◆ region

enum dpp::region : uint8_t

Represents voice regions for guilds and channels.

Deprecated:
Deprecated in favour of per-channel regions. Please use dpp::channel::rtc_region instead.
Enumerator
r_brazil 

Brazil.

r_central_europe 

Central Europe.

r_hong_kong 

Hong Kong.

r_india 

India.

r_japan 

Japan.

r_russia 

Russia.

r_singapore 

Singapore.

r_south_africa 

South Africa.

r_sydney 

Sydney.

r_us_central 

US Central.

r_us_east 

US East Coast.

r_us_south 

US South.

r_us_west 

US West Coast.

r_western_europe 

Western Europe.

◆ role_flags

enum dpp::role_flags : uint8_t

Various flags related to dpp::role.

Enumerator
r_hoist 

Hoisted role (if the role is pinned in the user listing).

r_managed 

Managed role (introduced by a bot or application).

r_mentionable 

Whether this role is mentionable with a ping.

r_premium_subscriber 

Whether this is the guild's booster role.

r_available_for_purchase 

Whether the role is available for purchase.

r_guild_connections 

Whether the role is a guild's linked role.

r_in_prompt 

Whether the role can be selected by members in an onboarding prompt.

◆ sku_flags

enum dpp::sku_flags : uint16_t

SKU flags.

Enumerator
sku_available 

SKU is available for purchase.

sku_guild_subscription 

Recurring SKU that can be purchased by a user and applied to a single server. Grants access to every user in that server.

sku_user_subscription 

Recurring SKU purchased by a user for themselves. Grants access to the purchasing user in every server.

◆ sku_type

enum dpp::sku_type : uint8_t

The type of SKU.

Enumerator
DURABLE 

Represents a durable one-time purchase.

CONSUMABLE 

Consumable one-time purchase.

SUBSCRIPTION 

Represents a recurring subscription.

SUBSCRIPTION_GROUP 

System-generated group for each SUBSCRIPTION SKU created.

Warning
These are automatically created for each subscription SKU and are not used at this time. Please refrain from using these.

◆ slashcommand_contextmenu_type

Right-click context menu types.

Enumerator
ctxm_none 

Undefined context menu type.

ctxm_chat_input 

DEFAULT: these are the generic slash commands (e.g. /ping, /pong, etc)

ctxm_user 

A slashcommand that goes in the user context menu.

ctxm_message 

A slashcommand that goes in the message context menu.

◆ stage_privacy_level

enum dpp::stage_privacy_level : uint8_t

Represents the privacy of a stage instance.

Enumerator
sp_public 

The Stage instance is visible publicly, such as on Stage Discovery.

sp_guild_only 

The Stage instance is visible to only guild members.

◆ start_type

enum dpp::start_type : bool

Types of startup for cluster::start()

Enumerator
st_wait 

Wait forever on a condition variable. The cluster will spawn threads for each shard and start() will not return in normal operation.

st_return 

Return immediately after starting shard threads. If you set the parameter of cluster::start() to this value, you will have to manage the lifetime and scope of your cluster object yourself. Taking it out of scope or deleting its pointer will terminate the bot.

◆ sticker_format

enum dpp::sticker_format : uint8_t

The file format (png, apng, lottie) of a sticker.

Enumerator
sf_png 
sf_apng 
sf_lottie 
sf_gif 

◆ sticker_type

enum dpp::sticker_type : uint8_t

Represents the type of a sticker.

Enumerator
st_standard 

An official sticker in a pack.

st_guild 

Guild sticker.

◆ team_member_role_t

enum dpp::team_member_role_t : uint8_t

Team member role types for application team members.

These are hard coded to string forms by discord. If further types are added, this enum will be extended to support them.

Enumerator
tmr_owner 

Team owner.

tmr_admin 

Team admin.

tmr_developer 

Developer.

tmr_readonly 

Read-Only.

◆ team_member_status

enum dpp::team_member_status : uint8_t

status of a member of a team who maintain a bot/application

Enumerator
tms_invited 

User was invited to the team.

tms_accepted 

User has accepted membership onto the team.

◆ text_style_type

enum dpp::text_style_type : uint8_t

Types of text input.

Enumerator
text_short 

Intended for short single-line text.

text_paragraph 

Intended for much longer inputs.

◆ user_flags

enum dpp::user_flags : uint32_t

Various bitmask flags used to represent information about a dpp::user.

Enumerator
u_bot 

User is a bot.

u_system 

User is a system user (Clyde!).

u_mfa_enabled 

User has multi-factor authentication enabled.

u_verified 

User is verified (verified email address).

u_nitro_full 

User has full nitro.

u_nitro_classic 

User has nitro classic.

u_discord_employee 

User is discord staff.

u_partnered_owner 

User owns a partnered server.

u_hypesquad_events 

User is a member of hypesquad events.

u_bughunter_1 

User has BugHunter level 1.

u_house_bravery 

User is a member of House Bravery.

u_house_brilliance 

User is a member of House Brilliance.

u_house_balance 

User is a member of House Balance.

u_early_supporter 

User is an early supporter.

u_team_user 

User is a team user.

u_bughunter_2 

User is has Bug Hunter level 2.

u_verified_bot 

User is a verified bot.

u_verified_bot_dev 

User has the Early Verified Bot Developer badge.

u_animated_icon 

User's icon is animated.

u_certified_moderator 

User is a certified moderator.

u_bot_http_interactions 

User is a bot using HTTP interactions.

Note
shows online even when not connected to a websocket.
u_nitro_basic 

User has nitro basic.

u_active_developer 

User has the active developer badge.

u_animated_banner 

User's banner is animated.

◆ verification_level_t

enum dpp::verification_level_t : uint8_t

Guild verification level.

Enumerator
ver_none 

Unrestricted.

ver_low 

Must have verified email on account.

ver_medium 

Must be registered on Discord for longer than 5 minutes.

ver_high 

Must be a member of the server for longer than 10 minutes.

ver_very_high 

Must have a verified phone number.

◆ voice_websocket_opcode_t

Discord voice websocket opcode types.

Enumerator
voice_opcode_connection_identify 
voice_opcode_connection_select_protocol 
voice_opcode_connection_ready 
voice_opcode_connection_heartbeat 
voice_opcode_connection_description 
voice_opcode_client_speaking 
voice_opcode_connection_heartbeat_ack 
voice_opcode_connection_resume 
voice_opcode_connection_hello 
voice_opcode_connection_resumed 
voice_opcode_multiple_clients_connect 
voice_opcode_client_disconnect 
voice_opcode_media_sink 
voice_client_flags 
voice_client_platform 
voice_client_dave_prepare_transition 
voice_client_dave_execute_transition 
voice_client_dave_transition_ready 
voice_client_dave_prepare_epoch 
voice_client_dave_mls_external_sender 
voice_client_dave_mls_key_package 
voice_client_dave_mls_proposals 
voice_client_dave_mls_commit_message 
voice_client_dave_announce_commit_transition 
voice_client_dave_mls_welcome 
voice_client_dave_mls_invalid_commit_welcome 

◆ voiceregion_flags

Flags related to a voice region.

Enumerator
v_optimal 

The closest (optimal) voice region.

v_deprecated 

A Deprecated voice region (avoid switching to these).

v_custom 

A custom voice region (used for events/etc).

◆ voicestate_flags

Bit mask flags relating to voice states.

Enumerator
vs_deaf 

Deafened by the server.

vs_mute 

Muted by the server.

vs_self_mute 

Locally Muted.

vs_self_deaf 

Locally deafened.

vs_self_stream 

Whether this user is streaming using "Go Live".

vs_self_video 

Whether this user's camera is enabled.

vs_suppress 

Whether this user's permission to speak is denied.

◆ webhook_type

Defines types of webhook.

Enumerator
w_incoming 

Incoming webhook.

w_channel_follower 

Channel following webhook.

w_application 

Application webhooks for interactions.

◆ websocket_protocol_t

enum dpp::websocket_protocol_t : uint8_t

Websocket protocol types available on Discord.

Enumerator
ws_json 

JSON data, text, UTF-8 character set.

ws_etf 

Erlang Term Format (ETF) binary protocol.

◆ ws_opcode

enum dpp::ws_opcode : uint8_t

Low-level websocket opcodes for frames.

Enumerator
OP_CONTINUATION 

Continuation.

OP_TEXT 

Text frame.

OP_BINARY 

Binary frame.

OP_CLOSE 

Close notification with close code.

OP_PING 

Low level ping.

OP_PONG 

Low level pong.

OP_AUTO 

Automatic selection of type.

◆ ws_state

enum dpp::ws_state : uint8_t

Websocket connection status.

Enumerator
HTTP_HEADERS 

Sending/receiving HTTP headers, acting as a standard HTTP connection. This is the state prior to receiving "HTTP/1.1 101 Switching Protocols" from the server side.

CONNECTED 

Connected as a websocket, and "upgraded". Now talking using binary frames.

Function Documentation

◆ base64_encode()

std::string DPP_EXPORT dpp::base64_encode ( unsigned char const *  buf,
unsigned int  buffer_length 
)

Base64 encode data into a string.

Parameters
bufRaw binary buffer
buffer_lengthBuffer length to encode
Returns
The base64 encoded string

◆ bool_not_null()

bool DPP_EXPORT dpp::bool_not_null ( const nlohmann::json *  j,
const char *  keyname 
)

Returns a boolean value from a json field value, if defined, else returns false.

Parameters
jnlohmann::json instance to retrieve value from
keynamekey name to check for a value
Returns
found value

◆ close_socket()

bool dpp::close_socket ( dpp::socket  sfd)

Close a socket.

Parameters
sfdSocket to close
Returns
false on error, true on success

◆ comma()

template<class T >
std::string dpp::comma ( value)

Add commas to a string (or dots) based on current locale server-side.

Template Parameters
Ttype of numeric value
Parameters
valueValue
Returns
std::string number with commas added

◆ double_not_null()

double DPP_EXPORT dpp::double_not_null ( const nlohmann::json *  j,
const char *  keyname 
)

Returns a double from a json field value, if defined, else returns 0.

Parameters
jnlohmann::json instance to retrieve value from
keynamekey name to check for a value
Returns
found value

◆ DPP_CHECK_ABI_COMPAT() [1/3]

dpp::DPP_CHECK_ABI_COMPAT ( async<>  ,
async_dummy   
)

◆ DPP_CHECK_ABI_COMPAT() [2/3]

dpp::DPP_CHECK_ABI_COMPAT ( coroutine< void >  ,
coroutine_dummy   
)

◆ DPP_CHECK_ABI_COMPAT() [3/3]

dpp::DPP_CHECK_ABI_COMPAT ( task< void >  ,
task_dummy   
)

◆ DPP_DEPRECATED()

class DPP_EXPORT dpp::DPP_DEPRECATED ( "commandhandler should not be used. Please consider using dpp::cluster::register_command instead."  )

The commandhandler class represents a group of commands, prefixed or slash commands with handling functions.

It can automatically register slash commands, and handle routing of messages and interactions to separated command handler functions.

Deprecated:
commandhandler and message commands are deprecated and dpp::slashcommand is encouraged as a replacement.

List of guild commands to bulk register

List of global commands to bulk register

Commands in the handler

Valid prefixes

Set to true automatically if one of the prefixes added is "/"

Cluster we are attached to for issuing REST calls

Application ID

Interaction event handle

Message event handle

Returns true if the string has a known prefix on the start. Modifies string to remove prefix if it returns true.

Parameters
strString to check and modify
Returns
true string contained a prefix, prefix removed from string
false string did not contain a prefix

Construct a new commandhandler object

Parameters
oOwning cluster to attach to
auto_hook_eventsSet to true to automatically hook the on_slashcommand and on_message events. You should not need to set this to false unless you have a specific use case, as D++ supports multiple listeners to an event, so will allow the commandhandler to hook to your command events without disrupting other uses for the events you may have.
application_idThe application id of the bot. If not specified, the class will look within the cluster object and use cluster::me::id instead.

Destroy the commandhandler object

Set the application id after construction

Parameters
oOwning cluster to attach to

Add a prefix to the command handler

Parameters
prefixPrefix to be handled by the command handler
Returns
commandhandler& reference to self

Add a command to the command handler

Parameters
commandCommand to be handled. Note that if any one of your prefixes is "/" this will attempt to register a global command using the API and you will receive notification of this command via an interaction event.
handlerHandler function
parametersParameters to use for the command
descriptionThe description of the command, shown for slash commands
guild_idThe guild ID to restrict the command to. For slash commands causes registration of a guild command as opposed to a global command.
Returns
commandhandler& reference to self
Exceptions
dpp::logic_exceptionif application ID cannot be determined

Register all slash commands with Discord This method must be called at least once if you are using the "/" prefix to mark the end of commands being added to the handler. Note that this uses bulk registration and will replace any existing slash commands.

Note that if you have previously registered your commands and they have not changed, you do not need to call this again. Discord retains a cache of previously added commands.

Returns
commandhandler& Reference to self for chaining method calls

Route a command from the on_message_create function. Call this method from within your on_message_create with the received dpp::message object if you have disabled automatic registration of events.

Parameters
eventmessage create event to parse

Route a command from the on_slashcommand function. Call this method from your on_slashcommand with the received dpp::interaction_create_t object if you have disabled automatic registration of events.

Parameters
eventcommand interaction event to parse

Reply to a command. You should use this method rather than cluster::message_create as the way you reply varies between slash commands and message commands. Note you should ALWAYS reply. Slash commands will emit an ugly error to the user if you do not emit some form of reply within 3 seconds.

Parameters
mmessage to reply with.
sourcesource of the command
callbackUser function to execute when the api call completes.

Reply to a command without a message, causing the discord client to display "Bot name is thinking...". The "thinking" message will persist for a maximum of 15 minutes. This counts as a reply for a slash command. Slash commands will emit an ugly error to the user if you do not emit some form of reply within 3 seconds.

Parameters
sourcesource of the command
callbackUser function to execute when the api call completes.

Easter egg (redefinition of dpp::commandhandler::thinking).

◆ find_channel()

DPP_EXPORT class channel * dpp::find_channel ( snowflake  id)

Find an object in the cache by id.

Returns
channel * Pointer to the object or nullptr when it's not found

◆ find_emoji()

DPP_EXPORT class emoji * dpp::find_emoji ( snowflake  id)

Find an object in the cache by id.

Returns
emoji * Pointer to the object or nullptr when it's not found

◆ find_guild()

DPP_EXPORT class guild * dpp::find_guild ( snowflake  id)

Find an object in the cache by id.

Returns
guild * Pointer to the object or nullptr when it's not found

◆ find_guild_member()

guild_member DPP_EXPORT dpp::find_guild_member ( const snowflake  guild_id,
const snowflake  user_id 
)

Get the guild_member from cache of given IDs.

Parameters
guild_idID of the guild to find guild_member for
user_idID of the user to find guild_member for
Exceptions
dpp::cache_exceptionif the guild or guild_member is not found in the cache
Returns
guild_member the cached object, if found

◆ find_role()

DPP_EXPORT class role * dpp::find_role ( snowflake  id)

Find an object in the cache by id.

Returns
role * Pointer to the object or nullptr when it's not found

◆ find_user()

DPP_EXPORT class user * dpp::find_user ( snowflake  id)

Find an object in the cache by id.

Returns
user * Pointer to the object or nullptr when it's not found

◆ for_each_json()

void DPP_EXPORT dpp::for_each_json ( nlohmann::json *  parent,
std::string_view  key,
const std::function< void(nlohmann::json *)> &  fn 
)

Applies a function to each element of a json array.

Parameters
parentnlohmann::json instance to retrieve value from
keykey name to check for the values
fnfunction to apply to each element

◆ from_json() [1/8]

void dpp::from_json ( const nlohmann::json &  j,
autocomplete_interaction ai 
)

helper function to deserialize an autocomplete_interaction from json

See also
https://github.com/nlohmann/json#arbitrary-types-conversions
Parameters
joutput json object
aiautocomplete_interaction to be deserialized

◆ from_json() [2/8]

void dpp::from_json ( const nlohmann::json &  j,
command_data_option cdo 
)

helper function to deserialize a command_data_option from json

See also
https://github.com/nlohmann/json#arbitrary-types-conversions
Parameters
joutput json object
cdocommand_data_option to be deserialized

◆ from_json() [3/8]

void dpp::from_json ( const nlohmann::json &  j,
command_interaction ci 
)

helper function to deserialize a command_interaction from json

See also
https://github.com/nlohmann/json#arbitrary-types-conversions
Parameters
joutput json object
cicommand_interaction to be deserialized

◆ from_json() [4/8]

void dpp::from_json ( const nlohmann::json &  j,
component_interaction bi 
)

helper function to deserialize a component_interaction from json

See also
https://github.com/nlohmann/json#arbitrary-types-conversions
Parameters
joutput json object
bibutton_interaction to be deserialized

◆ from_json() [5/8]

void dpp::from_json ( const nlohmann::json &  j,
guild_member gm 
)

helper function to deserialize a guild_member from json

See also
https://github.com/nlohmann/json#arbitrary-types-conversions
Parameters
joutput json object
gmguild_member to be deserialized

◆ from_json() [6/8]

void dpp::from_json ( const nlohmann::json &  j,
interaction i 
)

helper function to deserialize an interaction from json

See also
https://github.com/nlohmann/json#arbitrary-types-conversions
Parameters
joutput json object
iinteraction to be deserialized

◆ from_json() [7/8]

void dpp::from_json ( const nlohmann::json &  j,
user u 
)

helper function to deserialize a user from json

See also
https://github.com/nlohmann/json#arbitrary-types-conversions
Parameters
joutput json object
uuser to be deserialized

◆ from_json() [8/8]

void dpp::from_json ( const nlohmann::json &  j,
user_identified u 
)

helper function to deserialize a user_identified from json

See also
https://github.com/nlohmann/json#arbitrary-types-conversions
Parameters
joutput json object
uuser to be deserialized

◆ from_string() [1/5]

template<typename T >
T dpp::from_string ( const std::string &  s)

Convert any value from a string to another type using stringstream.

Template Parameters
TType to convert to
Parameters
sString to convert from
Returns
T Returned numeric value
Note
Base 10 for numeric conversions.

◆ from_string() [2/5]

template<uint64_t >
uint64_t dpp::from_string ( const std::string &  s)

Specialised conversion of uint64_t from string.

Template Parameters
int64_t
Parameters
sstring to convert
Returns
uint64_t return value

◆ from_string() [3/5]

template<uint32_t >
uint32_t dpp::from_string ( const std::string &  s)

Specialised conversion of uint32_t from string.

Template Parameters
uint32_t
Parameters
sstring to convert
Returns
uint32_t return value

◆ from_string() [4/5]

template<int >
int dpp::from_string ( const std::string &  s)

Specialised conversion of int from string.

Template Parameters
int
Parameters
sstring to convert
Returns
int return value

◆ from_string() [5/5]

template<typename T >
T dpp::from_string ( const std::string &  s,
std::ios_base &(*)(std::ios_base &)  f 
)

Convert any value from a string to another type using stringstream. The optional second parameter indicates the format of the input string, e.g. std::dec for decimal, std::hex for hex, std::oct for octal.

Template Parameters
TType to convert to
Parameters
sString to convert from
fNumeric base, e.g. std::dec or std::hex
Returns
T Returned numeric value

◆ garbage_collection()

void DPP_EXPORT dpp::garbage_collection ( )

Run garbage collection across all caches removing deleted items that have been deleted over 60 seconds ago.

◆ get_channel_cache()

DPP_EXPORT cache< class channel > * dpp::get_channel_cache ( )

◆ get_channel_count()

DPP_EXPORT uint64_t dpp::get_channel_count ( )

Get the amount of cached channel objects.

◆ get_emoji_cache()

DPP_EXPORT cache< class emoji > * dpp::get_emoji_cache ( )

◆ get_emoji_count()

DPP_EXPORT uint64_t dpp::get_emoji_count ( )

Get the amount of cached emoji objects.

◆ get_guild_cache()

DPP_EXPORT cache< class guild > * dpp::get_guild_cache ( )

◆ get_guild_count()

DPP_EXPORT uint64_t dpp::get_guild_count ( )

Get the amount of cached guild objects.

◆ get_role_cache()

DPP_EXPORT cache< class role > * dpp::get_role_cache ( )

◆ get_role_count()

DPP_EXPORT uint64_t dpp::get_role_count ( )

Get the amount of cached role objects.

◆ get_user_cache()

DPP_EXPORT cache< class user > * dpp::get_user_cache ( )

◆ get_user_count()

DPP_EXPORT uint64_t dpp::get_user_count ( )

Get the amount of cached user objects.

◆ int16_not_null()

uint16_t DPP_EXPORT dpp::int16_not_null ( const nlohmann::json *  j,
const char *  keyname 
)

Returns a 16 bit unsigned integer from a json field value, if defined, else returns 0.

Parameters
jnlohmann::json instance to retrieve value from
keynamekey name to check for a value
Returns
found value

◆ int32_not_null()

uint32_t DPP_EXPORT dpp::int32_not_null ( const nlohmann::json *  j,
const char *  keyname 
)

Returns a 32 bit unsigned integer from a json field value, if defined, else returns 0.

Parameters
jnlohmann::json instance to retrieve value from
keynamekey name to check for a value
Returns
found value

◆ int64_not_null()

uint64_t DPP_EXPORT dpp::int64_not_null ( const nlohmann::json *  j,
const char *  keyname 
)

Returns a 64 bit unsigned integer from a json field value, if defined, else returns 0. DO NOT use this for snowflakes, as usually snowflakes are wrapped in a string!

Parameters
jnlohmann::json instance to retrieve value from
keynamekey name to check for a value
Returns
found value

◆ int8_not_null()

uint8_t DPP_EXPORT dpp::int8_not_null ( const nlohmann::json *  j,
const char *  keyname 
)

Returns an 8 bit unsigned integer from a json field value, if defined, else returns 0.

Parameters
jnlohmann::json instance to retrieve value from
keynamekey name to check for a value
Returns
found value

◆ leading_zeroes()

template<typename T >
std::string dpp::leading_zeroes ( i,
size_t  width 
)

Format a numeric type as a string with leading zeroes.

Template Parameters
Tnumeric type
Parameters
inumeric value
widthwidth of type including the leading zeroes
Returns
std::string resultant string with leading zeroes

◆ lowercase()

template<typename T >
std::basic_string< T > dpp::lowercase ( const std::basic_string< T > &  s)

Convert a string to lowercase using tolower()

Template Parameters
Ttype of string
Parameters
sString to lowercase
Returns
std::basic_string<T> lowercased string

◆ ltrim()

std::string dpp::ltrim ( std::string  s)
inline

trim from beginning of string (left)

Parameters
sstring to trim
Returns
std::string trimmed string

◆ resolve_hostname()

const dns_cache_entry * dpp::resolve_hostname ( const std::string &  hostname,
const std::string &  port 
)

Resolve a hostname to an addrinfo.

Parameters
hostnameHostname to resolve
portA port number or named service, e.g. "80"
Returns
dns_cache_entry* First IP address associated with the hostname DNS record
Exceptions
dpp::connection_exceptionOn failure to resolve hostname

◆ rest_request()

template<class T >
void dpp::rest_request ( dpp::cluster c,
const char *  basepath,
const std::string &  major,
const std::string &  minor,
http_method  method,
const std::string &  postdata,
command_completion_event_t  callback 
)
inline

Templated REST request helper to save on typing.

Template Parameters
Ttype to return in lambda callback
Parameters
ccalling cluster
basepathbase path for API call
majormajor API function
minorminor API function
methodHTTP method
postdataPost data or empty string
callbackCallback lambda

◆ rest_request< confirmation >()

template<>
void dpp::rest_request< confirmation > ( dpp::cluster c,
const char *  basepath,
const std::string &  major,
const std::string &  minor,
http_method  method,
const std::string &  postdata,
command_completion_event_t  callback 
)
inline

Templated REST request helper to save on typing (specialised for confirmation)

Template Parameters
Ttype to return in lambda callback
Parameters
ccalling cluster
basepathbase path for API call
majormajor API function
minorminor API function
methodHTTP method
postdataPost data or empty string
callbackCallback lambda

◆ rest_request< message >()

template<>
void dpp::rest_request< message > ( dpp::cluster c,
const char *  basepath,
const std::string &  major,
const std::string &  minor,
http_method  method,
const std::string &  postdata,
command_completion_event_t  callback 
)
inline

Templated REST request helper to save on typing (specialised for message)

Template Parameters
Ttype to return in lambda callback
Parameters
ccalling cluster
basepathbase path for API call
majormajor API function
minorminor API function
methodHTTP method
postdataPost data or empty string
callbackCallback lambda

◆ rest_request_list() [1/2]

template<class T >
void dpp::rest_request_list ( dpp::cluster c,
const char *  basepath,
const std::string &  major,
const std::string &  minor,
http_method  method,
const std::string &  postdata,
command_completion_event_t  callback,
const std::string &  key,
const std::string &  root 
)
inline

Templated REST request helper to save on typing (for returned lists)

Template Parameters
Tsingular type to return in lambda callback
Tmap type to return in lambda callback
Parameters
ccalling cluster
basepathbase path for API call
majormajor API function
minorminor API function
methodHTTP method
postdataPost data or empty string
keyKey name of elements in the json list
rootRoot element to look for
callbackCallback lambda

◆ rest_request_list() [2/2]

template<class T >
void dpp::rest_request_list ( dpp::cluster c,
const char *  basepath,
const std::string &  major,
const std::string &  minor,
http_method  method,
const std::string &  postdata,
command_completion_event_t  callback,
const std::string &  key = "id" 
)
inline

Templated REST request helper to save on typing (for returned lists)

Template Parameters
Tsingular type to return in lambda callback
Tmap type to return in lambda callback
Parameters
ccalling cluster
basepathbase path for API call
majormajor API function
minorminor API function
methodHTTP method
postdataPost data or empty string
keyKey name of elements in the json list
callbackCallback lambda

◆ rest_request_list< ban >()

template<>
void dpp::rest_request_list< ban > ( dpp::cluster c,
const char *  basepath,
const std::string &  major,
const std::string &  minor,
http_method  method,
const std::string &  postdata,
command_completion_event_t  callback,
const std::string &  key 
)
inline

Templated REST request helper to save on typing (for returned lists, specialised for bans)

Template Parameters
Tsingular type to return in lambda callback
Tmap type to return in lambda callback
Parameters
ccalling cluster
basepathbase path for API call
majormajor API function
minorminor API function
methodHTTP method
postdataPost data or empty string
keyKey name of elements in the json list
callbackCallback lambda

◆ rest_request_list< invite >()

template<>
void dpp::rest_request_list< invite > ( dpp::cluster c,
const char *  basepath,
const std::string &  major,
const std::string &  minor,
http_method  method,
const std::string &  postdata,
command_completion_event_t  callback,
const std::string &  key 
)
inline

Templated REST request helper to save on typing (for returned lists, specialised for invites)

Template Parameters
Tsingular type to return in lambda callback
Tmap type to return in lambda callback
Parameters
ccalling cluster
basepathbase path for API call
majormajor API function
minorminor API function
methodHTTP method
postdataPost data or empty string
keyKey name of elements in the json list
callbackCallback lambda

◆ rest_request_list< sticker_pack >()

template<>
void dpp::rest_request_list< sticker_pack > ( dpp::cluster c,
const char *  basepath,
const std::string &  major,
const std::string &  minor,
http_method  method,
const std::string &  postdata,
command_completion_event_t  callback,
const std::string &  key 
)
inline

Templated REST request helper to save on typing (for returned lists, specialised for sticker packs)

Template Parameters
Tsingular type to return in lambda callback
Tmap type to return in lambda callback
Parameters
ccalling cluster
basepathbase path for API call
majormajor API function
minorminor API function
methodHTTP method
postdataPost data or empty string
keyKey name of elements in the json list
callbackCallback lambda

◆ rest_request_list< voiceregion >()

template<>
void dpp::rest_request_list< voiceregion > ( dpp::cluster c,
const char *  basepath,
const std::string &  major,
const std::string &  minor,
http_method  method,
const std::string &  postdata,
command_completion_event_t  callback,
const std::string &  key 
)
inline

Templated REST request helper to save on typing (for returned lists, specialised for voiceregions)

Template Parameters
Tsingular type to return in lambda callback
Tmap type to return in lambda callback
Parameters
ccalling cluster
basepathbase path for API call
majormajor API function
minorminor API function
methodHTTP method
postdataPost data or empty string
keyKey name of elements in the json list
callbackCallback lambda

◆ rest_request_vector()

template<class T >
void dpp::rest_request_vector ( dpp::cluster c,
const char *  basepath,
const std::string &  major,
const std::string &  minor,
http_method  method,
const std::string &  postdata,
command_completion_event_t  callback 
)
inline

Templated REST request helper to save on typing (for returned lists, specialised for objects which doesn't have ids)

Template Parameters
Tsingular type to return in lambda callback
Tvector type to return in lambda callback
Parameters
ccalling cluster
basepathbase path for API call
majormajor API function
minorminor API function
methodHTTP method
postdataPost data or empty string
callbackCallback lambda

◆ rtrim()

std::string dpp::rtrim ( std::string  s)
inline

trim from end of string (right)

Parameters
sString to trim
Returns
std::string trimmed string

◆ run_once()

template<typename T >
auto dpp::run_once ( )

Run some code within an if() statement only once.

Use this template like this:

if (dpp::run_once<struct any_unique_name_you_like_here>()) {
// Your code here
}
Template Parameters
Tany unique 'tag' identifier name
Returns
auto a true/false return to say if we should execute or not

◆ set_bool_not_null()

void DPP_EXPORT dpp::set_bool_not_null ( const nlohmann::json *  j,
const char *  keyname,
bool &  v 
)

Sets a boolean from a json field value, if defined, else does nothing.

Parameters
jnlohmann::json instance to retrieve value from
keynamekey name to check for a value
vValue to change

◆ set_double_not_null()

void DPP_EXPORT dpp::set_double_not_null ( const nlohmann::json *  j,
const char *  keyname,
double &  v 
)

Sets a double from a json field value, if defined, else does nothing.

Parameters
jnlohmann::json instance to retrieve value from
keynamekey name to check for a value
vValue to change

◆ set_iconhash_not_null()

void DPP_EXPORT dpp::set_iconhash_not_null ( const nlohmann::json *  j,
const char *  keyname,
utility::iconhash v 
)

This is a repeat of set_string_not_null, but takes in a iconhash.

Parameters
jnlohmann::json instance to retrieve value from
keynamekey name to check for a value
vValue to change

◆ set_int16_not_null()

void DPP_EXPORT dpp::set_int16_not_null ( const nlohmann::json *  j,
const char *  keyname,
uint16_t &  v 
)

Sets an unsigned 16 bit integer from a json field value, if defined, else does nothing.

Parameters
jnlohmann::json instance to retrieve value from
keynamekey name to check for a value
vValue to change

◆ set_int32_not_null()

void DPP_EXPORT dpp::set_int32_not_null ( const nlohmann::json *  j,
const char *  keyname,
uint32_t &  v 
)

Sets an unsigned 32 bit integer from a json field value, if defined, else does nothing.

Parameters
jnlohmann::json instance to retrieve value from
keynamekey name to check for a value
vValue to change

◆ set_int64_not_null()

void DPP_EXPORT dpp::set_int64_not_null ( const nlohmann::json *  j,
const char *  keyname,
uint64_t &  v 
)

Sets an unsigned 64 bit integer from a json field value, if defined, else does nothing.

Parameters
jnlohmann::json instance to retrieve value from
keynamekey name to check for a value
vValue to change

◆ set_int8_not_null()

void DPP_EXPORT dpp::set_int8_not_null ( const nlohmann::json *  j,
const char *  keyname,
uint8_t &  v 
)

Sets an unsigned 8 bit integer from a json field value, if defined, else does nothing.

Parameters
jnlohmann::json instance to retrieve value from
keynamekey name to check for a value
vValue to change

◆ set_nonblocking()

bool dpp::set_nonblocking ( dpp::socket  sockfd,
bool  non_blocking 
)

Set a socket to blocking or non-blocking IO.

Parameters
sockfdsocket to act upon
non_blockingshould socket be non-blocking?
Returns
false on error, true on success

◆ set_object_array_not_null()

template<class T >
void dpp::set_object_array_not_null ( nlohmann::json *  j,
std::string_view  key,
std::vector< T > &  v 
)

Sets an array of objects from a json field value, if defined, else does nothing.

Template Parameters
TThe class of which the array consists of. Must be derived from dpp::json_interface
Parameters
jnlohmann::json instance to retrieve value from
keykey name to check for the values
vValue to change

◆ set_snowflake_array_not_null()

void DPP_EXPORT dpp::set_snowflake_array_not_null ( const nlohmann::json *  j,
const char *  keyname,
std::vector< class snowflake > &  v 
)

Sets an array of snowflakes from a json field value, if defined, else does nothing.

Parameters
jnlohmann::json instance to retrieve value from
keynamekey name to check for the values
vValue to change

◆ set_snowflake_not_null()

void DPP_EXPORT dpp::set_snowflake_not_null ( const nlohmann::json *  j,
const char *  keyname,
uint64_t &  v 
)

Sets a snowflake id from a json field value, if defined, else does nothing.

Parameters
jnlohmann::json instance to retrieve value from
keynamekey name to check for a value
vValue to change

◆ set_string_not_null()

void DPP_EXPORT dpp::set_string_not_null ( const nlohmann::json *  j,
const char *  keyname,
std::string &  v 
)

Sets a string from a json field value, if defined, else does nothing.

Parameters
jnlohmann::json instance to retrieve value from
keynamekey name to check for a value
vValue to change

◆ set_ts_not_null()

void DPP_EXPORT dpp::set_ts_not_null ( const nlohmann::json *  j,
const char *  keyname,
time_t &  v 
)

Sets an timestamp from a json field value containing an ISO8601 string, if defined, else does nothing.

Parameters
jnlohmann::json instance to retrieve value from
keynamekey name to check for a value
vValue to change

◆ snowflake_not_null()

uint64_t DPP_EXPORT dpp::snowflake_not_null ( const nlohmann::json *  j,
const char *  keyname 
)

Returns a snowflake id from a json field value, if defined, else returns 0.

Parameters
jnlohmann::json instance to retrieve value from
keynamekey name to check for a value
Returns
found value

◆ string_not_null()

std::string DPP_EXPORT dpp::string_not_null ( const nlohmann::json *  j,
const char *  keyname 
)

Returns a string from a json field value, if defined, else returns an empty string.

Parameters
jnlohmann::json instance to retrieve value from
keynamekey name to check for a value
Returns
found value

◆ sync()

template<typename T , class F , class... Ts>
T dpp::sync ( class cluster c,
func,
Ts &&...  args 
)

Call a D++ REST function synchronously.

Synchronously calling a REST function means IT WILL BLOCK - This is a Bad Thing™ and strongly discouraged. There are very few circumstances you actually need this. If you do need to use this, you'll know it.

Example:

dpp::message m = dpp::sync<dpp::message>(&bot, &dpp::cluster::message_create, dpp::message(channel_id, "moo."));
void message_create(const struct message &m, command_completion_event_t callback=utility::log_error())
Send a message to a channel. The callback function is called when the message has been sent.
Represents messages sent and received on Discord.
Definition: message.h:2071
Warning
As previously mentioned, this template will block. It is ill-advised to call this outside of a separate thread and this should never be directly used in any event such as dpp::cluster::on_interaction_create!
Template Parameters
Ttype of expected return value, should match up with the method called
FType of class method in dpp::cluster to call.
TsFunction parameters in method call
Parameters
cA pointer to dpp::cluster object
funcpointer to class method in dpp::cluster to call. This can call any dpp::cluster member function who's last parameter is a dpp::command_completion_event_t callback type.
argsZero or more arguments for the method call
Returns
An instantiated object of type T
Exceptions
dpp::rest_exceptionOn failure of the method call, an exception is thrown

◆ to_hex()

template<typename T >
std::string dpp::to_hex ( i,
bool  leading_zeroes = true 
)

Convert a numeric value to hex.

Template Parameters
Tnumeric type
Parameters
inumeric value
leading_zeroesset to false if you don't want the leading zeroes in the output
Returns
std::string value in hex, the length will be 2* the raw size of the type

◆ to_json() [1/7]

void dpp::to_json ( nlohmann::json &  j,
const command_option opt 
)

helper function to serialize a command_option to json

See also
https://github.com/nlohmann/json#arbitrary-types-conversions
Parameters
joutput json object
optcommand_option to be serialized

◆ to_json() [2/7]

void dpp::to_json ( nlohmann::json &  j,
const command_option_choice choice 
)

helper function to serialize a command_option_choice to json

See also
https://github.com/nlohmann/json#arbitrary-types-conversions
Parameters
joutput json object
choicecommand_option_choice to be serialized

◆ to_json() [3/7]

void dpp::to_json ( nlohmann::json &  j,
const command_permission cp 
)

helper function to serialize a command_permission to json

See also
https://github.com/nlohmann/json#arbitrary-types-conversions
Parameters
joutput json object
cpcommand_permission to be serialized

◆ to_json() [4/7]

void dpp::to_json ( nlohmann::json &  j,
const guild_command_permissions gcp 
)

helper function to serialize a guild_command_permissions to json

See also
https://github.com/nlohmann/json#arbitrary-types-conversions
Parameters
joutput json object
gcpguild_command_permissions to be serialized

◆ to_json() [5/7]

void dpp::to_json ( nlohmann::json &  j,
const permission_overwrite po 
)

Serialize a permission_overwrite object to json.

Parameters
jJSON object to serialize to
poobject to serialize

◆ to_json() [6/7]

void dpp::to_json ( nlohmann::json &  j,
const slashcommand cmd 
)

helper function to serialize a slashcommand to json

See also
https://github.com/nlohmann/json#arbitrary-types-conversions
Parameters
joutput json object
cmdslashcommand to be serialized

◆ to_json() [7/7]

void dpp::to_json ( nlohmann::json &  j,
const thread_metadata tmdata 
)

Serialize a thread_metadata object to json.

Parameters
jJSON object to serialize to
tmdataobject to serialize

◆ trim()

std::string dpp::trim ( std::string  s)
inline

Trim from both ends of string (right then left)

Parameters
sstring to trim
Returns
std::string trimmed string

◆ ts_not_null()

time_t DPP_EXPORT dpp::ts_not_null ( const nlohmann::json *  j,
const char *  keyname 
)

Returns a time_t from an ISO8601 timestamp field in a json value, if defined, else returns epoch value of 0.

Parameters
jnlohmann::json instance to retrieve value from
keynamekey name to check for a value
Returns
found value

◆ ts_to_string()

std::string DPP_EXPORT dpp::ts_to_string ( time_t  ts)

Convert time_t unix epoch to std::string ISO date/time.

Parameters
tsTimestamp to convert
Returns
std::string Converted time/date string

◆ uppercase()

template<typename T >
std::basic_string< T > dpp::uppercase ( const std::basic_string< T > &  s)

Convert a string to uppercase using toupper()

Template Parameters
Ttype of string
Parameters
sString to uppercase
Returns
std::basic_string<T> uppercased string

◆ validate_configuration()

template<build_type >
bool dpp::validate_configuration ( )

◆ when_any()

template<typename... Args>
dpp::when_any ( Args...  ) -> when_any< detail::when_any::awaitable_type< Args >... >

Variable Documentation

◆ deletion_mutex

DPP_EXPORT std::mutex dpp::deletion_mutex
extern

◆ deletion_queue

DPP_EXPORT std::unordered_map<managed*, time_t> dpp::deletion_queue
extern

◆ DISCORD_HOST

constexpr const char* dpp::DISCORD_HOST = "https://discord.com"
inlinestaticconstexpr

◆ FORMAT_VERSION

const uint8_t dpp::FORMAT_VERSION = 131

Current ETF format version in use.

◆ http_version

const std::string dpp::http_version
inlinestatic
Initial value:
= "DiscordBot (https://github.com/brainboxdotcc/DPP, "
+ to_hex(DPP_VERSION_MAJOR, false) + "."
+ to_hex(DPP_VERSION_MINOR, false) + "."
+ to_hex(DPP_VERSION_PATCH, false) + ")"
std::string to_hex(T i, bool leading_zeroes=true)
Convert a numeric value to hex.
Definition: stringops.h:195

◆ is_valid_config

const bool dpp::is_valid_config = validate_configuration<build_type::universal>()
inline

Version checking, making sure the program is in a configuration compatible with DPP's.

Do NOT make these variables constexpr. We want them to initialize at runtime so the function can be pulled from the shared library object.

◆ MAX_AVATAR_SIZE

constexpr uint32_t dpp::MAX_AVATAR_SIZE = 10240 * 1000
constexpr

◆ message_ref_type

enum DPP_EXPORT dpp::message_ref_type

Message Reference type.

◆ mrt_forward

enum DPP_EXPORT dpp::mrt_forward = 1

A forwarded message

◆ opus_channel_count

constexpr int32_t dpp::opus_channel_count = 2
inlineconstexpr

Channel count for OPUS (stereo)

◆ opus_sample_rate_hz

constexpr int32_t dpp::opus_sample_rate_hz = 48000
inlineconstexpr

Sample rate for OPUS (48khz)

◆ secret_key_size

constexpr size_t dpp::secret_key_size = 32
inlineconstexpr

◆ send_audio_raw_max_length

constexpr size_t dpp::send_audio_raw_max_length = 11520
inlineconstexpr

◆ voice_protocol_version

constexpr uint8_t dpp::voice_protocol_version = 8
inlineconstexpr

Discord voice protocol version.

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