Search Results for

    Show / Hide Table of Contents

    Class ChoiceAttribute

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

    Inheritance
    Object
    ChoiceAttribute
    Namespace: Discord.Interactions
    Assembly: Discord.Net.Interactions.dll
    Syntax
    public class ChoiceAttribute : Attribute

    Constructors

    | Improve this Doc View Source

    ChoiceAttribute(String, Double)

    Create a parameter choice with type Number.

    Declaration
    public ChoiceAttribute(string name, double value)
    Parameters
    Type Name Description
    String name

    Name of the choice.

    Double value

    Predefined value of the choice.

    | Improve this Doc View Source

    ChoiceAttribute(String, Int32)

    Create a parameter choice with type Integer.

    Declaration
    public ChoiceAttribute(string name, int value)
    Parameters
    Type Name Description
    String name

    Name of the choice.

    Int32 value

    Predefined value of the choice.

    | Improve this Doc View Source

    ChoiceAttribute(String, String)

    Create a parameter choice with type String.

    Declaration
    public ChoiceAttribute(string name, string value)
    Parameters
    Type Name Description
    String name

    Name of the choice.

    String value

    Predefined value of the choice.

    Properties

    | Improve this Doc View Source

    Name

    Gets the name of the choice.

    Declaration
    public string Name { get; }
    Property Value
    Type Description
    String
    | Improve this Doc View Source

    Type

    Gets the type of this choice.

    Declaration
    public SlashCommandChoiceType Type { get; }
    Property Value
    Type Description
    SlashCommandChoiceType
    | Improve this Doc View Source

    Value

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

    Declaration
    public object Value { get; }
    Property Value
    Type Description
    Object

    Theme

    • Improve this Doc
    • View Source
    In This Article
    Back to top Discord.Net (c) 2015-2022 3.9.0