Table of Contents

Interface ICommandBuilder

Namespace
Discord.Interactions.Builders
Assembly
Discord.Net.Interactions.dll

Represent a command builder for creating ICommandInfo.

public interface ICommandBuilder

Properties

Attributes

Gets a collection of the attributes of this command.

IReadOnlyList<Attribute> Attributes { get; }

Property Value

IReadOnlyList<Attribute>

Callback

Gets the execution delegate of this command.

ExecuteCallback Callback { get; }

Property Value

ExecuteCallback

IgnoreGroupNames

Gets or sets true if this command will be registered and executed as a standalone command, unaffected by the GroupAttributes of of the commands parents.

bool IgnoreGroupNames { get; set; }

Property Value

bool

MethodName

Gets or sets the method name of this command.

string MethodName { get; set; }

Property Value

string

Module

Gets the parent module of this command.

ModuleBuilder Module { get; }

Property Value

ModuleBuilder

Name

Gets the name of this command.

string Name { get; }

Property Value

string

Parameters

Gets a collection of the parameters of this command.

IReadOnlyList<IParameterBuilder> Parameters { get; }

Property Value

IReadOnlyList<IParameterBuilder>

Preconditions

Gets a collection of the preconditions of this command.

IReadOnlyList<PreconditionAttribute> Preconditions { get; }

Property Value

IReadOnlyList<PreconditionAttribute>

RunMode

Gets or sets the run mode this command gets executed with.

RunMode RunMode { get; set; }

Property Value

RunMode

TreatNameAsRegex

Gets or sets whether the Name should be directly used as a Regex pattern.

bool TreatNameAsRegex { get; set; }

Property Value

bool

Methods

AddParameters(params IParameterBuilder[])

Adds parameter builders to Parameters.

ICommandBuilder AddParameters(params IParameterBuilder[] parameters)

Parameters

parameters IParameterBuilder[]

New parameter builders to be added to Parameters.

Returns

ICommandBuilder

The builder instance.

SetRunMode(RunMode)

Sets RunMode.

ICommandBuilder SetRunMode(RunMode runMode)

Parameters

runMode RunMode

New value of the RunMode.

Returns

ICommandBuilder

The builder instance.

WithAttributes(params Attribute[])

Adds attributes to Attributes.

ICommandBuilder WithAttributes(params Attribute[] attributes)

Parameters

attributes Attribute[]

New attributes to be added to Attributes.

Returns

ICommandBuilder

The builder instance.

WithMethodName(string)

Sets MethodName.

ICommandBuilder WithMethodName(string name)

Parameters

name string

New value of the MethodName.

Returns

ICommandBuilder

The builder instance.

WithName(string)

Sets Name.

ICommandBuilder WithName(string name)

Parameters

name string

New value of the Name.

Returns

ICommandBuilder

The builder instance.

WithNameAsRegex(bool)

ICommandBuilder WithNameAsRegex(bool value)

Parameters

value bool

New value of the TreatNameAsRegex.

Returns

ICommandBuilder

The builder instance.

WithPreconditions(params PreconditionAttribute[])

Adds preconditions to Preconditions.

ICommandBuilder WithPreconditions(params PreconditionAttribute[] preconditions)

Parameters

preconditions PreconditionAttribute[]

New preconditions to be added to Preconditions.

Returns

ICommandBuilder

The builder instance.