v3.4.0 push 2 (html transcripts v2)

This commit is contained in:
DJj123dj
2023-05-17 21:43:57 +02:00
parent fb6b891835
commit f608cb71ce
11 changed files with 649 additions and 106 deletions
+6 -5
View File
@@ -6,7 +6,7 @@ const tsconfig = bot.tsconfig
const tsembeds = require("../embeds")
const tsdb = require("../tsdb")
/**@typedef {{status:"success"|"error", id:String, time:Number, estimated:{lastdump: Number, processtime:Number}, transcriptstatus:{value:2, data:{fetchedmsgs:true, uploaded:true, inqueue:true, processed:false, waiting:false, available:false}}}} OTuploadResponse */
/**@typedef {{status:"success"|"error", id:String, time:Number, estimated:{lastdump: Number, processtime:Number,waittime:Number}, transcriptstatus:{value:2, data:{fetchedmsgs:true, uploaded:true, inqueue:true, processed:false, waiting:false, available:false}}}} OTuploadResponse */
/**
* @param {Object} json
@@ -17,12 +17,13 @@ exports.upload = async (json) => {
const data = encodeURIComponent(JSON.stringify(json))
try {
const res = await axios.get("https://api.transcripts.dj-dj.be/upload?auth=openticketTRANSCRIPT1234&version=1.0.0&data="+data)
const res = await axios.post("https://transcripts.dj-dj.be/api/upload?auth=openticketTRANSCRIPT1234&version=2",JSON.stringify(json))
//const res = await axios.get("https://transcripts.dj-dj.be/api/upload?auth=openticketTRANSCRIPT1234&version=2&data="+data)
if (res.status != 200) resolve(false)
resolve(res.data)
}catch{
console.log("failed transcript upload!")
}catch(err){
console.log("failed transcript upload!",err.response)
resolve(false)
}
})