class Tourmaline::Poll

Overview

This object contains information about a poll.

Included Modules

Defined in:

tourmaline/types/api.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(id : String, question : String, total_voter_count : Int32 | Int64, is_closed : Bool, is_anonymous : Bool, type : String, allows_multiple_answers : Bool, options : Array(Tourmaline::PollOption) = [] of Tourmaline::PollOption, correct_option_id : Int32 | Int64 | Nil = nil, explanation : String | Nil = nil, explanation_entities : Array(Tourmaline::MessageEntity) = [] of Tourmaline::MessageEntity, open_period : Int32 | Int64 | Nil = nil, close_date : Int32 | Int64 | Nil = nil) #

[View source]
def self.new(pull : JSON::PullParser) #

[View source]

Instance Method Detail

def allows_multiple_answers=(allows_multiple_answers : Bool) #

True, if the poll allows multiple answers


[View source]
def allows_multiple_answers? : Bool #

True, if the poll allows multiple answers


[View source]
def close_date : Time | Nil #

[View source]
def close_date=(close_date : Time | Nil) #

[View source]
def correct_option_id : Int32 | Int64 | Nil #

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.


[View source]
def correct_option_id=(correct_option_id : Int32 | Int64 | Nil) #

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.


[View source]
def explanation : String | Nil #

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


[View source]
def explanation=(explanation : String | Nil) #

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


[View source]
def explanation_entities : Array(Tourmaline::MessageEntity) #

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


[View source]
def explanation_entities=(explanation_entities : Array(Tourmaline::MessageEntity)) #

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


[View source]
def id : String #

Unique poll identifier


[View source]
def id=(id : String) #

Unique poll identifier


[View source]
def is_anonymous=(is_anonymous : Bool) #

True, if the poll is anonymous


[View source]
def is_anonymous? : Bool #

True, if the poll is anonymous


[View source]
def is_closed=(is_closed : Bool) #

True, if the poll is closed


[View source]
def is_closed? : Bool #

True, if the poll is closed


[View source]
def open_period : Int32 | Int64 | Nil #

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


[View source]
def open_period=(open_period : Int32 | Int64 | Nil) #

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


[View source]
def options : Array(Tourmaline::PollOption) #

List of poll options


[View source]
def options=(options : Array(Tourmaline::PollOption)) #

List of poll options


[View source]
def question : String #

Poll question, 1-300 characters


[View source]
def question=(question : String) #

Poll question, 1-300 characters


[View source]
def total_voter_count : Int32 | Int64 #

Total number of users that voted in the poll


[View source]
def total_voter_count=(total_voter_count : Int32 | Int64) #

Total number of users that voted in the poll


[View source]
def type : String #

Poll type, currently can be "regular" or "quiz"


[View source]
def type=(type : String) #

Poll type, currently can be "regular" or "quiz"


[View source]