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 <appcommand.h>
Public Member Functions | |
interaction_response ()=default | |
Construct a new interaction response object. More... | |
interaction_response (interaction_response_type t) | |
Construct a new interaction response object. More... | |
interaction_response (interaction_response_type t, const message &m) | |
Construct a new interaction response object. More... | |
interaction_response (interaction_response_type t, message &&m) | |
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 (bool with_id=false) 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 ()=default |
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... | |
message | msg {} |
Message tied to this response. 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;
|
default |
Construct a new interaction response object.
dpp::interaction_response::interaction_response | ( | interaction_response_type | t | ) |
Construct a new interaction response object.
t | Type of reply |
dpp::interaction_response::interaction_response | ( | interaction_response_type | t, |
const 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, |
message && | m | ||
) |
Construct a new interaction response object.
t | Type of reply |
m | Message to reply with |
|
virtualdefault |
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 from dpp::json_interface< interaction_response >.
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.
message dpp::interaction_response::msg {} |
Message tied to this response.
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.