#155 : Fixed reply on creation when disabled.

Fixed a bug that caused the bot to send a partial ephemeral message while "replyOnTicketCreation" was disabled.
This commit is contained in:
DJj123dj
2025-04-28 18:22:54 +02:00
parent 4efa165949
commit e8eb52e00b
2 changed files with 13 additions and 4 deletions
+6 -3
View File
@@ -142,7 +142,8 @@ export const registerButtonResponders = async () => {
instance.modal(await opendiscord.builders.modals.getSafe("opendiscord:ticket-questions").build("panel-button",{guild,channel,user,option})) instance.modal(await opendiscord.builders.modals.getSafe("opendiscord:ticket-questions").build("panel-button",{guild,channel,user,option}))
}else{ }else{
//create ticket //create ticket
await instance.defer("reply",true) await instance.defer((generalConfig.data.system.replyOnTicketCreation) ? "reply" : "update",true)
const res = await opendiscord.actions.get("opendiscord:create-ticket").run("panel-button",{guild,user,answers:[],option}) const res = await opendiscord.actions.get("opendiscord:create-ticket").run("panel-button",{guild,user,answers:[],option})
if (!res.channel || !res.ticket){ if (!res.channel || !res.ticket){
//error //error
@@ -196,7 +197,8 @@ export const registerDropdownResponders = async () => {
instance.modal(await opendiscord.builders.modals.getSafe("opendiscord:ticket-questions").build("panel-dropdown",{guild,channel,user,option})) instance.modal(await opendiscord.builders.modals.getSafe("opendiscord:ticket-questions").build("panel-dropdown",{guild,channel,user,option}))
}else{ }else{
//create ticket //create ticket
await instance.defer("reply",true) await instance.defer((generalConfig.data.system.replyOnTicketCreation) ? "reply" : "update",true)
const res = await opendiscord.actions.get("opendiscord:create-ticket").run("panel-dropdown",{guild,user,answers:[],option}) const res = await opendiscord.actions.get("opendiscord:create-ticket").run("panel-dropdown",{guild,user,answers:[],option})
if (!res.channel || !res.ticket){ if (!res.channel || !res.ticket){
//error //error
@@ -264,7 +266,8 @@ export const registerModalResponders = async () => {
}) })
//create ticket //create ticket
await instance.defer("reply",true) await instance.defer((generalConfig.data.system.replyOnTicketCreation) ? "reply" : "update",true)
const res = await opendiscord.actions.get("opendiscord:create-ticket").run(originalSource,{guild,user,answers,option}) const res = await opendiscord.actions.get("opendiscord:create-ticket").run(originalSource,{guild,user,answers,option})
if (!res.channel || !res.ticket){ if (!res.channel || !res.ticket){
//error //error
+7 -1
View File
@@ -13,5 +13,11 @@ export const migrations = [
for (const panel of (await globalDatabase.getCategory("opendiscord:panel-update") ?? [])){ for (const panel of (await globalDatabase.getCategory("opendiscord:panel-update") ?? [])){
globalDatabase.set("opendiscord:panel-message",panel.key,panel.value) globalDatabase.set("opendiscord:panel-message",panel.key,panel.value)
} }
}) }),
//MIGRATE TO v4.0.2
new utilities.ODVersionMigration(api.ODVersion.fromString("opendiscord:version","v4.0.2"),async () => {},async () => {}),
//MIGRATE TO v4.0.3
new utilities.ODVersionMigration(api.ODVersion.fromString("opendiscord:version","v4.0.3"),async () => {},async () => {})
] ]