1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-10-07 09:55:03 +00:00
tgbotapi/docs/dev.inmo.tgbotapi.bot/-requests-executor/index.md

49 lines
10 KiB
Markdown
Raw Normal View History

//[docs](../../../index.md)/[dev.inmo.tgbotapi.bot](../index.md)/[RequestsExecutor](index.md)
# RequestsExecutor
[common] interface [RequestsExecutor](index.md) :
Interface for making requests to Telegram Bot API. Currently, there is only one built-in implementation - [dev.inmo.tgbotapi.bot.Ktor.KtorRequestsExecutor](../../dev.inmo.tgbotapi.bot.Ktor/-ktor-requests-executor/index.md)
## See also
common
| | |
|---|---|
| <a name="dev.inmo.tgbotapi.bot/RequestsExecutor///PointingToDeclaration/"></a>[dev.inmo.tgbotapi.requests.abstracts.Request](../../dev.inmo.tgbotapi.requests.abstracts/-request/index.md)| <a name="dev.inmo.tgbotapi.bot/RequestsExecutor///PointingToDeclaration/"></a>|
| <a name="dev.inmo.tgbotapi.bot/RequestsExecutor///PointingToDeclaration/"></a>[dev.inmo.tgbotapi.bot.Ktor.KtorRequestsExecutor](../../dev.inmo.tgbotapi.bot.Ktor/-ktor-requests-executor/index.md)| <a name="dev.inmo.tgbotapi.bot/RequestsExecutor///PointingToDeclaration/"></a>|
## Functions
| Name | Summary |
|---|---|
| <a name="io.ktor.utils.io.core/Closeable/close/#/PointingToDeclaration/"></a>[close](../../dev.inmo.tgbotapi.extensions.behaviour_builder/-behaviour-context/index.md#%5Bio.ktor.utils.io.core%2FCloseable%2Fclose%2F%23%2FPointingToDeclaration%2F%5D%2FFunctions%2F625018081)| <a name="io.ktor.utils.io.core/Closeable/close/#/PointingToDeclaration/"></a>[common] <br>Content <br>abstract fun [close](../../dev.inmo.tgbotapi.extensions.behaviour_builder/-behaviour-context/index.md#%5Bio.ktor.utils.io.core%2FCloseable%2Fclose%2F%23%2FPointingToDeclaration%2F%5D%2FFunctions%2F625018081)() <br><br><br>|
| <a name="dev.inmo.tgbotapi.bot/RequestsExecutor/execute/#dev.inmo.tgbotapi.requests.abstracts.Request[TypeParam(bounds=[kotlin.Any])]/PointingToDeclaration/"></a>[execute](execute.md)| <a name="dev.inmo.tgbotapi.bot/RequestsExecutor/execute/#dev.inmo.tgbotapi.requests.abstracts.Request[TypeParam(bounds=[kotlin.Any])]/PointingToDeclaration/"></a>[common] <br>Content <br>abstract suspend fun <[T](execute.md) : [Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)> [execute](execute.md)(request: [Request](../../dev.inmo.tgbotapi.requests.abstracts/-request/index.md)<[T](execute.md)>): [T](execute.md) <br>More info <br>Unsafe execution of incoming [request](execute.md). <br><br><br>|
## Inheritors
| Name |
|---|
| <a name="dev.inmo.tgbotapi.bot/BaseRequestsExecutor///PointingToDeclaration/"></a>[BaseRequestsExecutor](../-base-requests-executor/index.md)|
| <a name="dev.inmo.tgbotapi.extensions.behaviour_builder/BehaviourContext///PointingToDeclaration/"></a>[BehaviourContext](../../dev.inmo.tgbotapi.extensions.behaviour_builder/-behaviour-context/index.md)|
## Extensions
| Name | Summary |
|---|---|
| <a name="dev.inmo.tgbotapi.extensions.utils.shortcuts//executeAsync/dev.inmo.tgbotapi.bot.RequestsExecutor#dev.inmo.tgbotapi.requests.abstracts.Request[TypeParam(bounds=[kotlin.Any])]#kotlinx.coroutines.CoroutineScope/PointingToDeclaration/"></a>[executeAsync](../../dev.inmo.tgbotapi.extensions.utils.shortcuts/execute-async.md)| <a name="dev.inmo.tgbotapi.extensions.utils.shortcuts//executeAsync/dev.inmo.tgbotapi.bot.RequestsExecutor#dev.inmo.tgbotapi.requests.abstracts.Request[TypeParam(bounds=[kotlin.Any])]#kotlinx.coroutines.CoroutineScope/PointingToDeclaration/"></a>[common] <br>Content <br>fun <[T](../../dev.inmo.tgbotapi.extensions.utils.shortcuts/execute-async.md) : [Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)> [RequestsExecutor](index.md).[executeAsync](../../dev.inmo.tgbotapi.extensions.utils.shortcuts/execute-async.md)(request: [Request](../../dev.inmo.tgbotapi.requests.abstracts/-request/index.md)<[T](../../dev.inmo.tgbotapi.extensions.utils.shortcuts/execute-async.md)>, scope: ): <[T](../../dev.inmo.tgbotapi.extensions.utils.shortcuts/execute-async.md)> <br>suspend fun <[T](../../dev.inmo.tgbotapi.extensions.utils.shortcuts/execute-async.md) : [Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)> [RequestsExecutor](index.md).[executeAsync](../../dev.inmo.tgbotapi.extensions.utils.shortcuts/execute-async.md)(request: [Request](../../dev.inmo.tgbotapi.requests.abstracts/-request/index.md)<[T](../../dev.inmo.tgbotapi.extensions.utils.shortcuts/execute-async.md)>): <[T](../../dev.inmo.tgbotapi.extensions.utils.shortcuts/execute-async.md)> <br><br><br>|
| <a name="dev.inmo.tgbotapi.extensions.utils.shortcuts//executeUnsafe/dev.inmo.tgbotapi.bot.RequestsExecutor#dev.inmo.tgbotapi.requests.abstracts.Request[TypeParam(bounds=[kotlin.Any])]#kotlin.Int#kotlin.Long#kotlin.coroutines.SuspendFunction1[kotlin.Array[kotlin.Throwable],kotlin.Unit]?/PointingToDeclaration/"></a>[executeUnsafe](../../dev.inmo.tgbotapi.extensions.utils.shortcuts/execute-unsafe.md)| <a name="dev.inmo.tgbotapi.extensions.utils.shortcuts//executeUnsafe/dev.inmo.tgbotapi.bot.RequestsExecutor#dev.inmo.tgbotapi.requests.abstracts.Request[TypeParam(bounds=[kotlin.Any])]#kotlin.Int#kotlin.Long#kotlin.coroutines.SuspendFunction1[kotlin.Array[kotlin.Throwable],kotlin.Unit]?/PointingToDeclaration/"></a>[common] <br>Content <br>suspend fun <[T](../../dev.inmo.tgbotapi.extensions.utils.shortcuts/execute-unsafe.md) : [Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)> [RequestsExecutor](index.md).[executeUnsafe](../../dev.inmo.tgbotapi.extensions.utils.shortcuts/execute-unsafe.md)(request: [Request](../../dev.inmo.tgbotapi.requests.abstracts/-request/index.md)<[T](../../dev.inmo.tgbotapi.extensions.utils.shortcuts/execute-unsafe.md)>, retries: [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) = 0, retriesDelay: [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html) = 1000L, onAllFailed: suspend (exceptions: [Array](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html)<[Throwable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)>) -> [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)? = null): [T](../../dev.inmo.tgbotapi.extensions.utils.shortcuts/execute-unsafe.md)? <br><br><br>|
| <a name="dev.inmo.tgbotapi.extensions.utils.updates.retrieving//setWebhookInfoAndStartListenWebhooks/dev.inmo.tgbotapi.bot.RequestsExecutor#kotlin.Int#io.ktor.server.engine.ApplicationEngineFactory[*,*]#dev.inmo.tgbotapi.requests.webhook.SetWebhookRequest#kotlin.coroutines.SuspendFunction1[kotlin.Throwable,kotlin.Unit]#kotlin.String#kotlin.String#dev.inmo.tgbotapi.updateshandlers.webhook.WebhookPrivateKeyConfig?#kotlinx.coroutines.CoroutineScope#kotlin.Long#kotlin.coroutines.SuspendFunction1[dev.inmo.tgbotapi.types.update.abstracts.Update,kotlin.Unit]/PointingToDeclaration/"></a>[setWebhookInfoAndStartListenWebhooks](../../dev.inmo.tgbotapi.extensions.utils.updates.retrieving/set-webhook-info-and-start-listen-webhooks.md)| <a name="dev.inmo.tgbotapi.extensions.utils.updates.retrieving//setWebhookInfoAndStartListenWebhooks/dev.inmo.tgbotapi.bot.RequestsExecutor#kotlin.Int#io.ktor.server.engine.ApplicationEngineFactory[*,*]#dev.inmo.tgbotapi.requests.webhook.SetWebhookRequest#kotlin.coroutines.SuspendFunction1[kotlin.Throwable,kotlin.Unit]#kotlin.String#kotlin.String#dev.inmo.tgbotapi.updateshandlers.webhook.WebhookPrivateKeyConfig?#kotlinx.coroutines.CoroutineScope#kotlin.Long#kotlin.coroutines.SuspendFunction1[dev.inmo.tgbotapi.types.update.abstracts.Update,kotlin.Unit]/PointingToDeclaration/"></a>[jvm] <br>Content <br>suspend fun [RequestsExecutor](index.md#%5Bdev.inmo.tgbotapi.bot%2FRequestsExecutor%2F%2F%2FPointingToDeclaration%2F%5D%2FExtensions%2F745855401).[setWebhookInfoAndStartListenWebhooks](../../dev.inmo.tgbotapi.extensions.utils.updates.retrieving/set-webhook-info-and-start-listen-webhooks.md)(listenPort: [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html), engineFactory: <*, *>, setWebhookRequest: [SetWebhookRequest](../../dev.inmo.tgbotapi.requests.webhook/-set-webhook-request/index.md), exceptionsHandler: <[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)> = {}, listenHost: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) = "0.0.0.0", listenRoute: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) = "/", privateKeyConfig: [WebhookPrivateKeyConfig](../../dev.inmo.tgbotapi.updateshandlers.webhook/-webhook-private-key-config/index.md)? = null, scope: = CoroutineScope(Executors.newFixedThreadPool(4).asCoroutineDispatcher()), mediaGroupsDebounceTimeMillis: [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html) = 1000L, block: <[Update](../../dev.inmo.tgbotapi.types.update.abstracts/-update/index.md)>): <br>More info <br>Setting up ktor server, set webhook info via [SetWebhookRequest](../../dev.inmo.tgbotapi.requests.webhook/-set-webhook-request/index.md) request. <br><br><br>|
| <a name="dev.inmo.tgbotapi.extensions.utils.updates.retrieving//startGettingOfUpdatesByLongPolling/dev.inmo.tgbotapi.bot.RequestsExecutor#dev.inmo.tgbotapi.updateshandlers.UpdatesFilter#kotlin.Int#kotlin.coroutines.SuspendFunction1[kotlin.Throwable,kotlin.Unit]?#kotlinx.coroutines.CoroutineScope/PointingToDeclaration/"></a>[startGettingOfUpdatesByLongPolling](../../dev.inmo.tgbotapi.extensions.utils.updates.retrieving/start-getting-of-updates-by-long-polling.md)| <a name="dev.inmo.tgbotapi.extensions.utils.updates.retrieving//startGettingOfUpdatesByLongPolling/dev.inmo.tgbotapi.bot.RequestsExecutor#dev.inmo.tgbotapi.updateshandlers.UpdatesFilter#kotlin.Int#kotlin.coroutines.SuspendFunction1[kotlin.Throwable,kotlin.Unit]?#kotlinx.coroutines.CoroutineScope/PointingToDeclaration/"></a>[common] <br>Content <br>fun [RequestsExecutor](index.md).[startGettingOfUpdatesByLongPolling](../../dev.inmo.tgbotapi.extensions.utils.updates.retrieving/start-getting-of-updates-by-long-polling.md)(updatesFilter: [UpdatesFilter](../../dev.inmo.tgbotapi.updateshandlers/-updates-filter/index.md), timeoutSeconds: [Seconds](../../dev.inmo.tgbotapi.types/index.md#%5Bdev.inmo.tgbotapi.types%2FSeconds%2F%2F%2FPointingToDeclaration%2F%5D%2FClasslikes%2F625018081) = 30, exceptionsHandler: <[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)>? = null, scope: = CoroutineScope(Dispatchers.Default)): <br><br><br>|