Interface IDiscordComponent
Represents a discord components API model. Docs: https://discord.com/developers/docs/interactions/message-components#component-object
Namespace: Color_Chan.Discord.Core.Common.Models
Assembly: Color-Chan.Discord.Core.dll
Syntax
public interface IDiscordComponent
Properties
| Improve this Doc View SourceButtonStyle
The style the button.
Declaration
DiscordButtonStyle? ButtonStyle { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<DiscordButtonStyle> |
ChildComponents
A list of child components.
Declaration
IEnumerable<IDiscordComponent> ChildComponents { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IDiscordComponent> |
CustomId
A developer-defined identifier for the button, max 100 characters.
Declaration
string CustomId { get; set; }
Property Value
Type | Description |
---|---|
String |
Disabled
Whether the button is disabled, default false
Declaration
bool? Disabled { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<Boolean> |
Emoji
Partial emoji data. Name, id, and animated.
Declaration
IDiscordEmoji Emoji { get; set; }
Property Value
Type | Description |
---|---|
IDiscordEmoji |
Label
Text that appears on the button, max 80 characters.
Declaration
string Label { get; set; }
Property Value
Type | Description |
---|---|
String |
MaxValues
The maximum number of items that can be chosen; default 1, max 25.
Declaration
int? MaxValues { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<Int32> |
MinValues
The minimum number of items that must be chosen; default 1, min 0, max 25.
Declaration
int? MinValues { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<Int32> |
Placeholder
Custom placeholder text if nothing is selected, max 100 characters.
Declaration
string Placeholder { get; set; }
Property Value
Type | Description |
---|---|
String |
SelectOptions
The choices in the select, max 25.
Declaration
List<IDiscordSelectOption> SelectOptions { get; set; }
Property Value
Type | Description |
---|---|
List<IDiscordSelectOption> |
Type
The component type.
Declaration
DiscordComponentType Type { get; set; }
Property Value
Type | Description |
---|---|
DiscordComponentType |
Url
Url for link-style buttons.
Declaration
string Url { get; set; }
Property Value
Type | Description |
---|---|
String |
Methods
| Improve this Doc View SourceToDataModel()
Converts the model back to a discord data model so that it can be send to discord.
Declaration
DiscordComponentData ToDataModel()
Returns
Type | Description |
---|---|
DiscordComponentData | The converted DiscordComponentData. |