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
ModalContext
Overrides
BaseContext.constructorDefined in
src/structures/Contexts/ModalContext.ts:42Properties
API
•Private
API: YorClientAPI
Defined in
src/structures/Contexts/ModalContext.ts:34applicationId
•Readonly
applicationId: string
Defined in
src/structures/Contexts/ModalContext.ts:26channel
• channel:undefined
| Channel
Defined in
src/structures/Contexts/ModalContext.ts:30client
• client:YorClient
Inherited from
BaseContext.clientDefined in
src/structures/Base.ts:4components
• components:ModalSubmitActionRowComponent
[]
Defined in
src/structures/Contexts/ModalContext.ts:29customId
•Readonly
customId: string
Defined in
src/structures/Contexts/ModalContext.ts:24interactionId
•Readonly
interactionId: string
Defined in
src/structures/Contexts/ModalContext.ts:25member
• member:undefined
| Member
Defined in
src/structures/Contexts/ModalContext.ts:32raw
•Readonly
raw: APIModalSubmitInteraction
Defined in
src/structures/Contexts/ModalContext.ts:22token
•Readonly
token: string
Defined in
src/structures/Contexts/ModalContext.ts:27user
• user:undefined
| User
Defined in
src/structures/Contexts/ModalContext.ts:31Methods
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.decorateDefined in
src/structures/Contexts/BaseContext.ts:22defer
▸ 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:82deleteReply
▸ 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:151editReply
▸ 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:125fetchReply
▸ 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:160followUp
▸ 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:173isFromMessage
▸ 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:72reply
▸ 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.