RoleCheck class Null safety

A Check thats checks for a specific role or roles.

Integrates with Discord slash command permissions:

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

Constructors

RoleCheck(IRole role, [String? name])
Create a new Role Check based on a role.
RoleCheck.any(Iterable<IRole> roles, [String? name])
Create a new Role Check based on multiple roles.
RoleCheck.anyId(Iterable<Snowflake> roles, [String? name])
Create a new Role Check based on multiple role ids.
RoleCheck.id(Snowflake id, [String? name])
Create a new Role Check based on a role 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
roleIds Iterable<Snowflake>
The roles this check allows.
read / write
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

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