mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-18 23:15:48 +00:00
[commands] Add Command.cooldown property
This commit is contained in:
parent
9f83eb6032
commit
f5acd9e8b6
@ -664,6 +664,15 @@ class Command(_BaseCommand, Generic[CogT, P, T]):
|
||||
"""
|
||||
return self.params.copy()
|
||||
|
||||
@property
|
||||
def cooldown(self) -> Optional[Cooldown]:
|
||||
"""Optional[:class:`~discord.app_commands.Cooldown`]: The cooldown of a command when invoked
|
||||
or ``None`` if the command doesn't have a registered cooldown.
|
||||
|
||||
.. versionadded:: 2.0
|
||||
"""
|
||||
return self._buckets._cooldown
|
||||
|
||||
@property
|
||||
def full_parent_name(self) -> str:
|
||||
""":class:`str`: Retrieves the fully qualified parent command name.
|
||||
|
Loading…
x
Reference in New Issue
Block a user