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

Arguments for Api::sendPoll. More...

#include <Types.h>

Public Attributes

std::variant< std::int64_t, std::string > chatId { }
 Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username. Polls can't be sent to channel direct messages chats.
std::string question { }
 Poll question, 1-300 characters.
std::vector< std::shared_ptr< InputPollOption > > options { }
 A JSON-serialized list of 1-12 answer options.
bool disableNotification = false
 Sends the message silently. Users will receive a notification with no sound.
std::shared_ptr< ReplyParameters > replyParameters = nullptr
 Description of the message to reply to.
std::variant< std::shared_ptr< InlineKeyboardMarkup >, std::shared_ptr< ReplyKeyboardMarkup >, std::shared_ptr< ReplyKeyboardRemove >, std::shared_ptr< ForceReply > > replyMarkup = { }
 Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
bool isAnonymous = true
 True, if the poll needs to be anonymous, defaults to True.
std::string type = ""
 Poll type, “quiz” or “regular”, defaults to “regular”
bool allowsMultipleAnswers = false
 Pass True if the poll allows multiple answers, defaults to False.
std::string explanation = ""
 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 with at most 2 line feeds after entities parsing.
std::string explanationParseMode = ""
 Mode for parsing entities in the explanation. See formatting options for more details.
std::vector< std::shared_ptr< MessageEntity > > explanationEntities = { }
 A JSON-serialized list of special entities that appear in the poll explanation. It can be specified instead of explanation_parse_mode.
std::int32_t openPeriod = 0
 Amount of time in seconds the poll will be active after creation, 5-2628000. Can't be used together with close_date.
std::int32_t closeDate = 0
 Point in time (Unix timestamp) when the poll will be automatically closed. Must be at least 5 and no more than 2628000 seconds in the future. Can't be used together with open_period.
bool isClosed = false
 Pass True if the poll needs to be immediately closed. This can be useful for poll preview.
std::int32_t messageThreadId = 0
 Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only.
bool protectContent = false
 Protects the contents of the sent message from forwarding and saving.
std::string businessConnectionId = ""
 Unique identifier of the business connection on behalf of which the message will be sent.
bool allowAddingOptions = false
 Pass True if answer options can be added to the poll after creation; not supported for anonymous polls and quizzes.
bool allowPaidBroadcast = false
 Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.
bool allowsRevoting = false
 Pass True if the poll allows to change chosen answer options, defaults to False for quizzes and to True for regular polls.
std::vector< std::int32_t > correctOptionIds = { }
 A JSON-serialized list of monotonically increasing 0-based identifiers of the correct answer options, required for polls in quiz mode.
std::vector< std::string > countryCodes = { }
 A JSON-serialized list of 0-12 two-letter ISO 3166-1 alpha-2 country codes indicating the countries from which users can vote in the poll; for channel chats only. Use “FT” as a country code to allow users with anonymous numbers to vote. If omitted or empty, then users from any country can participate in the poll.
std::string description = ""
 Description of the poll to be sent, 0-1024 characters after entities parsing.
std::vector< std::shared_ptr< MessageEntity > > descriptionEntities = { }
 A JSON-serialized list of special entities that appear in the poll description, which can be specified instead of description_parse_mode.
std::string descriptionParseMode = ""
 Mode for parsing entities in the poll description. See formatting options for more details.
std::shared_ptr< InputPollMedia > explanationMedia = nullptr
 Media added to the quiz explanation.
bool hideResultsUntilCloses = false
 Pass True if poll results must be shown only after the poll closes.
std::shared_ptr< InputPollMedia > media = nullptr
 Media added to the poll description.
bool membersOnly = false
 Pass True if voting is limited to users who have been members of the chat where the poll is being sent for more than 24 hours; for channel chats only.
std::string messageEffectId = ""
 Unique identifier of the message effect to be added to the message; for private chats only.
std::vector< std::shared_ptr< MessageEntity > > questionEntities = { }
 A JSON-serialized list of special entities that appear in the poll question. It can be specified instead of question_parse_mode.
