Discord.C++ 0.13.0
Loading...
Searching...
No Matches
DiscordCPP::InteractionData Class Reference

#include <InteractionData.h>

Inheritance diagram for DiscordCPP::InteractionData:
DiscordCPP::DiscordObject

Public Member Functions

 InteractionData (const json &data, const std::string &token)
 
std::string get_name ()
 
ApplicationCommand::Type get_type ()
 
std::optional< InteractionResolvedDataget_resolved_data ()
 
std::vector< InteractionDataOptionVariantget_options ()
 
std::optional< std::string > get_guild_id ()
 
std::optional< std::string > get_target_id ()
 
std::optional< std::string > get_custom_id ()
 
- Public Member Functions inherited from DiscordCPP::DiscordObject
 DiscordObject ()=default
 
 DiscordObject (std::string token)
 
 DiscordObject (std::string token, std::string id)
 
std::string get_id () const
 

Additional Inherited Members

- Protected Member Functions inherited from DiscordCPP::DiscordObject
std::string get_token () const
 
json api_call (const std::string &url, const std::string &method="GET", const json &data=json(), const std::string &content_type="", const bool cache=true)
 helper function to communicate with the http api
 

Constructor & Destructor Documentation

◆ InteractionData()

DiscordCPP::InteractionData::InteractionData ( const json & data,
const std::string & token )

Member Function Documentation

◆ get_custom_id()

std::optional< std::string > DiscordCPP::InteractionData::get_custom_id ( )
inline
Returns
The custom id of the component.

◆ get_guild_id()

std::optional< std::string > DiscordCPP::InteractionData::get_guild_id ( )
inline
Returns
The id of the guild the command is registered to.

◆ get_name()

std::string DiscordCPP::InteractionData::get_name ( )
inline
Returns
name of the invoked command.

◆ get_options()

std::vector< InteractionDataOptionVariant > DiscordCPP::InteractionData::get_options ( )
inline
Returns
The parameters and values from the user.

◆ get_resolved_data()

std::optional< InteractionResolvedData > DiscordCPP::InteractionData::get_resolved_data ( )
inline
Returns
The resolved users, roles, channels, messages and/or attachments.

◆ get_target_id()

std::optional< std::string > DiscordCPP::InteractionData::get_target_id ( )
inline
Returns
Id the of user or message targeted by a user or message command.

◆ get_type()

ApplicationCommand::Type DiscordCPP::InteractionData::get_type ( )
inline
Returns
The type of the invoked command.

The documentation for this class was generated from the following files: