dpp::command_option_choice
dpp::json_interface< command_option_choice >
appcommand.h
struct friend struct json_interface< command_option_choice > json_interface< command_option_choice > dpp::command_option_choice::json_interface< command_option_choice > json_interface< command_option_choice >
std::string std::string dpp::command_option_choice::name name dpp::command_option_choice::name

Option name (1-32 chars).

std::map< std::string, std::string > std::map<std::string, std::string> dpp::command_option_choice::name_localizations name_localizations dpp::command_option_choice::name_localizations

Localisations of command option name.

command_value command_value dpp::command_option_choice::value value dpp::command_option_choice::value

Option value.

command_option_choice & command_option_choice & dpp::command_option_choice::fill_from_json_impl (nlohmann::json *j) fill_from_json_impl dpp::command_option_choice::fill_from_json_impl nlohmann::json * j

Fill object properties from JSON.

j

JSON to fill from

command_option_choice& Reference to self

dpp::command_option_choice::command_option_choice
()=default
command_option_choice
dpp::command_option_choice::command_option_choice

Construct a new command option choice object.

dpp::command_option_choice::command_option_choice
(const std::string &n, command_value v)
command_option_choice
dpp::command_option_choice::command_option_choice
const std::string & n
command_value v

Construct a new command option choice object.

n

name to initialise with

v

value to initialise with

virtual dpp::command_option_choice::~command_option_choice
()=default
~command_option_choice
dpp::command_option_choice::~command_option_choice
command_option_choice & command_option_choice & dpp::command_option_choice::add_localization (const std::string &language, const std::string &_name) add_localization dpp::command_option_choice::add_localization const std::string & language const std::string & _name

Add a localisation for this command option choice.

https://discord.com/developers/docs/reference#locales

language

Name of language, see the list of locales linked to above

_name

name of command option choice in the specified language

command_option_choice& reference to self for fluent chaining

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

Convert object to json string.

with_id

Whether to include the ID or not

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

std::string Json built from the structure

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

Convert object from nlohmann::json.

j

nlohmann::json object

T& Reference to self for fluent calling

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

Convert object to nlohmann::json.

with_id

Whether to include the ID or not

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

json Json built from the structure

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

dpp::command_option_choice
dpp::json_interface< T >
dpp::json_interface< command_option_choice >
< command_option_choice >
K
T
dpp::command_option_choice
name
value
name_localizations
dpp::json_interface< T >
dpp::json_interface< command_option_choice >
< command_option_choice >
std::basic_string< Char >
std::map< K, T >
keys
elements
std::map< std::string, std::string >
elements
keys
< std::string, std::string >
std::string
variant< std::monostate, std::string, int64_t, bool, snowflake, double >
- dpp::command_option_choice
  add_localization
- dpp::command_option_choice
  build_json
- dpp::command_option_choice
  command_option_choice
- dpp::command_option_choice
  command_option_choice
- dpp::command_option_choice
  fill_from_json
- dpp::command_option_choice
  fill_from_json_impl
- dpp::command_option_choice
  json_interface< command_option_choice >
- dpp::command_option_choice
  name
- dpp::command_option_choice
  name_localizations
- dpp::command_option_choice
  to_json
- dpp::command_option_choice
  value
- dpp::command_option_choice
  ~command_option_choice