diff options
| author | Rapptz <[email protected]> | 2021-07-02 05:35:38 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2021-07-02 05:35:38 -0400 |
| commit | 982140b5f7313bbf9f8532d4844bd8b389d567b2 (patch) | |
| tree | b0e5266f2e2bd32a1382de581930fe21b46c83d1 /discord/ext | |
| parent | Add Thread.mention (diff) | |
| download | discord.py-982140b5f7313bbf9f8532d4844bd8b389d567b2.tar.xz discord.py-982140b5f7313bbf9f8532d4844bd8b389d567b2.zip | |
[commands] Mention that dynamic_cooldown callable can return None
Diffstat (limited to 'discord/ext')
| -rw-r--r-- | discord/ext/commands/core.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py index e9dbd385..509df057 100644 --- a/discord/ext/commands/core.py +++ b/discord/ext/commands/core.py @@ -1947,7 +1947,8 @@ def dynamic_cooldown(cooldown, type=BucketType.default): This differs from :func:`.cooldown` in that it takes a function that accepts a single parameter of type :class:`.discord.Message` and must - return a :class:`.Cooldown` + return a :class:`.Cooldown` or ``None``. If ``None`` is returned then + that cooldown is effectively bypassed. A cooldown allows a command to only be used a specific amount of times in a specific time frame. These cooldowns can be based @@ -1964,9 +1965,9 @@ def dynamic_cooldown(cooldown, type=BucketType.default): Parameters ------------ - cooldown: Callable[[:class:`.discord.Message`], :class:`.Cooldown`] + cooldown: Callable[[:class:`.discord.Message`], Optional[:class:`.Cooldown`]] A function that takes a message and returns a cooldown that will - apply to this invocation + apply to this invocation or ``None`` if the cooldown should be bypassed. type: :class:`.BucketType` The type of cooldown to have. """ |