Skip to content

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

NameTypeDescription
data?BaseMessageComponent | BaseMessageComponentOptionsThe 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

NameTypeDescription
dataMessageComponentOptionsData for a MessageComponent
client?Client | WebhookClientClient constructing this component

Returns: MessageComponent \| ModalComponentSource

resolveType

static · private

resolveType(type: MessageComponentTypeResolvable): MessageComponentType

Resolves the type of a component Parameters

NameTypeDescription
typeMessageComponentTypeResolvableThe type to resolve

Returns: MessageComponentTypeSource

Unofficial software. Not affiliated with or supported by Discord.