Skip to content

Commit

Permalink
fix: missing messagepayload entry
Browse files Browse the repository at this point in the history
  • Loading branch information
thewilloftheshadow committed Sep 21, 2024
1 parent 63a6d07 commit 546ac8c
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions packages/carbon/src/internals/ModalInteraction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ import {
Routes
} from "discord-api-types/v10"
import { BaseInteraction } from "../abstracts/BaseInteraction.js"
import type {
InteractionReplyData,
InteractionReplyOptions
} from "../abstracts/BaseInteraction.js"
import type { InteractionReplyOptions } from "../abstracts/BaseInteraction.js"
import type { Client, InteractionDefaults } from "../index.js"
import { FieldsHandler } from "./FieldsHandler.js"
import type { MessagePayload } from "../types.js"
import { serializePayload } from "../utils.js"

export class ModalInteraction extends BaseInteraction<APIModalSubmitInteraction> {
customId: string
Expand Down Expand Up @@ -48,18 +47,17 @@ export class ModalInteraction extends BaseInteraction<APIModalSubmitInteraction>
* This can only be used for modals triggered from components
*/
async update(
data: InteractionReplyData,
data: MessagePayload,
options: Pick<InteractionReplyOptions, "files"> = {}
) {
const serialized = serializePayload(data)
await this.client.rest.post(
Routes.interactionCallback(this.rawData.id, this.rawData.token),
{
body: {
type: InteractionResponseType.UpdateMessage,
data: {
...data,
embeds: data.embeds?.map((embed) => embed.serialize()),
components: data.components?.map((row) => row.serialize())
...serialized
}
} as RESTPostAPIInteractionCallbackJSONBody,
files: options.files
Expand Down

0 comments on commit 546ac8c

Please sign in to comment.