Increased HTML Transcript log level

This commit is contained in:
DJj123dj
2024-12-15 20:11:39 +01:00
parent bf13e15d56
commit 7646b3fc35
2 changed files with 15 additions and 4 deletions
+2
View File
@@ -246,6 +246,8 @@ export class ODTranscriptCollector {
}
}
}catch{}
//DEPRECATED WARNING!!! => msg.interaction might break in a future version of discord.js => required for slash command name
}else if (msg.interaction && msg.interaction.type == discord.InteractionType.ApplicationCommand){
//slash command reply
const member = await msg.guild.members.fetch(msg.interaction.user.id)
+13 -4
View File
@@ -448,15 +448,24 @@ export const loadAllTranscriptCompilers = async () => {
const req = new ODHTTPHtmlPostRequest("apis.dj-dj.be",htmlFinal)
const res = await req.run()
//check status
if (!res || res.status != 200 || !res.body){
if (res.status == 429) return {ticket,channel,user,success:false,errorReason:"Failed to upload HTML Transcripts due to Ratelimt! Try again in a few minutes!",messages,data:null}
else return {ticket,channel,user,success:false,errorReason:"Failed to upload HTML Transcripts!",messages,data:null}
//ratelimit error
if (res.status == 429) return {ticket,channel,user,success:false,errorReason:"Failed to upload HTML Transcripts! (Ratelimit)\nTry again in a few minutes!",messages,data:null}
//unknown status error
openticket.debugfile.writeNote("HTML Transcripts Error => status: "+res.status+", body:\n"+res.body)
return {ticket,channel,user,success:false,errorReason:"Failed to upload HTML Transcripts! (Unknown Error)",messages,data:null}
}
//check body
try{
var data: api.ODTranscriptHtmlV2Response = JSON.parse(res.body)
if (!data || data["status"] != "success") return {ticket,channel,user,success:false,errorReason:"Failed to upload HTML Transcripts! (Status: Error)",messages,data:null}
if (!data || data["status"] != "success"){
openticket.debugfile.writeNote("HTML Transcripts Error => status: "+res.status+", body:\n"+res.body)
return {ticket,channel,user,success:false,errorReason:"Failed to upload HTML Transcripts! (Server 500 Error)",messages,data:null}}
}catch{
return {ticket,channel,user,success:false,errorReason:"Failed to upload HTML Transcripts due to JSON parse error!",messages,data:null}
openticket.debugfile.writeNote("HTML Transcripts Error => status: "+res.status+", body:\n"+res.body)
return {ticket,channel,user,success:false,errorReason:"Failed to upload HTML Transcripts! (JSON parse error)",messages,data:null}
}
const url = "https://transcripts.dj-dj.be/v2/"+data.time+"_"+data.id+".html"