Description class Null safety

An annotation used to add a description to Slash Command arguments.

For example, these two snippets of code produce different results:

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

commands.addCommand(test);

and

ChatCommand test = ChatCommand(
  'test',
  'A test command',
  (
    IChatContext context,
    @Description('The message to send') String message,
  ) async {
    context.respond(MessageBuilder.content(message));
  },
);

commands.addCommand(test);

Constructors

Description(String value, [Map<Locale, String>? localizedDescriptions])
Create a new Description.
const

Properties

hashCode int
The hash code for this object.
read-only, inherited
localizedDescriptions Map<Locale, String>?
The localized descriptions for the command.
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
value String
The value of the description.
final

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