diff options
Diffstat (limited to 'discord/ext/commands/cooldowns.py')
| -rw-r--r-- | discord/ext/commands/cooldowns.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/discord/ext/commands/cooldowns.py b/discord/ext/commands/cooldowns.py index e39e3034..32c4e65e 100644 --- a/discord/ext/commands/cooldowns.py +++ b/discord/ext/commands/cooldowns.py @@ -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 |