Interface MessagePoll


public interface MessagePoll
Poll sent with messages.
See Also:
  • Field Details

  • Method Details

    • getLayout

      @Nonnull MessagePoll.LayoutType getLayout()
      The layout of the poll.
      Returns:
      The poll layout, or MessagePoll.LayoutType.UNKNOWN if unknown
    • getQuestion

      @Nonnull MessagePoll.Question getQuestion()
      The poll question, representing the title.
      Returns:
      MessagePoll.Question
    • getAnswers

      @Nonnull @Unmodifiable List<MessagePoll.Answer> getAnswers()
      The poll answers.

      Each answer also has the current votes. The votes might not be finalized and might be incorrect before the poll has expired, see isFinalizedVotes().

      Returns:
      Immutable List of MessagePoll.Answer
    • getTimeExpiresAt

      @Nullable OffsetDateTime getTimeExpiresAt()
      The time when this poll will automatically expire.

      The author of the poll can always expire the poll manually, using Message.endPoll().

      Returns:
      OffsetDateTime representing the time when the poll expires automatically, or null if it never expires
    • isMultiAnswer

      boolean isMultiAnswer()
      Whether this poll allows multiple answers to be selected.
      Returns:
      True, if this poll allows multi selection
    • isFinalizedVotes

      boolean isFinalizedVotes()
      Whether this poll is finalized and recounted.

      The votes for answers might be inaccurate due to eventual consistency, until this is true. Finalization does not mean the votes cannot change anymore, use isExpired() to check if a poll has ended.

      Returns:
      True, if the votes have been precisely counted
    • isExpired

      default boolean isExpired()
      Whether this poll has passed its expiration time.
      Returns:
      True, if this poll is expired.