Class MenuProperties
public abstract class MenuProperties : IInteractiveComponentProperties, IMessageComponentProperties, IJsonSerializable<IMessageComponentProperties>, IComponentContainerComponentProperties, IJsonSerializable<IComponentContainerComponentProperties>, ILabelComponentProperties, IComponentProperties, IJsonSerializable<ILabelComponentProperties>
- Inheritance
-
MenuProperties
- Implements
- Derived
- Inherited Members
Constructors
MenuProperties(string)
protected MenuProperties(string customId)
Parameters
customIdstringDeveloper-defined identifier for the component (max 100 characters).
Properties
ComponentType
Type of the component.
[JsonPropertyName("type")]
public abstract ComponentType ComponentType { get; }
Property Value
CustomId
Developer-defined identifier for the component (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
Required
Whether the menu is required to answer in a modal. Defaults to true.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("required")]
public bool? Required { get; set; }
Property Value
- bool?
Methods
WithCustomId(string)
Developer-defined identifier for the component (max 100 characters).
public MenuProperties WithCustomId(string customId)
Parameters
customIdstring
Returns
WithDisabled(bool)
Whether the menu is disabled.
public MenuProperties WithDisabled(bool disabled = true)
Parameters
disabledbool
Returns
WithId(int?)
Unique identifier for the component. Auto populated through increment if not provided.
public MenuProperties WithId(int? id)
Parameters
idint?
Returns
WithMaxValues(int?)
Maximum number of items that can be chosen, default 1 (max 25).
public MenuProperties WithMaxValues(int? maxValues)
Parameters
maxValuesint?
Returns
WithMinValues(int?)
Minimum number of items that must be chosen, default 1 (0-25).
public MenuProperties WithMinValues(int? minValues)
Parameters
minValuesint?
Returns
WithParentId(int?)
public MenuProperties WithParentId(int? parentId)
Parameters
parentIdint?
Returns
WithPlaceholder(string?)
Placeholder text if nothing is selected (max 150 characters).
public MenuProperties WithPlaceholder(string? placeholder)
Parameters
placeholderstring
Returns
WithRequired(bool?)
Whether the menu is required to answer in a modal. Defaults to true.
public MenuProperties WithRequired(bool? required = true)
Parameters
requiredbool?