diff options
| -rw-r--r-- | discord/ext/commands/cooldowns.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/discord/ext/commands/cooldowns.py b/discord/ext/commands/cooldowns.py index ebcdd69e..74146284 100644 --- a/discord/ext/commands/cooldowns.py +++ b/discord/ext/commands/cooldowns.py @@ -92,6 +92,10 @@ class CooldownMapping: def valid(self): return self._cooldown is not None + @classmethod + def from_cooldown(cls, rate, per, type): + return cls(Cooldown(rate, per, type)) + def _bucket_key(self, ctx): msg = ctx.message bucket_type = self._cooldown.type |