ChatGroup class Null safety

Represents a Subcommand Group.

ChatGroups can be used to organise chat commands into groups of similar commands to avoid filling up a user's UI. Instead, commands are organised into a tree, with only the root of the tree being shown to the user until they select it.

You might also be interested in:

  • ChatCommand, for creating commands that can be added to groups.
Implemented types


ChatGroup(String name, String description, {List<String> aliases = const [], Iterable<IChatCommandComponent> children = const [], Iterable<AbstractCheck> checks = const [], CommandOptions options = const CommandOptions(), Map<Locale, String>? localizedNames, Map<Locale, String>? localizedDescriptions})
Create a new ChatGroup.


aliases List<String>
The aliases for this entity.
checks Iterable<AbstractCheck>
The checks that should be applied to this entity.
read-only, inherited
children Iterable<IChatCommandComponent>
A list of all the children of this group
read-only, inherited
description String
The description of this entity.
fullName String
The full name of this command.
read-only, inherited
hashCode int
The hash code for this object.
read-only, inherited
hasSlashCommand bool
Whether this entity has a child entity that is a slash command or has a slash command itself.
read-only, inherited
localizedDescriptions Map<Locale, String>?
The localized descriptions of this entity.
localizedNames Map<Locale, String>?
The localized names of this child. Since you cannot add descriptions to UserCommand and MessageCommand, can't set localized descriptions too.
name String
The name of this child.
onPostCall Stream<IChatContext>
A stream that emits contexts after the command callback is executed.
late, final, inherited
onPreCall Stream<IChatContext>
A stream that emits contexts before the command callback is executed.
late, final, inherited
options CommandOptions
The options to use for this entity.
parent ICommandGroup<IContext>?
The parent of this child.
read / write, inherited
resolvedOptions CommandOptions
Get the resolvec options for this child.
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited


addCommand(ICommandRegisterable<IChatContext> command) → void
Add a command to this group.
check(AbstractCheck check) → void
Add a check to this entity.
getCommand(StringView view) ChatCommand?
Attempt to get a command from a string.
getOptions(CommandsPlugin commands) Iterable<CommandOptionBuilder>
Return the CommandOptionBuilders that represent this entity for slash command registration.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
toString() String
A string representation of this object.
walkCommands() Iterable<ChatCommand>
Returns an iterable that recursively iterates over all the ICommands in this group.


operator ==(Object other) bool
The equality operator.