TelegramBotAPI
common
tgbotapi.core
/
dev.inmo.tgbotapi.bot.settings.limiters
/
CommonLimiter
Common
Limiter
@
Serializable
class
CommonLimiter
(
lockCount
:
Int
=
10
,
regenTime
:
MilliSeconds
=
15 * 1000
,
scope
:
CoroutineScope
=
CoroutineScope(Dispatchers.Default)
)
:
RequestLimiter
Members
Constructors
Common
Limiter
Link copied to clipboard
constructor
(
lockCount
:
Int
=
10
,
regenTime
:
MilliSeconds
=
15 * 1000
,
scope
:
CoroutineScope
=
CoroutineScope(Dispatchers.Default)
)
Functions
limit
Link copied to clipboard
open
suspend override
fun
<
T
>
limit
(
block
:
suspend
(
)
->
T
)
:
T
Use limit for working of block (like delay between or after, for example)
open
suspend
fun
<
T
:
Any
>
limit
(
request
:
Request
<
T
>
,
block
:
suspend
(
)
->
T
)
:
T