resolvedType property Null safety

CommandType resolvedType

The resolved type of this ChatCommand.

If type is CommandType.def, this will query the parent of this command for the default type. Otherwise, type is returned.

If type is CommandType.def and no parent provides a default type, CommandType.def is returned.

Implementation

CommandType get resolvedType {
  if (type != CommandType.def) {
    return type;
  }

  return resolvedOptions.defaultCommandType ?? CommandType.def;
}