CommandType enum

Indicates the ways a ChatCommand can be executed.

For example, a command with type slashOnly cannot be executed with a text message:

ChatCommand test = ChatCommand.slashOnly(
  'test',
  'A test command',
  (IChatContext context) async {
    context.respond(MessageBuilder.content('Hi there!'));
  },
);

commands.addCommand(test);

Inheritance

Constructors

CommandType()
const

Values

textOnly → const CommandType

Indicates that a ChatCommand should only be executable through text messages (sent with the bot prefix).

If this is the type of a ChatCommand, then that command will not be registered as a Slash Command in the Discord API.

slashOnly → const CommandType

Indicates that a ChatCommand should only be executable through Slash Commands.

all → const CommandType

Indicates that a ChatCommand can be executed by both Slash Commands and text messages.

Properties

hashCode int
The hash code for this object.
no setterinherited
index int
A numeric identifier for the enumerated value.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

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

Operators

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

Constants

values → const List<CommandType>
A constant List of the values in this enum, in order of their declaration.