std::string questionParseMode = ""
 Mode for parsing entities in the question. See formatting options for more details. Currently, only custom emoji entities are allowed.
bool shuffleOptions = false
 Pass True if the poll options must be shown in random order.

Detailed Description

Arguments for Api::sendPoll.

Definition at line 19271 of file Types.h.

Member Data Documentation

◆ allowAddingOptions

bool TgBot::SendPollArgs::allowAddingOptions = false

Pass True if answer options can be added to the poll after creation; not supported for anonymous polls and quizzes.

Definition at line 19384 of file Types.h.

◆ allowPaidBroadcast

bool TgBot::SendPollArgs::allowPaidBroadcast = false

Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.

Definition at line 19391 of file Types.h.

◆ allowsMultipleAnswers

bool TgBot::SendPollArgs::allowsMultipleAnswers = false

Pass True if the poll allows multiple answers, defaults to False.

Definition at line 19322 of file Types.h.

◆ allowsRevoting

bool TgBot::SendPollArgs::allowsRevoting = false

Pass True if the poll allows to change chosen answer options, defaults to False for quizzes and to True for regular polls.

Definition at line 19397 of file Types.h.

◆ businessConnectionId

std::string TgBot::SendPollArgs::businessConnectionId = ""

Unique identifier of the business connection on behalf of which the message will be sent.

Definition at line 19378 of file Types.h.

◆ chatId

std::variant<std::int64_t, std::string> TgBot::SendPollArgs::chatId { }

Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username. Polls can't be sent to channel direct messages chats.

Definition at line 19277 of file Types.h.

◆ closeDate

std::int32_t TgBot::SendPollArgs::closeDate = 0

Point in time (Unix timestamp) when the poll will be automatically closed. Must be at least 5 and no more than 2628000 seconds in the future. Can't be used together with open_period.

Definition at line 19354 of file Types.h.

◆ correctOptionIds

std::vector<std::int32_t> TgBot::SendPollArgs::correctOptionIds = { }

A JSON-serialized list of monotonically increasing 0-based identifiers of the correct answer options, required for polls in quiz mode.

Definition at line 19403 of file Types.h.

◆ countryCodes

std::vector<std::string> TgBot::SendPollArgs::countryCodes = { }

A JSON-serialized list of 0-12 two-letter ISO 3166-1 alpha-2 country codes indicating the countries from which users can vote in the poll; for channel chats only. Use “FT” as a country code to allow users with anonymous numbers to vote. If omitted or empty, then users from any country can participate in the poll.

Definition at line 19412 of file Types.h.

◆ description

std::string TgBot::SendPollArgs::description = ""

Description of the poll to be sent, 0-1024 characters after entities parsing.

Definition at line 19418 of file Types.h.

◆ descriptionEntities

std::vector<std::shared_ptr<MessageEntity> > TgBot::SendPollArgs::descriptionEntities = { }

A JSON-serialized list of special entities that appear in the poll description, which can be specified instead of description_parse_mode.

Definition at line 19424 of file Types.h.

◆ descriptionParseMode

std::string TgBot::SendPollArgs::descriptionParseMode = ""

Mode for parsing entities in the poll description. See formatting options for more details.

Definition at line 19430 of file Types.h.

◆ disableNotification

bool TgBot::SendPollArgs::disableNotification = false

Sends the message silently. Users will receive a notification with no sound.

Definition at line 19293 of file Types.h.

◆ explanation

std::string TgBot::SendPollArgs::explanation = ""

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 with at most 2 line feeds after entities parsing.

Definition at line 19329 of file Types.h.

◆ explanationEntities

std::vector<std::shared_ptr<MessageEntity> > TgBot::SendPollArgs::explanationEntities = { }

A JSON-serialized list of special entities that appear in the poll explanation. It can be specified instead of explanation_parse_mode.

Definition at line 19341 of file Types.h.

