Table of Contents

Class CommandGroupBuilder

Namespace
NetCord.Services.Commands
Assembly
NetCord.Services.dll

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

aliases IEnumerable<string>
Aliases of the command.

Properties

Aliases

Aliases of the command.

public IEnumerable<string> Aliases { get; }

Property Value

IEnumerable<string>

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

int

Methods

AddSubCommand(IEnumerable<string>, Delegate)

Adds a sub command to a command group.

public CommandBuilder AddSubCommand(IEnumerable<string> aliases, Delegate handler)

Parameters

aliases IEnumerable<string>
Aliases of the command.
handler Delegate
Handler 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

aliases IEnumerable<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

aliases IEnumerable<string>
Aliases of the command.
builder Action<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

priority int

Returns

CommandGroupBuilder