cooldown

fun RateLimitManager.cooldown(group: String, duration: Duration, scope: RateLimitScope = RateLimitScope.USER, deleteOnRefill: Boolean = true, block: ReceiverConsumer<RateLimitBuilder> = ReceiverConsumer.noop()): RateLimitInfo(source)

Creates a rate limit-based cooldown.

As this is a convenience method, any cooldown applied will be lost on restart. To persist the cooldowns, use rateLimit with RateLimiter.createDefaultProxied and a Buckets.ofCooldown.

Note: The cooldown won't apply if you are a bot owner.

Cooldown cancellation

The cooldown can be cancelled inside the command with CancellableRateLimit.cancelRateLimit on your event.

Parameters

group

The name of the underlying rate limiter

scope

The scope of the cooldown

duration

The duration before the cooldown expires

deleteOnRefill

Whether the cooldown message should be deleted after the cooldown expires

block

Further configures the RateLimitBuilder

See also