[commands] Fix issue with decorator order with checks and cooldowns
Now they're just explicitly copied.
This commit is contained in:
parent
10ed41d8a0
commit
9827d6eeaf
@ -98,6 +98,11 @@ class CooldownMapping:
|
|||||||
self._cache = {}
|
self._cache = {}
|
||||||
self._cooldown = original
|
self._cooldown = original
|
||||||
|
|
||||||
|
def copy(self):
|
||||||
|
ret = CooldownMapping(self._cooldown)
|
||||||
|
ret._cache = self._cache.copy()
|
||||||
|
return ret
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def valid(self):
|
def valid(self):
|
||||||
return self._cooldown is not None
|
return self._cooldown is not None
|
||||||
|
@ -268,6 +268,10 @@ class Command(_BaseCommand):
|
|||||||
ret = self.__class__(self.callback, **self.__original_kwargs__)
|
ret = self.__class__(self.callback, **self.__original_kwargs__)
|
||||||
ret._before_invoke = self._before_invoke
|
ret._before_invoke = self._before_invoke
|
||||||
ret._after_invoke = self._after_invoke
|
ret._after_invoke = self._after_invoke
|
||||||
|
if self.checks != ret.checks:
|
||||||
|
ret.checks = self.checks.copy()
|
||||||
|
if self._buckets != ret._buckets:
|
||||||
|
ret._buckets = self._buckets.copy()
|
||||||
try:
|
try:
|
||||||
ret.on_error = self.on_error
|
ret.on_error = self.on_error
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user