Check constructor

Check(
  1. FutureOr<bool> _check(
    1. CommandContext
    ),
  2. {String name = 'Check',
  3. FutureOr<bool> allowsDm = true,
  4. FutureOr<Flags<Permissions>?> requiredPermissions}
)

Create a new Check.

_check should be a callback that returns true or false to indicate check success or failure respectively. _check should not throw to indicate failure.

name can optionally be provided and will be used in error messages to identify this check.

Implementation

Check(
  this._check, {
  String name = 'Check',
  this.allowsDm = true,
  this.requiredPermissions,
}) : super(name);