ChatGroup constructor
- String name,
- String description,
- {List<
String> aliases = const [], - Iterable<
ChatCommandComponent> children = const [], - Iterable<
AbstractCheck> checks = const [], - CommandOptions options = const CommandOptions(),
- Map<
Locale, String> ? localizedNames, - Map<
Locale, String> ? localizedDescriptions}
Create a new ChatGroup.
Implementation
ChatGroup(
this.name,
this.description, {
this.aliases = const [],
Iterable<ChatCommandComponent> children = const [],
Iterable<AbstractCheck> checks = const [],
this.options = const CommandOptions(),
this.localizedNames,
this.localizedDescriptions,
}) {
if (!commandNameRegexp.hasMatch(name) || name != name.toLowerCase()) {
throw CommandRegistrationError('Invalid group name "$name"');
}
for (final child in children) {
addCommand(child);
}
for (final check in checks) {
super.check(check);
}
}