[commands] allow arbitrary callables in cooldown
This commit is contained in:
@@ -1959,8 +1959,11 @@ def cooldown(rate, per, type=BucketType.default):
|
||||
The number of times a command can be used before triggering a cooldown.
|
||||
per: :class:`float`
|
||||
The amount of seconds to wait for a cooldown when it's been triggered.
|
||||
type: :class:`.BucketType`
|
||||
The type of cooldown to have.
|
||||
type: Union[:class:`.BucketType`, Callable[[:class:`.Message`], Any]]
|
||||
The type of cooldown to have. If callable, should return a key for the mapping.
|
||||
|
||||
.. versionchanged:: 1.7
|
||||
Callables are now supported for custom bucket types.
|
||||
"""
|
||||
|
||||
def decorator(func):
|
||||
|
||||
Reference in New Issue
Block a user