aliases property

  1. @override
List<String> aliases
final

The aliases for this entity.

Since chat commands can be invoked from text messages and are not displayed in the UI (unless they are registered as slash commands), aliases can be used to refer to the same command with multiple different names.

For example, a command that can be invoked with both test and t:

ChatCommand test = ChatCommand(
  'test',
  'A test command',
  (IChatContext context) async {
    context.respond(MessageBuilder.content('Hi there!'));
  },
  aliases: ['t'],
);

commands.addCommand(test);

Implementation

@override
final List<String> aliases;