v3.3 push 5

This commit is contained in:
DJj123dj
2023-03-16 20:58:08 +01:00
parent f67af805c1
commit 67d429c52b
8 changed files with 278 additions and 42 deletions
+130 -7
View File
@@ -75,10 +75,6 @@ if (process.argv.some((v) => v == "--devconfig")){
if (process.argv.some((v) => v == "--debug")) console.log("[TEMP_DEBUG]","loaded flags")
exports.developerConfig = isDevConfig
const language = require("./core/languageManager").language
exports.language = language
if (process.argv.some((v) => v == "--debug")) console.log("[TEMP_DEBUG]","loaded language")
const config = tempconfig
exports.config = config
@@ -86,16 +82,21 @@ exports.config = config
const tsconfig = isDevConfig ? require("./devtsconfig.json") : require("./transcriptconfig.json")
exports.tsconfig = tsconfig
const language = require("./core/languageManager").language
exports.language = language
if (process.argv.some((v) => v == "--debug")) console.log("[TEMP_DEBUG]","loaded language")
if (process.argv.some((v) => v == "--debug")) console.log("[TEMP_DEBUG]","loaded config")
exports.storage = require('./core/dynamicdatabase/storage')
if (process.argv.some((v) => v == "--debug")) console.log("[TEMP_DEBUG]","loaded storage")
exports.errorLog = require("./core/errorLogSystem")
const log = this.errorLog.log
if (process.argv.some((v) => v == "--debug")) console.log("[TEMP_DEBUG]","LOADED LOGGING SYSTEM")
if (process.argv.some((v) => v == "--debug")) console.log("[TEMP_DEBUG]","switching to new logs")
this.errorLog.log("debug","loaded new logs")
exports.actionRecorder = require("./core/utils/liveStatus").actionRecorder
exports.hiddenData = require("./core/utils/hiddendata")
this.errorLog.log("debug","loaded hiddendataTM")
@@ -111,6 +112,12 @@ this.errorLog.log("debug","loaded buttons & embeds")
client.on('ready',async () => {
this.errorLog.log("debug","client logged in")
this.actionRecorder.push({
category:"ot.managers.djs",
file:"index.js",
time:new Date().getTime(),
type:"client.loggedin.success"
})
var statusSet = false
const setStatus = (type,text) => {
if (statusSet == true) return
@@ -124,10 +131,22 @@ client.on('ready',async () => {
statusSet = true
}
this.errorLog.log("debug","bot status loaded")
this.actionRecorder.push({
category:"ot.managers.djs",
file:"index.js",
time:new Date().getTime(),
type:"client.setstatus.success"
})
const chalk = await (await import("chalk")).default
require("./core/startscreen").run()
this.actionRecorder.push({
category:"ot.managers.main",
file:"index.js",
time:new Date().getTime(),
type:"startscreen.success"
})
if (!process.argv[2] || (process.argv[2] && !process.argv[2].startsWith("slash"))){
//normal start
@@ -137,6 +156,13 @@ client.on('ready',async () => {
setStatus(config.status.type,config.status.text)
}
this.actionRecorder.push({
category:"ot.managers.main",
file:"index.js",
time:new Date().getTime(),
type:"startmode.normal"
})
var updatingSlash = false
if (fs.existsSync("./storage/slashcmdEnabled.txt")){
/**@type {"true"|"false"|String} */
@@ -158,6 +184,12 @@ client.on('ready',async () => {
updatingSlash = true
}
}
this.actionRecorder.push({
category:"ot.managers.main",
file:"index.js",
time:new Date().getTime(),
type:"slashcmd.autoupdate.success"
})
try {
await client.guilds.cache.find((g) => g.id == config.serverId).members.fetch()
@@ -172,9 +204,21 @@ client.on('ready',async () => {
this.errorLog.log("debug","slashmode activated")
if (process.argv[3] == "enable"){
console.log(chalk.green("switching to slashEnable.js"))
this.actionRecorder.push({
category:"ot.managers.main",
file:"index.js",
time:new Date().getTime(),
type:"startmode.slash.enable"
})
require("./core/slashSystem/slashEnable")()
}else if (process.argv[3] == "disable"){
console.log(chalk.green("switching to slashDisable.js"))
this.actionRecorder.push({
category:"ot.managers.main",
file:"index.js",
time:new Date().getTime(),
type:"startmode.slash.disable"
})
require("./core/slashSystem/slashDisable")()
}else{
console.log(chalk.bgRed("[SLASH CMD MANAGER]: unknown slash command action!"))
@@ -183,17 +227,49 @@ client.on('ready',async () => {
}
//load plugins
this.actionRecorder.push({
category:"ot.managers.plugins",
file:"./core/api/pluginlauncher.js",
time:new Date().getTime(),
type:"plugins.loading"
})
require("./core/api/pluginlauncher")()
this.actionRecorder.push({
category:"ot.managers.plugins",
file:"./core/api/pluginlauncher.js",
time:new Date().getTime(),
type:"plugins.success"
})
this.errorLog.log("debug","loading plugins")
})
if (!require("./core/api/api.json").disable.checkerjs.all) require("./core/checker").checker()
if (!require("./core/api/api.json").disable.checkerjs.all){
this.actionRecorder.push({
category:"ot.managers.main",
file:"./core/checker.js",
time:new Date().getTime(),
type:"checker.loading"
})
require("./core/checker").checker()
this.errorLog.log("debug","loading checker.js")
this.errorLog.log("debug","checking config...")
this.actionRecorder.push({
category:"ot.managers.main",
file:"./core/checker.js",
time:new Date().getTime(),
type:"checker.success"
})
}
if (process.argv[2] && process.argv[2].startsWith("slash")){
//do nothing
}else{
this.actionRecorder.push({
category:"ot.managers.loader",
file:"./index.js",
time:new Date().getTime(),
type:"commands.loading"
})
this.errorLog.log("debug","LOADING COMMANDS")
//commands
require('./commands/ticket')()
@@ -207,7 +283,19 @@ if (process.argv[2] && process.argv[2].startsWith("slash")){
require("./commands/claim")()
require("./commands/unclaim")()
require("./commands/change")()
this.actionRecorder.push({
category:"ot.managers.loader",
file:"./index.js",
time:new Date().getTime(),
type:"commands.success"
})
this.actionRecorder.push({
category:"ot.managers.loader",
file:"./index.js",
time:new Date().getTime(),
type:"core.loading"
})
this.errorLog.log("debug","LOADING CORE")
//core
require('./core/ticketActions/ticketOpener')()
@@ -217,13 +305,38 @@ if (process.argv[2] && process.argv[2].startsWith("slash")){
//InteractionHandlers
require("./core/interactionHandlers/handlers/handlers")()
//require("./test")()
this.actionRecorder.push({
category:"ot.managers.loader",
file:"./index.js",
time:new Date().getTime(),
type:"core.success"
})
}
this.actionRecorder.push({
category:"ot.managers.loader",
file:"./index.js",
time:new Date().getTime(),
type:"api.loading"
})
this.errorLog.log("debug","loading api")
const APIEvents = require("./core/api/modules/events")
const APIConfig = require("./core/api/api.json")
this.actionRecorder.push({
category:"ot.managers.loader",
file:"./index.js",
time:new Date().getTime(),
type:"api.success"
})
this.actionRecorder.push({
category:"ot.managers.loader",
file:"./index.js",
time:new Date().getTime(),
type:"debugsystem.loading"
})
const debugLog = (debugString) => {
if (!APIConfig.disable.debug.all && !APIConfig.disable.debug.debuglogs){
const content = fs.existsSync("./openticketdebug.txt") ? fs.readFileSync("./openticketdebug.txt").toString() : "==========================\n<OPEN TICKET DEBUG FILE:>\n=========================="
@@ -254,6 +367,16 @@ process.on("uncaughtException",async (error,origin) => {
errorLog(error.name+": "+error.message+" | origin: "+origin,error.stack)
APIEvents.onError(error.name+": "+error.message,new Date())
//TEMPORARY INTEGRATION FOR LIVESTATUS ERROR UPLOADER:
await require("./core/utils/liveStatus").liveStatusUploadManager(error.name+": "+error.message+" | origin: "+origin+"\n"+error.stack)
})
this.actionRecorder.push({
category:"ot.managers.loader",
file:"./index.js",
time:new Date().getTime(),
type:"debugsystem.success"
})
const token = config.token.fromENV ? process.env.TOKEN : config.token.value