From ec7a701cebc2ea5db9b02a08103078617093ed4c Mon Sep 17 00:00:00 2001 From: Rapptz Date: Sun, 14 Apr 2019 16:57:47 -0400 Subject: [PATCH] [commands] Allow passing reference time to update_rate_limit --- discord/ext/commands/cooldowns.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/discord/ext/commands/cooldowns.py b/discord/ext/commands/cooldowns.py index 9687d5f6c..02d5c64de 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)