Interface IParameterBuilder
- Namespace
- Discord.Interactions.Builders
- Assembly
- Discord.Net.Interactions.dll
Represent a command builder for creating IParameterInfo.
public interface IParameterBuilder
Properties
Attributes
Gets a collection of the attributes of this command.
IReadOnlyCollection<Attribute> Attributes { get; }
Property Value
Command
Gets the parent command of this parameter.
ICommandBuilder Command { get; }
Property Value
DefaultValue
Gets the default value of this parameter.
object DefaultValue { get; }
Property Value
IsParameterArray
Gets whether this parameter is params.
bool IsParameterArray { get; }
Property Value
IsRequired
Gets whether this parameter is required.
bool IsRequired { get; }
Property Value
Name
Gets the name of this parameter.
string Name { get; }
Property Value
ParameterType
Gets the type of this parameter.
Type ParameterType { get; }
Property Value
Preconditions
Gets a collection of the preconditions of this command.
IReadOnlyCollection<ParameterPreconditionAttribute> Preconditions { get; }
Property Value
Methods
AddAttributes(params Attribute[])
Adds attributes to Attributes.
IParameterBuilder AddAttributes(params Attribute[] attributes)
Parameters
attributes
Attribute[]New attributes to be added to Attributes.
Returns
- IParameterBuilder
The builder instance.
AddPreconditions(params ParameterPreconditionAttribute[])
Adds preconditions to Preconditions.
IParameterBuilder AddPreconditions(params ParameterPreconditionAttribute[] preconditions)
Parameters
preconditions
ParameterPreconditionAttribute[]New attributes to be added to Preconditions.
Returns
- IParameterBuilder
The builder instance.
SetDefaultValue(object)
Sets DefaultValue.
IParameterBuilder SetDefaultValue(object defaultValue)
Parameters
defaultValue
objectNew value of the DefaultValue.
Returns
- IParameterBuilder
The builder instance.
SetParameterType(Type)
Sets ParameterType.
IParameterBuilder SetParameterType(Type type)
Parameters
type
TypeNew value of the ParameterType.
Returns
- IParameterBuilder
The builder instance.
SetRequired(bool)
Sets IsRequired.
IParameterBuilder SetRequired(bool isRequired)
Parameters
isRequired
boolNew value of the IsRequired.
Returns
- IParameterBuilder
The builder instance.
WithName(string)
Sets Name.
IParameterBuilder WithName(string name)
Parameters
Returns
- IParameterBuilder
The builder instance.