| D++ (DPP) C++ Discord API Bot Library

Search
Loading...
Searching...
No Matches
dpp::application Class Reference

The application class represents details of a bot application. More...

`#include <application.h>`

Inheritance diagram for dpp::application:
[legend]
Collaboration diagram for dpp::application:
[legend]

## Public Member Functions

| application ()
| ~application ()
std::string | build_json (bool with_id=false) const
| Convert object to json string.
application & | fill_from_json (nlohmann::json *j)
| Convert object from nlohmann::json.
std::string | get_cover_image_url (uint16_t size=0, const image_type format=i_png) const
| Get the application's cover image url if they have one, otherwise returns an empty string.
constexpr double | get_creation_time () const noexcept
| Get the creation time of this object according to Discord.
std::string | get_icon_url (uint16_t size=0, const image_type format=i_png) const
| Get the application's icon url if they have one, otherwise returns an empty string.
constexpr bool | operator!= (const managed &other) const noexcept
| Comparison operator for comparing two managed objects by id.
constexpr bool | operator== (const managed &other) const noexcept
| Comparison operator for comparing two managed objects by id.
auto | to_json (bool with_id=false) const
| Convert object to nlohmann::json.

## Public Attributes

uint64_t | approximate_guild_count
| Optional: Approximate count of guilds the app has been added to.
uint64_t | approximate_user_install_count
| Optional: Approximate count of users that have installed the app.
user | bot
| Optional: Partial user object for the bot user associated with the app.
bool | bot_public
| When false, only app owner add the bot to guilds.
bool | bot_require_code_grant
| When true, the app's bot will only join upon completion of the full oauth2 code grant flow.
utility::iconhash | cover_image
| Optional: the application's default rich presence invite cover image hash.
uint8_t | creator_monetization_state
std::string | custom_install_url
| The application's default custom authorization link, if enabled.
std::string | description
| The description of the app.
uint8_t | discoverability_state
uint32_t | discovery_eligibility_flags
application_event_webhook_status | event_webhooks_status
std::vector< std::string > | event_webhooks_types
| List of Webhook event types the app subscribes to.
std::string | event_webhooks_url
| Event webhooks URL for the app to receive webhook events.
uint8_t | explicit_content_filter
uint32_t | flags
| Optional: the application's public flags.
snowflake | guild_id
| Optional: if this application is a game sold on Discord, this field will be the guild to which it has been linked.
guild | guild_obj
| Partial object of the associated guild.
bool | hook
utility::iconhash | icon
| The icon hash of the app (may be empty).
snowflake | id = {}
| Unique ID of object set by Discord. This value contains a timestamp, worker ID, internal server ID, and an incrementing value. Only the timestamp is relevant to us as useful metadata.
application_install_params | install_params
| Settings for the application's default in-app authorization link, if enabled.
bool | integration_public
bool | integration_require_code_grant
std::map< application_integration_types, integration_configuration > | integration_types_config
| Default scopes and permissions for each supported installation context.
std::string | interactions_endpoint_url
| Optional: Interactions endpoint URL for the app.
std::vector< std::string > | interactions_event_types
uint8_t | interactions_version
bool | is_monetized
uint32_t | monetization_eligibility_flags
uint8_t | monetization_state
std::string | name
| The name of the app.
user | owner
| Optional: partial user object containing info on the owner of the application.
snowflake | primary_sku_id
| Optional: if this application is a game sold on Discord, this field will be the id of the "Game SKU" that is created, if exists.
std::string | privacy_policy_url
| Optional: the url of the app's privacy policy.
std::vector< std::string > | redirect_uris
| Optional: Array of redirect URIs for the app.
std::string | role_connections_verification_url
| The application's role connection verification entry point which, when configured, will render the app as a verification method in the guild role verification configuration.
uint8_t | rpc_application_state
std::vector< std::string > | rpc_origins
| Optional: an array of rpc origin urls, if rpc is enabled.
std::string | slug
| Optional: if this application is a game sold on Discord, this field will be the URL slug that links to the store page.
uint8_t | store_application_state
std::string | summary
| If this application is a game sold on Discord, this field will be the summary field for the store page of its primary SKU.
std::vector< std::string > | tags
| Up to 5 tags describing the content and functionality of the application.
app_team | team
| If the application belongs to a team, this will be a list of the members of that team (may be empty).
std::string | terms_of_service_url
| Optional: the url of the app's terms of service.
uint8_t | verification_state
std::string | verify_key
| The hex encoded key for verification in interactions and the GameSDK's GetTicket.

## Protected Member Functions

application & | fill_from_json_impl (nlohmann::json *j)

## Friends

struct | json_interface< application >

## Detailed Description

The application class represents details of a bot application.

## Constructor & Destructor Documentation

## ◆ application()

dpp::application::application | ( |  | ) |

Constructor

## ◆ ~application()

dpp::application::~application | ( |  | ) |

Destructor

## Member Function Documentation

## ◆ build_json()

std::string dpp::json_interface< application >::build_json | ( | bool | with_id = false | ) | const

inline inherited

Convert object to json string.

