Table of Contents

Class MenuProperties

Namespace
NetCord.Rest
Assembly
NetCord.dll
public abstract class MenuProperties : IComponentProperties
Inheritance
MenuProperties
Implements
Derived
Inherited Members

Constructors

MenuProperties(string)

protected MenuProperties(string customId)

Parameters

customId string

ID for the menu (max 100 characters).

Properties

ComponentType

Type of the component.

[JsonPropertyName("type")]
public abstract ComponentType ComponentType { get; }

Property Value

ComponentType

CustomId

ID for the menu (max 100 characters).

[JsonPropertyName("custom_id")]
public string CustomId { get; set; }

Property Value

string

Disabled

Whether the menu is disabled.

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
[JsonPropertyName("disabled")]
public bool Disabled { get; set; }

Property Value

bool

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

string

Methods

WithCustomId(string)

ID for the menu (max 100 characters).

public MenuProperties WithCustomId(string customId)

Parameters

customId string

Returns

MenuProperties

WithDisabled(bool)

Whether the menu is disabled.

public MenuProperties WithDisabled(bool disabled = true)

Parameters

disabled bool

Returns

MenuProperties

WithId(int?)

public MenuProperties WithId(int? id)

Parameters

id int?

Returns

MenuProperties

WithMaxValues(int?)

Maximum number of items that can be chosen, default 1 (max 25).

public MenuProperties WithMaxValues(int? maxValues)

Parameters

maxValues int?

Returns

MenuProperties

WithMinValues(int?)

Minimum number of items that must be chosen, default 1 (0-25).

public MenuProperties WithMinValues(int? minValues)

Parameters

minValues int?

Returns

MenuProperties

WithParentId(int?)

public MenuProperties WithParentId(int? parentId)

Parameters

parentId int?

Returns

MenuProperties

WithPlaceholder(string?)

Placeholder text if nothing is selected (max 150 characters).

public MenuProperties WithPlaceholder(string? placeholder)

Parameters

placeholder string

Returns

MenuProperties