-

cooldown#

+

cooldown¶

Helpers for setting a cooldown on commands.

-exception CommandOnCooldown(message, function, /, *args, **kwargs)[source]#
+exception CommandOnCooldown(message, function, /, *args, **kwargs)[source]¶

Bases: CommandError, Generic[P, R]

Raised when a command is invoked while on cooldown.

-__init__(message, function, /, *args, **kwargs)[source]#
+__init__(message, function, /, *args, **kwargs)[source]¶
-async call_without_cooldown()[source]#
+async call_without_cooldown()[source]¶

Run the command this cooldown blocked.

Return type:
@@ -409,20 +409,20 @@
-P = ~P[source]#
+P = ~P[source]¶

The command’s signature.

-class R[source]#
+class R[source]¶

The command’s return value.

alias of TypeVar(‘R’)

-block_duplicate_invocations(*, cooldown_duration=5, send_notice=False, args_preprocessor=None)[source]#
+block_duplicate_invocations(*, cooldown_duration=5, send_notice=False, args_preprocessor=None)[source]¶

Prevent duplicate invocations of a command with the same arguments in a channel for cooldown_duration seconds.

Parameters:
@@ -524,7 +524,7 @@ its return value is then used to check for the cooldown instead of the raw argum - + -- cgit v1.2.3