yor.ts / Exports / ComponentContext
BaseContext
↳ ComponentContext
• new 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. |
BaseContext.constructor
src/structures/Contexts/ComponentContext.ts:35
• Private
API: YorClientAPI
src/structures/Contexts/ComponentContext.ts:27
• Readonly
applicationId: string
src/structures/Contexts/ComponentContext.ts:21
• channel: Channel
src/structures/Contexts/ComponentContext.ts:23
• client: YorClient
BaseContext.client
• Readonly
interactionId: string
src/structures/Contexts/ComponentContext.ts:20
• member: undefined
| Member
src/structures/Contexts/ComponentContext.ts:25
• Readonly
raw: APIMessageComponentInteraction
src/structures/Contexts/ComponentContext.ts:19
• Readonly
token: string
src/structures/Contexts/ComponentContext.ts:22
• user: undefined
| User
src/structures/Contexts/ComponentContext.ts:24
▸ decorate(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.
BaseContext.decorate
src/structures/Contexts/BaseContext.ts:22
▸ defer(): Promise
<void
>
Defer a message update.
Promise
<void
>
A promise that resolves when the message update is deferred.
src/structures/Contexts/ComponentContext.ts:59
▸ editReply(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.
src/structures/Contexts/ComponentContext.ts:121
▸ followUp(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.
src/structures/Contexts/ComponentContext.ts:91
▸ isButton(): boolean
Determines if the element is a button.
boolean
true
if the element is a button, false
otherwise.src/structures/Contexts/ComponentContext.ts:139
▸ isChannelSelectMenu(): boolean
Checks if the component is a channel select menu.
boolean
src/structures/Contexts/ComponentContext.ts:157
▸ isMentionableSelectMenu(): boolean
Determines if the select menu is mentionable.
boolean
True if the select menu is mentionable, false otherwise.
src/structures/Contexts/ComponentContext.ts:166
▸ isRoleSelectMenu(): boolean
Determines if the function is a role select menu.
boolean
True if the function is a role select menu, false otherwise.
src/structures/Contexts/ComponentContext.ts:175
▸ isStringSelectMenu(): boolean
Determines if the select menu is of type string.
boolean
true if the select menu is of type string, false otherwise
src/structures/Contexts/ComponentContext.ts:148
▸ isUserSelectMenu(): boolean
Determines whether the component type of the raw data is a UserSelect.
boolean
true if the component type is UserSelect, false otherwise
src/structures/Contexts/ComponentContext.ts:184
▸ reply(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.
src/structures/Contexts/ComponentContext.ts:106
▸ update(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.
src/structures/Contexts/ComponentContext.ts:72
yor.ts / Exports / ComponentContext
BaseContext
↳ ComponentContext
• new 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. |
BaseContext.constructor
src/structures/Contexts/ComponentContext.ts:35
• Private
API: YorClientAPI
src/structures/Contexts/ComponentContext.ts:27
• Readonly
applicationId: string
src/structures/Contexts/ComponentContext.ts:21
• channel: Channel
src/structures/Contexts/ComponentContext.ts:23
• client: YorClient
BaseContext.client
• Readonly
interactionId: string
src/structures/Contexts/ComponentContext.ts:20
• member: undefined
| Member
src/structures/Contexts/ComponentContext.ts:25
• Readonly
raw: APIMessageComponentInteraction
src/structures/Contexts/ComponentContext.ts:19
• Readonly
token: string
src/structures/Contexts/ComponentContext.ts:22
• user: undefined
| User
src/structures/Contexts/ComponentContext.ts:24
▸ decorate(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.
BaseContext.decorate
src/structures/Contexts/BaseContext.ts:22
▸ defer(): Promise
<void
>
Defer a message update.
Promise
<void
>
A promise that resolves when the message update is deferred.
src/structures/Contexts/ComponentContext.ts:59
▸ editReply(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.
src/structures/Contexts/ComponentContext.ts:121
▸ followUp(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.
src/structures/Contexts/ComponentContext.ts:91
▸ isButton(): boolean
Determines if the element is a button.
boolean
true
if the element is a button, false
otherwise.src/structures/Contexts/ComponentContext.ts:139
▸ isChannelSelectMenu(): boolean
Checks if the component is a channel select menu.
boolean
src/structures/Contexts/ComponentContext.ts:157
▸ isMentionableSelectMenu(): boolean
Determines if the select menu is mentionable.
boolean
True if the select menu is mentionable, false otherwise.
src/structures/Contexts/ComponentContext.ts:166
▸ isRoleSelectMenu(): boolean
Determines if the function is a role select menu.
boolean
True if the function is a role select menu, false otherwise.
src/structures/Contexts/ComponentContext.ts:175
▸ isStringSelectMenu(): boolean
Determines if the select menu is of type string.
boolean
true if the select menu is of type string, false otherwise
src/structures/Contexts/ComponentContext.ts:148
▸ isUserSelectMenu(): boolean
Determines whether the component type of the raw data is a UserSelect.
boolean
true if the component type is UserSelect, false otherwise
src/structures/Contexts/ComponentContext.ts:184
▸ reply(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.
src/structures/Contexts/ComponentContext.ts:106
▸ update(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.
src/structures/Contexts/ComponentContext.ts:72