Class Poll
java.lang.Object
io.micronaut.chatbots.telegram.api.Poll
This object contains information about a poll.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription@NonNull Boolean
@Nullable Integer
@Nullable String
@Nullable List<MessageEntity>
@NonNull String
getId()
@Nullable Integer
@NonNull List<PollOption>
@NonNull String
@NonNull Integer
@NonNull String
getType()
@NonNull Boolean
@NonNull Boolean
isClosed()
void
setAllowsMultipleAnswers
(@NonNull Boolean allowsMultipleAnswers) void
setAnonymous
(@NonNull Boolean anonymous) void
void
setCloseDate
(@Nullable Integer closeDate) void
setCorrectOptionId
(Integer correctOptionId) void
setExplanation
(@Nullable String explanation) void
setExplanationEntities
(@Nullable List<MessageEntity> explanationEntities) void
void
setOpenPeriod
(@Nullable Integer openPeriod) void
setOptions
(@NonNull List<PollOption> options) void
setQuestion
(@NonNull String question) void
setTotalVoterCount
(@NonNull Integer totalVoterCount) void
toString()
-
Constructor Details
-
Poll
public Poll()
-
-
Method Details
-
getId
- Returns:
- Unique poll identifier.
-
setId
- Parameters:
id
- Unique poll identifier.
-
getQuestion
- Returns:
- Poll question, 1-255 characters.
-
setQuestion
- Parameters:
question
- Poll question, 1-255 characters.
-
getOptions
- Returns:
- List of poll options.
-
setOptions
- Parameters:
options
- List of poll options.
-
getTotalVoterCount
- Returns:
- Total number of users that voted in the poll.
-
setTotalVoterCount
- Parameters:
totalVoterCount
- Total number of users that voted in the poll.
-
isClosed
- Returns:
- True, if the poll is closed.
-
setClosed
- Parameters:
closed
- True, if the poll is closed.
-
isAnonymous
- Returns:
- True, if the poll is anonymous.
-
setAnonymous
- Parameters:
anonymous
- True, if the poll is anonymous.
-
getType
- Returns:
- type, currently can be “regular” or “quiz”.
-
setType
- Parameters:
type
- type, currently can be “regular” or “quiz”.
-
getAllowsMultipleAnswers
- Returns:
- True, if the poll allows multiple answers.
-
setAllowsMultipleAnswers
- Parameters:
allowsMultipleAnswers
- True, if the poll allows multiple answers.
-
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
- 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
- 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
- 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
- Returns:
- Special entities like usernames, URLs, bot commands, etc. that appear in the explanation
-
setExplanationEntities
- Parameters:
explanationEntities
- Special entities like usernames, URLs, bot commands, etc. that appear in the explanation
-
getOpenPeriod
- Returns:
- Amount of time in seconds the poll will be active after creation.
-
setOpenPeriod
- Parameters:
openPeriod
- Amount of time in seconds the poll will be active after creation.
-
getCloseDate
- Returns:
- Point in time (Unix timestamp) when the poll will be automatically closed
-
setCloseDate
- Parameters:
closeDate
- Point in time (Unix timestamp) when the poll will be automatically closed
-
toString
-