CooldownCheck class Null safety

A Check that checks that a Command is not on cooldown.



CooldownCheck(CooldownType type, Duration duration, [int tokensPer = 1, String? name])
Create a new CooldownCheck with a specific type, period and token count. [...]


duration Duration
The duration of this cooldown.
read / write
hashCode int
The hash code for this object. [...]
read-only, inherited
name String
The name of the check
final, inherited
permissions Future<Iterable<CommandPermissionBuilderAbstract>>
An Iterable of permission overrides that will be used on slash commands using this check.
read-only, override
postCallHooks Iterable<void Function(Context p1)>
An Iterable of post-call hooks that will be called when a command this check is on emits to Command.onPostCall. [...]
read-only, override
preCallHooks Iterable<void Function(Context)>
An Iterable of pre-call hooks that will be called when a command this check is on emits to Command.onPreCall. [...]
read / write, override-getter
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
tokensPer int
The number of tokens per duration. [...]
read / write
type CooldownType
The type of this cooldown. [...]


check(Context context) FutureOr<bool>
The method called to validate this check. [...]
getKey(Context context) int
Get a key representing a Context depending on type.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
remaining(Context context) Duration
Get the remaining cooldown time for a context. [...]
toString() String
A string representation of this object. [...]


operator ==(Object other) bool
The equality operator. [...]