registerHandler method

void registerHandler(
  1. SlashCommandHandler handler
)

Registers handler for subcommand

Implementation

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

  this.handler = handler;
}