D++ (DPP)
C++ Discord API Bot Library
|
A response to an interaction, used to reply to a command and initiate a message, which can be hidden from others (ephemeral) or visible to all. More...
#include <slashcommand.h>
Public Member Functions | |
interaction_response () | |
Construct a new interaction response object. More... | |
interaction_response (interaction_response_type t, const struct message &m) | |
Construct a new interaction response object. More... | |
interaction_response (interaction_response_type t) | |
Construct a new interaction response object. More... | |
interaction_response & | fill_from_json (nlohmann::json *j) |
Fill object properties from JSON. More... | |
virtual std::string | build_json () const |
Build a json string for this object. More... | |
interaction_response & | add_autocomplete_choice (const command_option_choice &achoice) |
Add a command option choice. More... | |
virtual | ~interaction_response () |
Destroy the interaction response object. More... | |
Public Attributes | |
interaction_response_type | type |
Response type from dpp::interaction_response_type. Should be one of ir_pong, ir_channel_message_with_source, or ir_deferred_channel_message_with_source. More... | |
struct message * | msg |
A message object. This pointer is always valid while the containing interaction_response exists. More... | |
std::vector< command_option_choice > | autocomplete_choices |
Array of up to 25 autocomplete choices. More... | |
A response to an interaction, used to reply to a command and initiate a message, which can be hidden from others (ephemeral) or visible to all.
The dpp::interaction_response object wraps a dpp::message object. To set the message as 'ephemeral' (e.g. only the command issuer can see it) you should add the dpp::m_ephemeral flag to the dpp::message::flags field. e.g.:
mymessage.flags |= dpp::m_ephemeral;
dpp::interaction_response::interaction_response | ( | ) |
Construct a new interaction response object.
dpp::interaction_response::interaction_response | ( | interaction_response_type | t, |
const struct message & | m | ||
) |
Construct a new interaction response object.
t | Type of reply |
m | Message to reply with |
dpp::interaction_response::interaction_response | ( | interaction_response_type | t | ) |
Construct a new interaction response object.
t | Type of reply |
|
virtual |
Destroy the interaction response object.
interaction_response & dpp::interaction_response::add_autocomplete_choice | ( | const command_option_choice & | achoice | ) |
Add a command option choice.
achoice | command option choice to add |
|
virtual |
Build a json string for this object.
Reimplemented in dpp::interaction_modal_response.
interaction_response & dpp::interaction_response::fill_from_json | ( | nlohmann::json * | j | ) |
Fill object properties from JSON.
j | JSON to fill from |
std::vector<command_option_choice> dpp::interaction_response::autocomplete_choices |
Array of up to 25 autocomplete choices.
struct message* dpp::interaction_response::msg |
A message object. This pointer is always valid while the containing interaction_response exists.
interaction_response_type dpp::interaction_response::type |
Response type from dpp::interaction_response_type. Should be one of ir_pong, ir_channel_message_with_source, or ir_deferred_channel_message_with_source.