SendPollRequest

data class SendPollRequest(chat_id: String, question: String, options: List<String>, is_anonymous: Boolean?, type: String?, allows_multiple_answers: Boolean?, correct_option_id: Long?, explanation: String?, explanation_parse_mode: String?, explanation_entities: List<MessageEntity>?, open_period: Long?, close_date: Long?, is_closed: Boolean?, disable_notification: Boolean?, reply_to_message_id: Long?, allow_sending_without_reply: Boolean?, reply_markup: KeyboardOption?) : TelegramRequest

Use this method to send a native poll. On success, the sent Message is returned.

Constructors

SendPollRequest
Link copied to clipboard
fun SendPollRequest(chat_id: String, question: String, options: List<String>, is_anonymous: Boolean? = null, type: String? = null, allows_multiple_answers: Boolean? = null, correct_option_id: Long? = null, explanation: String? = null, explanation_parse_mode: String? = null, explanation_entities: List<MessageEntity>? = null, open_period: Long? = null, close_date: Long? = null, is_closed: Boolean? = null, disable_notification: Boolean? = null, reply_to_message_id: Long? = null, allow_sending_without_reply: Boolean? = null, reply_markup: KeyboardOption? = null)

Properties

allow_sending_without_reply
Link copied to clipboard
val allow_sending_without_reply: Boolean? = null
Pass True, if the message should be sent even if the specified replied-to message is not found
allows_multiple_answers
Link copied to clipboard
val allows_multiple_answers: Boolean? = null
True, if the poll allows multiple answers, ignored for polls in quiz mode, defaults to False
chat_id
Link copied to clipboard
val chat_id: String
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
close_date
Link copied to clipboard
val close_date: Long? = null
Point in time (Unix timestamp) when the poll will be automatically closed.
correct_option_id
Link copied to clipboard
val correct_option_id: Long? = null
0-based identifier of the correct answer option, required for polls in quiz mode
disable_notification
Link copied to clipboard
val disable_notification: Boolean? = null
Sends the message
explanation
Link copied to clipboard
val explanation: String? = null
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 with at most 2 line feeds after entities parsing
explanation_entities
Link copied to clipboard
val explanation_entities: List<MessageEntity>? = null
List of special entities that appear in the poll explanation, which can be specified instead of parse_mode
explanation_parse_mode
Link copied to clipboard
val explanation_parse_mode: String? = null
Mode for parsing entities in the explanation.
is_anonymous
Link copied to clipboard
val is_anonymous: Boolean? = null
True, if the poll needs to be anonymous, defaults to True
is_closed
Link copied to clipboard
val is_closed: Boolean? = null
Pass True, if the poll needs to be immediately closed.
open_period
Link copied to clipboard
val open_period: Long? = null
Amount of time in seconds the poll will be active after creation, 5-600.
options
Link copied to clipboard
val options: List<String>
A JSON-serialized list of answer options, 2-10 strings 1-100 characters each
question
Link copied to clipboard
val question: String
Poll question, 1-300 characters
reply_markup
Link copied to clipboard
val reply_markup: KeyboardOption? = null
Additional interface options.
reply_to_message_id
Link copied to clipboard
val reply_to_message_id: Long? = null
If the message is a reply, ID of the original message
type
Link copied to clipboard
val type: String? = null
Poll type, “quiz” or “regular”, defaults to “regular”