stopPoll method

Future<Poll> stopPoll(
  1. dynamic chat_id,
  2. int message_id,
  3. InlineKeyboardMarkup reply_markup
)
inherited

Use this method to stop a poll which was sent by the bot

On success, the stopped Poll with the final results is returned.

https://core.telegram.org/bots/api#stoppoll

Implementation

Future<Poll> stopPoll(dynamic chat_id, int message_id,
    InlineKeyboardMarkup reply_markup) async {
  if (chat_id is! String && chat_id is! int) {
    return Future.error(TelegramException(
        'Attribute \'chat_id\' can only be either type of String or int'));
  }
  var requestUrl = _apiUri('stopPoll');
  var body = <String, dynamic>{
    'chat_id': chat_id,
    'message_id': message_id,
    'reply_markup': reply_markup,
  };
  return Poll.fromJson(await HttpClient.httpPost(requestUrl, body: body));
}