Name class Null safety

An annotation used to change the name displayed in the Discord UI for a given command argument.

For example, changing the name of an argument from 'foo' to 'message':

ChatCommand test = ChatCommand(
  'test',
  'A test command',
  (
    IChatContext context,
    @Name('message') String foo,
  ) async {
    context.respond(MessageBuilder.content(foo));
  },
);

commands.addCommand(test);

Constructors

Name(String name, [Map<Locale, String>? localizedNames])
Create a new Name.
const

Properties

hashCode int
The hash code for this object.
read-only, inherited
localizedNames Map<Locale, String>?
The localized names to use.
final
name String
The custom name to use.
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

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