java.lang.Object
io.github.natanimn.telebof.types.updates.Poll
All Implemented Interfaces:
TelegramUpdate

public class Poll extends Object implements TelegramUpdate
This class contains information about a poll.
Since:
3 March 2025
Author:
Natanim
  • Field Details

    • id

      private String id
      Unique poll identifier
    • question

      private String question
      Poll question, 1-300 characters
    • type

      private PollType type
      Poll type
    • explanation

      private 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
    • options

      private List<PollOption> options
      List of poll options
    • totalVoterCount

      @SerializedName("total_voter_count") private Integer totalVoterCount
      Total number of users that voted in the poll
    • correctOptionId

      @SerializedName("correct_option_id") private Integer correctOptionId
      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.
    • openPeriod

      @SerializedName("open_period") private Integer openPeriod
      Amount of time in seconds the poll will be active after creation
    • closeDate

      @SerializedName("close_date") private Integer closeDate
      Point in time (Unix timestamp) when the poll will be automatically closed
    • isClosed

      @SerializedName("is_closed") private Boolean isClosed
      True, if the poll is closed
    • isAnonymous

      @SerializedName("is_anonymous") private Boolean isAnonymous
      True, if the poll is anonymous
    • allowsMultipleAnswers

      @SerializedName("allows_multiple_answers") private Boolean allowsMultipleAnswers
      True, if the poll allows multiple answers
    • explanationEntities

      @SerializedName("explanation_entities") private List<MessageEntity> explanationEntities
      Special entities like usernames, URLs, bot commands, etc. that appear in the explanation
    • questionEntities

      @SerializedName("question_entities") private List<MessageEntity> questionEntities
      Special entities that appear in the question. Currently, only custom emoji entities are allowed in poll questions
  • Constructor Details

    • Poll

      public Poll()
  • Method Details

    • getId

      public String getId()
    • getQuestion

      public String getQuestion()
    • getType

      public PollType getType()
    • getExplanation

      public String getExplanation()
    • getOptions

      public List<PollOption> getOptions()
    • getTotalVoterCount

      public Integer getTotalVoterCount()
    • getCorrectOptionId

      public Integer getCorrectOptionId()
    • getOpenPeriod

      public Integer getOpenPeriod()
    • getCloseDate

      public Integer getCloseDate()
    • getIsClosed

      public Boolean getIsClosed()
    • getIsAnonymous

      public Boolean getIsAnonymous()
    • getAllowsMultipleAnswers

      public Boolean getAllowsMultipleAnswers()
    • getExplanationEntities

      public List<MessageEntity> getExplanationEntities()
    • getQuestionEntities

      public List<MessageEntity> getQuestionEntities()
    • toString

      public String toString()
      Overrides:
      toString in class Object