# dev.inmo.tgbotapi.extensions.utils.updates.retrieving

docs

# Package dev.inmo.tgbotapi.extensions.utils.updates.retrieving

## Functions

createAccumulatedUpdatesRetrieverFlow
Link copied to clipboard
fun TelegramBot . createAccumulatedUpdatesRetrieverFlow ( avoidInlineQueries: Boolean = false, avoidCallbackQueries: Boolean = false, exceptionsHandler: ExceptionHandler< Unit >? = null, allowedUpdates: List < String >? = null): Flow< Update >
Content copied to clipboard
flushAccumulatedUpdates
Link copied to clipboard
suspend fun TelegramBot . flushAccumulatedUpdates ( avoidInlineQueries: Boolean = false, avoidCallbackQueries: Boolean = false, scope: CoroutineScope = CoroutineScope(Dispatchers.Default), allowedUpdates: List < String >? = null, exceptionsHandler: ExceptionHandler< Unit >? = null, updatesReceiver: UpdateReceiver < Update > = {})
Content copied to clipboard
includeWebhookHandlingInRoute
Link copied to clipboard
fun Route. includeWebhookHandlingInRoute ( scope: CoroutineScope, exceptionsHandler: ExceptionHandler< Unit >? = null, mediaGroupsDebounceTimeMillis: Long = 1000, block: UpdateReceiver<Update>)
Content copied to clipboard

Allows to include webhook in custom route everywhere in your server

includeWebhookHandlingInRouteWithFlows
Link copied to clipboard
fun Route. includeWebhookHandlingInRouteWithFlows ( scope: CoroutineScope, exceptionsHandler: ExceptionHandler< Unit >? = null, mediaGroupsDebounceTimeMillis: Long = 1000, block: FlowsUpdatesFilter.() -> Unit )
Content copied to clipboard
longPolling
Link copied to clipboard
fun TelegramBot . longPolling ( flowsUpdatesFilter: FlowsUpdatesFilter , timeoutSeconds: Seconds = 30, scope: CoroutineScope = CoroutineScope(Dispatchers.Default), exceptionsHandler: ExceptionHandler< Unit >? = null): Job
Content copied to clipboard

Will startGettingOfUpdatesByLongPolling using incoming flowsUpdatesFilter. It is assumed that you ALREADY CONFIGURE all updates receivers, because this method will trigger getting of updates and.

fun TelegramBot . longPolling ( timeoutSeconds: Seconds = 30, scope: CoroutineScope = CoroutineScope(Dispatchers.Default), exceptionsHandler: ExceptionHandler< Unit >? = null, flowsUpdatesFilterUpdatesKeeperCount: Int = 100, flowUpdatesPreset: FlowsUpdatesFilter .() -> Unit ): Job
Content copied to clipboard

Will enable longPolling by creating FlowsUpdatesFilter with flowsUpdatesFilterUpdatesKeeperCount as an argument and applied flowUpdatesPreset. It is assumed that you WILL CONFIGURE all updates receivers in flowUpdatesPreset, because of after flowUpdatesPreset method calling will be triggered getting of updates.

longPollingFlow
Link copied to clipboard
fun TelegramBot . longPollingFlow ( timeoutSeconds: Seconds = 30, exceptionsHandler: ExceptionHandler< Unit >? = null, allowedUpdates: List < String >? = null): Flow< Update >
Content copied to clipboard
retrieveAccumulatedUpdates
Link copied to clipboard
fun TelegramBot . retrieveAccumulatedUpdates ( flowsUpdatesFilter: FlowsUpdatesFilter , avoidInlineQueries: Boolean = false, avoidCallbackQueries: Boolean = false, scope: CoroutineScope = CoroutineScope(Dispatchers.Default), exceptionsHandler: ExceptionHandler< Unit >? = null): Job
Content copied to clipboard
fun TelegramBot . retrieveAccumulatedUpdates ( avoidInlineQueries: Boolean = false, avoidCallbackQueries: Boolean = false, scope: CoroutineScope = CoroutineScope(Dispatchers.Default), exceptionsHandler: ExceptionHandler< Unit >? = null, allowedUpdates: List < String >? = null, updatesReceiver: UpdateReceiver < Update >): Job
Content copied to clipboard
setWebhookInfoAndStartListenWebhooks
Link copied to clipboard
suspend fun RequestsExecutor . setWebhookInfoAndStartListenWebhooks ( listenPort: Int , engineFactory: ApplicationEngineFactory<*, *>, setWebhookRequest: SetWebhookRequest, exceptionsHandler: ExceptionHandler< Unit > = {}, listenHost: String = "0.0.0.0", listenRoute: String = "/", privateKeyConfig: WebhookPrivateKeyConfig ? = null, scope: CoroutineScope = CoroutineScope(Executors.newFixedThreadPool(4).asCoroutineDispatcher()), mediaGroupsDebounceTimeMillis: Long = 1000, additionalApplicationEngineEnvironmentConfigurator: ApplicationEngineEnvironmentBuilder.() -> Unit = {}, block: UpdateReceiver<Update>): ApplicationEngine
Content copied to clipboard

Setting up ktor server, set webhook info via SetWebhookRequest request.

startGettingOfUpdatesByLongPolling
Link copied to clipboard
fun RequestsExecutor . startGettingOfUpdatesByLongPolling ( updatesFilter: UpdatesFilter , timeoutSeconds: Seconds = 30, exceptionsHandler: ExceptionHandler< Unit >? = null, scope: CoroutineScope = CoroutineScope(Dispatchers.Default)): Job
Content copied to clipboard
fun TelegramBot . startGettingOfUpdatesByLongPolling ( timeoutSeconds: Seconds = 30, scope: CoroutineScope = CoroutineScope(Dispatchers.Default), exceptionsHandler: ExceptionHandler< Unit >? = null, allowedUpdates: List < String >? = null, updatesReceiver: UpdateReceiver < Update >): Job
Content copied to clipboard
startListenWebhooks
Link copied to clipboard
fun startListenWebhooks ( listenPort: Int , engineFactory: ApplicationEngineFactory<*, *>, exceptionsHandler: ExceptionHandler< Unit >, listenHost: String = "0.0.0.0", listenRoute: String ? = null, privateKeyConfig: WebhookPrivateKeyConfig ? = null, scope: CoroutineScope = CoroutineScope(Executors.newFixedThreadPool(4).asCoroutineDispatcher()), mediaGroupsDebounceTimeMillis: Long = 1000, additionalApplicationEngineEnvironmentConfigurator: ApplicationEngineEnvironmentBuilder.() -> Unit = {}, block: UpdateReceiver<Update>): ApplicationEngine
Content copied to clipboard

Setting up ktor server

updateHandlerWithMediaGroupsAdaptation
Link copied to clipboard
fun CoroutineScope. updateHandlerWithMediaGroupsAdaptation (output: UpdateReceiver < Update >): suspend ( Update ) -> Unit
Content copied to clipboard
fun CoroutineScope. updateHandlerWithMediaGroupsAdaptation (output: UpdateReceiver < Update >, debounceTimeMillis: Long = 1000): UpdateReceiver < Update >
Content copied to clipboard

Create UpdateReceiver object which will correctly accumulate updates and send into output updates which INCLUDE dev.inmo.tgbotapi.types.update.MediaGroupUpdates.MediaGroupUpdates.