Human-readable categorical name for the commands in the set.
Context for the currently executing command.
Add the command cmd to the command set.
Lookup a command in this command set by one of its names.
Sorted list of the primary names of all commands in the command set.
Base class for command sets.
Commands are implemented by adding public, non-static methods to the derived class. Non-public or static methods of the derived class are ignored, as well as methods with the $(DPREF attribute, ignore) attribute.
The name of the method becomes the primary name through which the command is invoked in chat. Other names may be added by tagging the method with the @aliases ($(DPREF attribute, aliases)) command attribute. When the command is invoked through one of its names, the method is called.
Commands are invoked by sending a message to a channel the bot is a member of, where the message starts with the bot's command prefix followed by the name of the command to invoke. Whitespace-separated words following the command name are parsed as arguments to the command.
The arguments to the chat command map one-to-one to the parameters of the method. The method's allowed parameter types are: const or immutable UTF-8 strings, integers and floating point numbers.
If the method's last parameter type is a string, then it is passed all the text passed in chat after the previous arguments, including whitespace.
If the method's last parameter is an array of strings, then the method must also be marked typesafe-variadic; the array is filled with all whitespace-separated arguments passed after arguments to preceding parameters. If no such arguments are passed, the array is empty.
Parameters may have default arguments. If a command invocation does not pass an argument to a parameter with a default argument, the default argument is used instead.
If an argument is not passed to a parameter without a default argument, or a non-integer is passed to an integer parameter or a non-number is passed to a floating point parameter, then the bot replies with an error message and the command method is not called.
See $(DPMODULE attribute) for a list of attributes that can be attached to command methods to alter the behaviour of the command.
This type subtypes a context object ($(DPREF context, Context)) that provides contextual operations and information for use by command method implementations.