[commands] Fix errors with cooldown mappings
This commit is contained in:
parent
7d79b4ba55
commit
1ecadf057e
@ -140,7 +140,7 @@ class CooldownMapping:
|
|||||||
self._type = type
|
self._type = type
|
||||||
|
|
||||||
def copy(self):
|
def copy(self):
|
||||||
ret = CooldownMapping(self._cooldown)
|
ret = CooldownMapping(self._cooldown, self._type)
|
||||||
ret._cache = self._cache.copy()
|
ret._cache = self._cache.copy()
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
@ -150,7 +150,7 @@ class CooldownMapping:
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_cooldown(cls, rate, per, type):
|
def from_cooldown(cls, rate, per, type):
|
||||||
return cls(Cooldown(rate, per, type))
|
return cls(Cooldown(rate, per), type)
|
||||||
|
|
||||||
def _bucket_key(self, msg):
|
def _bucket_key(self, msg):
|
||||||
return self._type(msg)
|
return self._type(msg)
|
||||||
@ -192,6 +192,11 @@ class DynamicCooldownMapping(CooldownMapping):
|
|||||||
super().__init__(None, type)
|
super().__init__(None, type)
|
||||||
self._factory = factory
|
self._factory = factory
|
||||||
|
|
||||||
|
def copy(self):
|
||||||
|
ret = DynamicCooldownMapping(self._factory, self._type)
|
||||||
|
ret._cache = self._cache.copy()
|
||||||
|
return ret
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def valid(self):
|
def valid(self):
|
||||||
return True
|
return True
|
||||||
|
Loading…
x
Reference in New Issue
Block a user