sendPoll

Use this method to send a native poll. On success, the sent Message is returned. This method support both normal and static use

Arguments
Name Type Description Required
question string | array Poll question, 1-300 characters yes
options string[] A JSON-serialized list of answer options, 2-10 strings 1-100 characters each yes
chat_id int | string | null Unique identifier for the target chat or username of the target channel (in the format @channelusername) no
message_thread_id int | null Unique identifier for the target message thread (topic) of the forum; for forum supergroups only no
is_anonymous bool | null True, if the poll needs to be anonymous, defaults to True no
type string | null Poll type, “quiz” or “regular”, defaults to “regular” no
allows_multiple_answers bool | null True, if the poll allows multiple answers, ignored for polls in quiz mode, defaults to False no
correct_option_id int | null 0-based identifier of the correct answer option, required for polls in quiz mode no
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 no
explanation_parse_mode string | null Mode for parsing entities in the explanation. See formatting options for more details. no
explanation_entities messageEntity[] | null | stdClass[] A JSON-serialized list of special entities that appear in the poll explanation, which can be specified instead of parse_mode no
open_period int | null Amount of time in seconds the poll will be active after creation, 5-600. Can't be used together with close_date. no
close_date int | null Point in time (Unix timestamp) when the poll will be automatically closed. Must be at least 5 and no more than 600 seconds in the future. Can't be used together with open_period. no
is_closed bool | null Pass True if the poll needs to be immediately closed. This can be useful for poll preview. no
disable_notification bool | null Sends the message silently. Users will receive a notification with no sound. no
protect_content bool | null Protects the contents of the sent message from forwarding and saving no
reply_to_message_id int | null If the message is a reply, ID of the original message no
allow_sending_without_reply bool | null Pass True if the message should be sent even if the specified replied-to message is not found no
reply_markup inlineKeyboardMarkup | replyKeyboardMarkup | replyKeyboardRemove | forceReply | null | stdClass Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. no
token string | null You can use this method on another bot with specify this parameter no
forgot bool | null You can set to not receive request result, dont set it or pass null for turn it off no
answer bool | null You can set to answer to webhook, dont set it or pass null for turn it off no

Output : BPT\types\message | BPT\types\responseError | bool

Static or normal : Static

Examples :

telegram::sendPoll(question: string, options: Array, chat_id: int | string | null, message_thread_id: int | null, is_anonymous: bool | null, type: string | null, allows_multiple_answers: bool | null, correct_option_id: int | null, explanation: string | null, explanation_parse_mode: string | null, explanation_entities: Array | null, open_period: int | null, close_date: int | null, is_closed: bool | null, disable_notification: bool | null, protect_content: bool | null, reply_to_message_id: int | null, allow_sending_without_reply: bool | null, reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | null, token: String | null, forgot: Boolean | null, answer: Boolean | null);
telegram::sendPoll(['question' => string, 'options' => Array, 'chat_id' => int | string | null, 'message_thread_id' => int | null, 'is_anonymous' => bool | null, 'type' => string | null, 'allows_multiple_answers' => bool | null, 'correct_option_id' => int | null, 'explanation' => string | null, 'explanation_parse_mode' => string | null, 'explanation_entities' => Array | null, 'open_period' => int | null, 'close_date' => int | null, 'is_closed' => bool | null, 'disable_notification' => bool | null, 'protect_content' => bool | null, 'reply_to_message_id' => int | null, 'allow_sending_without_reply' => bool | null, 'reply_markup' => InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | null, 'token' => String | null, 'forgot' => Boolean | null, 'answer' => Boolean | null]);
telegram::sendPoll(question: string, options: Array);
telegram::sendPoll(['question' => string, 'options' => Array]);
$this->sendPoll(question: string, options: Array, chat_id: int | string | null, message_thread_id: int | null, is_anonymous: bool | null, type: string | null, allows_multiple_answers: bool | null, correct_option_id: int | null, explanation: string | null, explanation_parse_mode: string | null, explanation_entities: Array | null, open_period: int | null, close_date: int | null, is_closed: bool | null, disable_notification: bool | null, protect_content: bool | null, reply_to_message_id: int | null, allow_sending_without_reply: bool | null, reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | null, token: String | null, forgot: Boolean | null, answer: Boolean | null);
$this->sendPoll(['question' => string, 'options' => Array, 'chat_id' => int | string | null, 'message_thread_id' => int | null, 'is_anonymous' => bool | null, 'type' => string | null, 'allows_multiple_answers' => bool | null, 'correct_option_id' => int | null, 'explanation' => string | null, 'explanation_parse_mode' => string | null, 'explanation_entities' => Array | null, 'open_period' => int | null, 'close_date' => int | null, 'is_closed' => bool | null, 'disable_notification' => bool | null, 'protect_content' => bool | null, 'reply_to_message_id' => int | null, 'allow_sending_without_reply' => bool | null, 'reply_markup' => InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | null, 'token' => String | null, 'forgot' => Boolean | null, 'answer' => Boolean | null]);
$this->sendPoll(question: string, options: Array);
$this->sendPoll(['question' => string, 'options' => Array]);