Implement configurable command node separators

This fixes #304 over foxbot's PR for the same issue.
This commit is contained in:
FiniteReality
2016-12-09 10:31:57 +00:00
parent 803b65212e
commit 70d30efb94
6 changed files with 65 additions and 34 deletions

View File

@@ -12,20 +12,20 @@ namespace Discord.Commands
_root = new CommandMapNode("");
}
public void AddCommand(CommandInfo command)
public void AddCommand(CommandInfo command, CommandService service)
{
foreach (string text in GetAliases(command))
_root.AddCommand(text, 0, command);
_root.AddCommand(service, text, 0, command);
}
public void RemoveCommand(CommandInfo command)
public void RemoveCommand(CommandInfo command, CommandService service)
{
foreach (string text in GetAliases(command))
_root.RemoveCommand(text, 0, command);
_root.RemoveCommand(service, text, 0, command);
}
public IEnumerable<CommandInfo> GetCommands(string text)
public IEnumerable<CommandInfo> GetCommands(string text, CommandService service)
{
return _root.GetCommands(text, 0);
return _root.GetCommands(service, text, 0);
}
private IReadOnlyList<string> GetAliases(CommandInfo command)