- Executor register all method that inherit CommandModule.
- Can execute commands with only string.
- String will automatically change to parameter type.
- Provides set arguments count for array.
First, declare executor class.
// in Main method
Executor executor = new(new ExecutorConfiguration() {
IgnoreCase = true,
IgnoreExtraArguments = false,
GetPrivateMethod = false
});
Second, create class that inheriting CommandModule.
// outisde of Main class
public class BasicCommand : CommandModule
{
// You can set command name and alias.
[Command]
public void Hello(string person)
{
Console.WriteLine($"Hello, {person}!");
}
}
Third, register class.
// in Main method
executor.RegisterCommands<BasicCommand>();
Last, execute commands with string.
// in Main method
executor.Execute("Hello World");
Then, it execute 'Hello' method with arguments "World"
- Add GetAllCommands method and GetCommands method
- Providing registered commands array
- Events
- CommandErrored
- CommandExecuted
- Support override method
- Support SubCommand (or GroupCommand)
- Discord : 단비#1004
- Gmail : [email protected]
Framework version : Standard 2.1 / .NET 5.0
Referred the source of the following repo