docs
4.2.3
common
docs
/
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
Constructors
Functions
Constructors
Common
Limiter
Link copied to clipboard
fun
CommonLimiter
(
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