java.lang.Object
io.micronaut.chatbots.telegram.api.Poll

public class Poll extends Object
This object contains information about a poll.
See Also:
  • Constructor Details

    • Poll

      public Poll()
  • Method Details

    • getId

      public @NonNull String getId()
      Returns:
      Unique poll identifier.
    • setId

      public void setId(@NonNull String id)
      Parameters:
      id - Unique poll identifier.
    • getQuestion

      public @NonNull String getQuestion()
      Returns:
      Poll question, 1-255 characters.
    • setQuestion

      public void setQuestion(@NonNull String question)
      Parameters:
      question - Poll question, 1-255 characters.
    • getOptions

      public @NonNull List<PollOption> getOptions()
      Returns:
      List of poll options.
    • setOptions

      public void setOptions(@NonNull List<PollOption> options)
      Parameters:
      options - List of poll options.
    • getTotalVoterCount

      public @NonNull Integer getTotalVoterCount()
      Returns:
      Total number of users that voted in the poll.
    • setTotalVoterCount

      public void setTotalVoterCount(@NonNull Integer totalVoterCount)
      Parameters:
      totalVoterCount - Total number of users that voted in the poll.
    • isClosed

      public @NonNull Boolean isClosed()
      Returns:
      True, if the poll is closed.
    • setClosed

      public void setClosed(@NonNull Boolean closed)
      Parameters:
      closed - True, if the poll is closed.
    • isAnonymous

      public @NonNull Boolean isAnonymous()
      Returns:
      True, if the poll is anonymous.
    • setAnonymous

      public void setAnonymous(@NonNull Boolean anonymous)
      Parameters:
      anonymous - True, if the poll is anonymous.
    • getType

      public @NonNull String getType()
      Returns:
      type, currently can be “regular” or “quiz”.
    • setType

      public void setType(@NonNull String type)
      Parameters:
      type - type, currently can be “regular” or “quiz”.
    • getAllowsMultipleAnswers

      public @NonNull Boolean getAllowsMultipleAnswers()
      Returns:
      True, if the poll allows multiple answers.
    • setAllowsMultipleAnswers

      public void setAllowsMultipleAnswers(@NonNull Boolean allowsMultipleAnswers)
      Parameters:
      allowsMultipleAnswers - True, if the poll allows multiple answers.
    • getCorrectOptionId

      public Integer getCorrectOptionId()
      Returns:
      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.
    • setCorrectOptionId

      public void setCorrectOptionId(Integer correctOptionId)
      Parameters:
      correctOptionId - 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.
    • getExplanation

      public @Nullable String getExplanation()
      Returns:
      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
    • setExplanation

      public void setExplanation(@Nullable String explanation)
      Parameters:
      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
    • getExplanationEntities

      public @Nullable List<MessageEntity> getExplanationEntities()
      Returns:
      Special entities like usernames, URLs, bot commands, etc. that appear in the explanation
    • setExplanationEntities

      public void setExplanationEntities(@Nullable List<MessageEntity> explanationEntities)
      Parameters:
      explanationEntities - Special entities like usernames, URLs, bot commands, etc. that appear in the explanation
    • getOpenPeriod

      public @Nullable Integer getOpenPeriod()
      Returns:
      Amount of time in seconds the poll will be active after creation.
    • setOpenPeriod

      public void setOpenPeriod(@Nullable Integer openPeriod)
      Parameters:
      openPeriod - Amount of time in seconds the poll will be active after creation.
    • getCloseDate

      public @Nullable Integer getCloseDate()
      Returns:
      Point in time (Unix timestamp) when the poll will be automatically closed
    • setCloseDate

      public void setCloseDate(@Nullable Integer closeDate)
      Parameters:
      closeDate - Point in time (Unix timestamp) when the poll will be automatically closed
    • toString

      public String toString()
      Overrides:
      toString in class Object