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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      public void setAllowsMultipleAnswers(@NonNull @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

      @Nullable 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 @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

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

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

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

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

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

      public void setCloseDate(@Nullable @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