1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-10-06 09:25:05 +00:00
tgbotapi/docs/dev.inmo.tgbotapi.bot.settings.limiters/-exceptions-only-limiter/index.md
2021-03-17 15:18:37 +00:00

2.8 KiB

//docs/dev.inmo.tgbotapi.bot.settings.limiters/ExceptionsOnlyLimiter

ExceptionsOnlyLimiter

[common] class ExceptionsOnlyLimiter(defaultTooManyRequestsDelay: MilliSeconds) : RequestLimiter

This limiter will limit requests only after getting a RetryAfterError or with status code. Important thing is that in case if some of block has been blocked, all the others will wait until it will be possible to be called

Parameters

common

defaultTooManyRequestsDelay

This parameter will be used in case of getting with as a parameter for delay like it would be TooMuchRequestsException. The reason of it is that in there is no information about required delay between requests

Constructors

ExceptionsOnlyLimiter [common] fun ExceptionsOnlyLimiter(defaultTooManyRequestsDelay: MilliSeconds = 1000L)This parameter will be used in case of getting with as a parameter for delay like it would be TooMuchRequestsException.

Functions

Name Summary
limit [common]
Content
open suspend override fun <T> limit(block: suspend () -> T): T
More info
Use limit for working of block (like delay between or after, for example)