tgbotxx  1.1.6.9
Telegram Bot C++ Library
tgbotxx::CallbackQuery Struct Reference

This object represents an incoming callback query from a callback button in an inline keyboard. If the button that originated the query was attached to a message sent by the bot, the field message will be present. If the button was attached to a message sent via the bot (in inline mode), the field inline_message_id will be present. Exactly one of the fields data or game_short_name will be present. https://core.telegram.org/bots/api#callbackquery. More...

#include <CallbackQuery.hpp>

Public Member Functions

 CallbackQuery ()=default
 
 CallbackQuery (const nl::json &json)
 
nl::json toJson () const
 Serializes this object to JSON. More...
 
void fromJson (const nl::json &json)
 Deserializes this object from JSON. More...
 

Public Attributes

std::string id
 Unique identifier for this query. More...
 
Ptr< Userfrom
 Sender. More...
 
Ptr< Messagemessage
 Optional. Message with the callback button that originated the query. More...
 
std::string inlineMessageId
 Optional. Identifier of the message sent via the bot in inline mode, that originated the query. More...
 
std::string chatInstance
 Global identifier, uniquely corresponding to the chat to which the message with the callback button was sent. Useful for high scores in games. More...
 
std::string data
 Optional. Data associated with the callback button. More...
 
std::string gameShortName
 Optional. Short name of a Game to be returned, serves as the unique identifier for the game. More...
 

Detailed Description

This object represents an incoming callback query from a callback button in an inline keyboard. If the button that originated the query was attached to a message sent by the bot, the field message will be present. If the button was attached to a message sent via the bot (in inline mode), the field inline_message_id will be present. Exactly one of the fields data or game_short_name will be present. https://core.telegram.org/bots/api#callbackquery.

Definition at line 16 of file CallbackQuery.hpp.

Constructor & Destructor Documentation

◆ CallbackQuery() [1/2]

tgbotxx::CallbackQuery::CallbackQuery ( )
default

◆ CallbackQuery() [2/2]

tgbotxx::CallbackQuery::CallbackQuery ( const nl::json &  json)
inlineexplicit

Definition at line 18 of file CallbackQuery.hpp.

Member Function Documentation

◆ fromJson()

void tgbotxx::CallbackQuery::fromJson ( const nl::json &  json)
inline

Deserializes this object from JSON.

Definition at line 61 of file CallbackQuery.hpp.

◆ toJson()

nl::json tgbotxx::CallbackQuery::toJson ( ) const
inline

Serializes this object to JSON.

Returns
JSON representation of this object

Definition at line 48 of file CallbackQuery.hpp.

Member Data Documentation

◆ chatInstance

std::string tgbotxx::CallbackQuery::chatInstance

Global identifier, uniquely corresponding to the chat to which the message with the callback button was sent. Useful for high scores in games.

Definition at line 37 of file CallbackQuery.hpp.

◆ data

std::string tgbotxx::CallbackQuery::data

Optional. Data associated with the callback button.

Note
Be aware that the message originated the query can contain no callback buttons with this data.

Definition at line 41 of file CallbackQuery.hpp.

◆ from

Ptr<User> tgbotxx::CallbackQuery::from

Sender.

Definition at line 26 of file CallbackQuery.hpp.

◆ gameShortName

std::string tgbotxx::CallbackQuery::gameShortName

Optional. Short name of a Game to be returned, serves as the unique identifier for the game.

Definition at line 44 of file CallbackQuery.hpp.

◆ id

std::string tgbotxx::CallbackQuery::id

Unique identifier for this query.

Definition at line 23 of file CallbackQuery.hpp.

◆ inlineMessageId

std::string tgbotxx::CallbackQuery::inlineMessageId

Optional. Identifier of the message sent via the bot in inline mode, that originated the query.

Definition at line 33 of file CallbackQuery.hpp.

◆ message

Ptr<Message> tgbotxx::CallbackQuery::message

Optional. Message with the callback button that originated the query.

Note
Note that message content and message date will not be available if the message is too old

Definition at line 30 of file CallbackQuery.hpp.


The documentation for this struct was generated from the following file: