Fixed small bugs

This commit is contained in:
DJj123dj
2025-01-25 14:06:41 +01:00
parent 04789d5426
commit 213ec32225
5 changed files with 29 additions and 6 deletions
+3 -1
View File
@@ -40,9 +40,11 @@ export const registerActions = async () => {
//create transcript
if (!params.withoutTranscript){
const transcriptRes = await openticket.actions.get("openticket:create-transcript").run(source,{guild,channel,user,ticket})
//transcript failure
if (typeof transcriptRes.success == "boolean" && !transcriptRes.success && transcriptRes.compiler){
const {compiler} = transcriptRes
await channel.send((await openticket.builders.messages.getSafe("openticket:transcript-error").build(source,{guild,channel,user,ticket,compiler,reason:transcriptRes.errorReason ?? null})).message)
.catch((reason) => openticket.log("Unable to send transcript failure to ticket channel!","error",[{key:"id",value:channel.id}]))
//undo deletion
ticket.get("openticket:for-deletion").value = false
@@ -83,7 +85,7 @@ export const registerActions = async () => {
const {guild,channel,user,ticket,reason} = params
//delete channel & events
await openticket.events.get("onTicketChannelDeletion").emit([ticket,channel,user])
await channel.delete("Ticket Deleted")
await channel.delete("Ticket Deleted").catch((reason) => openticket.log("Unable to delete ticket channel!","error",[{key:"id",value:channel.id}]))
await openticket.events.get("afterTicketChannelDeleted").emit([ticket,user])
//delete permissions from manager
+2 -2
View File
@@ -73,7 +73,7 @@ export class ODConsoleMessage {
})
const pstring = (pstrings.length > 0) ? " ("+pstrings.join(", ")+")" : ""
const date = new Date()
const dstring = `${date.getDate()}/${date.getMonth()}/${date.getFullYear()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`
const dstring = `${date.getDate()}/${date.getMonth()+1}/${date.getFullYear()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`
return `[${dstring} ${this.prefix}] ${this.message}${pstring}`
}
/**Render the parameters of this message in a specific color. */
@@ -348,7 +348,7 @@ export class ODDebugFileManager {
/**Generate the stats/header of the debug file (containing the version) */
#createStatsText(){
const date = new Date()
const dstring = `${date.getDate()}/${date.getMonth()}/${date.getFullYear()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`
const dstring = `${date.getDate()}/${date.getMonth()+1}/${date.getFullYear()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`
return [
"=========================",
"OPEN TICKET DEBUG FILE:",
+2 -2
View File
@@ -47,7 +47,7 @@ export const loadAllTranscriptCompilers = async () => {
openticket.transcripts.add(new api.ODTranscriptCompiler<{contents:string}>("openticket:text-compiler",undefined,async (ticket,channel,user) => {
//COMPILE
const rawMessages = await collector.collectAllMessages(ticket)
if (!rawMessages) return {ticket,channel,user,success:false,errorReason:"Unable to collect messages!",messages:null,data:null}
if (!rawMessages) return {ticket,channel,user,success:false,errorReason:"Unable to collect messages! Channel not found!",messages:null,data:null}
const messages = await collector.convertMessagesToTranscriptData(rawMessages)
const finalMessages: string[] = []
@@ -195,7 +195,7 @@ export const loadAllTranscriptCompilers = async () => {
},async (ticket,channel,user) => {
//COMPILE
const rawMessages = await collector.collectAllMessages(ticket)
if (!rawMessages) return {ticket,channel,user,success:false,errorReason:"Unable to collect messages!",messages:null,data:null}
if (!rawMessages) return {ticket,channel,user,success:false,errorReason:"Unable to collect messages! Channel not found!",messages:null,data:null}
const messages = await collector.convertMessagesToTranscriptData(rawMessages)
const htmlMessages: api.ODTranscriptHtmlV2Data["messages"] = []
+2 -1
View File
@@ -20,8 +20,9 @@
INFORMATION:
============
Open Ticket v4.0.0 - © DJdj Development
Open Ticket v4.0.0 - © DJdj Development
support us: https://github.com/sponsors/DJj123dj
discord: https://discord.dj-dj.be
website: https://openticket.dj-dj.be
github: https://otgithub.dj-dj.be
+20
View File
@@ -38,5 +38,25 @@
"usingTextTranscripts":true,
"usingHtmlTranscripts":true
}
},
{
"message":{
"title":"Support Us",
"titleColor":"magenta",
"description":"Support our development at https://github.com/sponsors/DJj123dj/",
"descriptionColor":"normal"
},
"active":{
"versions":["4.0.0"],
"languages":[],
"allLanguages":true,
"usingPlugins":true,
"notUsingPlugins":true,
"usingSlashCommands":true,
"notUsingSlashCommands":true,
"notUsingTranscripts":true,
"usingTextTranscripts":true,
"usingHtmlTranscripts":true
}
}
]