handle method

CommandBuilder handle(
  1. Function fn
)

Implementation

CommandBuilder handle(Function fn) {
  final firstArg = fn.toString().split('(')[1].split(')')[0].split(' ')[0];

  if (!firstArg.contains('CommandContext')) {
    throw Exception(
        'The first argument of the handler function must be CommandContext');
  }

  _handle = fn;
  return this;
}