Interface ICommand
- Namespace
- Signal.Application.Commands
- Assembly
- Signal.Application.dll
A class-based command. Instances are resolved from the message's DI scope, so constructor injection works. Arguments are not bound automatically; read Arguments and Flags.
public interface ICommand
Remarks
Derive from CommandBase to take metadata from a CommandAttribute.
Properties
Aliases
Alternative names.
IReadOnlyList<string> Aliases { get; }
Property Value
Description
One-line description for the help listing.
string? Description { get; }
Property Value
Hidden
Whether the command is hidden from the help listing.
bool Hidden { get; }
Property Value
Name
The command name (typed after the prefix).
string Name { get; }
Property Value
Usage
Usage text without prefix, e.g. ban <number> [reason...].
string? Usage { get; }
Property Value
Methods
ExecuteAsync(CommandContext, CancellationToken)
Executes the command.
Task ExecuteAsync(CommandContext context, CancellationToken cancellationToken)
Parameters
contextCommandContextThe command context (message, arguments, services, reply helpers).
cancellationTokenCancellationTokenCancelled when the host shuts down.
Returns
- Task
A task that completes when the command has finished.