stopPoll method
Use this method to stop a poll which was sent by the bot
On success, the stopped Poll with the final results is returned.
Implementation
Future<Poll> stopPoll(
dynamic chatId, int messageId, InlineKeyboardMarkup replyMarkup) async {
if (chatId is! String && chatId is! int) {
return Future.error(TelegramException(
'Attribute \'chatId\' can only be either type of String or int'));
}
var requestUrl = _apiUri('stopPoll');
var body = <String, dynamic>{
'chat_id': chatId,
'message_id': messageId,
'reply_markup': replyMarkup,
};
return Poll.fromJson(await HttpClient.httpPost(requestUrl, body: body));
}