diff --git a/discord/ext/commands/cooldowns.py b/discord/ext/commands/cooldowns.py index ae48b284b..9687d5f6c 100644 --- a/discord/ext/commands/cooldowns.py +++ b/discord/ext/commands/cooldowns.py @@ -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 diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py index b980b92ff..45c3eb80e 100644 --- a/discord/ext/commands/core.py +++ b/discord/ext/commands/core.py @@ -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: