[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):
|
def valid(self):
|
||||||
return self._cooldown is not None
|
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):
|
def _bucket_key(self, ctx):
|
||||||
msg = ctx.message
|
msg = ctx.message
|
||||||
bucket_type = self._cooldown.type
|
bucket_type = self._cooldown.type
|
||||||
|
Loading…
x
Reference in New Issue
Block a user