longPolling

fun TelegramBot.longPolling(updatesFilter: UpdatesFilter, timeoutSeconds: Seconds = 30, scope: CoroutineScope = CoroutineScope(Dispatchers.Default), autoDisableWebhooks: Boolean = true, autoSkipTimeoutExceptions: Boolean = true, mediaGroupsDebounceTimeMillis: Long? = 1000, exceptionsHandler: ExceptionHandler<Unit>? = null): Job

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

Parameters

mediaGroupsDebounceTimeMillis

Will be used for calling of updateHandlerWithMediaGroupsAdaptation. Pass null in case you wish to enable classic way of updates handling, but in that mode some media group messages can be retrieved in different updates


fun TelegramBot.longPolling(timeoutSeconds: Seconds = 30, scope: CoroutineScope = CoroutineScope(Dispatchers.Default), exceptionsHandler: ExceptionHandler<Unit>? = null, flowsUpdatesFilterUpdatesKeeperCount: Int = 100, autoDisableWebhooks: Boolean = true, autoSkipTimeoutExceptions: Boolean = true, mediaGroupsDebounceTimeMillis: Long? = 1000, flowUpdatesPreset: FlowsUpdatesFilter.() -> Unit): Job

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.

Parameters

mediaGroupsDebounceTimeMillis

Will be used for calling of updateHandlerWithMediaGroupsAdaptation. Pass null in case you wish to enable classic way of updates handling, but in that mode some media group messages can be retrieved in different updates