diff --git a/packages/bot/src/transformers/interaction.ts b/packages/bot/src/transformers/interaction.ts index 8220e0024..c6f52eb8f 100644 --- a/packages/bot/src/transformers/interaction.ts +++ b/packages/bot/src/transformers/interaction.ts @@ -62,8 +62,8 @@ export const baseInteraction: InternalBot['transformers']['$inferredTypes']['int } if (!this.acknowledged) { - if (this.type !== InteractionTypes.MessageComponent) - throw new Error("This interaction has not been responded to yet and this isn't a MessageComponent interaction.") + if (this.type !== InteractionTypes.MessageComponent && this.type !== InteractionTypes.ModalSubmit) + throw new Error("This interaction has not been responded to yet and this isn't a MessageComponent or ModalSubmit interaction.") this.acknowledged = true return await this.bot.helpers.sendInteractionResponse( @@ -80,8 +80,8 @@ export const baseInteraction: InternalBot['transformers']['$inferredTypes']['int if (this.type === InteractionTypes.ApplicationCommandAutocomplete) throw new Error('Cannot edit an autocomplete interaction.') if (this.acknowledged) throw new Error('Cannot defer an already responded interaction.') - if (this.type !== InteractionTypes.MessageComponent) - throw new Error("Cannot defer to then edit an interaction that isn't a MessageComponent interaction.") + if (this.type !== InteractionTypes.MessageComponent && this.type !== InteractionTypes.ModalSubmit) + throw new Error("Cannot defer to then edit an interaction that isn't a MessageComponent or ModalSubmit interaction.") this.acknowledged = true return await this.bot.helpers.sendInteractionResponse(this.id, this.token, { type: InteractionResponseTypes.DeferredUpdateMessage }, options)