aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2019-04-14 16:57:47 -0400
committerRapptz <[email protected]>2019-04-14 16:57:47 -0400
commitec7a701cebc2ea5db9b02a08103078617093ed4c (patch)
tree9a8de922b72ffb9a45bc75b0289bc699b5f09d67
parentFix abc.GuildChannel.overwrites returning None keys. (diff)
downloaddiscord.py-ec7a701cebc2ea5db9b02a08103078617093ed4c.tar.xz
discord.py-ec7a701cebc2ea5db9b02a08103078617093ed4c.zip
[commands] Allow passing reference time to update_rate_limit
-rw-r--r--discord/ext/commands/cooldowns.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/discord/ext/commands/cooldowns.py b/discord/ext/commands/cooldowns.py
index 9687d5f6..02d5c64d 100644
--- a/discord/ext/commands/cooldowns.py
+++ b/discord/ext/commands/cooldowns.py
@@ -61,8 +61,8 @@ class Cooldown:
tokens = self.rate
return tokens
- def update_rate_limit(self):
- current = time.time()
+ def update_rate_limit(self, current=None):
+ current = current or time.time()
self._last = current
self._tokens = self.get_tokens(current)