Yor.ts | classes/ModalContext
yor.ts / Exports / ModalContext
Class: ModalContext
Hierarchy
-
BaseContext
↳
ModalContext
Table of contents
Constructors
Properties
Methods
Constructors
constructor
• new ModalContext(client
, data
): ModalContext
Initializes a new instance of the constructor.
Parameters
Name | Type | Description |
---|---|---|
client | YorClient | The client object. |
data | APIModalSubmitInteraction | The data to initialize the instance with. |
Returns
Overrides
BaseContext.constructor
Defined in
src/structures/Contexts/ModalContext.ts:42
Properties
API
• Private
API: YorClientAPI
Defined in
src/structures/Contexts/ModalContext.ts:34
applicationId
• Readonly
applicationId: string
Defined in
src/structures/Contexts/ModalContext.ts:26
channel
• channel: undefined
| Channel
Defined in
src/structures/Contexts/ModalContext.ts:30
client
• client: YorClient
Inherited from
BaseContext.client
Defined in
components
• components: ModalSubmitActionRowComponent
[]
Defined in
src/structures/Contexts/ModalContext.ts:29
customId
• Readonly
customId: string
Defined in
src/structures/Contexts/ModalContext.ts:24
interactionId
• Readonly
interactionId: string
Defined in
src/structures/Contexts/ModalContext.ts:25
member
• member: undefined
| Member
Defined in
src/structures/Contexts/ModalContext.ts:32
raw
• Readonly
raw: APIModalSubmitInteraction
Defined in
src/structures/Contexts/ModalContext.ts:22
token
• Readonly
token: string
Defined in
src/structures/Contexts/ModalContext.ts:27
user
• user: undefined
| User
Defined in
src/structures/Contexts/ModalContext.ts:31
Methods
decorate
▸ decorate(name
, data
): unknown
Decorates the object with a new property.
Parameters
Name | Type | Description |
---|---|---|
name | string | The name of the property. |
data | unknown | The data to assign to the property. |
Returns
unknown
The decorated object.
Inherited from
BaseContext.decorate
Defined in
src/structures/Contexts/BaseContext.ts:22
defer
▸ defer(ephemeral?
): Promise
<void
>
Defers the execution of the function.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
ephemeral | boolean | false | Whether the message is ephemeral or not. |
Returns
Promise
<void
>
A promise that resolves when the deferral is complete.
Defined in
src/structures/Contexts/ModalContext.ts:82
deleteReply
▸ deleteReply(): Promise
<void
>
Deletes a reply.
Returns
Promise
<void
>
A promise that resolves when the reply is deleted.
Defined in
src/structures/Contexts/ModalContext.ts:151
editReply
▸ editReply(data
): Promise
<APIMessage
>
Edits a reply.
Parameters
Name | Type | Description |
---|---|---|
data | Omit <RESTPostAPIWebhookWithTokenJSONBody , "username" | "avatar_url" > & { flags? : MessageFlags } & { files? : RawFile [] } | The data for editing the reply. |
Returns
Promise
<APIMessage
>
A promise that resolves when the reply is edited.
Defined in
src/structures/Contexts/ModalContext.ts:125
fetchReply
▸ fetchReply(): Promise
<APIMessage
>
Fetches the reply asynchronously.
Returns
Promise
<APIMessage
>
A promise that resolves when the original reply is fetched.
Defined in
src/structures/Contexts/ModalContext.ts:160
followUp
▸ followUp(data
): Promise
<APIMessage
>
Calls the followUp method of the API class with the provided data.
Parameters
Name | Type | Description |
---|---|---|
data | Omit <RESTPostAPIWebhookWithTokenJSONBody , "username" | "avatar_url" > & { flags? : MessageFlags } & { files? : RawFile [] } | The data to be passed to the followUp method. |
Returns
Promise
<APIMessage
>
A promise that resolves to an APIMessage object.
Defined in
src/structures/Contexts/ModalContext.ts:173
isFromMessage
▸ isFromMessage(): boolean
Determines if the function is from a message.
Returns
boolean
Returns true if the function is from a message, otherwise false.
Defined in
src/structures/Contexts/ModalContext.ts:72
reply
▸ reply(data
): Promise
<void
>
Replies to an interaction.
Parameters
Name | Type | Description |
---|---|---|
data | Omit <RESTPostAPIWebhookWithTokenJSONBody , "username" | "avatar_url" > & { flags? : MessageFlags } & { files? : RawFile [] } | The data for creating the reply. |
Returns
Promise
<void
>
A promise that resolves when the reply is sent.
Defined in
Was this page helpful?