Browse Source

[commands] Fix cooldown decorator to work regardless of order.

pull/276/head
Rapptz 9 years ago
parent
commit
1a186c5a55
  1. 2
      discord/ext/commands/core.py

2
discord/ext/commands/core.py

@ -896,7 +896,7 @@ def cooldown(rate, per, type=BucketType.default):
def decorator(func):
if isinstance(func, Command):
func.cooldown = Cooldown(rate, per, type)
func._buckets = CooldownMapping(Cooldown(rate, per, type))
else:
func.__commands_cooldown__ = Cooldown(rate, per, type)
return func

Loading…
Cancel
Save