Skip to main content

Class SelectMenuOptionBuilder

Represents a class used to build Discord.SelectMenuOption's.

Assembly: Discord.Net.Core.dll​
View Source​
Declaration
public class SelectMenuOptionBuilder

Properties​

Label​

Gets or sets the label of the current select menu.

View Source​
Declaration
public string Label { get; set; }

Value​

Gets or sets the value of the current select menu.

View Source​
Declaration
public string Value { get; set; }

Description​

Gets or sets this menu options description.

View Source​
Declaration
public string Description { get; set; }

Emote​

Gets or sets the emote of this option.

View Source​
Declaration
public IEmote Emote { get; set; }

IsDefault​

Gets or sets the whether or not this option will render selected by default.

View Source​
Declaration
public bool? IsDefault { get; set; }

Fields​

MaxSelectLabelLength​

The maximum length of a Discord.SelectMenuOption.Label.

View Source​
Declaration
public const int MaxSelectLabelLength = 100

MaxDescriptionLength​

The maximum length of a Discord.SelectMenuOption.Description.

View Source​
Declaration
public const int MaxDescriptionLength = 100

MaxSelectValueLength​

The maximum length of a Discord.SelectMenuOption.Value.

View Source​
Declaration
public const int MaxSelectValueLength = 100

Methods​

WithLabel(String)​

Sets the field label.

View Source​
Declaration
public SelectMenuOptionBuilder WithLabel(string label)
Returns​

Discord.SelectMenuOptionBuilder: The current builder.

Parameters​
TypeNameDescription
System.StringlabelThe value to set the field label to.

WithValue(String)​

Sets the field value.

View Source​
Declaration
public SelectMenuOptionBuilder WithValue(string value)
Returns​

Discord.SelectMenuOptionBuilder: The current builder.

Parameters​
TypeNameDescription
System.StringvalueThe value to set the field value to.

WithDescription(String)​

Sets the field description.

View Source​
Declaration
public SelectMenuOptionBuilder WithDescription(string description)
Returns​

Discord.SelectMenuOptionBuilder: The current builder.

Parameters​
TypeNameDescription
System.StringdescriptionThe value to set the field description to.

WithEmote(IEmote)​

Sets the field emote.

View Source​
Declaration
public SelectMenuOptionBuilder WithEmote(IEmote emote)
Returns​

Discord.SelectMenuOptionBuilder: The current builder.

Parameters​
TypeNameDescription
Discord.IEmoteemoteThe value to set the field emote to.

WithDefault(Boolean)​

Sets the field default.

View Source​
Declaration
public SelectMenuOptionBuilder WithDefault(bool isDefault)
Returns​

Discord.SelectMenuOptionBuilder: The current builder.

Parameters​
TypeNameDescription
System.BooleanisDefaultThe value to set the field default to.

Build()​

Builds a Discord.SelectMenuOption.

View Source​
Declaration
public SelectMenuOption Build()
Returns​

Discord.SelectMenuOption: The newly built Discord.SelectMenuOption.