AbstractCheck class abstract
Represents a check on a command.
A check is a function that is executed when a command is about to be invoked. A check can either fail or succeed; if any of a command's checks fail then the execution of that command is cancelled.
You might also be interested in:
- Check, which allows you to construct checks with a simple callback;
- Checked.check, which allows you to add checks to a command or command group;
- CheckFailedException, the exception that is thrown and added to CommandsPlugin.onCommandError when a check fails.
- Implementers
Constructors
- AbstractCheck(String name)
- Create a new AbstractCheck.
Properties
-
allowsDm
→ FutureOr<
bool> -
Whether this check will allow commands to be executed in DM channels.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- name → String
-
The name of this check.
final
-
postCallHooks
→ Iterable<
void Function(CommandContext)> -
An iterable of callbacks executed after a command is executed.
no setter
-
preCallHooks
→ Iterable<
void Function(CommandContext)> -
An iterable of callbacks executed before a command is executed but after all the checks for
that command have succeeded.
no setter
-
requiredPermissions
→ FutureOr<
Flags< Permissions> ?> -
The permissions required from members to pass this check.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
check(
CommandContext context) → FutureOr< bool> -
Validate
context
against this check. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited