InputMessagePoll class final

A message with a poll. Polls can't be sent to secret chats and channel direct messages chats. Polls can be sent to a private chat only if the chat is a chat with a bot or the Saved Messages chat

Inheritance

Constructors

InputMessagePoll({required FormattedText question, required List<InputPollOption> options, FormattedText? description, InputPollMedia? media, required bool isAnonymous, required bool allowsMultipleAnswers, required bool allowsRevoting, required bool membersOnly, required List<String> countryCodes, required bool shuffleOptions, required bool hideResultsUntilCloses, required InputPollType type, required int openPeriod, required int closeDate, required bool isClosed})
A message with a poll. Polls can't be sent to secret chats and channel direct messages chats. Polls can be sent to a private chat only if the chat is a chat with a bot or the Saved Messages chat
const
InputMessagePoll.fromJson(Map<String, dynamic> json)
Parses a InputMessagePoll from TDLib JSON.
factory

Properties

allowsMultipleAnswers → bool
True, if multiple answer options can be chosen simultaneously
final
allowsRevoting → bool
True, if the poll can be answered multiple times
final
clientId → int?
Identifier of the TDLib client that sent this object, when known.
no setterinherited
closeDate → int
Point in time (Unix timestamp) when the poll will automatically be closed; must be 0-getOption("poll_open_period_max") seconds in the future; pass 0 if not specified
final
countryCodes → List<String>
The list of two-letter ISO 3166-1 alpha-2 codes of countries, users from which will be able to vote; for channel chats only. If empty, then all users can participate in the poll. There can be up to getOption("poll_country_count_max") chosen countries
final
description → FormattedText?
Poll description; pass null to use an empty description; 0-getOption("message_caption_length_max") characters
final
extra → dynamic
"@extra" of the request this object answers; null for updates.
no setterinherited
hashCode → int
The hash code for this object.
no setterinherited
hideResultsUntilCloses → bool
True, if the poll results will appear only after the poll closes
final
isAnonymous → bool
True, if the poll voters are anonymous. Non-anonymous polls can't be sent or forwarded to channels
final
isClosed → bool
True, if the poll needs to be sent already closed; for bots only
final
media → InputPollMedia?
Media attached to the poll; pass null if none. Must be one of the following types: inputPollMediaAnimation, inputPollMediaAudio, inputPollMediaDocument, inputPollMediaLocation, inputPollMediaPhoto, inputPollMediaVenue, or inputPollMediaVideo without caption
final
membersOnly → bool
True, if only the users that are members of the chat for more than a day will be able to vote; for channel chats only
final
openPeriod → int
Amount of time the poll will be active after creation, in seconds; 0-getOption("poll_open_period_max"); pass 0 if not specified
final
options → List<InputPollOption>
List of poll answer options; 1-getOption("poll_answer_count_max") options
final
question → FormattedText
Poll question; 1-255 characters (up to 300 characters for bots). Only custom emoji entities are allowed to be added and only by Premium users
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
shuffleOptions → bool
True, if poll options must be shown in a fixed random order
final
type → InputPollType
Type of the poll
final

Methods

copyWith({FormattedText? question, List<InputPollOption>? options, FormattedText? description()?, InputPollMedia? media()?, bool? isAnonymous, bool? allowsMultipleAnswers, bool? allowsRevoting, bool? membersOnly, List<String>? countryCodes, bool? shuffleOptions, bool? hideResultsUntilCloses, InputPollType? type, int? openPeriod, int? closeDate, bool? isClosed}) → InputMessagePoll
Returns a copy with the given fields replaced. For a nullable field pass a function, e.g. field: () => null to clear it.
override
getConstructor() → String
TDLib type name, e.g. updateNewMessage.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
Converts this object to TDLib JSON.
override
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Constants

CONSTRUCTOR → const String
TDLib type name.