This commit is contained in:
DJj123dj
2023-08-11 11:22:25 +02:00
parent bf7a003799
commit 589bbe5cd5
29 changed files with 145 additions and 38 deletions
+16 -10
View File
@@ -3,6 +3,9 @@ const bot = require("../../index")
const log = bot.errorLog.log
module.exports = () => {
const args = process.argv
const debugMode = args.includes("--debug")
const files = fs.readdirSync("./plugins")
const api = require("./api.json")
var totalcount = 0
@@ -11,27 +14,30 @@ module.exports = () => {
files.forEach((file) => {
if (file.endsWith(".plugin.js")){
try {
require("../../plugins/"+file)()
require("../../plugins/" + file)()
successcount++
totalcount++
}catch(err){
/**@type {Error} */
const theError = err
if (api.enableAPIdebug){
try {
const data = fs.readFileSync("./apiDebug.txt")
const newData = data ? data.toString() : ""
fs.writeFileSync("./apiDebug.txt",newData+"ERROR: "+theError.name+": "+theError.message+"\n"+theError.stack+"\n\n")
}catch{
fs.writeFileSync("./apiDebug.txt","ERROR: "+theError.name+": "+theError.message+"\n"+theError.stack+"\n\n")
}
if (api.enableAPIdebug || debugMode) {
console.error(theError)
}
try {
const data = fs.readFileSync("./openticketdebug.txt")
const newData = data ? data.toString() : ""
fs.writeFileSync("./openticketdebug.txt", newData + "\nPLUGIN "+file+" ERROR: " + theError.name + ": " + theError.message + "\n" + theError.stack + "\n\n")
} catch {
fs.writeFileSync("./openticketdebug.txt", "\nPLUGIN "+file+" ERROR: " + theError.name + ": " + theError.message + "\n" + theError.stack + "\n\n")
}
failcount++
totalcount++
}
}
})
require("../startscreen").headerDataPlugins({total:totalcount,success:successcount,error:failcount})
require("../startscreen").headerDataPlugins({ total: totalcount, success: successcount, error: failcount })
}
+1 -1
View File
@@ -427,7 +427,7 @@ exports.checker = async () => {
checkType(config.languageFile,"string","languagefile")
const lf = config.languageFile
if (!lf.startsWith("custom") && !lf.startsWith("english") && !lf.startsWith("dutch") && !lf.startsWith("romanian") && !lf.startsWith("german") && !lf.startsWith("arabic") && !lf.startsWith("spanish") && !lf.startsWith("portuguese") && !lf.startsWith("french") && !lf.startsWith("italian") && !lf.startsWith("czech") && !lf.startsWith("danish") && !lf.startsWith("russian") && !lf.startsWith("turkish") && !lf.startsWith("polish") && !lf.startsWith("slovenian") && !lf.startsWith("thai") && !lf.startsWith("norwegian") && !lf.startsWith("greek") && !lf.startsWith("ukrainian")){
if (!lf.startsWith("custom") && !lf.startsWith("english") && !lf.startsWith("dutch") && !lf.startsWith("romanian") && !lf.startsWith("german") && !lf.startsWith("arabic") && !lf.startsWith("spanish") && !lf.startsWith("portuguese") && !lf.startsWith("french") && !lf.startsWith("italian") && !lf.startsWith("czech") && !lf.startsWith("danish") && !lf.startsWith("russian") && !lf.startsWith("turkish") && !lf.startsWith("polish") && !lf.startsWith("slovenian") && !lf.startsWith("thai") && !lf.startsWith("norwegian") && !lf.startsWith("greek") && !lf.startsWith("ukrainian") && !lf.startsWith("hungarian")){
createError("'languagefile' | invalid language, more info in the wiki")
}
+1 -1
View File
@@ -189,7 +189,7 @@ exports.liveStatusUploadManager = async (err) => {
//system:config.system
},
language:config.languageFile,
version:"3.4.1",
version:"3.4.2",
slashcmds:slashMode,
transcripts:transcriptMode,
plugins:fs.readdirSync("./plugins"),