Class ChannelMenuProperties
public class ChannelMenuProperties : EntityMenuProperties, IInteractiveComponentProperties, IMessageComponentProperties, IJsonSerializable<IMessageComponentProperties>, IComponentContainerComponentProperties, IJsonSerializable<IComponentContainerComponentProperties>, ILabelComponentProperties, IComponentProperties, IJsonSerializable<ILabelComponentProperties>
- Inheritance
-
ChannelMenuProperties
- Implements
- Inherited Members
Constructors
ChannelMenuProperties(string)
public ChannelMenuProperties(string customId)
Parameters
customIdstringID for the menu (max 100 characters).
Properties
ChannelTypes
List of channel types to include in the menu.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("channel_types")]
public IEnumerable<ChannelType>? ChannelTypes { get; set; }
Property Value
ComponentType
Type of the component.
public override ComponentType ComponentType { get; }
Property Value
DefaultValues
Default values for auto-populated select menu components.
[JsonConverter(typeof(ChannelMenuProperties.DefaultValuesConverter))]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("default_values")]
public IEnumerable<ulong>? DefaultValues { get; set; }
Property Value
Methods
AddChannelTypes(params IEnumerable<ChannelType>)
List of channel types to include in the menu.
public ChannelMenuProperties AddChannelTypes(params IEnumerable<ChannelType> channelTypes)
Parameters
channelTypesIEnumerable<ChannelType>
Returns
AddDefaultValues(params IEnumerable<ulong>)
Default values for auto-populated select menu components.
public ChannelMenuProperties AddDefaultValues(params IEnumerable<ulong> defaultValues)
Parameters
defaultValuesIEnumerable<ulong>
Returns
WithChannelTypes(IEnumerable<ChannelType>?)
List of channel types to include in the menu.
public ChannelMenuProperties WithChannelTypes(IEnumerable<ChannelType>? channelTypes)
Parameters
channelTypesIEnumerable<ChannelType>
Returns
WithCustomId(string)
Developer-defined identifier for the component (max 100 characters).
public ChannelMenuProperties WithCustomId(string customId)
Parameters
customIdstring
Returns
WithDefaultValues(IEnumerable<ulong>?)
Default values for auto-populated select menu components.
public ChannelMenuProperties WithDefaultValues(IEnumerable<ulong>? defaultValues)
Parameters
defaultValuesIEnumerable<ulong>
Returns
WithDisabled(bool)
Whether the menu is disabled.
public ChannelMenuProperties WithDisabled(bool disabled = true)
Parameters
disabledbool
Returns
WithId(int?)
Unique identifier for the component. Auto populated through increment if not provided.
public ChannelMenuProperties WithId(int? id)
Parameters
idint?
Returns
WithMaxValues(int?)
Maximum number of items that can be chosen, default 1 (max 25).
public ChannelMenuProperties WithMaxValues(int? maxValues)
Parameters
maxValuesint?
Returns
WithMinValues(int?)
Minimum number of items that must be chosen, default 1 (0-25).
public ChannelMenuProperties WithMinValues(int? minValues)
Parameters
minValuesint?
Returns
WithParentId(int?)
public ChannelMenuProperties WithParentId(int? parentId)
Parameters
parentIdint?
Returns
WithPlaceholder(string?)
Placeholder text if nothing is selected (max 150 characters).
public ChannelMenuProperties WithPlaceholder(string? placeholder)
Parameters
placeholderstring
Returns
WithRequired(bool?)
Whether the menu is required to answer in a modal. Defaults to true.
public ChannelMenuProperties WithRequired(bool? required = true)
Parameters
requiredbool?