Cooldowns
cooldown
#
cooldown(
capacity: int,
period: timedelta,
*,
callback: CooldownCallbackT = _default_callback,
bucket: BucketCallbackT = _default_bucket
) -> Callable[[Context], Awaitable[HookResult | None]]
Ratelimit implementation using a sliding window.
PARAMETER | DESCRIPTION |
---|---|
capacity |
The amount of times the command can be used within the period.
TYPE:
|
period |
The period of time, in seconds, between cooldown resets.
TYPE:
|
callback |
Callback for when a user is ratelimited.
TYPE:
|
bucket |
Callback that returns a key for a bucket.
TYPE:
|