Table of Contents

Class SlashCommandParameterAttribute

Namespace
NetCord.Services.ApplicationCommands
Assembly
NetCord.Services.dll

Specifies metadata for a parameter of a slash command. Use this attribute to configure how a parameter is presented and validated.

[AttributeUsage(AttributeTargets.Parameter)]
public class SlashCommandParameterAttribute : Attribute
Inheritance
SlashCommandParameterAttribute
Inherited Members

Constructors

SlashCommandParameterAttribute()

public SlashCommandParameterAttribute()

Properties

AllowedChannelTypes

If the option is a channel type, the channels shown will be restricted to these types.

public ChannelType[]? AllowedChannelTypes { get; init; }

Property Value

ChannelType[]

AutocompleteProviderType

Provider for autocomplete functionality, allowing dynamic suggestions based on user input.

public Type? AutocompleteProviderType { get; init; }

Property Value

Type

ChoicesProviderType

Provider for choices for the parameter, allowing users to select from predefined options.

public Type? ChoicesProviderType { get; init; }

Property Value

Type

Description

Description of the parameter (1-100 characters).

public string? Description { get; init; }

Property Value

string

MaxLength

Maximum length of the parameter value (1-6000).

public int MaxLength { get; init; }

Property Value

int

MaxValue

Maximum value permitted for the parameter.

public double MaxValue { get; init; }

Property Value

double

MinLength

Minimum length of the parameter value (0-6000).

public int MinLength { get; init; }

Property Value

int

MinValue

Minimum value permitted for the parameter.

public double MinValue { get; init; }

Property Value

double

Name

Name of the parameter (1-32 characters).

public string? Name { get; init; }

Property Value

string

TypeReaderType

Type reader for the parameter, used to convert the input value to the specified type.

public Type? TypeReaderType { get; init; }

Property Value

Type