RoleCheck class Null safety
A check that checks that the user that executes a command has a specific role.
- Inheritance
-
- Object
- AbstractCheck
- Check
- RoleCheck
Constructors
- RoleCheck(IRole role, [String? name])
-
Create a new RoleCheck that succeeds if the user that created the context has
role
. -
RoleCheck.any(Iterable<
IRole> roles, [String? name]) -
Create a new RoleCheck that succeeds if the user that created the context has any of
roles
. -
RoleCheck.anyId(Iterable<
Snowflake> roles, [String? name]) -
Create a new RoleCheck that succeeds if the user that created the context has any role for
which the role's id is in
roles
. - RoleCheck.id(Snowflake id, [String? name])
-
Create a new RoleCheck that succeeds if the user that created the context has a role with
the id
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.
read-onlyinherited
- name → String
-
The name of this check.
finalinherited
-
permissions
→ Future<
Iterable< CommandPermissionBuilderAbstract> > -
The set of Discord Slash Command Permissions
this check represents.
finalinherited
-
postCallHooks
→ Iterable<
void Function(IContext context)> -
An iterable of callbacks executed after a command is executed.
read-onlyinherited
-
preCallHooks
→ Iterable<
void Function(IContext context)> -
An iterable of callbacks executed before a command is executed but after all the checks for
that command have succeeded.
read-onlyinherited
-
requiredPermissions
→ FutureOr<
int?> -
The permissions required from members to pass this check.
finalinherited
-
roleIds
↔ Iterable<
Snowflake> -
The IDs of the roles this check allows.
read / write
- runtimeType → Type
-
A representation of the runtime type of the object.
read-onlyinherited
Methods
-
check(
IContext context) → FutureOr< bool> -
Validate
context
against 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