CommandGroupBuilder.fromJson constructor

CommandGroupBuilder.fromJson(
  1. Map json
)

Implementation

factory CommandGroupBuilder.fromJson(Map json) {
  final builder = CommandGroupBuilder()
    ..setName(json['name'])
    ..setDescription(json['description']);

  for (final command in json['commands']) {
    builder.addSubCommand((builder) {
      builder
        ..setName(command['name'])
        ..setDescription(command['description']);
    });
  }

  return builder;
}