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
+3 -3
View File
@@ -56,7 +56,7 @@ export const registerCommandResponders = async () => {
} }
//check ticket permissions //check ticket permissions
if (!checkTicketCreationPerms(instance,source,guild,user,option)) return cancel() if (!(await checkTicketCreationPerms(instance,source,guild,user,option))) return cancel()
//start ticket creation //start ticket creation
if (option.exists("opendiscord:questions") && option.get("opendiscord:questions").value.length > 0){ if (option.exists("opendiscord:questions") && option.get("opendiscord:questions").value.length > 0){
@@ -107,7 +107,7 @@ export const registerButtonResponders = async () => {
} }
//check ticket permissions //check ticket permissions
if (!checkTicketCreationPerms(instance,"panel-button",guild,user,option)) return cancel() if (!(await checkTicketCreationPerms(instance,"panel-button",guild,user,option))) return cancel()
//start ticket creation //start ticket creation
if (option.exists("opendiscord:questions") && option.get("opendiscord:questions").value.length > 0){ if (option.exists("opendiscord:questions") && option.get("opendiscord:questions").value.length > 0){
@@ -151,7 +151,7 @@ export const registerDropdownResponders = async () => {
} }
//check ticket permissions //check ticket permissions
if (!checkTicketCreationPerms(instance,"panel-dropdown",guild,user,option)) return cancel() if (!(await checkTicketCreationPerms(instance,"panel-dropdown",guild,user,option))) return cancel()
//start ticket creation //start ticket creation
if (option.exists("opendiscord:questions") && option.get("opendiscord:questions").value.length > 0){ if (option.exists("opendiscord:questions") && option.get("opendiscord:questions").value.length > 0){
+8 -4
View File
@@ -426,7 +426,8 @@ export class ODCommandResponderInstance {
/**Show a modal as reply to this command. */ /**Show a modal as reply to this command. */
async modal(modal:ODModalBuildResult){ async modal(modal:ODModalBuildResult){
if (this.type != "interaction" || !(this.interaction instanceof discord.ChatInputCommandInteraction)) return false 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 this.didReply = true
return true return true
} }
@@ -601,7 +602,8 @@ export class ODButtonResponderInstance {
} }
/**Show a modal as reply to this button. */ /**Show a modal as reply to this button. */
async modal(modal:ODModalBuildResult){ 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 this.didReply = true
return true return true
} }
@@ -889,7 +891,8 @@ export class ODDropdownResponderInstance {
} }
/**Show a modal as reply to this dropdown. */ /**Show a modal as reply to this dropdown. */
async modal(modal:ODModalBuildResult){ 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 this.didReply = true
return true return true
} }
@@ -1261,7 +1264,8 @@ export class ODContextMenuResponderInstance {
} }
/**Show a modal as reply to this context menu. */ /**Show a modal as reply to this context menu. */
async modal(modal:ODModalBuildResult){ 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 this.didReply = true
return true return true
} }