Fixed: Unknown interaction when on cooldown
This commit is contained in:
@@ -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){
|
||||||
|
|||||||
@@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user