nyxx.commander library

Classes

BasicCommandHandler
Basic implementation of command handler. Used internally in library.
CommandContext
Helper class which describes context in which command is executed
CommandEntity
Base object for CommandHandler and CommandGroup
Commander
Lightweight command framework. Doesn't use dart:mirrors and can be used in browser. While constructing specify prefix which is string with prefix or implement PrefixHandlerFunction for more fine control over where and in what conditions commands are executed. [...]
CommandGroup
Creates command group. Pass a name to crated command and commands added via registerSubCommand will be subcommands og that group
CommandHandler
Handles command execution - requires to implement name field which returns name of command to match message content, and commandHandler callback which is fired when command matches message content.

Functions

getFullCommandName(CommandEntity entity) String
Full qualified command name with its parents names

Typedefs

AfterHandlerFunction(CommandContext context) FutureOr<void>
Handler for executing logic after executing command.
CommandExecutionError(CommandContext context, dynamic exception) FutureOr<void>
Callback called when command executions returns with Exception or Error (exception variable could be either).
CommandHandlerFunction(CommandContext context, String message) FutureOr<void>
Handler for executing command logic.
LoggerHandlerFunction(CommandContext context, String commandName, Logger logger) FutureOr<void>
Callback to customize logger output when command is executed.
PassHandlerFunction(CommandContext context) FutureOr<bool>
Used to determine if command can be executed in given environment. Return true to allow executing command or false otherwise.
PrefixHandlerFunction(Message message) FutureOr<String>
Handler used to determine prefix for command in given environment. Can be used to define different prefixes for different guild, users or dms. Return String containing prefix or null if command cannot be executed.