Poll#

class pyrogram.types.Poll[source]#

A Poll.

Parameters:
  • id (str) – Unique poll identifier.

  • question (FormattedText) – Poll question, 1-255 characters.

  • options (List of PollOption) – List of poll options.

  • total_voter_count (int) – Total number of users that voted in the poll.

  • is_closed (bool) – True, if the poll is closed.

  • is_anonymous (bool) – True, if the poll is anonymous

  • type (PollType) – Poll type.

  • allows_multiple_answers (bool) – True, if the poll allows multiple answers.

  • allows_revoting (bool) – True, if the poll allows to change the chosen answer options.

  • chosen_option_id (int, optional) – 0-based index of the chosen option), None in case of no vote yet.

  • correct_option_ids (List of int, 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.

  • explanation (FormattedText, 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.

  • open_period (int, optional) – Amount of time in seconds the poll will be active after creation.

  • close_date (datetime, optional) – Point in time when the poll will be automatically closed.

  • has_open_answers (bool, optional) – Participants can suggest new options.

  • description (FormattedText, optional) – Description of the poll; for polls inside the Message object only.

  • can_add_option (bool, property) – True, if an option can be added to the poll using add_poll_option().