mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-06-07 12:18:59 +00:00
[commands] Fix cooldown decorator to work regardless of order.
This commit is contained in:
parent
b13029b993
commit
1a186c5a55
@ -896,7 +896,7 @@ def cooldown(rate, per, type=BucketType.default):
|
|||||||
|
|
||||||
def decorator(func):
|
def decorator(func):
|
||||||
if isinstance(func, Command):
|
if isinstance(func, Command):
|
||||||
func.cooldown = Cooldown(rate, per, type)
|
func._buckets = CooldownMapping(Cooldown(rate, per, type))
|
||||||
else:
|
else:
|
||||||
func.__commands_cooldown__ = Cooldown(rate, per, type)
|
func.__commands_cooldown__ = Cooldown(rate, per, type)
|
||||||
return func
|
return func
|
||||||
|
Loading…
x
Reference in New Issue
Block a user