[commands] Allow subtracting multiple tokens from cooldown

This commit is contained in:
Florian Spieß
2022-04-21 18:23:20 +02:00
committed by GitHub
parent 832d2c0542
commit 0e5c4c391d
2 changed files with 12 additions and 9 deletions

View File

@ -140,9 +140,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):