registerHandler method

void registerHandler(
  1. SlashCommandHandler handler
)

Registers handler for subcommand

Implementation

void registerHandler(SlashCommandHandler handler) {
  if (this.type != CommandOptionType.subCommand) {
    throw StateError("Cannot register handler for command option with type other that subcommand");
  }

  this._handler = handler;
}