mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 16:57:22 +00:00
Allow edit and deferEdit on modal submit interaction (#4053)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user