mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-04 17:06:21 +00:00
[commands] Allow subtracting multiple tokens from cooldown
This commit is contained in:
@ -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):
|
||||
|
Reference in New Issue
Block a user