#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:
@@ -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
|
||||||
|
|||||||
@@ -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 () => {})
|
||||||
]
|
]
|
||||||
Reference in New Issue
Block a user