sendPoll method

Future<Message> sendPoll(
  1. ChatID chatId,
  2. String question,
  3. List<String> options, {
  4. bool? isAnonymous,
  5. String? type,
  6. bool? allowsMultipleAnswers,
  7. int? correctOptionId,
  8. bool? isClosed,
  9. bool? disableNotification,
  10. int? replyToMessageId,
  11. bool? allowSendingWithoutReply,
  12. ReplyMarkup? replyMarkup,
})
inherited

Use this method to send a native poll.

On success, the sent Message is returned.

Implementation

Future<Message> sendPoll(
  ChatID chatId,
  String question,
  List<String> options, {
  bool? isAnonymous,
  String? type,
  bool? allowsMultipleAnswers,
  int? correctOptionId,
  bool? isClosed,
  bool? disableNotification,
  int? replyToMessageId,
  bool? allowSendingWithoutReply,
  ReplyMarkup? replyMarkup,
}) {
  return _client.apiCall(
    _token,
    'sendPoll',
    {
      'chat_id': chatId,
      'question': question,
      'options': options,
      'is_anonymous': isAnonymous,
      'type': type,
      'allows_multiple_answers': allowsMultipleAnswers,
      'correct_option_id': correctOptionId,
      'is_closed': isClosed,
      'disable_notification': disableNotification,
      'reply_to_message_id': replyToMessageId,
      'allow_sending_without_reply': allowSendingWithoutReply,
      'reply_markup': replyMarkup
    },
  );
}