diff --git a/src/commands/ticket.ts b/src/commands/ticket.ts index faab16c..40e2cc6 100644 --- a/src/commands/ticket.ts +++ b/src/commands/ticket.ts @@ -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})) }else{ //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}) if (!res.channel || !res.ticket){ //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})) }else{ //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}) if (!res.channel || !res.ticket){ //error @@ -264,7 +266,8 @@ export const registerModalResponders = async () => { }) //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}) if (!res.channel || !res.ticket){ //error diff --git a/src/core/startup/migration.ts b/src/core/startup/migration.ts index 45db853..63354fb 100644 --- a/src/core/startup/migration.ts +++ b/src/core/startup/migration.ts @@ -13,5 +13,11 @@ export const migrations = [ for (const panel of (await globalDatabase.getCategory("opendiscord:panel-update") ?? [])){ 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 () => {}) ] \ No newline at end of file