Command.slashOnly constructor Null safety

Command.slashOnly(
  1. String name,
  2. String description,
  3. Function execute,
  4. {List<String> aliases = const [],
  5. Iterable<GroupMixin> children = const [],
  6. Iterable<AbstractCheck> checks = const [],
  7. Iterable<AbstractCheck> singleChecks = const [],
  8. bool? hideOriginalResponse}
)

Create a new slash-only Command.

name must match commandNameRegexp or an CommandRegistrationError will be thrown. execute must be a function whose first parameter must be of type InteractionContext.

Implementation

Command.slashOnly(
  String name,
  String description,
  Function execute, {
  List<String> aliases = const [],
  Iterable<GroupMixin> children = const [],
  Iterable<AbstractCheck> checks = const [],
  Iterable<AbstractCheck> singleChecks = const [],
  bool? hideOriginalResponse,
}) : this._(
        name,
        description,
        execute,
        InteractionContext,
        aliases: aliases,
        type: CommandType.slashOnly,
        children: children,
        checks: checks,
        singleChecks: singleChecks,
        hideOriginalResponse: hideOriginalResponse,
      );