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

Describes data sent from a Web App to the bot. https://core.telegram.org/bots/api#webappdata. More...

#include <WebAppData.hpp>

Public Member Functions

 WebAppData ()=default
 
 WebAppData (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 data
 The data. Be aware that a bad client can send arbitrary data in this field. More...
 
std::string buttonText
 Text of the web_app keyboard button from which the Web App was opened. More...
 

Detailed Description

Describes data sent from a Web App to the bot. https://core.telegram.org/bots/api#webappdata.

Definition at line 7 of file WebAppData.hpp.

Constructor & Destructor Documentation

◆ WebAppData() [1/2]

tgbotxx::WebAppData::WebAppData ( )
default

◆ WebAppData() [2/2]

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

Definition at line 9 of file WebAppData.hpp.

Member Function Documentation

◆ fromJson()

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

Deserializes this object from JSON.

Definition at line 30 of file WebAppData.hpp.

◆ toJson()

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

Serializes this object to JSON.

Returns
JSON representation of this object

Definition at line 22 of file WebAppData.hpp.

Member Data Documentation

◆ buttonText

std::string tgbotxx::WebAppData::buttonText

Text of the web_app keyboard button from which the Web App was opened.

Note
Be aware that a bad client can send arbitrary data in this field.

Definition at line 18 of file WebAppData.hpp.

◆ data

std::string tgbotxx::WebAppData::data

The data. Be aware that a bad client can send arbitrary data in this field.

Definition at line 14 of file WebAppData.hpp.


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