Discord.C++ 0.13.0
Loading...
Searching...
No Matches
DiscordCPP::ApplicationCommand Class Reference

#include <ApplicationCommand.h>

Inheritance diagram for DiscordCPP::ApplicationCommand:
DiscordCPP::DiscordObject

Public Types

enum  Type { CHAT_INPUT = 1 , USER = 2 , MESSAGE = 3 }
 

Public Member Functions

 ApplicationCommand ()=default
 
 ApplicationCommand (const json &data, const std::string &token)
 
json to_json ()
 
void delete_command ()
 Delete this command.
 
std::string get_application_id ()
 
std::optional< std::string > get_guild_id ()
 
std::string get_name ()
 
std::string get_description ()
 
Type get_type ()
 
std::vector< ApplicationCommandOptionVariantget_options ()
 
bool has_dm_permission ()
 
std::string get_version ()
 
void set_guild_id (std::string guild_id)
 Set the guild of the command.
 
void set_name (std::string name)
 Set the command's name.
 
void set_description (std::string description)
 Set the command's description. Empty string for USER and MESSAGE commands.
 
void set_type (Type type)
 Set the command type.
 
void add_option (ApplicationCommandOptionVariant option)
 Add parameters for the command, max of 25.
 
void set_dm_permission (bool dm_permission)
 Set indicator wether the command is enabled in DMs.
 
- Public Member Functions inherited from DiscordCPP::DiscordObject
 DiscordObject ()=default
 
 DiscordObject (std::string token)
 
 DiscordObject (std::string token, std::string id)
 
std::string get_id () const
 

Additional Inherited Members

- Protected Member Functions inherited from DiscordCPP::DiscordObject
std::string get_token () const
 
json api_call (const std::string &url, const std::string &method="GET", const json &data=json(), const std::string &content_type="", const bool cache=true)
 helper function to communicate with the http api
 

Member Enumeration Documentation

◆ Type

Enumerator
CHAT_INPUT 
USER 
MESSAGE 

Constructor & Destructor Documentation

◆ ApplicationCommand() [1/2]

DiscordCPP::ApplicationCommand::ApplicationCommand ( )
default

◆ ApplicationCommand() [2/2]

DiscordCPP::ApplicationCommand::ApplicationCommand ( const json & data,
const std::string & token )

Member Function Documentation

◆ add_option()

void DiscordCPP::ApplicationCommand::add_option ( ApplicationCommandOptionVariant option)
inline

Add parameters for the command, max of 25.

◆ delete_command()

void DiscordCPP::ApplicationCommand::delete_command ( )

Delete this command.

◆ get_application_id()

std::string DiscordCPP::ApplicationCommand::get_application_id ( )
inline
Returns
The application id.

◆ get_description()

std::string DiscordCPP::ApplicationCommand::get_description ( )
inline
Returns
The command's description. Empty string for USER and MESSAGE commands.

◆ get_guild_id()

std::optional< std::string > DiscordCPP::ApplicationCommand::get_guild_id ( )
inline
Returns
The guild of the command.

◆ get_name()

std::string DiscordCPP::ApplicationCommand::get_name ( )
inline
Returns
The command's name.

◆ get_options()

std::vector< ApplicationCommandOptionVariant > DiscordCPP::ApplicationCommand::get_options ( )
inline
Returns
Parameters for the command, max of 25.

◆ get_type()

Type DiscordCPP::ApplicationCommand::get_type ( )
inline
Returns
The command type.

◆ get_version()

std::string DiscordCPP::ApplicationCommand::get_version ( )
inline
Returns
Autoincrementing version identifier updated during substantial record changes.

◆ has_dm_permission()

bool DiscordCPP::ApplicationCommand::has_dm_permission ( )
inline
Returns
Indicates wether the command is enabled in DMs. Defaults to true.

◆ set_description()

void DiscordCPP::ApplicationCommand::set_description ( std::string description)
inline

Set the command's description. Empty string for USER and MESSAGE commands.

◆ set_dm_permission()

void DiscordCPP::ApplicationCommand::set_dm_permission ( bool dm_permission)
inline

Set indicator wether the command is enabled in DMs.

◆ set_guild_id()

void DiscordCPP::ApplicationCommand::set_guild_id ( std::string guild_id)
inline

Set the guild of the command.

◆ set_name()

void DiscordCPP::ApplicationCommand::set_name ( std::string name)
inline

Set the command's name.

◆ set_type()

void DiscordCPP::ApplicationCommand::set_type ( Type type)
inline

Set the command type.

◆ to_json()

json DiscordCPP::ApplicationCommand::to_json ( )

The documentation for this class was generated from the following files: