Represents the sending source of a command. More...
#include "commandhandler.h"
Public Member Functions | |
command_source (const struct interaction_create_t &event) | |
Construct a command_source object from an interaction_create_t event. More... | |
command_source (const struct message_create_t &event) | |
Construct a command_source object from a message_create_t event. More... | |
Public Attributes | |
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... | |
snowflake | guild_id |
Sending guild id. More... | |
std::optional< interaction_create_t > | interaction_event |
Copy of the underlying interaction_create_t event, if it was an interaction create event. More... | |
user | issuer |
The user who issued the command. More... | |
std::optional< message_create_t > | message_event |
Copy of the underlying message_create_t event, if it was a message create event. More... | |
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.
dpp::command_source::command_source | ( | const struct message_create_t & | event | ) |
Construct a command_source object from a message_create_t event.
dpp::command_source::command_source | ( | const struct interaction_create_t & | event | ) |
Construct a command_source object from an interaction_create_t event.
snowflake dpp::command_source::channel_id |
Source channel id.
snowflake dpp::command_source::command_id |
Command ID of a slash command.
std::string dpp::command_source::command_token |
Token for sending a slash command reply.
snowflake dpp::command_source::guild_id |
Sending guild id.
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.
user dpp::command_source::issuer |
The user who issued the command.
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.