From 8401316e489f3c14239778f47d5530bfcb940ccf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Spie=C3=9F?= Date: Thu, 21 Apr 2022 18:23:20 +0200 Subject: [PATCH] [commands] Allow subtracting multiple tokens from cooldown --- 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 7aadf0506..38b2fab9e 100644 --- a/discord/ext/commands/cooldowns.py +++ b/discord/ext/commands/cooldowns.py @@ -253,9 +253,9 @@ class CooldownMapping: return bucket - def update_rate_limit(self, message: Message, current: Optional[float] = None) -> Optional[float]: + def update_rate_limit(self, message: Message, current: Optional[float] = None, tokens: int = 1) -> Optional[float]: bucket = self.get_bucket(message, current) - return bucket.update_rate_limit(current) + return bucket.update_rate_limit(current, tokens=tokens) class DynamicCooldownMapping(CooldownMapping):