tgbot-cpp
Loading...
Searching...
No Matches
TgBot::Poll Struct Reference

This object contains information about a poll. More...

#include <Types.h>

Public Types

using Ptr = std::shared_ptr<Poll>

Public Attributes

std::string id { }
 Unique poll identifier.
std::string question { }
 Poll question, 1-300 characters.
std::optional< std::vector< std::shared_ptr< MessageEntity > > > questionEntities { }
 Optional. Special entities that appear in the question. Currently, only custom emoji entities are allowed in poll questions.
std::vector< std::shared_ptr< PollOption > > options { }
 List of poll options.
std::int32_t totalVoterCount { }
 Total number of users that voted in the poll.
bool isClosed { }
 True, if the poll is closed.
bool isAnonymous { }
 True, if the poll is anonymous.
std::string type { }
 Poll type, currently can be “regular” or “quiz”
bool allowsMultipleAnswers { }
 True, if the poll allows multiple answers.
bool allowsRevoting { }
 True, if the poll allows to change the chosen answer options.
bool membersOnly { }
 True if voting is limited to users who have been members of the chat where the poll was originally sent for more than 24 hours.
std::optional< std::vector< std::string > > countryCodes { }
 Optional. A list of two-letter ISO 3166-1 alpha-2 country codes indicating the countries from which users can vote in the poll. The country code “FT” is used for users with anonymous numbers. If omitted, then users from any country can participate in the poll.
std::optional< std::vector< std::int32_t > > correctOptionIds { }
 Optional. Array of 0-based identifiers of the correct answer options. Available only for polls in quiz mode which are closed or were sent (not forwarded) by the bot or to the private chat with the bot.
std::optional< std::string > explanation { }
 Optional. Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters.
std::optional< std::vector< std::shared_ptr< MessageEntity > > > explanationEntities { }
 Optional. Special entities like usernames, URLs, bot commands, etc. that appear in the explanation.
std::shared_ptr< PollMediaexplanationMedia { }
 Optional. Media added to the quiz explanation.
std::optional< std::int32_t > openPeriod { }
 Optional. Amount of time in seconds the poll will be active after creation.
std::optional< std::int32_t > closeDate { }
 Optional. Point in time (Unix timestamp) when the poll will be automatically closed.
std::optional< std::string > description { }
 Optional. Description of the poll; for polls inside the Message object only.
std::optional< std::vector< std::shared_ptr< MessageEntity > > > descriptionEntities { }
 Optional. Special entities like usernames, URLs, bot commands, etc. that appear in the description.
std::shared_ptr< PollMediamedia { }
 Optional. Media added to the poll description; for polls inside the Message object only.

Detailed Description

This object contains information about a poll.

Definition at line 10780 of file Types.h.

Member Typedef Documentation

◆ Ptr

using TgBot::Poll::Ptr = std::shared_ptr<Poll>

Definition at line 10781 of file Types.h.

Member Data Documentation

◆ allowsMultipleAnswers

bool TgBot::Poll::allowsMultipleAnswers { }

True, if the poll allows multiple answers.

Definition at line 10827 of file Types.h.

◆ allowsRevoting

bool TgBot::Poll::allowsRevoting { }

True, if the poll allows to change the chosen answer options.

Definition at line 10832 of file Types.h.

◆ closeDate

std::optional<std::int32_t> TgBot::Poll::closeDate { }

Optional. Point in time (Unix timestamp) when the poll will be automatically closed.

Definition at line 10879 of file Types.h.

◆ correctOptionIds

std::optional<std::vector<std::int32_t> > TgBot::Poll::correctOptionIds { }

Optional. Array of 0-based identifiers of the correct answer options. Available only for polls in quiz mode which are closed or were sent (not forwarded) by the bot or to the private chat with the bot.

Definition at line 10852 of file Types.h.

◆ countryCodes

std::optional<std::vector<std::string> > TgBot::Poll::countryCodes { }

Optional. A list of two-letter ISO 3166-1 alpha-2 country codes indicating the countries from which users can vote in the poll. The country code “FT” is used for users with anonymous numbers. If omitted, then users from any country can participate in the poll.

Definition at line 10845 of file Types.h.

◆ description

std::optional<std::string> TgBot::Poll::description { }

Optional. Description of the poll; for polls inside the Message object only.

Definition at line 10884 of file Types.h.

◆ descriptionEntities

std::optional<std::vector<std::shared_ptr<MessageEntity> > > TgBot::Poll::descriptionEntities { }

Optional. Special entities like usernames, URLs, bot commands, etc. that appear in the description.

Definition at line 10890 of file Types.h.

◆ explanation

std::optional<std::string> TgBot::Poll::explanation { }

Optional. Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters.

Definition at line 10858 of file Types.h.

◆ explanationEntities

std::optional<std::vector<std::shared_ptr<MessageEntity> > > TgBot::Poll::explanationEntities { }

Optional. Special entities like usernames, URLs, bot commands, etc. that appear in the explanation.

Definition at line 10864 of file Types.h.

◆ explanationMedia

std::shared_ptr<PollMedia> TgBot::Poll::explanationMedia { }

Optional. Media added to the quiz explanation.

Definition at line 10869 of file Types.h.

◆ id

std::string TgBot::Poll::id { }

Unique poll identifier.

Definition at line 10786 of file Types.h.

◆ isAnonymous

bool TgBot::Poll::isAnonymous { }

True, if the poll is anonymous.

Definition at line 10817 of file Types.h.

◆ isClosed

bool TgBot::Poll::isClosed { }

True, if the poll is closed.

Definition at line 10812 of file Types.h.

◆ media

std::shared_ptr<PollMedia> TgBot::Poll::media { }

Optional. Media added to the poll description; for polls inside the Message object only.

Definition at line 10895 of file Types.h.

◆ membersOnly

bool TgBot::Poll::membersOnly { }

True if voting is limited to users who have been members of the chat where the poll was originally sent for more than 24 hours.

Definition at line 10838 of file Types.h.

◆ openPeriod

std::optional<std::int32_t> TgBot::Poll::openPeriod { }

Optional. Amount of time in seconds the poll will be active after creation.

Definition at line 10874 of file Types.h.

◆ options

std::vector<std::shared_ptr<PollOption> > TgBot::Poll::options { }

List of poll options.

Definition at line 10802 of file Types.h.

◆ question

std::string TgBot::Poll::question { }

Poll question, 1-300 characters.

Definition at line 10791 of file Types.h.

◆ questionEntities

std::optional<std::vector<std::shared_ptr<MessageEntity> > > TgBot::Poll::questionEntities { }

Optional. Special entities that appear in the question. Currently, only custom emoji entities are allowed in poll questions.

Definition at line 10797 of file Types.h.

◆ totalVoterCount

std::int32_t TgBot::Poll::totalVoterCount { }

Total number of users that voted in the poll.

Definition at line 10807 of file Types.h.

◆ type

std::string TgBot::Poll::type { }

Poll type, currently can be “regular” or “quiz”

Definition at line 10822 of file Types.h.


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