BaseMessageComponent
classe · Source
Represents an interactive component of a Message or Modal. It should not be necessary to construct this directly. See MessageComponent
Constructor
new BaseMessageComponent(data?: BaseMessageComponent | BaseMessageComponentOptions)
Parameters
| Name | Type | Description |
|---|---|---|
data? | BaseMessageComponent | BaseMessageComponentOptions | The options for this component Default: {}. |
Properties
type
nullable
type: MessageComponentType
The type of this component Source
data
data: MessageComponentOptions
The data for this component Source
id
readonly
id: number
The id of this component Source
Methods
create
static · private
create(data: MessageComponentOptions, client?: Client | WebhookClient): MessageComponent | ModalComponent
Constructs a component based on the type of the incoming data Parameters
| Name | Type | Description |
|---|---|---|
data | MessageComponentOptions | Data for a MessageComponent |
client? | Client | WebhookClient | Client constructing this component |
Returns: MessageComponent \| ModalComponentSource
resolveType
static · private
resolveType(type: MessageComponentTypeResolvable): MessageComponentType
Resolves the type of a component Parameters
| Name | Type | Description |
|---|---|---|
type | MessageComponentTypeResolvable | The type to resolve |
Returns: MessageComponentTypeSource