Parameters

  with_id | Whether to include the ID or not

Note
  Some fields are conditionally filled, do not rely on all fields being present

Returns
  std::string Json built from the structure

## ◆ fill_from_json()

application & dpp::json_interface< application >::fill_from_json | ( | nlohmann::json * | j | ) |

inline inherited

Convert object from nlohmann::json.

Parameters

  j | nlohmann::json object

Returns
  T& Reference to self for fluent calling

## ◆ fill_from_json_impl()

application & dpp::application::fill_from_json_impl | ( | nlohmann::json * | j | ) |

protected

Read class values from json object

Parameters

  j | A json object to read from

Returns
  A reference to self

## ◆ get_cover_image_url()

std::string dpp::application::get_cover_image_url | ( | uint16_t | size = 0,
|  | const image_type | format = i_png ) const

Get the application's cover image url if they have one, otherwise returns an empty string.

Parameters

  size | The size of the cover image in pixels. It can be any power of two between 16 and 4096, otherwise the default sized cover image is returned.
  format | The format to use for the avatar. It can be one of i_webp, i_jpg or i_png.

Returns
  std::string cover image url or an empty string, if required attributes are missing or an invalid format was passed

## ◆ get_creation_time()

double dpp::managed::get_creation_time | ( |  | ) | const

inline constexpr noexcept inherited

Get the creation time of this object according to Discord.

Returns
  double creation time inferred from the snowflake ID. The minimum possible value is the first second of 2015.

## ◆ get_icon_url()

std::string dpp::application::get_icon_url | ( | uint16_t | size = 0,
|  | const image_type | format = i_png ) const

Get the application's icon url if they have one, otherwise returns an empty string.

Parameters

  size | The size of the icon in pixels. It can be any power of two between 16 and 4096, otherwise the default sized icon is returned.
  format | The format to use for the avatar. It can be one of i_webp, i_jpg or i_png.

Returns
  std::string icon url or an empty string, if required attributes are missing or an invalid format was passed

## ◆ operator!=()

bool dpp::managed::operator!= | ( | const managed & | other | ) | const

inline constexpr noexcept inherited

Comparison operator for comparing two managed objects by id.

Parameters

  other | Other object to compare against

Returns
  true objects are not the same id
  false objects are the same id

## ◆ operator==()

bool dpp::managed::operator== | ( | const managed & | other | ) | const

inline constexpr noexcept inherited

Comparison operator for comparing two managed objects by id.

Parameters

  other | Other object to compare against

Returns
  true objects are the same id
  false objects are not the same id

## ◆ to_json()

auto dpp::json_interface< application >::to_json | ( | bool | with_id = false | ) | const

inline inherited

Convert object to nlohmann::json.

Parameters

  with_id | Whether to include the ID or not

Note
  Some fields are conditionally filled, do not rely on all fields being present

Returns
  json Json built from the structure

## Friends And Related Symbol Documentation

## ◆ json_interface< application >

friend struct json_interface< application >

friend

## Member Data Documentation

## ◆ approximate_guild_count

uint64_t dpp::application::approximate_guild_count

Optional: Approximate count of guilds the app has been added to.

## ◆ approximate_user_install_count

uint64_t dpp::application::approximate_user_install_count

Optional: Approximate count of users that have installed the app.

## ◆ bot

user dpp::application::bot

Optional: Partial user object for the bot user associated with the app.

## ◆ bot_public

bool dpp::application::bot_public

When false, only app owner add the bot to guilds.

## ◆ bot_require_code_grant

bool dpp::application::bot_require_code_grant

When true, the app's bot will only join upon completion of the full oauth2 code grant flow.

## ◆ cover_image

utility::iconhash dpp::application::cover_image

Optional: the application's default rich presence invite cover image hash.

## ◆ creator_monetization_state

uint8_t dpp::application::creator_monetization_state

Warning
  This variable is not documented by discord, we have no idea what it means and how it works. Use at your own risk.

## ◆ custom_install_url

std::string dpp::application::custom_install_url

The application's default custom authorization link, if enabled.

## ◆ description

std::string dpp::application::description

The description of the app.

## ◆ discoverability_state

uint8_t dpp::application::discoverability_state

Warning
  This variable is not documented by discord, we have no idea what it means and how it works. Use at your own risk.

## ◆ discovery_eligibility_flags

uint32_t dpp::application::discovery_eligibility_flags

Warning
  This variable is not documented by discord, we have no idea what it means and how it works. Use at your own risk.

## ◆ event_webhooks_status

application_event_webhook_status dpp::application::event_webhooks_status

If webhook events are enabled for the app.

## ◆ event_webhooks_types

std::vector<std::string> dpp::application::event_webhooks_types

List of Webhook event types the app subscribes to.

## ◆ event_webhooks_url

std::string dpp::application::event_webhooks_url

Event webhooks URL for the app to receive webhook events.

## ◆ explicit_content_filter

uint8_t dpp::application::explicit_content_filter

Warning
  This variable is not documented by discord, we have no idea what it means and how it works. Use at your own risk.

## ◆ flags

uint32_t dpp::application::flags

Optional: the application's public flags.

