Search Results for

    Show / Hide Table of Contents

    Class DiscordSelectComponent

    A select menu with multiple options to choose from.

    Inheritance
    System.Object
    DiscordComponent
    DiscordSelectComponent
    Inherited Members
    DiscordComponent.Type
    DiscordComponent.CustomId
    Namespace: DisCatSharp.Entities
    Assembly: DisCatSharp.dll
    Syntax
    public sealed class DiscordSelectComponent : DiscordComponent

    Constructors

    | Improve this Doc View Source

    DiscordSelectComponent()

    Initializes a new instance of the DiscordSelectComponent class.

    Declaration
    public DiscordSelectComponent()
    | Improve this Doc View Source

    DiscordSelectComponent(String, IEnumerable<DiscordSelectComponentOption>, String, Int32, Int32, Boolean)

    Constructs a new DiscordSelectComponent.

    Declaration
    public DiscordSelectComponent(string placeholder, IEnumerable<DiscordSelectComponentOption> options, string customId = null, int minOptions = 1, int maxOptions = 1, bool disabled = false)
    Parameters
    Type Name Description
    System.String placeholder

    Text to show if no option is selected.

    System.Collections.Generic.IEnumerable<DiscordSelectComponentOption> options

    Array of options

    System.String customId

    The Id to assign to the select component.

    System.Int32 minOptions

    Minimum count of selectable options.

    System.Int32 maxOptions

    Maximum count of selectable options.

    System.Boolean disabled

    Whether this select component should be initialized as being disabled. User sees a greyed out select component that cannot be interacted with.

    | Improve this Doc View Source

    DiscordSelectComponent(String, String, IEnumerable<DiscordSelectComponentOption>, String, Int32, Int32, Boolean)

    Constructs a new DiscordSelectComponent for modals.

    Declaration
    public DiscordSelectComponent(string label, string placeholder, IEnumerable<DiscordSelectComponentOption> options, string customId = null, int minOptions = 1, int maxOptions = 1, bool disabled = false)
    Parameters
    Type Name Description
    System.String label

    Maximum count of selectable options.

    System.String placeholder

    Text to show if no option is selected.

    System.Collections.Generic.IEnumerable<DiscordSelectComponentOption> options

    Array of options

    System.String customId

    The Id to assign to the select component.

    System.Int32 minOptions

    Minimum count of selectable options.

    System.Int32 maxOptions

    Maximum count of selectable options.

    System.Boolean disabled

    Whether this select component should be initialized as being disabled. User sees a greyed out select component that cannot be interacted with.

    Properties

    | Improve this Doc View Source

    Disabled

    Whether this select can be used.

    Declaration
    public bool Disabled { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Label

    Label of component, if used in modal.

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

    MaximumSelectedValues

    The maximum amount of options that can be selected. Must be greater than or equal to zero or MinimumSelectedValues. Defaults to one.

    Declaration
    public int? MaximumSelectedValues { get; }
    Property Value
    Type Description
    System.Nullable<System.Int32>
    | Improve this Doc View Source

    MinimumSelectedValues

    The minimum amount of options that can be selected. Must be less than or equal to MaximumSelectedValues. Defaults to one.

    Declaration
    public int? MinimumSelectedValues { get; }
    Property Value
    Type Description
    System.Nullable<System.Int32>
    | Improve this Doc View Source

    Options

    The options to pick from on this component.

    Declaration
    public IReadOnlyList<DiscordSelectComponentOption> Options { get; }
    Property Value
    Type Description
    System.Collections.Generic.IReadOnlyList<DiscordSelectComponentOption>
    | Improve this Doc View Source

    Placeholder

    The text to show when no option is selected.

    Declaration
    public string Placeholder { get; }
    Property Value
    Type Description
    System.String

    Methods

    | Improve this Doc View Source

    Disable()

    Disables this component.

    Declaration
    public DiscordSelectComponent Disable()
    Returns
    Type Description
    DiscordSelectComponent

    The current component.

    | Improve this Doc View Source

    Enable()

    Enables this component if it was disabled before.

    Declaration
    public DiscordSelectComponent Enable()
    Returns
    Type Description
    DiscordSelectComponent

    The current component.

    Extension Methods

    ReflectionUtilities.ToDictionary<T>(T)
    • Improve this Doc
    • View Source
    In This Article
    Back to top © 2021-2022 Aiko IT Systems