Table of Contents

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

IReadOnlyCollection<Attribute>

Command

Gets the parent command of this parameter.

ICommandBuilder Command { get; }

Property Value

ICommandBuilder

DefaultValue

Gets the default value of this parameter.

object DefaultValue { get; }

Property Value

object

IsParameterArray

Gets whether this parameter is params.

bool IsParameterArray { get; }

Property Value

bool

IsRequired

Gets whether this parameter is required.

bool IsRequired { get; }

Property Value

bool

Name

Gets the name of this parameter.

string Name { get; }

Property Value

string

ParameterType

Gets the type of this parameter.

Type ParameterType { get; }

Property Value

Type

Preconditions

Gets a collection of the preconditions of this command.

IReadOnlyCollection<ParameterPreconditionAttribute> Preconditions { get; }

Property Value

IReadOnlyCollection<ParameterPreconditionAttribute>

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)

IParameterBuilder SetDefaultValue(object defaultValue)

Parameters

defaultValue object

New value of the DefaultValue.

Returns

IParameterBuilder

The builder instance.

SetParameterType(Type)

IParameterBuilder SetParameterType(Type type)

Parameters

type Type

New value of the ParameterType.

Returns

IParameterBuilder

The builder instance.

SetRequired(bool)

Sets IsRequired.

IParameterBuilder SetRequired(bool isRequired)

Parameters

isRequired bool

New value of the IsRequired.

Returns

IParameterBuilder

The builder instance.

WithName(string)

Sets Name.

IParameterBuilder WithName(string name)

Parameters

name string

New value of the Name.

Returns

IParameterBuilder

The builder instance.