Class DiscordSelectComponent
A select menu with multiple options to choose from.
Namespace: DisCatSharp.Entities
Assembly: DisCatSharp.dll
Syntax
public sealed class DiscordSelectComponent : DiscordComponent
Constructors
| Improve this Doc View SourceDiscordSelectComponent()
Initializes a new instance of the DiscordSelectComponent class.
Declaration
public DiscordSelectComponent()
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. |
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 SourceDisabled
Whether this select can be used.
Declaration
public bool Disabled { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Label
Label of component, if used in modal.
Declaration
public string Label { get; }
Property Value
Type | Description |
---|---|
System.String |
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> |
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> |
Options
The options to pick from on this component.
Declaration
public IReadOnlyList<DiscordSelectComponentOption> Options { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<DiscordSelectComponentOption> |
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 SourceDisable()
Disables this component.
Declaration
public DiscordSelectComponent Disable()
Returns
Type | Description |
---|---|
DiscordSelectComponent | The current component. |
Enable()
Enables this component if it was disabled before.
Declaration
public DiscordSelectComponent Enable()
Returns
Type | Description |
---|---|
DiscordSelectComponent | The current component. |