Table of Contents

Class ChoiceAttribute

Namespace
HeyBox.Interactions
Assembly
HeyBox.Net.Interactions.dll

为命令参数添加预设值。

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

Constructors

ChoiceAttribute(string, double)

创建一个类型为 Number 的参数选项。

public ChoiceAttribute(string name, double value)

Parameters

name string

选项名称。

value double

选项的预设值。

ChoiceAttribute(string, int)

创建一个类型为 Integer 的参数选项。

public ChoiceAttribute(string name, int value)

Parameters

name string

选项名称。

value int

选项的预设值。

ChoiceAttribute(string, string)

创建一个类型为 String 的参数选项。

public ChoiceAttribute(string name, string value)

Parameters

name string

选项名称。

value string

选项的预设值。

Properties

Name

获取选项名称。

public string Name { get; }

Property Value

string

Type

获取此选项的类型。

public SlashCommandChoiceType Type { get; }

Property Value

SlashCommandChoiceType

Value

获取当选择此选项时将被使用的值。

public object? Value { get; }

Property Value

object