UserCheck class

A check that checks that a command was executed by a specific user.

Inheritance

Constructors

UserCheck(User user, {String? name})
Create a new UserCheck that succeeds if the context was created by user.
UserCheck.any(Iterable<User> users, {String? name})
Create a new UserCheck that succeeds if the context was created by any one of users.
UserCheck.anyId(Iterable<Snowflake> ids, {String? name})
Create a new UserCheck that succeeds if the ID of the user that created the context is in ids.
UserCheck.id(Snowflake id, {String? name})
Create a new UserCheck that succeeds if the ID of the user that created the context is id.

Properties

allowsDm FutureOr<bool>
Whether this check will allow commands to be executed in DM channels.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
name String
The name of this check.
finalinherited
postCallHooks Iterable<void Function(CommandContext context)>
An iterable of callbacks executed after a command is executed.
no setterinherited
preCallHooks Iterable<void Function(CommandContext context)>
An iterable of callbacks executed before a command is executed but after all the checks for that command have succeeded.
no setterinherited
requiredPermissions FutureOr<Flags<Permissions>?>
The permissions required from members to pass this check.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
userIds Iterable<Snowflake>
The IDs of the users this check allows.
getter/setter pair

Methods

check(CommandContext context) FutureOr<bool>
Validate context against this check.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited