D++ (DPP)
C++ Discord API Bot Library
dpp::command_source Struct Reference

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

#include <commandhandler.h>

+ Collaboration diagram for dpp::command_source:

Public Member Functions

 command_source (const struct message_create_t &event)
 Construct a command_source object from a message_create_t event. More...
 
 command_source (const struct interaction_create_t &event)
 Construct a command_source object from an interaction_create_t event. More...
 

Public Attributes

snowflake guild_id
 Sending guild id. More...
 
snowflake channel_id
 Source channel id. More...
 
snowflake command_id
 Command ID of a slash command. More...
 
std::string command_token
 Token for sending a slash command reply. More...
 
user issuer
 The user who issued the command. More...
 
std::optional< message_create_tmessage_event
 Copy of the underlying message_create_t event, if it was a message create event. More...
 
std::optional< interaction_create_tinteraction_event
 Copy of the underlying interaction_create_t event, if it was an interaction create event. More...
 

Detailed Description

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.

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

Constructor & Destructor Documentation

◆ command_source() [1/2]

dpp::command_source::command_source ( const struct message_create_t event)

Construct a command_source object from a message_create_t event.

◆ command_source() [2/2]

dpp::command_source::command_source ( const struct interaction_create_t event)

Construct a command_source object from an interaction_create_t event.

Member Data Documentation

◆ channel_id

snowflake dpp::command_source::channel_id

Source channel id.

◆ command_id

snowflake dpp::command_source::command_id

Command ID of a slash command.

◆ command_token

std::string dpp::command_source::command_token

Token for sending a slash command reply.

◆ guild_id

snowflake dpp::command_source::guild_id

Sending guild id.

◆ interaction_event

std::optional<interaction_create_t> dpp::command_source::interaction_event

Copy of the underlying interaction_create_t event, if it was an interaction create event.

◆ issuer

user dpp::command_source::issuer

The user who issued the command.

◆ message_event

std::optional<message_create_t> dpp::command_source::message_event

Copy of the underlying message_create_t event, if it was a message create event.

D++ Library version 10.0.35D++ 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