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
Callback
Gets the execution delegate of this command.
ExecuteCallback Callback { get; }
Property Value
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
MethodName
Gets or sets the method name of this command.
string MethodName { get; set; }
Property Value
Module
Gets the parent module of this command.
ModuleBuilder Module { get; }
Property Value
Name
Gets the name of this command.
string Name { get; }
Property Value
Parameters
Gets a collection of the parameters of this command.
IReadOnlyList<IParameterBuilder> Parameters { get; }
Property Value
Preconditions
Gets a collection of the preconditions of this command.
IReadOnlyList<PreconditionAttribute> Preconditions { get; }
Property Value
RunMode
Gets or sets the run mode this command gets executed with.
RunMode RunMode { get; set; }
Property Value
TreatNameAsRegex
Gets or sets whether the Name should be directly used as a Regex pattern.
bool TreatNameAsRegex { get; set; }
Property Value
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
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
stringNew value of the MethodName.
Returns
- ICommandBuilder
The builder instance.
WithName(string)
Sets Name.
ICommandBuilder WithName(string name)
Parameters
Returns
- ICommandBuilder
The builder instance.
WithNameAsRegex(bool)
Sets TreatNameAsRegex.
ICommandBuilder WithNameAsRegex(bool value)
Parameters
value
boolNew 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.