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.
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
Optional. True, if the poll allows multiple answers, ignored for polls in quiz mode, defaults to False.
$allowsMultipleAnswers : boolean | null
Point in time (will be transformed to Unix timestamp on send) when the poll will be automatically closed.
$closeDate : \DateTimeInterface | null
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
Optional. Sends the message silently. Users will receive a notification with no sound.
$disableNotification : boolean | null
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
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
Optional. Mode for parsing entities in the explanation. See formatting options for more details.
$explanationParseMode : string | null
Optional. If the poll needs to be anonymous, defaults to True.
$isAnonymous : boolean | null
Optional. Pass True, if the poll needs to be immediately closed.
$isClosed : boolean | null
Optional. Amount of time in seconds the poll will be active after creation, 5-600.
$openPeriod : integer | null
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>
Poll question, 1-300 characters.
$question : \TgBotApi\BotApiBase\Method\string;
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
Optional. If the message is a reply, ID of the original message.
$replyToMessageId : integer | null
Optional. Poll type, “quiz” or “regular”, defaults to “regular”.
$type : string