## ◆ guild_id

snowflake dpp::application::guild_id

Optional: if this application is a game sold on Discord, this field will be the guild to which it has been linked.

## ◆ guild_obj

guild dpp::application::guild_obj

Partial object of the associated guild.

## ◆ hook

bool dpp::application::hook

Warning
  This variable is not documented by discord, we have no idea what it means and how it works. Use at your own risk.

## ◆ icon

utility::iconhash dpp::application::icon

The icon hash of the app (may be empty).

## ◆ id

snowflake dpp::managed::id = {}

inherited

Unique ID of object set by Discord. This value contains a timestamp, worker ID, internal server ID, and an incrementing value. Only the timestamp is relevant to us as useful metadata.

## ◆ install_params

application_install_params dpp::application::install_params

Settings for the application's default in-app authorization link, if enabled.

## ◆ integration_public

bool dpp::application::integration_public

Warning
  This variable is not documented by discord, we have no idea what it means and how it works. Use at your own risk.

## ◆ integration_require_code_grant

bool dpp::application::integration_require_code_grant

Warning
  This variable is not documented by discord, we have no idea what it means and how it works. Use at your own risk.

## ◆ integration_types_config

std::map<application_integration_types, integration_configuration> dpp::application::integration_types_config

Default scopes and permissions for each supported installation context.

## ◆ interactions_endpoint_url

std::string dpp::application::interactions_endpoint_url

Optional: Interactions endpoint URL for the app.

## ◆ interactions_event_types

std::vector<std::string> dpp::application::interactions_event_types

Warning
  This variable is not documented by discord, we have no idea what it means and how it works. Use at your own risk.

## ◆ interactions_version

uint8_t dpp::application::interactions_version

Warning
  This variable is not documented by discord, we have no idea what it means and how it works. Use at your own risk.

## ◆ is_monetized

bool dpp::application::is_monetized

Warning
  This variable is not documented by discord, we have no idea what it means and how it works. Use at your own risk.

## ◆ monetization_eligibility_flags

uint32_t dpp::application::monetization_eligibility_flags

Warning
  This variable is not documented by discord, we have no idea what it means and how it works. Use at your own risk.

## ◆ monetization_state

uint8_t dpp::application::monetization_state

Warning
  This variable is not documented by discord, we have no idea what it means and how it works. Use at your own risk.

## ◆ name

std::string dpp::application::name

The name of the app.

## ◆ owner

user dpp::application::owner

Optional: partial user object containing info on the owner of the application.

## ◆ primary_sku_id

snowflake dpp::application::primary_sku_id

Optional: if this application is a game sold on Discord, this field will be the id of the "Game SKU" that is created, if exists.

## ◆ privacy_policy_url

std::string dpp::application::privacy_policy_url

Optional: the url of the app's privacy policy.

## ◆ redirect_uris

std::vector<std::string> dpp::application::redirect_uris

Optional: Array of redirect URIs for the app.

## ◆ role_connections_verification_url

std::string dpp::application::role_connections_verification_url

The application's role connection verification entry point which, when configured, will render the app as a verification method in the guild role verification configuration.

## ◆ rpc_application_state

uint8_t dpp::application::rpc_application_state

Warning
  This variable is not documented by discord, we have no idea what it means and how it works. Use at your own risk.

## ◆ rpc_origins

std::vector<std::string> dpp::application::rpc_origins

Optional: an array of rpc origin urls, if rpc is enabled.

## ◆ slug

std::string dpp::application::slug

Optional: if this application is a game sold on Discord, this field will be the URL slug that links to the store page.

## ◆ store_application_state

uint8_t dpp::application::store_application_state

Warning
  This variable is not documented by discord, we have no idea what it means and how it works. Use at your own risk.

## ◆ summary

std::string dpp::application::summary

If this application is a game sold on Discord, this field will be the summary field for the store page of its primary SKU.

Deprecated
  Will be removed in v11

## ◆ tags

std::vector<std::string> dpp::application::tags

Up to 5 tags describing the content and functionality of the application.

## ◆ team

app_team dpp::application::team

If the application belongs to a team, this will be a list of the members of that team (may be empty).

## ◆ terms_of_service_url

std::string dpp::application::terms_of_service_url

Optional: the url of the app's terms of service.

## ◆ verification_state

uint8_t dpp::application::verification_state

Warning
  This variable is not documented by discord, we have no idea what it means and how it works. Use at your own risk.

## ◆ verify_key

std::string dpp::application::verify_key

The hex encoded key for verification in interactions and the GameSDK's GetTicket.

D++ Library version 9.0.13 D++ Library version 9.0.12 D++ Library version 9.0.11 D++ Library version 9.0.10 D++ Library version 9.0.9 D++ Library version 9.0.8 D++ Library version 9.0.7 D++ Library version 9.0.6 D++ Library version 9.0.5 D++ Library version 9.0.4 D++ Library version 9.0.3 D++ Library version 9.0.2 D++ Library version 9.0.1 D++ Library version 9.0.0 D++ Library version 1.0.2 D++ Library version 1.0.1 D++ Library version 1.0.0