[commands] Added a method to reset command cooldown.

This commit is contained in:
Dan Hess
2016-09-06 15:03:47 -05:00
committed by Rapptz
parent a23e51f6c4
commit b7ffbca0c7
2 changed files with 17 additions and 0 deletions

View File

@@ -337,6 +337,18 @@ class Command:
if retry_after:
raise CommandOnCooldown(bucket, retry_after)
def reset_cooldown(self, ctx):
"""Resets the cooldown on this command.
Parameters
-----------
ctx: :class:`Context`
The invocation context to reset the cooldown under.
"""
if self._buckets.valid:
bucket = self._buckets.get_bucket(ctx)
bucket.reset()
@asyncio.coroutine
def invoke(self, ctx):
ctx.command = self