mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-22 16:51:59 +00:00
[commands] Add CooldownMapping.from_cooldown factory classmethod.
This commit is contained in:
parent
1c967e9a7c
commit
63fcfa6d02
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user