mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-21 00:07:51 +00:00
[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._cooldown = original
|
||||
|
||||
def copy(self):
|
||||
ret = CooldownMapping(self._cooldown)
|
||||
ret._cache = self._cache.copy()
|
||||
return ret
|
||||
|
||||
@property
|
||||
def valid(self):
|
||||
return self._cooldown is not None
|
||||
|
@ -268,6 +268,10 @@ class Command(_BaseCommand):
|
||||
ret = self.__class__(self.callback, **self.__original_kwargs__)
|
||||
ret._before_invoke = self._before_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:
|
||||
ret.on_error = self.on_error
|
||||
except AttributeError:
|
||||
|
Loading…
x
Reference in New Issue
Block a user