Poll class
This object contains information about a poll.
- Annotations
-
- @JsonSerializable.new(includeIfNull: false)
Constructors
-
Poll({String? id, String? question, List<
PollOption> ? options, int? totalVoterCount, bool? isClosed, bool? isAnonymous, PollType? type, bool? allowsMultipleAnswers, int? correctOptionID, String? explanation, List<MessageEntity> ? explanation_entities, Duration? openPeriod, DateTime? closeDate}) -
Poll.fromJson(Map<
String, dynamic> json) -
factory
Properties
- allowsMultipleAnswers ↔ bool?
-
True, if the poll allows multiple answers
getter/setter pair
- closeDate ↔ DateTime?
-
Optional.
Point in time (Unix timestamp) when the poll will be automatically closed.
getter/setter pair
- correctOptionID ↔ int?
-
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.
getter/setter pair
- explanation ↔ String?
-
Optional. 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.
getter/setter pair
-
explanation_entities
↔ List<
MessageEntity> ? -
Optional. Special entities like usernames, URLs, bot commands, etc.
that appear in the explanation.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- id ↔ String?
-
Unique poll identifier.
getter/setter pair
- isAnonymous ↔ bool?
-
True, if the poll is anonymous.
getter/setter pair
- isClosed ↔ bool?
-
True, if the poll is closed.
getter/setter pair
- openPeriod ↔ Duration?
-
Optional.
Amount of time in seconds the poll will be active after creation.
getter/setter pair
-
options
↔ List<
PollOption> ? -
List of poll options.
getter/setter pair
- question ↔ String?
-
Poll question, 1-255 characters.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- totalVoterCount ↔ int?
-
Total number of users that voted in the poll.
getter/setter pair
- type ↔ PollType?
-
Poll type, currently can be “regular” or “quiz”.
getter/setter pair
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited