TelegramBotMiddlewaresPipelinesHandler

Constructors

Link copied to clipboard
constructor(middlewares: List<TelegramBotMiddleware> = emptyList())

Types

Link copied to clipboard
class Builder
Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open suspend override fun <T : Any> onAfterCallFactoryMakeCall(result: T?, request: Request<T>, potentialFactory: KtorCallFactory): T?

Will always be called after potentialFactory has tried to make request and got some result. If returns value - that value will be returned from dev.inmo.tgbotapi.bot.RequestsExecutor.execute instead

Link copied to clipboard
open suspend override fun onBeforeCallFactoryMakeCall(request: Request<*>, potentialFactory: KtorCallFactory)

Will always be called before potentialFactory will try to make request

Link copied to clipboard
open suspend override fun onBeforeSearchCallFactory(request: Request<*>, callsFactories: List<KtorCallFactory>)

Will always be called before requests executor will check all callsFactories for an opportunity to make call of request

Link copied to clipboard
open suspend override fun <T : Any> onRequestException(request: Request<T>, t: Throwable): T?

Will be called when any exception will happen due to the request handling. If returns value - that value will be returned from dev.inmo.tgbotapi.bot.RequestsExecutor.execute instead. In difference with onRequestExceptionInLimiter, this method will be called only AFTER dev.inmo.tgbotapi.bot.settings.limiters.RequestLimiter will pass result of call factory execution outside of its dev.inmo.tgbotapi.bot.settings.limiters.RequestLimiter.limit function

Link copied to clipboard
open suspend override fun <T : Any> onRequestExceptionInLimiter(request: Request<T>, t: Throwable): T?

Will be called when any exception will happen due to the request handling inside of limiter block. This method will be called for each exception happened during call factory call

Link copied to clipboard
open suspend override fun <T : Any> onRequestResultAbsent(request: Request<T>, callsFactories: List<KtorCallFactory>): T?

Will be called when there is no KtorCallFactory from callsFactories which may handle request. If returns value - that value will be returned from dev.inmo.tgbotapi.bot.RequestsExecutor.execute instead

Link copied to clipboard
open suspend override fun <T : Any> onRequestResultPresented(result: T, request: Request<T>, resultCallFactory: KtorCallFactory, callsFactories: List<KtorCallFactory>): T?

Will be called when resultCallFactory is the KtorCallFactory from callsFactories which has successfully handled request and returned result. If returns value - that value will be returned from dev.inmo.tgbotapi.bot.RequestsExecutor.execute instead

Link copied to clipboard
open suspend override fun <T : Any> onRequestReturnResult(result: Result<T>, request: Request<T>, callsFactories: List<KtorCallFactory>): Result<T>

This step will be called when the result has been retrieved (or exception has happened). If returns value - that value will be returned from dev.inmo.tgbotapi.bot.RequestsExecutor.execute instead