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 & | fill_from_json (nlohmann::json *j) |
Fill object properties from JSON. More... | |
std::string | build_json () const |
Build a json string for this object. More... | |
~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... | |
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 | ( | ) |
Destroy the interaction response object.
std::string dpp::interaction_response::build_json | ( | ) | const |
Build a json string for this object.
interaction_response & dpp::interaction_response::fill_from_json | ( | nlohmann::json * | j | ) |
Fill object properties from JSON.
j | JSON to fill from |
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.