UserCheck class Null safety

A Check that checks for a specific user or users.

Integrates with Discord slash command permissions:

  • Denies use by default
  • Allows use for the specified user(s)
Inheritance

Constructors

UserCheck(IUser user, [String? name])
Create a User Check based on a user.
UserCheck.any(Iterable<IUser> users, [String? name])
Create a User Check based on multiple users.
UserCheck.anyId(Iterable<Snowflake> ids, [String? name])
Create a User Check based on multiple user ids.
UserCheck.id(Snowflake id, [String? name])
Create a User Check based on a user id.

Properties

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 context)>
An Iterable of post-call hooks that will be called when a command this check is on emits to Command.onPostCall. [...]
read-only, inherited
preCallHooks Iterable<void Function(Context context)>
An Iterable of pre-call hooks that will be called when a command this check is on emits to Command.onPreCall. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
userIds Iterable<Snowflake>
The users this check allows.
read / write

Methods

check(Context context) FutureOr<bool>
The method called to validate this check. [...]
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
A string representation of this object. [...]
inherited

Operators

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