v3.5.3 push 1

This commit is contained in:
DJj123dj
2024-01-27 20:32:27 +01:00
parent 9d96d11cd3
commit d03abd9eeb
28 changed files with 38 additions and 120 deletions
+1 -1
View File
@@ -43,7 +43,7 @@ exports.getDropdown = (ids,placeholder) => {
}else{
if (option.label) selectComponent.setLabel(option.label)
if (option.icon) selectComponent.setEmoji(option.icon)
if (option.description) selectComponent.setDescription(option.description)
if (option.description && option.description.length < 100) selectComponent.setDescription(option.description)
}
dropdown.addOptions(selectComponent)
-76
View File
@@ -134,80 +134,4 @@ exports.run = async (pluginData) => {
})
console.log(final.join("\n\n"))
}
var waitTime = new Date().getTime()
var waitTimeEnabled = false
/**@param {OTLiveStatusError} options @returns {Promise<Boolean>} */
const uploadLiveStatus = (options) => {
return new Promise((resolve,reject) => {
if (process.argv.some((v) => v == "--noerrorupload")) return resolve(true)
try {
var data = encodeURIComponent(JSON.stringify(options))
axios.get("https://livestatus.dj-dj.be/openticket?auth=openticketLIVESTATUS1234&data="+data).then((res) => {
if (res.status == 200) resolve(true)
else resolve(false)
})
}catch{
resolve(false)
}
})
}
/**@param {String} err @returns {Promise<Boolean>}*/
exports.liveStatusUploadManager = async (err) => {
return new Promise(async (resolve) => {
if (process.argv.some((v) => v == "--noerrorupload")) return resolve(true)
else{
var tsenabled = (bot.tsconfig.sendTranscripts.enableChannel || bot.tsconfig.sendTranscripts.enableDM)
var tsmode = bot.tsconfig.sendTranscripts.useHTMLtranscripts ? "html" : "text"
const transcriptMode = tsenabled ? tsmode : false
const slashMode = getSlashEnabled()
try {
if (waitTimeEnabled){
if (new Date().getTime() < waitTime){
waitTimeEnabled = false
return resolve(false)
}
}
const result = await uploadLiveStatus({
bot:{
id:client.user.id,
name:client.user.username,
pfp:client.user.displayAvatarURL()
},
error:err,
openticket:{
config:{
//TEMPORARY SOLUTION => AXIOS 414 ERROR!
//messages:config.messages,
//options:config.options,
//transcripts:bot.tsconfig,
//system:config.system
},
language:config.languageFile,
version:"3.5.2",
slashcmds:slashMode,
transcripts:transcriptMode,
plugins:fs.readdirSync("./plugins"),
pluginload:globalPluginData
},
details:{
errortime:new Date().getTime()
//TEMPORARY SOLUTION => AXIOS 414 ERROR!
//actions:this.actionRecorder,
//database:fs.readFileSync("./storage/database.json").toString()
}
})
if (!result){
waitTime = new Date().getTime()+30000
waitTimeEnabled = true
}
resolve(result)
}catch{resolve(false)}
}
})
}