Commander class

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.

Allows to specify callbacks which are executed before and after command - also on per command basis. beforeCommandHandler callbacks are executed only command exists and is matched with message content.

Constructors

Commander(Nyxx client, {String prefix, PrefixHandlerFunction prefixHandler, PassHandlerFunction beforeCommandHandler, AfterHandlerFunction afterCommandHandler, LoggerHandlerFunction loggerHandlerFunction, CommandExecutionError commandExecutionError})
Either prefix or prefixHandler must be specified otherwise program will exit. Allows to specify additional beforeCommandHandler executed before main command callback, and afterCommandHandler executed after main command callback.

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
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
registerCommand(String commandName, CommandHandlerFunction commandHandler, {PassHandlerFunction beforeHandler, AfterHandlerFunction afterHandler}) → void
Registers command with given commandName. Allows to specify command specific before and after command execution callbacks
registerCommandGroup(CommandGroup commandGroup) → void
Registers command as implemented CommandEntity class
toString() String
Returns a string representation of this object.
inherited

Operators

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