Table of Contents

Interface IParameterInfo

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

Represents a ICommandInfo parameter.

public interface IParameterInfo

Properties

Attributes

Gets a list of the attributes this parameter has.

IReadOnlyCollection<Attribute> Attributes { get; }

Property Value

IReadOnlyCollection<Attribute>

Command

Gets the command that this parameter belongs to.

ICommandInfo Command { get; }

Property Value

ICommandInfo

DefaultValue

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

object DefaultValue { get; }

Property Value

object

IsParameterArray

Gets whether this parameter is marked with a params keyword.

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 list of the preconditions this parameter has.

IReadOnlyCollection<ParameterPreconditionAttribute> Preconditions { get; }

Property Value

IReadOnlyCollection<ParameterPreconditionAttribute>

Methods

CheckPreconditionsAsync(IInteractionContext, object, IServiceProvider)

Check if an execution context meets the parameter precondition requirements.

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

Parameters

context IInteractionContext
value object
services IServiceProvider

Returns

Task<PreconditionResult>