An interaction represents a user running a command and arrives via the dpp::cluster::on_interaction_create event.
More...
#include <appcommand.h>
An interaction represents a user running a command and arrives via the dpp::cluster::on_interaction_create event.
◆ interaction()
dpp::interaction::interaction |
( |
| ) |
|
Construct a new interaction object.
◆ ~interaction()
virtual dpp::interaction::~interaction |
( |
| ) |
|
|
virtualdefault |
◆ build_json()
std::string dpp::interaction::build_json |
( |
bool |
with_id = false | ) |
const |
|
virtual |
Build a json string for this object.
- Parameters
-
with_id | True if to include the ID in the JSON |
- Returns
- std::string JSON string
Reimplemented from dpp::json_interface< interaction >.
◆ fill_from_json()
interaction & dpp::interaction::fill_from_json |
( |
nlohmann::json * |
j | ) |
|
Fill object properties from JSON.
- Parameters
-
- Returns
- interaction& Reference to self
◆ get_autocomplete_interaction()
◆ get_command_interaction()
◆ get_command_name()
std::string dpp::interaction::get_command_name |
( |
| ) |
const |
Get the command name for a command interaction.
- Returns
- std::string command interaction, or empty string if the interaction is not for a command.
◆ get_component_interaction()
◆ get_creation_time()
double dpp::managed::get_creation_time |
( |
| ) |
const |
|
inherited |
Get the creation time of this object according to Discord.
- Returns
- double creation time inferred from the snowflake ID. The minimum possible value is the first second of 2015.
◆ operator!=()
bool dpp::managed::operator!= |
( |
const managed & |
other | ) |
const |
|
noexceptinherited |
Comparison operator for comparing two managed objects by id.
- Parameters
-
other | Other object to compare against |
- Returns
- true objects are not the same id
-
false objects are the same id
◆ operator==()
bool dpp::managed::operator== |
( |
const managed & |
other | ) |
const |
|
noexceptinherited |
Comparison operator for comparing two managed objects by id.
- Parameters
-
other | Other object to compare against |
- Returns
- true objects are the same id
-
false objects are not the same id
◆ application_id
id of the application this interaction is for
◆ cache_policy
Cache policy from cluster.
◆ channel_id
Optional: the channel it was sent from.
◆ data
Optional: the command data payload.
◆ guild_id
Optional: the guild it was sent from.
◆ guild_locale
std::string dpp::interaction::guild_locale |
Guild's locale (language) - for guild interactions only.
◆ id
Unique ID of object set by Discord. This value contains a timestamp, worker ID, internal server ID, and an incrementing value. Only the timestamp is relevant to us as useful metadata.
◆ locale
std::string dpp::interaction::locale |
◆ member
Optional: guild member data for the invoking user, including permissions.
◆ message_id
Originating message id for context menu actions.
◆ msg
Originating message for context menu actions.
◆ resolved
◆ token
std::string dpp::interaction::token |
a continuation token for responding to the interaction
◆ type
uint8_t dpp::interaction::type |
◆ usr
user dpp::interaction::usr |
Optional: user object for the invoking user, if invoked in a DM.
◆ version
uint8_t dpp::interaction::version |
read-only property, always 1