Class SendPollMethod Use this method to send a native poll. A native poll can't be sent to a private chat.

On success, the sent Message is returned.

see
package Default

 Methods

create()

create(\TgBotApi\BotApiBase\Method\string $chatId, \TgBotApi\BotApiBase\Method\string $question, array<mixed,string> $options, array $data = null) : \TgBotApi\BotApiBase\Method\SendPollMethod
Static

Parameters

$chatId

$question

$options

array<mixed,string>

$data

Exceptions

\TgBotApi\BotApiBase\Exception\BadArgumentException

Returns

\TgBotApi\BotApiBase\Method\SendPollMethod

fill()

fill(array $data, array $forbidden = array()
Inherited

Parameters

$data

array

$forbidden

array

Exceptions

\TgBotApi\BotApiBase\Exception\BadArgumentException

 Properties

 

Optional. Pass True, if the message should be sent even if the specified replied-to message is not found.

$allowSendingWithoutReply : boolean | null

Default

 

Optional. True, if the poll allows multiple answers, ignored for polls in quiz mode, defaults to False.

$allowsMultipleAnswers : boolean | null

Default

 

Point in time (will be transformed to Unix timestamp on send) when the poll will be automatically closed.

$closeDate : \DateTimeInterface | null

Default

Must be at least 5 and no more than 600 seconds in the future. Can't be used together with open_period.

 

Optional. 0-based identifier of the correct answer option, required for polls in quiz mode.

$correctOptionId : integer | null

Default

 

Optional. Sends the message silently. Users will receive a notification with no sound.

$disableNotification : boolean | null

Default

 

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 with at most 2 line feeds after entities parsing.

$explanation : string | null

Default

 

List of special entities that appear in the poll explanation, which can be specified instead of parse_mode.

$explanationEntities : array<mixed,\TgBotApi\BotApiBase\Type\MessageEntityType> | null

Default

 

Optional. Mode for parsing entities in the explanation. See formatting options for more details.

$explanationParseMode : string | null

Default

 

Optional. If the poll needs to be anonymous, defaults to True.

$isAnonymous : boolean | null

Default

 

Optional. Pass True, if the poll needs to be immediately closed.

$isClosed : boolean | null

Default

 

Optional. Amount of time in seconds the poll will be active after creation, 5-600.

$openPeriod : integer | null

Default

Can't be used together with close_date.

 

A JSON-serialized list of answer options, 2-10 strings 1-100 characters each.

$options : array<mixed,string>

Default

 

Poll question, 1-300 characters.

$question : \TgBotApi\BotApiBase\Method\string;

Default

 

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

$replyMarkup : \TgBotApi\BotApiBase\Type\InlineKeyboardMarkupType | \TgBotApi\BotApiBase\Type\ReplyKeyboardMarkupType | \TgBotApi\BotApiBase\Type\ReplyKeyboardRemoveType | \TgBotApi\BotApiBase\Type\ForceReplyType | null

Default

 

Optional. If the message is a reply, ID of the original message.

$replyToMessageId : integer | null

Default

 

Optional. Poll type, “quiz” or “regular”, defaults to “regular”.

$type : string

Default