class Hamilton::Types::Poll

Overview

This object contains information about a poll.

Included Modules

Defined in:

types/poll.cr

Constructors

Instance Method Summary

Instance methods inherited from class Reference

==(other : Hamilton::Any) ==

Instance methods inherited from class Object

===(other : Hamilton::Any) ===

Constructor Detail

def self.new(pull : JSON::PullParser) #

def self.new(params) #

def self.new(*, __pull_for_json_serializable pull : JSON::PullParser) #

def self.new(**params) #

Instance Method Detail

def allows_multiple_answers : Bool #

True, if the poll allows multiple answers.


def allows_multiple_answers=(allows_multiple_answers : Bool) #

True, if the poll allows multiple answers.


def close_date : Int32 #

Point in time (Unix timestamp) when the poll will be automatically closed.


def close_date=(close_date : Int32) #

Point in time (Unix timestamp) when the poll will be automatically closed.


def correct_option_id : Int32 | Nil #

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.


def correct_option_id=(correct_option_id : Int32 | Nil) #

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.


def 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.


def 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.


def explanation_entities : Array(Hamilton::Types::MessageEntity) | Nil #

Special entities like usernames, URLs, bot commands, etc. that appear in the explanation.


def explanation_entities=(explanation_entities : Array(Hamilton::Types::MessageEntity) | Nil) #

Special entities like usernames, URLs, bot commands, etc. that appear in the explanation.


def id : String #

Unique poll identifier.


def id=(id : String) #

Unique poll identifier.


def is_anonymous : Bool #

True, if the poll is anonymous.


def is_anonymous=(is_anonymous : Bool) #

True, if the poll is anonymous.


def is_closed : Bool #

True, if the poll is closed.


def is_closed=(is_closed : Bool) #

True, if the poll is closed.


def non_nil_fields : Array(String) #

List of available non-nil fields.


def non_nil_fields=(non_nil_fields : Array(String)) #

List of available non-nil fields.


def open_period : Int32 #

Amount of time in seconds the poll will be active after creation.


def open_period=(open_period : Int32) #

Amount of time in seconds the poll will be active after creation.


def options : Array(Hamilton::Types::PollOption) #

List of poll options.


def options=(options : Array(Hamilton::Types::PollOption)) #

List of poll options.


def question : String #

Poll question, 1-300 characters.


def question=(question : String) #

Poll question, 1-300 characters.


def question_entities : Array(Hamilton::Types::MessageEntity) | Nil #

Special entities that appear in the question. Currently, only custom emoji entities are allowed in poll questions.


def question_entities=(question_entities : Array(Hamilton::Types::MessageEntity) | Nil) #

Special entities that appear in the question. Currently, only custom emoji entities are allowed in poll questions.


def total_voter_count : Int32 #

Total number of users that voted in the poll.


def total_voter_count=(total_voter_count : Int32) #

Total number of users that voted in the poll.


def type : String #

Poll type, currently can be “regular” or “quiz”.


def type=(type : String) #

Poll type, currently can be “regular” or “quiz”.