Table of Contents

Class CommandParameterInfo

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

Represents the base parameter info class for InteractionService commands.

public class CommandParameterInfo : IParameterInfo
Inheritance
CommandParameterInfo
Implements
Derived
Inherited Members

Properties

Attributes

Gets a list of the attributes this parameter has.

public IReadOnlyCollection<Attribute> Attributes { get; }

Property Value

IReadOnlyCollection<Attribute>

Command

Gets the command that this parameter belongs to.

public ICommandInfo Command { get; }

Property Value

ICommandInfo

DefaultValue

Gets the default value of this parameter if the parameter is optional.

public object DefaultValue { get; }

Property Value

object

IsParameterArray

Gets whether this parameter is marked with a params keyword.

public bool IsParameterArray { get; }

Property Value

bool

IsRequired

Gets whether this parameter is required.

public bool IsRequired { get; }

Property Value

bool

Name

Gets the name of this parameter.

public string Name { get; }

Property Value

string

ParameterType

Gets the type of this parameter.

public Type ParameterType { get; }

Property Value

Type

Preconditions

Gets a list of the preconditions this parameter has.

public IReadOnlyCollection<ParameterPreconditionAttribute> Preconditions { get; }

Property Value

IReadOnlyCollection<ParameterPreconditionAttribute>

Methods

CheckPreconditionsAsync(IInteractionContext, object, IServiceProvider)

Check if an execution context meets the parameter precondition requirements.

public Task<PreconditionResult> CheckPreconditionsAsync(IInteractionContext context, object value, IServiceProvider services)

Parameters

context IInteractionContext
value object
services IServiceProvider

Returns

Task<PreconditionResult>