Fixed: Unknown interaction when on cooldown

This commit is contained in:
DJj123dj
2026-02-06 21:16:30 +01:00
parent db94f226fb
commit b972c97871
2 changed files with 11 additions and 7 deletions
+8 -4
View File
@@ -426,7 +426,8 @@ export class ODCommandResponderInstance {
/**Show a modal as reply to this command. */
async modal(modal:ODModalBuildResult){
if (this.type != "interaction" || !(this.interaction instanceof discord.ChatInputCommandInteraction)) return false
this.interaction.showModal(modal.modal)
if (this.interaction.deferred || this.interaction.replied) return false
await this.interaction.showModal(modal.modal)
this.didReply = true
return true
}
@@ -601,7 +602,8 @@ export class ODButtonResponderInstance {
}
/**Show a modal as reply to this button. */
async modal(modal:ODModalBuildResult){
this.interaction.showModal(modal.modal)
if (this.interaction.deferred || this.interaction.replied) return false
await this.interaction.showModal(modal.modal)
this.didReply = true
return true
}
@@ -889,7 +891,8 @@ export class ODDropdownResponderInstance {
}
/**Show a modal as reply to this dropdown. */
async modal(modal:ODModalBuildResult){
this.interaction.showModal(modal.modal)
if (this.interaction.deferred || this.interaction.replied) return false
await this.interaction.showModal(modal.modal)
this.didReply = true
return true
}
@@ -1261,7 +1264,8 @@ export class ODContextMenuResponderInstance {
}
/**Show a modal as reply to this context menu. */
async modal(modal:ODModalBuildResult){
this.interaction.showModal(modal.modal)
if (this.interaction.deferred || this.interaction.replied) return false
await this.interaction.showModal(modal.modal)
this.didReply = true
return true
}