Class MenuProperties
public abstract class MenuProperties : IComponentProperties
- Inheritance
-
MenuProperties
- Implements
- Derived
- Inherited Members
Constructors
MenuProperties(string)
protected MenuProperties(string customId)
Parameters
customId
stringID for the menu (max 100 characters).
Properties
ComponentType
Type of the component.
[JsonPropertyName("type")]
public abstract ComponentType ComponentType { get; }
Property Value
CustomId
ID for the menu (max 100 characters).
[JsonPropertyName("custom_id")]
public string CustomId { get; set; }
Property Value
Disabled
Whether the menu is disabled.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
[JsonPropertyName("disabled")]
public bool Disabled { get; set; }
Property Value
Id
Unique identifier for the component. Auto populated through increment if not provided.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("id")]
public int? Id { get; set; }
Property Value
- int?
MaxValues
Maximum number of items that can be chosen, default 1 (max 25).
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("max_values")]
public int? MaxValues { get; set; }
Property Value
- int?
MinValues
Minimum number of items that must be chosen, default 1 (0-25).
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("min_values")]
public int? MinValues { get; set; }
Property Value
- int?
ParentId
[JsonIgnore]
public int? ParentId { get; set; }
Property Value
- int?
Placeholder
Placeholder text if nothing is selected (max 150 characters).
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("placeholder")]
public string? Placeholder { get; set; }
Property Value
Methods
WithCustomId(string)
ID for the menu (max 100 characters).
public MenuProperties WithCustomId(string customId)
Parameters
customId
string
Returns
WithDisabled(bool)
Whether the menu is disabled.
public MenuProperties WithDisabled(bool disabled = true)
Parameters
disabled
bool
Returns
WithId(int?)
public MenuProperties WithId(int? id)
Parameters
id
int?
Returns
WithMaxValues(int?)
Maximum number of items that can be chosen, default 1 (max 25).
public MenuProperties WithMaxValues(int? maxValues)
Parameters
maxValues
int?
Returns
WithMinValues(int?)
Minimum number of items that must be chosen, default 1 (0-25).
public MenuProperties WithMinValues(int? minValues)
Parameters
minValues
int?
Returns
WithParentId(int?)
public MenuProperties WithParentId(int? parentId)
Parameters
parentId
int?
Returns
WithPlaceholder(string?)
Placeholder text if nothing is selected (max 150 characters).
public MenuProperties WithPlaceholder(string? placeholder)
Parameters
placeholder
string