You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Kilian edited this page Feb 13, 2023
·
2 revisions
Custom Commands
Custom commands can be created by attaching a [Command(name, ...)] Attribute to a static method.
Commands can be guarded with a Permission by adding a [Permission(name)] attribute.
Parameters
A Parameter can be anything as long as a ICommandParser class exists to convert a string passed from the commandline into an instance of that object.
You can change the name of a parameter displayed by the Help command by adding a [Title] attribute.
Types supported by default:
string and string[]
int and int[]
long and long[]
bool and bool[]
IClient and IClient[]
TimeSpan
If you need to have another type as a parameter for a command, you can create your own parser by making a class which implements ICommandParser, this class will be automatically used when calling that command.
Accessing caller information
You can access information about the calling of the command with the static properties Command.Caller or Command.Context.
Messaging Utils
You can send easily send messages to the callers and recievers of commands with the Logging helper class.