This repo serves as the basis for an innovative, modular, and extensible library of components to create a help system for Remora.Discord.
This repo is built off of the findings in my proof-of-concept
In short, it provides components that can be pieced together to construct a full help system, including tree searching, message formatting, metadata handling, and even dispatching the help message.
Firstly add VTP.RemoraHelpSystem
from NuGet to your project.
Then, add the help system:
var services = new ServiceCollection();
services.AddHelpSystem();
This will register the following into the container:
- TreeWalker
- HelpCommand
- IHelpFormatter
- ICommandHelpService
TreeWalker
is a generic component that simply walks a given tree and returns all the matching nodes.
ICommandHelpService
is an interface that is used to retrieve help for command(s).
IHelpFormatter
is an interface used by the default implementation of ICommandHelpService
to create embeds based on the retrieved nodes.
HelpCommand
is a command that simply invokes ICommandHelpService.ShowHelpAsync
based on the user's query.
That's fine, simply pass the name of the tree you want to register help for:
services.AddHelpSystem("my_custom_tree");
Grouping commands is easy, simply mark your command with the [Category("my cateogory")]
attribute.
Then, on your service collection:
services
.Configure<HelpSystemOptions>(options =>
{
options.CommandCategories.Add("my category");
});
Now any commands marked with [Category("my category")]
will be grouped under the category "my category".