@@ -156,6 +156,15 @@ def __init__(self, name, cmd): # Let's reuse old command formatting.
156156 self .on_error = None
157157
158158 def error (self , coro ):
159+ """
160+ A decorator that registers a coroutine as a local error handler.
161+
162+ Works the same way as it does in d.py
163+
164+ :param: :ref:`coroutine <coroutine>` - The coroutine to register as the local error handler
165+
166+ :raises: TypeError - The coroutine passed is not a coroutine
167+ """
159168 if not asyncio .iscoroutinefunction (coro ):
160169 raise TypeError ("The error handler must be a coroutine." )
161170 self .on_error = coro
@@ -205,17 +214,16 @@ async def invoke(self, *args, **kwargs):
205214 return await self .func (self .cog , * args , ** kwargs )
206215 return await self .func (* args , ** kwargs )
207216
208- def is_on_cooldown (self , ctx ):
209- """Checks whether the command is currently on cooldown.
210- Ref https://github.com/Rapptz/discord.py/blob/master/discord/ext/commands/core.py#L797
211- Parameters
212- -----------
213- ctx: :class:`.Context`
214- The invocation context to use when checking the commands cooldown status.
215- Returns
216- --------
217- :class:`bool`
218- A boolean indicating if the command is on cooldown.
217+ def is_on_cooldown (self , ctx ) -> bool :
218+ """
219+ Checks whether the command is currently on cooldown.
220+
221+ Works the same way as it does in d.py
222+
223+ :param ctx: SlashContext
224+ :type ctx: .context.SlashContext
225+
226+ :return: bool - indicating if the command is on cooldown.
219227 """
220228 if not self ._buckets .valid :
221229 return False
@@ -226,29 +234,28 @@ def is_on_cooldown(self, ctx):
226234 return bucket .get_tokens (current ) == 0
227235
228236 def reset_cooldown (self , ctx ):
229- """Resets the cooldown on this command.
230- Ref https://github.com/Rapptz/discord.py/blob/master/discord/ext/commands/core.py#L818
231- Parameters
232- -----------
233- ctx: :class:`.Context`
234- The invocation context to reset the cooldown under.
237+ """
238+ Resets the cooldown on this command.
239+
240+ Works the same way as it does in d.py
241+
242+ :param ctx: SlashContext
243+ :type ctx: .context.SlashContext
235244 """
236245 if self ._buckets .valid :
237246 bucket = self ._buckets .get_bucket (ctx .message )
238247 bucket .reset ()
239248
240- def get_cooldown_retry_after (self , ctx ):
241- """Retrieves the amount of seconds before this command can be tried again.
242- Ref https://github.com/Rapptz/discord.py/blob/master/discord/ext/commands/core.py#L830
243- Parameters
244- -----------
245- ctx: :class:`.Context`
246- The invocation context to retrieve the cooldown from.
247- Returns
248- --------
249- :class:`float`
250- The amount of time left on this command's cooldown in seconds.
251- If this is ``0.0`` then the command isn't on cooldown.
249+ def get_cooldown_retry_after (self , ctx ) -> float :
250+ """
251+ Retrieves the amount of seconds before this command can be tried again.
252+
253+ Works the same way as it does in d.py
254+
255+ :param ctx: SlashContext
256+ :type ctx: .context.SlashContext
257+
258+ :return: float - The amount of time left on this command's cooldown in seconds. If this is ``0.0`` then the command isn't on cooldown.
252259 """
253260 if self ._buckets .valid :
254261 bucket = self ._buckets .get_bucket (ctx .message )
0 commit comments