Class CommandGroupBuilder
Commands are text-based commands that can be invoked by users in a chat by sending a message, typically starting with a prefix.
public class CommandGroupBuilder : ICommandBuilder
- Inheritance
-
CommandGroupBuilder
- Implements
- Inherited Members
Constructors
CommandGroupBuilder(IEnumerable<string>)
Commands are text-based commands that can be invoked by users in a chat by sending a message, typically starting with a prefix.
public CommandGroupBuilder(IEnumerable<string> aliases)
Parameters
aliasesIEnumerable<string>Aliases of the command.
Properties
Aliases
Aliases of the command.
public IEnumerable<string> Aliases { get; }
Property Value
Priority
Priority of the command. Commands are matched in order of descending priority, and the first command that matches the input is executed. Higher values indicate higher priority.
public int Priority { get; set; }
Property Value
Methods
AddSubCommand(IEnumerable<string>, Delegate)
Adds a sub command to a command group.
public CommandBuilder AddSubCommand(IEnumerable<string> aliases, Delegate handler)
Parameters
aliasesIEnumerable<string>Aliases of the command. handlerDelegateHandler that represents the body of the command.
Returns
- CommandBuilder
The created sub command builder.
AddSubCommandGroup(IEnumerable<string>)
Adds a sub command group to a command group.
public CommandGroupBuilder AddSubCommandGroup(IEnumerable<string> aliases)
Parameters
aliasesIEnumerable<string>Aliases of the command.
Returns
- CommandGroupBuilder
The created sub command group builder.
AddSubCommandGroup(IEnumerable<string>, Action<CommandGroupBuilder>)
Adds a sub command group to a command group.
public CommandGroupBuilder AddSubCommandGroup(IEnumerable<string> aliases, Action<CommandGroupBuilder> builder)
Parameters
aliasesIEnumerable<string>Aliases of the command. builderAction<CommandGroupBuilder>A delegate that builds the sub command group.
Returns
- CommandGroupBuilder
The created sub command group builder.
WithPriority(int)
Priority of the command. Commands are matched in order of descending priority, and the first command that matches the input is executed. Higher values indicate higher priority.
public CommandGroupBuilder WithPriority(int priority)
Parameters
priorityint