From c167c556aefc95ad5989a1da71499442cf63fd76 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Tue, 12 Mar 2019 08:20:40 +0800 Subject: [PATCH] a little fixes --- .../TelegramBotAPI/utils/extensions/UpdatesPoller.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/extensions/UpdatesPoller.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/extensions/UpdatesPoller.kt index dd1698d6b8..fa604d42ab 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/extensions/UpdatesPoller.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/extensions/UpdatesPoller.kt @@ -53,7 +53,7 @@ class UpdatesPoller( lastHandledUpdate + 1, // incremented because offset counted from 1 when updates id from 0 allowed_updates = allowedUpdates ) - ) ?.map { + ).map { it.asUpdate } } @@ -77,7 +77,8 @@ class UpdatesPoller( while (isActive) { delay(requestsDelayMillis) try { - handleUpdates(getUpdates()) + val updates = getUpdates() + handleUpdates(updates) } catch (e: Exception) { e.printStackTrace() }