Browse Source

[commands] Allow subtracting multiple tokens from cooldown

pull/10109/head
Florian Spieß 3 years ago
committed by dolfies
parent
commit
8401316e48
  1. 4
      discord/ext/commands/cooldowns.py

4
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):

Loading…
Cancel
Save