Class UserMenuProperties
public class UserMenuProperties : EntityMenuProperties, IComponentProperties, IJsonSerializable
- Inheritance
-
UserMenuProperties
- Implements
- Inherited Members
Constructors
UserMenuProperties(string)
public UserMenuProperties(string customId)
Parameters
customId
string
Properties
ComponentType
Type of the component.
public override ComponentType ComponentType { get; }
Property Value
DefaultValues
Default values for auto-populated select menu components.
[JsonConverter(typeof(UserMenuProperties.DefaultValuesConverter))]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("default_values")]
public IEnumerable<ulong>? DefaultValues { get; set; }
Property Value
Methods
AddDefaultValues(params IEnumerable<ulong>)
Default values for auto-populated select menu components.
public UserMenuProperties AddDefaultValues(params IEnumerable<ulong> defaultValues)
Parameters
defaultValues
IEnumerable<ulong>
Returns
WithCustomId(string)
ID for the menu (max 100 characters).
public UserMenuProperties WithCustomId(string customId)
Parameters
customId
string
Returns
WithDefaultValues(IEnumerable<ulong>?)
Default values for auto-populated select menu components.
public UserMenuProperties WithDefaultValues(IEnumerable<ulong>? defaultValues)
Parameters
defaultValues
IEnumerable<ulong>
Returns
WithDisabled(bool)
Whether the menu is disabled.
public UserMenuProperties WithDisabled(bool disabled = true)
Parameters
disabled
bool
Returns
WithId(int?)
Unique identifier for the component. Auto populated through increment if not provided.
public UserMenuProperties WithId(int? id)
Parameters
id
int?
Returns
WithMaxValues(int?)
Maximum number of items that can be chosen, default 1 (max 25).
public UserMenuProperties WithMaxValues(int? maxValues)
Parameters
maxValues
int?
Returns
WithMinValues(int?)
Minimum number of items that must be chosen, default 1 (0-25).
public UserMenuProperties WithMinValues(int? minValues)
Parameters
minValues
int?
Returns
WithParentId(int?)
public UserMenuProperties WithParentId(int? parentId)
Parameters
parentId
int?
Returns
WithPlaceholder(string?)
Placeholder text if nothing is selected (max 150 characters).
public UserMenuProperties WithPlaceholder(string? placeholder)
Parameters
placeholder
string
Returns
WriteTo(Utf8JsonWriter)
public override void WriteTo(Utf8JsonWriter writer)
Parameters
writer
Utf8JsonWriter