Table of Contents

Class ChoiceAttribute

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

Add a pre-determined argument value to a command parameter.

[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = true, Inherited = true)]
public class ChoiceAttribute : Attribute
Inheritance
ChoiceAttribute
Inherited Members

Constructors

ChoiceAttribute(string, double)

Create a parameter choice with type Number.

public ChoiceAttribute(string name, double value)

Parameters

name string

Name of the choice.

value double

Predefined value of the choice.

ChoiceAttribute(string, int)

Create a parameter choice with type Integer.

public ChoiceAttribute(string name, int value)

Parameters

name string

Name of the choice.

value int

Predefined value of the choice.

ChoiceAttribute(string, string)

Create a parameter choice with type String.

public ChoiceAttribute(string name, string value)

Parameters

name string

Name of the choice.

value string

Predefined value of the choice.

Properties

Name

Gets the name of the choice.

public string Name { get; }

Property Value

string

Type

Gets the type of this choice.

public SlashCommandChoiceType Type { get; }

Property Value

SlashCommandChoiceType

Value

Gets the value that will be used whenever this choice is selected.

public object Value { get; }

Property Value

object