mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-05 01:16:21 +00:00
[commands] Added BucketType.members for cooldowns
This commit is contained in:
@ -31,8 +31,9 @@ __all__ = ['BucketType', 'Cooldown', 'CooldownMapping']
|
||||
class BucketType(enum.Enum):
|
||||
default = 0
|
||||
user = 1
|
||||
guild = 2
|
||||
guild = 2
|
||||
channel = 3
|
||||
member = 4
|
||||
|
||||
class Cooldown:
|
||||
__slots__ = ('rate', 'per', 'type', '_window', '_tokens', '_last')
|
||||
@ -111,6 +112,8 @@ class CooldownMapping:
|
||||
return (msg.guild or msg.author).id
|
||||
elif bucket_type is BucketType.channel:
|
||||
return msg.channel.id
|
||||
elif bucket_type is BucketType.member:
|
||||
return ((msg.guild and msg.guild.id), msg.author.id)
|
||||
|
||||
def _verify_cache_integrity(self):
|
||||
# we want to delete all cache objects that haven't been used
|
||||
|
Reference in New Issue
Block a user