aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2019-06-12 23:40:43 -0400
committerRapptz <[email protected]>2019-06-12 23:40:43 -0400
commit671a19a24a620396d403b3c3cb3af2ad5bb13876 (patch)
treecccf27579c2fdac217a7ae9acd8c3216373f4ee7
parentRename error type for `X.fetch_channel(s)`. (diff)
downloaddiscord.py-671a19a24a620396d403b3c3cb3af2ad5bb13876.tar.xz
discord.py-671a19a24a620396d403b3c3cb3af2ad5bb13876.zip
[commands] Ensure cooldowns are properly copied.
-rw-r--r--discord/ext/commands/core.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py
index 7eca1b20..ead83c72 100644
--- a/discord/ext/commands/core.py
+++ b/discord/ext/commands/core.py
@@ -290,7 +290,7 @@ class Command(_BaseCommand):
other._after_invoke = self._after_invoke
if self.checks != other.checks:
other.checks = self.checks.copy()
- if self._buckets != other._buckets:
+ if self._buckets.valid and not other._buckets.valid:
other._buckets = self._buckets.copy()
try:
other.on_error = self.on_error
@@ -305,8 +305,9 @@ class Command(_BaseCommand):
def _update_copy(self, kwargs):
if kwargs:
- copy = self.__class__(self.callback, **kwargs)
- copy.update(**self.__original_kwargs__)
+ kw = kwargs.copy()
+ kw.update(self.__original_kwargs__)
+ copy = self.__class__(self.callback, **kw)
return self._ensure_assignment_on_copy(copy)
else:
return self.copy()