Class ComponentCommandParameterBuilder
- Namespace
- Discord.Interactions.Builders
- Assembly
- Discord.Net.Interactions.dll
Represents a builder for creating ComponentCommandParameterInfo.
public class ComponentCommandParameterBuilder : ParameterBuilder<ComponentCommandParameterInfo, ComponentCommandParameterBuilder>, IParameterBuilder
- Inheritance
-
ComponentCommandParameterBuilder
- Implements
- Inherited Members
Constructors
ComponentCommandParameterBuilder(ICommandBuilder, string, Type)
Initializes a new ComponentCommandParameterBuilder.
public ComponentCommandParameterBuilder(ICommandBuilder command, string name, Type type)
Parameters
commandICommandBuilderParent command of this parameter.
namestringName of this command.
typeTypeType of this parameter.
Properties
Instance
protected override ComponentCommandParameterBuilder Instance { get; }
Property Value
IsRouteSegmentParameter
Gets whether this parameter is a CustomId segment or a Component value parameter.
public bool IsRouteSegmentParameter { get; }
Property Value
TypeConverter
Get the ComponentTypeConverter assigned to this parameter, if IsRouteSegmentParameter is false.
public ComponentTypeConverter TypeConverter { get; }
Property Value
TypeReader
Get the TypeReader assigned to this parameter, if IsRouteSegmentParameter is true.
public TypeReader TypeReader { get; }
Property Value
Methods
SetIsRouteSegment(bool)
Sets IsRouteSegmentParameter.
public ComponentCommandParameterBuilder SetIsRouteSegment(bool isRouteSegment)
Parameters
isRouteSegmentboolNew value of the IsRouteSegmentParameter.
Returns
- ComponentCommandParameterBuilder
The builder instance.
SetParameterType(Type)
Sets ParameterType.
public override ComponentCommandParameterBuilder SetParameterType(Type type)
Parameters
typeTypeNew value of the ParameterType.
Returns
- ComponentCommandParameterBuilder
The builder instance.
SetParameterType(Type, IServiceProvider)
Sets ParameterType.
public ComponentCommandParameterBuilder SetParameterType(Type type, IServiceProvider services)
Parameters
typeTypeNew value of the ParameterType.
servicesIServiceProviderService container to be used to resolve the dependencies of this parameters TypeConverter.
Returns
- ComponentCommandParameterBuilder
The builder instance.