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
ChoiceAttribute(string, int)
创建一个类型为 Integer 的参数选项。
public ChoiceAttribute(string name, int value)
Parameters
ChoiceAttribute(string, string)
创建一个类型为 String 的参数选项。
public ChoiceAttribute(string name, string value)
Parameters
Properties
Name
获取选项名称。
public string Name { get; }
Property Value
Type
获取此选项的类型。
public SlashCommandChoiceType Type { get; }
Property Value
Value
获取当选择此选项时将被使用的值。
public object? Value { get; }