telegram.Poll¶
-
class
telegram.
Poll
(id, question, options, total_voter_count, is_closed, is_anonymous, type, allows_multiple_answers, correct_option_id=None, **kwargs)¶ Bases:
telegram.base.TelegramObject
This object contains information about a poll.
-
id
¶ Unique poll identifier.
Type: str
-
question
¶ Poll question, 1-255 characters.
Type: str
-
options
¶ List of poll options.
Type: List[ PollOption
]
-
total_voter_count
¶ Total number of users that voted in the poll.
Type: int
-
is_closed
¶ True, if the poll is closed.
Type: bool
-
is_anonymous
¶ True, if the poll is anonymous.
Type: bool
-
allows_multiple_answers
¶ True, if the poll allows multiple answers.
Type: bool
-
correct_option_id
¶ Optional. Identifier of the correct answer option.
Type: int
Parameters: - id (
str
) – Unique poll identifier. - question (
str
) – Poll question, 1-255 characters. - options (List[
PollOption
]) – List of poll options. - is_closed (
bool
) – True, if the poll is closed. - is_anonymous (
bool
) – True, if the poll is anonymous. - type (
str
) – Poll type, currently can beREGULAR
orQUIZ
. - allows_multiple_answers (
bool
) – True, if the poll allows multiple answers. - correct_option_id (
int
, optional) – 0-based identifier of the correct answer option. Available only for polls in the quiz mode, which are closed, or was sent (not forwarded) by the bot or to the private chat with the bot.
-
QUIZ
= 'quiz'¶ ‘quiz’
Type: str
-
REGULAR
= 'regular'¶ ‘regular’
Type: str
-