improvements in longPolling extension

This commit is contained in:
InsanusMokrassar 2022-05-22 22:36:56 +06:00
parent c870a48a22
commit ad7fdc6211
2 changed files with 5 additions and 2 deletions

View File

@ -2,6 +2,9 @@
## 2.0.1 ## 2.0.1
* `Utils`:
* `TelegramBot#longPolling` now accepts `UpdatesFilter` instead of `FlowsUpdatesFilter`
## 2.0.0 ## 2.0.0
___ALL PREVIOUS DEPRECATIONS HAVE BEEN REMOVED___ ___ALL PREVIOUS DEPRECATIONS HAVE BEEN REMOVED___

View File

@ -166,11 +166,11 @@ suspend fun TelegramBot.flushAccumulatedUpdates(
* all updates receivers, because this method will trigger getting of updates and. * all updates receivers, because this method will trigger getting of updates and.
*/ */
fun TelegramBot.longPolling( fun TelegramBot.longPolling(
flowsUpdatesFilter: FlowsUpdatesFilter, updatesFilter: UpdatesFilter,
timeoutSeconds: Seconds = 30, timeoutSeconds: Seconds = 30,
scope: CoroutineScope = CoroutineScope(Dispatchers.Default), scope: CoroutineScope = CoroutineScope(Dispatchers.Default),
exceptionsHandler: ExceptionHandler<Unit>? = null exceptionsHandler: ExceptionHandler<Unit>? = null
): Job = flowsUpdatesFilter.run { ): Job = updatesFilter.run {
startGettingOfUpdatesByLongPolling(timeoutSeconds, scope, exceptionsHandler, allowedUpdates, asUpdateReceiver) startGettingOfUpdatesByLongPolling(timeoutSeconds, scope, exceptionsHandler, allowedUpdates, asUpdateReceiver)
} }