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 //create transcript
if (!params.withoutTranscript){ if (!params.withoutTranscript){
const transcriptRes = await openticket.actions.get("openticket:create-transcript").run(source,{guild,channel,user,ticket}) 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){ if (typeof transcriptRes.success == "boolean" && !transcriptRes.success && transcriptRes.compiler){
const {compiler} = transcriptRes 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) 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 //undo deletion
ticket.get("openticket:for-deletion").value = false ticket.get("openticket:for-deletion").value = false
@@ -83,7 +85,7 @@ export const registerActions = async () => {
const {guild,channel,user,ticket,reason} = params const {guild,channel,user,ticket,reason} = params
//delete channel & events //delete channel & events
await openticket.events.get("onTicketChannelDeletion").emit([ticket,channel,user]) 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]) await openticket.events.get("afterTicketChannelDeleted").emit([ticket,user])
//delete permissions from manager //delete permissions from manager
+2 -2
View File
@@ -73,7 +73,7 @@ export class ODConsoleMessage {
}) })
const pstring = (pstrings.length > 0) ? " ("+pstrings.join(", ")+")" : "" const pstring = (pstrings.length > 0) ? " ("+pstrings.join(", ")+")" : ""
const date = new Date() 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}` return `[${dstring} ${this.prefix}] ${this.message}${pstring}`
} }
/**Render the parameters of this message in a specific color. */ /**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) */ /**Generate the stats/header of the debug file (containing the version) */
#createStatsText(){ #createStatsText(){
const date = new Date() 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 [ return [
"=========================", "=========================",
"OPEN TICKET DEBUG FILE:", "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) => { openticket.transcripts.add(new api.ODTranscriptCompiler<{contents:string}>("openticket:text-compiler",undefined,async (ticket,channel,user) => {
//COMPILE //COMPILE
const rawMessages = await collector.collectAllMessages(ticket) 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 messages = await collector.convertMessagesToTranscriptData(rawMessages)
const finalMessages: string[] = [] const finalMessages: string[] = []
@@ -195,7 +195,7 @@ export const loadAllTranscriptCompilers = async () => {
},async (ticket,channel,user) => { },async (ticket,channel,user) => {
//COMPILE //COMPILE
const rawMessages = await collector.collectAllMessages(ticket) 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 messages = await collector.convertMessagesToTranscriptData(rawMessages)
const htmlMessages: api.ODTranscriptHtmlV2Data["messages"] = [] const htmlMessages: api.ODTranscriptHtmlV2Data["messages"] = []
+1
View File
@@ -22,6 +22,7 @@
============ ============
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 discord: https://discord.dj-dj.be
website: https://openticket.dj-dj.be website: https://openticket.dj-dj.be
github: https://otgithub.dj-dj.be github: https://otgithub.dj-dj.be
+20
View File
@@ -38,5 +38,25 @@
"usingTextTranscripts":true, "usingTextTranscripts":true,
"usingHtmlTranscripts":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
}
} }
] ]