From ad7fdc6211a7f390bf46173d66d19266edae7146 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sun, 22 May 2022 22:36:56 +0600 Subject: [PATCH] improvements in longPolling extension --- CHANGELOG.md | 3 +++ .../extensions/utils/updates/retrieving/LongPolling.kt | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b0562004d..b15ed59d41 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## 2.0.1 +* `Utils`: + * `TelegramBot#longPolling` now accepts `UpdatesFilter` instead of `FlowsUpdatesFilter` + ## 2.0.0 ___ALL PREVIOUS DEPRECATIONS HAVE BEEN REMOVED___ diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/updates/retrieving/LongPolling.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/updates/retrieving/LongPolling.kt index b0c8550231..421427e2ac 100644 --- a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/updates/retrieving/LongPolling.kt +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/updates/retrieving/LongPolling.kt @@ -166,11 +166,11 @@ suspend fun TelegramBot.flushAccumulatedUpdates( * all updates receivers, because this method will trigger getting of updates and. */ fun TelegramBot.longPolling( - flowsUpdatesFilter: FlowsUpdatesFilter, + updatesFilter: UpdatesFilter, timeoutSeconds: Seconds = 30, scope: CoroutineScope = CoroutineScope(Dispatchers.Default), exceptionsHandler: ExceptionHandler? = null -): Job = flowsUpdatesFilter.run { +): Job = updatesFilter.run { startGettingOfUpdatesByLongPolling(timeoutSeconds, scope, exceptionsHandler, allowedUpdates, asUpdateReceiver) }