[commands] Add Command.cooldown property

This commit is contained in:
ImNimboss 2022-03-29 12:20:04 +05:30 committed by GitHub
parent 9f83eb6032
commit f5acd9e8b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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.