const account = require("../models/accounts"); import { red, white } from "chalk"; import { mainMongoose } from "../main"; import { createString } from "../utils/createString"; import { logoOptions } from "../utils/logoOptions"; import { changeTheme } from "./changeTheme"; import { config } from "./config"; import { createTemplate } from "./createTemplate"; import { credits } from "./credits"; import { deleteTemplate } from "./deleteTemplate"; import reportIssue from "./report-issue"; import { rapid } from "./rapidTitlePromise"; import { scrape } from "./scrape"; import { wizz } from "./wizz"; import { logo } from "../utils/logo"; function main(db, rl, client) { rapid("[External-Nuker] - Main menu", 1).then(() => { setTimeout(() => { process.title = "[External nuker] - Main menu"; }, 40); }); console.clear(); logoOptions(db); rl.question(createString("Enter option", db), async (option) => { if (db.get("isAdmin") === false || !db.has("isAdmin")) { let findAccData = await account.findOne({ Username: db.get("username") }); if (findAccData) { if (findAccData.Admin) { db.set("isAdmin", true); } } } // if (db.get("discordAccountID") === false) { // function goGetThereIdLol(logDie) { // console.clear(); // logo(db); // if (logDie === true) { // console.log(createString("Some data is missing", db, "semi", "fail")); // } // console.log(" "); // setTimeout(() => { // rl.question( // createString("What is your discord account ID", db), // async (accId) => { // let findThatId = await client.users.fetch(accId); // if (!findThatId) { // console.log( // createString( // "There is no discord account with tha ID", // db, // "semi", // "fail" // ) // ); // setTimeout(() => { // goGetThereIdLol(false) // }, 2000) // return; // } // if (findThatId.bot === true) { // console.log( // createString( // "That is a bot account, We need your account ID", // db, // "semi", // "fail" // ) // ); // setTimeout(() => { // goGetThereIdLol(false) // }, 2000) // return; // } // } // ); // }, 1000); // } // goGetThereIdLol(true); // return; // } option = option.toLowerCase(); option = option.trim(); if ( ![ "x", "2", "1", "3", "c", "credits", "credit", "z", "v", "n", "config", "m", ].includes(option) ) { process.title = "[External-Nuker] - Unknown option"; console.log(createString("Unknown option", db, "semi", "fail")); setTimeout(() => { main(db, rl, client); }, 1000); return; } if (option === "config" || option === "settings") { config(db, rl, client); } if (option === "x") { changeTheme(rl, db, client); } if (option === "2") { scrape(rl, db, client); } if (option === "1") { wizz(client, db, rl); } if (option === "c") { if (db.has("logged-in")) { db.delete("logged-in"); db.save(); console.log(createString("Logged out", db, "semi")); setTimeout(() => { mainMongoose(); }, 2000); } else { console.log(createString("No auto-log in found", db, "semi", "fail")); setTimeout(() => { main(db, rl, client); }, 1000); } } if (option === "credits" || option === "credit" || option === "z") { credits(db, rl, "main", client); } if (option === "v") { require("./utils")(client, db, rl); } if (option === "3") { reportIssue(client, db, rl); } if (option === "n") { createTemplate(db, rl, client); } if (option === "m") { deleteTemplate(db, rl, client); } }); } export { main };