Hook
cooldown
#
cooldown(delay: timedelta, *, capacity: int = 1, bucket: BucketType = BucketType.USER, response: Callable[[InteractionContext, CooldownException], Awaitable[None]] = default_response) -> Hook
Returns a hook for applying a cooldown to a command.
Parameters:
-
delay
(timedelta
) –The time delay for the cooldown.
-
capacity
(int
, default:1
) –The allowed capacity within the cooldown period. Defaults to 1.
-
bucket
(BucketType
, default:BucketType.USER
) –The type of bucket for specifying the cooldown scope.
-
response
(Callable[[InteractionContext, CooldownException], Awaitable[None]]
, default:default_response
) –The response function to handle the cooldown exception.
Returns:
-
Hook
(Hook
) –The cooldown hook.