3 Commits

Author SHA1 Message Date
Rapptz
e4b16851bf Slots use tuples instead now. 2017-01-03 09:51:50 -05:00
Dan Hess
b7ffbca0c7 [commands] Added a method to reset command cooldown. 2016-09-08 07:02:33 -04:00
Rapptz
cd0de57d13 [commands] Implement a command cooldown system.
The way the command cooldown works is using a windowed way of doing it.
That is, if we have a cooldown of 2 commands every 30 seconds then if we
do a single command, we have 30 seconds to do the second command or else
we will get rate limited. This more or less matches the common
expectations on how cooldowns should be.

These cooldowns can be bucketed up to a single dimension of depth for
a per-user, per-guild, or per-channel basis. Of course, a global bucket
is also provided. These cannot be mixed, e.g. no per-channel per-user
cooldowns.

When a command cooldown is triggered, the error handlers will receive a
an exception of type CommandOnCooldown with proper information regarding
the cooldown such as retry_after and the bucket information itself.
2016-07-22 18:05:38 -04:00