[commands] Add role cooldown bucket

This commit is contained in:
BluePhoenixGame
2019-08-12 00:44:16 +02:00
committed by Danny
parent 12343c1422
commit c7d3ebb400
2 changed files with 11 additions and 1 deletions

View File

@ -1592,7 +1592,7 @@ def cooldown(rate, per, type=BucketType.default):
A cooldown allows a command to only be used a specific amount
of times in a specific time frame. These cooldowns can be based
either on a per-guild, per-channel, per-user, or global basis.
either on a per-guild, per-channel, per-user, per-role or global basis.
Denoted by the third argument of ``type`` which must be of enum
type ``BucketType`` which could be either:
@ -1602,6 +1602,7 @@ def cooldown(rate, per, type=BucketType.default):
- ``BucketType.channel`` for a per-channel basis.
- ``BucketType.member`` for a per-member basis.
- ``BucketType.category`` for a per-category basis.
- ``BucketType.role`` for a per-role basis.
If a cooldown is triggered, then :exc:`.CommandOnCooldown` is triggered in
:func:`.on_command_error` and the local error handler.