class
Hamilton::Types::Poll
- Hamilton::Types::Poll
- Reference
- Object
Overview
This object contains information about a poll.
Included Modules
- Hamilton::Types::Common
- JSON::Serializable
Defined in:
types/poll.crConstructors
- .new(pull : JSON::PullParser)
- .new(params)
- .new(*, __pull_for_json_serializable pull : JSON::PullParser)
- .new(**params)
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
Point in time (Unix timestamp) when the poll will be automatically closed.
-
#close_date=(close_date : Int32)
Point in time (Unix timestamp) when the poll will be automatically closed.
-
#correct_option_id : Int32 | Nil
0-based identifier of the correct answer option.
-
#correct_option_id=(correct_option_id : Int32 | Nil)
0-based identifier of the correct answer option.
-
#explanation : String | Nil
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.
-
#explanation=(explanation : String | Nil)
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.
-
#explanation_entities : Array(Hamilton::Types::MessageEntity) | Nil
Special entities like usernames, URLs, bot commands, etc.
-
#explanation_entities=(explanation_entities : Array(Hamilton::Types::MessageEntity) | Nil)
Special entities like usernames, URLs, bot commands, etc.
-
#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.
-
#non_nil_fields : Array(String)
List of available non-nil fields.
-
#non_nil_fields=(non_nil_fields : Array(String))
List of available non-nil fields.
-
#open_period : Int32
Amount of time in seconds the poll will be active after creation.
-
#open_period=(open_period : Int32)
Amount of time in seconds the poll will be active after creation.
-
#options : Array(Hamilton::Types::PollOption)
List of poll options.
-
#options=(options : Array(Hamilton::Types::PollOption))
List of poll options.
-
#question : String
Poll question, 1-300 characters.
-
#question=(question : String)
Poll question, 1-300 characters.
-
#question_entities : Array(Hamilton::Types::MessageEntity) | Nil
Special entities that appear in the question.
-
#question_entities=(question_entities : Array(Hamilton::Types::MessageEntity) | Nil)
Special entities that appear in the question.
-
#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 Reference
==(other : Hamilton::Any)
==
Instance methods inherited from class Object
===(other : Hamilton::Any)
===
Constructor Detail
Instance Method Detail
True, if the poll allows multiple answers.
Point in time (Unix timestamp) when the poll will be automatically closed.
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.
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.
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.
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.
Special entities like usernames, URLs, bot commands, etc. that appear in the explanation.
Special entities like usernames, URLs, bot commands, etc. that appear in the explanation.
Amount of time in seconds the poll will be active after creation.
Special entities that appear in the question. Currently, only custom emoji entities are allowed in poll questions.
Special entities that appear in the question. Currently, only custom emoji entities are allowed in poll questions.