onCommand method

void onCommand(
  1. String command,
  2. Future callback(
    1. Bot,
    2. Update
    )
)

Adds a new command callback which will be executed when the given command is received

If a command callback throws an error, errorHandler is called

Implementation

void onCommand(String command, Future Function(Bot, Update) callback) {
  _commandCallbacks[command] = callback;
}