sendPoll
Send a poll.
Parameters
The chat to send the poll to.
The poll’s question.
The poll’s options.
The entities of the poll’s question.
The parse mode to use for the poll’s question. If not provided, the default parse mode will be used.
The parse mode to use for the poll’s options. If not provided, the default parse mode will be used.
Whether the poll should be anonymous.
The type of the poll.
Whether multiple selections should be allowed. Only valid for regular polls.
Index of the correct option. Required for quiz polls.
A text that will be shown to the user when the poll is answered. Only valid for quiz polls.
The parse mode to use for the explanation. If not provided, the default parse mode will be used.
The explanation’s entities.
Duration of the poll in seconds. Must be in the range of 5-600. Cannot be used simultaneously with closeDate
.
The time in which the poll will be closed. Must be at least 5 seconds in the future, and no more than 600. Cannot be used simultaneously with openPeriod
.
Whether the poll should be closed as soon as it is sent, allowing no answers.
Whether to send the message in a silent way without making a sound on the recipients’ clients.
Whether to protect the contents of the message from copying and forwarding.
Information on what the message is replying to.
The identifier of a thread to send the message to.
The identifier of a chat to send the message on behalf of. User-only.
The identifier of a message effect to be attached to the message.
If specified, the message will be scheduled to be sent at that date. User-only.
The identifier of a business connection ID to perform the action on. Bot-only.
The reply markup of the message. Bot-only.
Result
The sent poll.
Syntax
// Required parameters only.
await client.sendPoll(chatId, question, options);
// Required parameters + optional parameters.
// Any of the optional parameters can be omitted.
await client.sendPoll(chatId, question, options, {
questionEntities,
questionParseMode,
optionParseMode,
isAnonymous,
type,
allowMultipleAnswers,
correctOptionIndex,
explanation,
explanationParseMode,
explanationEntities,
openPeriod,
closeDate,
isClosed,
disableNotification,
protectContent,
replyTo,
messageThreadId,
sendAs,
effectId,
sendAt,
businessConnectionId,
paidBroadcast,
replyMarkup,
});