class Telegram::API::Poll
- Telegram::API::Poll
- Telegram::API::Type
- Reference
- Object
Overview
This object contains information about a poll.
Defined in:
telegram/api/generated/types.crtelegram/api/overrides/poll.cr
Constructors
- .new(id : String, question : String, total_voter_count : Int32, is_closed : Bool, is_anonymous : Bool, type : String, allows_multiple_answers : Bool, options : Array(PollOption) = Array(PollOption).new, correct_option_id : Int32 | Nil = nil, explanation : String | Nil = nil, open_period : Int32 | Nil = nil, close_date : Int32 | Nil = nil, explanation_entities : Array(MessageEntity) = Array(MessageEntity).new)
-
.new(pull : JSON::PullParser)
This object contains information about a poll.
Instance Method Summary
-
#allows_multiple_answers : Bool
True, if the poll allows multiple answers
-
#allows_multiple_answers=(allows_multiple_answers : Bool)
True, if the poll allows multiple answers
-
#close_date : Int32 | Nil
Optional.
-
#close_date=(close_date : Int32 | Nil)
Optional.
-
#correct_option_id : Int32 | Nil
Optional.
-
#correct_option_id=(correct_option_id : Int32 | Nil)
Optional.
-
#explanation : String | Nil
Optional.
-
#explanation=(explanation : String | Nil)
Optional.
-
#explanation_entities : Array(MessageEntity)
Optional.
-
#explanation_entities=(explanation_entities : Array(MessageEntity))
Optional.
-
#id : String
Unique poll identifier
-
#id=(id : String)
Unique poll identifier
-
#is_anonymous : Bool
True, if the poll is anonymous
-
#is_anonymous=(is_anonymous : Bool)
True, if the poll is anonymous
-
#is_closed : Bool
True, if the poll is closed
-
#is_closed=(is_closed : Bool)
True, if the poll is closed
-
#open_period : Int32 | Nil
Optional.
-
#open_period=(open_period : Int32 | Nil)
Optional.
-
#options : Array(PollOption)
List of poll options
-
#options=(options : Array(PollOption))
List of poll options
-
#question : String
Poll question, 1-300 characters
-
#question=(question : String)
Poll question, 1-300 characters
- #quiz?
-
#total_voter_count : Int32
Total number of users that voted in the poll
-
#total_voter_count=(total_voter_count : Int32)
Total number of users that voted in the poll
-
#type : String
Poll type, currently can be "regular" or "quiz"
-
#type=(type : String)
Poll type, currently can be "regular" or "quiz"
Instance methods inherited from class Telegram::API::Type
==(other)
==,
client
client
Constructor methods inherited from class Telegram::API::Type
new(pull : JSON::PullParser)
new
Constructor Detail
Instance Method Detail
True, if the poll allows multiple answers
Optional. Point in time (Unix timestamp) when the poll will be automatically closed
Optional. Point in time (Unix timestamp) when the poll will be automatically closed
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.
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.
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
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
Optional. Special entities like usernames, URLs, bot commands, etc. that appear in the explanation
Optional. Special entities like usernames, URLs, bot commands, etc. that appear in the explanation
Optional. Amount of time in seconds the poll will be active after creation
Optional. Amount of time in seconds the poll will be active after creation