◆ explanationMedia

std::shared_ptr<InputPollMedia> TgBot::SendPollArgs::explanationMedia = nullptr

Media added to the quiz explanation.

Definition at line 19435 of file Types.h.

◆ explanationParseMode

std::string TgBot::SendPollArgs::explanationParseMode = ""

Mode for parsing entities in the explanation. See formatting options for more details.

Definition at line 19335 of file Types.h.

◆ hideResultsUntilCloses

bool TgBot::SendPollArgs::hideResultsUntilCloses = false

Pass True if poll results must be shown only after the poll closes.

Definition at line 19440 of file Types.h.

◆ isAnonymous

bool TgBot::SendPollArgs::isAnonymous = true

True, if the poll needs to be anonymous, defaults to True.

Definition at line 19312 of file Types.h.

◆ isClosed

bool TgBot::SendPollArgs::isClosed = false

Pass True if the poll needs to be immediately closed. This can be useful for poll preview.

Definition at line 19360 of file Types.h.

◆ media

std::shared_ptr<InputPollMedia> TgBot::SendPollArgs::media = nullptr

Media added to the poll description.

Definition at line 19445 of file Types.h.

◆ membersOnly

bool TgBot::SendPollArgs::membersOnly = false

Pass True if voting is limited to users who have been members of the chat where the poll is being sent for more than 24 hours; for channel chats only.

Definition at line 19452 of file Types.h.

◆ messageEffectId

std::string TgBot::SendPollArgs::messageEffectId = ""

Unique identifier of the message effect to be added to the message; for private chats only.

Definition at line 19458 of file Types.h.

◆ messageThreadId

std::int32_t TgBot::SendPollArgs::messageThreadId = 0

Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only.

Definition at line 19367 of file Types.h.

◆ openPeriod

std::int32_t TgBot::SendPollArgs::openPeriod = 0

Amount of time in seconds the poll will be active after creation, 5-2628000. Can't be used together with close_date.

Definition at line 19347 of file Types.h.

◆ options

std::vector<std::shared_ptr<InputPollOption> > TgBot::SendPollArgs::options { }

A JSON-serialized list of 1-12 answer options.

Definition at line 19287 of file Types.h.

◆ protectContent

bool TgBot::SendPollArgs::protectContent = false

Protects the contents of the sent message from forwarding and saving.

Definition at line 19372 of file Types.h.

◆ question

std::string TgBot::SendPollArgs::question { }

Poll question, 1-300 characters.

Definition at line 19282 of file Types.h.

◆ questionEntities

std::vector<std::shared_ptr<MessageEntity> > TgBot::SendPollArgs::questionEntities = { }

A JSON-serialized list of special entities that appear in the poll question. It can be specified instead of question_parse_mode.

Definition at line 19464 of file Types.h.

◆ questionParseMode

std::string TgBot::SendPollArgs::questionParseMode = ""

Mode for parsing entities in the question. See formatting options for more details. Currently, only custom emoji entities are allowed.

Definition at line 19470 of file Types.h.

◆ replyMarkup

std::variant<std::shared_ptr<InlineKeyboardMarkup>, std::shared_ptr<ReplyKeyboardMarkup>, std::shared_ptr<ReplyKeyboardRemove>, std::shared_ptr<ForceReply> > TgBot::SendPollArgs::replyMarkup = { }

Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.

Definition at line 19307 of file Types.h.

◆ replyParameters

std::shared_ptr<ReplyParameters> TgBot::SendPollArgs::replyParameters = nullptr

Description of the message to reply to.

Definition at line 19298 of file Types.h.

◆ shuffleOptions

bool TgBot::SendPollArgs::shuffleOptions = false

Pass True if the poll options must be shown in random order.

Definition at line 19475 of file Types.h.

◆ type

std::string TgBot::SendPollArgs::type = ""

Poll type, “quiz” or “regular”, defaults to “regular”

Definition at line 19317 of file Types.h.


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