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

This object represents an answer of a user in a non-anonymous poll. https://core.telegram.org/bots/api#pollanswer. More...

#include <PollAnswer.hpp>

Public Member Functions

 PollAnswer ()=default
 
 PollAnswer (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 pollId
 Unique poll identifier. More...
 
Ptr< ChatvoterChat
 Optional. The chat that changed the answer to the poll, if the voter is anonymous. More...
 
Ptr< Useruser
 Optional. The user that changed the answer to the poll, if the voter isn't anonymous. More...
 
std::vector< std::int32_t > optionIds
 0-based identifiers of chosen answer options. May be empty if the vote was retracted. More...
 

Detailed Description

This object represents an answer of a user in a non-anonymous poll. https://core.telegram.org/bots/api#pollanswer.

Definition at line 9 of file PollAnswer.hpp.

Constructor & Destructor Documentation

◆ PollAnswer() [1/2]

tgbotxx::PollAnswer::PollAnswer ( )
default

◆ PollAnswer() [2/2]

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

Definition at line 11 of file PollAnswer.hpp.

Member Function Documentation

◆ fromJson()

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

Deserializes this object from JSON.

Definition at line 40 of file PollAnswer.hpp.

◆ toJson()

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

Serializes this object to JSON.

Returns
JSON representation of this object

Definition at line 30 of file PollAnswer.hpp.

Member Data Documentation

◆ optionIds

std::vector<std::int32_t> tgbotxx::PollAnswer::optionIds

0-based identifiers of chosen answer options. May be empty if the vote was retracted.

Definition at line 25 of file PollAnswer.hpp.

◆ pollId

std::string tgbotxx::PollAnswer::pollId

Unique poll identifier.

Definition at line 16 of file PollAnswer.hpp.

◆ user

Ptr<User> tgbotxx::PollAnswer::user

Optional. The user that changed the answer to the poll, if the voter isn't anonymous.

Definition at line 22 of file PollAnswer.hpp.

◆ voterChat

Ptr<Chat> tgbotxx::PollAnswer::voterChat

Optional. The chat that changed the answer to the poll, if the voter is anonymous.

Definition at line 19 of file PollAnswer.hpp.


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