11 explicit Poll(
const nl::json& json) {
58 nl::json json = nl::json::object();
#define OBJECT_SERIALIZE_FIELD_PTR_ARRAY(json, json_field, array_field)
#define OBJECT_SERIALIZE_FIELD(json, json_field, field)
Available objects: https://core.telegram.org/bots/api#available-types.
#define OBJECT_DESERIALIZE_FIELD(json, json_field, field, default_value, optional)
Deserialize.
#define OBJECT_DESERIALIZE_FIELD_PTR_ARRAY(json, json_field, array_field, optional)
This object contains information about a poll. https://core.telegram.org/bots/api#poll.
std::string id
Unique poll identifier.
std::time_t closeDate
Optional. Point in time (Unix timestamp) when the poll will be automatically closed.
std::vector< Ptr< PollOption > > options
List of poll options.
Poll(const nl::json &json)
std::int32_t openPeriod
Optional. Amount of time in seconds the poll will be active after creation.
void fromJson(const nl::json &json)
Deserializes this object from JSON.
std::int32_t correctOptionId
Optional. 0-based identifier of the correct answer option. Available only for polls in the quiz mode,...
std::string type
Poll type, currently can be “regular” or “quiz”
std::vector< Ptr< MessageEntity > > explanationEntities
Optional. Special entities like usernames, URLs, bot commands, etc. that appear in the explanation.
nl::json toJson() const
Serializes this object to JSON.
bool isAnonymous
True, if the poll is anonymous.
std::string explanation
Optional. Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a qu...
std::int32_t totalVoterCount
Total number of users that voted in the poll.
bool isClosed
True, if the poll is closed.
std::string question
Poll question, 1-300 characters.
bool allowsMultipleAnswers
True, if the poll allows multiple answers.