v2.4.0 push 2 (first working api)

This commit is contained in:
DJj123dj
2022-07-26 14:51:51 +02:00
parent 6b32fc9d5d
commit e7a331b969
9 changed files with 216 additions and 116 deletions
+26
View File
@@ -0,0 +1,26 @@
const fs = require("fs")
const bot = require("../../index")
const log = bot.errorLog.log
module.exports = () => {
const files = fs.readdirSync("./plugins")
var totalcount = 0
var successcount = 0
var failcount = 0
files.forEach((file) => {
if (file.endsWith(".plugin.js")){
try {
require("../../plugins/"+file)()
successcount++
totalcount++
}catch{
failcount++
totalcount++
}
}
})
log("info","loaded plugins",[{key:"success",value:successcount},{key:"error",value:failcount},{key:"total",value:totalcount}])
}