onCommand method

void onCommand(
  1. String command,
  2. MessageFn exec, {
  3. Iterable<FutureOr<bool> Function()>? middlewares,
})

Implementation

void onCommand(String command, MessageFn exec,
    {Iterable<FutureOr<bool> Function()>? middlewares}) {
  _checkKey([command]);

  _one[command] = exec;

  this.middlewares[exec] = middlewares;
}