Class SelectMenuBuilder
Represents a class used to build Discord.SelectMenuComponent's.
Assembly: Discord.Net.Core.dll​
View Source​
public class SelectMenuBuilder
Properties​
CustomId​
Gets or sets the custom id of the current select menu.
View Source​
public string CustomId { get; set; }
Placeholder​
Gets or sets the placeholder text of the current select menu.
View Source​
public string Placeholder { get; set; }
MinValues​
Gets or sets the minimum values of the current select menu.
View Source​
public int MinValues { get; set; }
MaxValues​
Gets or sets the maximum values of the current select menu.
View Source​
public int MaxValues { get; set; }
Options​
Gets or sets a collection of Discord.SelectMenuOptionBuilder for this current select menu.
View Source​
public List<SelectMenuOptionBuilder> Options { get; set; }
IsDisabled​
Gets or sets whether the current menu is disabled.
View Source​
public bool IsDisabled { get; set; }
Fields​
MaxPlaceholderLength​
The max length of a Discord.SelectMenuComponent.Placeholder.
View Source​
public const int MaxPlaceholderLength = 100
MaxValuesCount​
The maximum number of values for the Discord.SelectMenuComponent.MinValues and Discord.SelectMenuComponent.MaxValues properties.
View Source​
public const int MaxValuesCount = 25
MaxOptionCount​
The maximum number of options a Discord.SelectMenuComponent can have.
View Source​
public const int MaxOptionCount = 25
Methods​
WithCustomId(String)​
Sets the field CustomId.
View Source​
public SelectMenuBuilder WithCustomId(string customId)
Returns​
Discord.SelectMenuBuilder: The current builder.
Parameters​
Type | Name | Description |
---|---|---|
System.String | customId | The value to set the field CustomId to. |
WithPlaceholder(String)​
Sets the field placeholder.
View Source​
public SelectMenuBuilder WithPlaceholder(string placeholder)
Returns​
Discord.SelectMenuBuilder: The current builder.
Parameters​
Type | Name | Description |
---|---|---|
System.String | placeholder | The value to set the field placeholder to. |
WithMinValues(Int32)​
Sets the field minValues.
View Source​
public SelectMenuBuilder WithMinValues(int minValues)
Returns​
Discord.SelectMenuBuilder: The current builder.
Parameters​
Type | Name | Description |
---|---|---|
System.Int32 | minValues | The value to set the field minValues to. |
WithMaxValues(Int32)​
Sets the field maxValues.
View Source​
public SelectMenuBuilder WithMaxValues(int maxValues)
Returns​
Discord.SelectMenuBuilder: The current builder.
Parameters​
Type | Name | Description |
---|---|---|
System.Int32 | maxValues | The value to set the field maxValues to. |
WithOptions(List<SelectMenuOptionBuilder>)​
Sets the field options.
View Source​
public SelectMenuBuilder WithOptions(List<SelectMenuOptionBuilder> options)
Returns​
Discord.SelectMenuBuilder: The current builder.
Parameters​
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<Discord.SelectMenuOptionBuilder> | options | The value to set the field options to. |
AddOption(SelectMenuOptionBuilder)​
Add one option to menu options.
View Source​
public SelectMenuBuilder AddOption(SelectMenuOptionBuilder option)
Returns​
Discord.SelectMenuBuilder: The current builder.
Parameters​
Type | Name | Description |
---|---|---|
Discord.SelectMenuOptionBuilder | option | The option builder class containing the option properties. |
AddOption(String, String, String, IEmote, Nullable<Boolean>)​
Add one option to menu options.
View Source​
public SelectMenuBuilder AddOption(string label, string value, string description = null, IEmote emote = null, bool? isDefault = null)
Returns​
Discord.SelectMenuBuilder: The current builder.
Parameters​
Type | Name | Description |
---|---|---|
System.String | label | The label for this option. |
System.String | value | The value of this option. |
System.String | description | The description of this option. |
Discord.IEmote | emote | The emote of this option. |
System.Nullable<System.Boolean> | isDefault | Render this option as selected by default or not. |
WithDisabled(Boolean)​
Sets whether the current menu is disabled.
View Source​
public SelectMenuBuilder WithDisabled(bool isDisabled)
Returns​
Discord.SelectMenuBuilder: The current builder.
Parameters​
Type | Name | Description |
---|---|---|
System.Boolean | isDisabled | Whether the current menu is disabled or not. |
Build()​
Builds a Discord.SelectMenuComponent
View Source​
public SelectMenuComponent Build()
Returns​
Discord.SelectMenuComponent: The newly built Discord.SelectMenuComponent