BaseContext
↳ ComponentContext
client
, data
): ComponentContext
Creates a new instance of the constructor.
Name | Type | Description |
---|---|---|
client | YorClient | The client object. |
data | APIMessageComponentInteraction | The data for the constructor. |
ComponentContext
Private
API: YorClientAPI
Readonly
applicationId: string
Channel
YorClient
Readonly
interactionId: string
undefined
| Member
Readonly
raw: APIMessageComponentInteraction
Readonly
token: string
undefined
| User
name
, data
): unknown
Decorates the object with a new property.
Name | Type | Description |
---|---|---|
name | string | The name of the property. |
data | unknown | The data to assign to the property. |
unknown
The decorated object.
Promise
<void
>
Defer a message update.
Promise
<void
>
A promise that resolves when the message update is deferred.
data
): Promise
<APIMessage
>
Calls the editReply
method of the API with the provided data.
Name | Type | Description |
---|---|---|
data | Omit <RESTPostAPIWebhookWithTokenJSONBody , "username" | "avatar_url" > & { flags? : MessageFlags } & { files? : RawFile [] } | The data to be passed to the editReply method. |
Promise
<APIMessage
>
A promise that resolves to the response from the editReply
method.
data
): Promise
<APIMessage
>
Calls the followUp
method of the API with the provided data.
Name | Type | Description |
---|---|---|
data | Omit <RESTPostAPIWebhookWithTokenJSONBody , "username" | "avatar_url" > & { flags? : MessageFlags } & { files? : RawFile [] } | The data to be passed to the followUp method. |
Promise
<APIMessage
>
A promise that resolves to the response from the followUp
method.
boolean
Determines if the element is a button.
boolean
true
if the element is a button, false
otherwise.boolean
Checks if the component is a channel select menu.
boolean
boolean
Determines if the select menu is mentionable.
boolean
True if the select menu is mentionable, false otherwise.
boolean
Determines if the function is a role select menu.
boolean
True if the function is a role select menu, false otherwise.
boolean
Determines if the select menu is of type string.
boolean
true if the select menu is of type string, false otherwise
boolean
Determines whether the component type of the raw data is a UserSelect.
boolean
true if the component type is UserSelect, false otherwise
data
): Promise
<void
>
Reply to a message.
Name | Type | Description |
---|---|---|
data | Omit <RESTPostAPIWebhookWithTokenJSONBody , "username" | "avatar_url" > & { flags? : MessageFlags } & { files? : RawFile [] } | The data to reply with. |
Promise
<void
>
A promise that resolves when the reply is sent.
data
): Promise
<void
>
Updates the message using the provided data.
Name | Type | Description |
---|---|---|
data | Omit <RESTPostAPIWebhookWithTokenJSONBody , "username" | "avatar_url" > & { flags? : MessageFlags } & { files? : RawFile [] } | The updated message data. |
Promise
<void
>
A promise that resolves when the update is complete.