aboutsummaryrefslogtreecommitdiff
path: root/discord/ext/commands/cooldowns.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2019-02-23 07:41:25 -0500
committerRapptz <[email protected]>2019-02-23 07:41:25 -0500
commit9827d6eeaf191fb4cd8a144388804617922f50f4 (patch)
tree1ca62915d2c7df6c412647f14106ed93513e0d3d /discord/ext/commands/cooldowns.py
parent[commands] Fix bug with cog bot check once not being unloaded properly. (diff)
downloaddiscord.py-9827d6eeaf191fb4cd8a144388804617922f50f4.tar.xz
discord.py-9827d6eeaf191fb4cd8a144388804617922f50f4.zip
[commands] Fix issue with decorator order with checks and cooldowns
Now they're just explicitly copied.
Diffstat (limited to 'discord/ext/commands/cooldowns.py')
-rw-r--r--discord/ext/commands/cooldowns.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/discord/ext/commands/cooldowns.py b/discord/ext/commands/cooldowns.py
index ae48b284..9687d5f6 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