D++ (DPP)
C++ Discord API Bot Library
|
Represents an application command, created by your bot either globally, or on a guild. More...
#include <slashcommand.h>
Public Member Functions | |
slashcommand () | |
Construct a new slashcommand object. More... | |
~slashcommand () | |
Destroy the slashcommand object. More... | |
slashcommand & | add_option (const command_option &o) |
Add an option (parameter) More... | |
slashcommand & | set_name (const std::string &n) |
Set the name of the command. More... | |
slashcommand & | set_description (const std::string &d) |
Set the description of the command. More... | |
slashcommand & | set_application_id (snowflake i) |
Set the application id of the command. More... | |
slashcommand & | fill_from_json (nlohmann::json *j) |
Fill object properties from JSON. More... | |
std::string | build_json (bool with_id=false) const |
Build a json string for this object. More... | |
Public Attributes | |
snowflake | application_id |
Application id (usually matches your bots id) More... | |
std::string | name |
Command name (1-32 chars) More... | |
std::string | description |
Command description (1-100 chars) More... | |
std::vector< command_option > | options |
Command options (parameters) More... | |
snowflake | id |
Represents an application command, created by your bot either globally, or on a guild.
dpp::slashcommand::slashcommand | ( | ) |
Construct a new slashcommand object.
dpp::slashcommand::~slashcommand | ( | ) |
Destroy the slashcommand object.
slashcommand & dpp::slashcommand::add_option | ( | const command_option & | o | ) |
Add an option (parameter)
o | option (parameter) to add |
std::string dpp::slashcommand::build_json | ( | bool | with_id = false | ) | const |
Build a json string for this object.
with_id | True if to include the ID in the JSON |
slashcommand & dpp::slashcommand::fill_from_json | ( | nlohmann::json * | j | ) |
Fill object properties from JSON.
j | JSON to fill from |
slashcommand & dpp::slashcommand::set_application_id | ( | snowflake | i | ) |
Set the application id of the command.
i | application id |
slashcommand & dpp::slashcommand::set_description | ( | const std::string & | d | ) |
Set the description of the command.
d | description |
slashcommand & dpp::slashcommand::set_name | ( | const std::string & | n | ) |
Set the name of the command.
n | name of command |
snowflake dpp::slashcommand::application_id |
Application id (usually matches your bots id)
std::string dpp::slashcommand::description |
Command description (1-100 chars)
|
inherited |
Unique ID of object
std::string dpp::slashcommand::name |
Command name (1-32 chars)
std::vector<command_option> dpp::slashcommand::options |
Command options (parameters)