|
| 1 | +// ╔◎☱☱☱☱☱☱☱☱☱☱☱☱☱☱☱☱☱☱☱☱☱☱☱☱[ ⒸBloomBot by Magneum™ ]☱☱☱☱☱☱☱☱☱☱☱☱☱☱☱☱☱☱☱☱☱☱☱☱◎" |
| 2 | +// ║⧉༻ 🤖𝐁𝐥𝐨𝐨𝐦𝐁𝐨𝐭🌻𝐌𝐮𝐥𝐭𝐢-𝐃𝐞𝐯𝐢𝐜𝐞🤖 |
| 3 | +// ║ IS A WHATSAPP USER-BOT WITH AUTOMATION, MODERATION, MUSIC, GAMES AND MORE OF 200+ COMMANDS! |
| 4 | +// ║ |
| 5 | +// ║🌟 A versatile whatsApp multi-purpose bot designed for group management and user convenience. |
| 6 | +// ║🚀 Simplifies group management tasks and enhances the overall user experience. |
| 7 | +// ║⚠️ Please note: Engaging in spamming activities may lead to account suspension. Use responsibly! |
| 8 | +// ║🎉 BloomBot is intended for fun and convenience, but we're not responsible for account bans. |
| 9 | +// ║🔀 forking the repository is allowed, but customized versions or modified plugins are unsupported. |
| 10 | +// ║⚠️ Exercise caution and take responsibility for any modifications made to the bot. |
| 11 | +// ║📞 Need assistance or have issues? Contact our developers at +918436686758 and +918250889325. |
| 12 | +// ║🔄 We'll continue providing updates and support for the original version of the bot. |
| 13 | +// ║👉 Enjoy the features and functionality of BloomBot responsibly! Make the most out of your |
| 14 | +// ║ whatsApp group management experience! 🎉 |
| 15 | +// ║ |
| 16 | +// ║🐞 Developers: +918436686758, +91825088932593259325 |
| 17 | +// ╚◎☱☱☱☱☱☱☱☱☱☱☱☱☱☱☱☱☱☱☱☱☱☱☱☱[ ⒸBloomBot by Magneum™ ]☱☱☱☱☱☱☱☱☱☱☱☱☱☱☱☱☱☱☱☱☱☱☱☱◎" |
| 18 | +require("./config"); |
| 19 | +const fs = require("fs"); |
| 20 | +const chalk = require("chalk"); |
| 21 | +const yargs = require("yargs"); |
| 22 | +const { join } = require("path"); |
| 23 | +const { say } = require("cfonts"); |
| 24 | +const mFolders = fs.readdirSync("./routes"); |
| 25 | +const { createInterface } = require("readline"); |
| 26 | +const { watchFile, unwatchFile } = require("fs"); |
| 27 | +const { setupMaster, fork } = require("cluster"); |
| 28 | +const rl = createInterface(process.stdin, process.stdout); |
| 29 | + |
| 30 | +process.env.NODE_NO_WARNINGS = "1"; |
| 31 | +process.removeAllListeners("warning"); |
| 32 | +process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0"; |
| 33 | +process.on("uncaughtException", (error) => { |
| 34 | + logger.error(error); |
| 35 | +}); |
| 36 | +require("events").EventEmitter.prototype._maxListeners = 0; |
| 37 | +say("BloomBot\nwhatsApp Multi Device\nUser bot", { |
| 38 | + font: "chrome", |
| 39 | + align: "center", |
| 40 | + gradient: ["red", "yellow"], |
| 41 | +}); |
| 42 | +say(`~ by Magneum™`, { |
| 43 | + font: "console", |
| 44 | + align: "center", |
| 45 | + gradient: ["green", "red"], |
| 46 | +}); |
| 47 | + |
| 48 | +function showCommands(path) { |
| 49 | + say("Loading Commands From Folders", { |
| 50 | + font: "console", |
| 51 | + align: "left", |
| 52 | + gradient: ["red", "blue"], |
| 53 | + }); |
| 54 | + const specialFolders = [ |
| 55 | + "⚙️System", |
| 56 | + "⭕YTFilter", |
| 57 | + "🍁ᴏᴡɴᴇʀ", |
| 58 | + "🍑Hentai", |
| 59 | + "🐉Emotions", |
| 60 | + "👅NSFW", |
| 61 | + "💗Commands", |
| 62 | + "💰Games", |
| 63 | + "📢aFilter", |
| 64 | + "📥Downloader", |
| 65 | + "📼Conversion", |
| 66 | + "🔎Searches", |
| 67 | + "🔰Group", |
| 68 | + "🖼️Photogenic", |
| 69 | + "🦄SFW", |
| 70 | + ]; |
| 71 | + for (const cFolder of mFolders) { |
| 72 | + const cFiles = fs |
| 73 | + .readdirSync(`./${path}/${cFolder}`) |
| 74 | + .filter((cFile) => cFile.endsWith("")); |
| 75 | + |
| 76 | + if (specialFolders.includes(cFolder)) { |
| 77 | + console.log( |
| 78 | + chalk.bgGreen(chalk.black("> " + cFolder)), |
| 79 | + chalk.yellow(" | " + cFiles) |
| 80 | + ); |
| 81 | + } |
| 82 | + } |
| 83 | +} |
| 84 | + |
| 85 | +let isRunning = false; |
| 86 | +function ignite(cFile) { |
| 87 | + if (isRunning) return; |
| 88 | + isRunning = true; |
| 89 | + const args = [join(__dirname, cFile), ...process.argv.slice(2)]; |
| 90 | + setupMaster({ |
| 91 | + exec: args[0], |
| 92 | + args: args.slice(1), |
| 93 | + }); |
| 94 | + const p = fork(); |
| 95 | + p.on("message", (data) => { |
| 96 | + console.log(chalk.bgGreen(chalk.black("[RECEIVED]")), chalk.yellow(data)); |
| 97 | + switch (data) { |
| 98 | + case "reset": |
| 99 | + p.process.kill(); |
| 100 | + isRunning = false; |
| 101 | + ignite.apply(this, arguments); |
| 102 | + break; |
| 103 | + case "uptime": |
| 104 | + p.send(process.uptime()); |
| 105 | + break; |
| 106 | + } |
| 107 | + }); |
| 108 | + p.on("exit", (_, code) => { |
| 109 | + isRunning = false; |
| 110 | + console.error(chalk.bgRed("❌ An unexpected error occurred:" + _)); |
| 111 | + p.process.kill(); |
| 112 | + isRunning = false; |
| 113 | + ignite.apply(this, arguments); |
| 114 | + if (code === 0) return; |
| 115 | + watchFile(args[0], () => { |
| 116 | + unwatchFile(args[0]); |
| 117 | + ignite(cFile); |
| 118 | + }); |
| 119 | + }); |
| 120 | + const opts = yargs(process.argv.slice(2)).exitProcess(false).parse(); |
| 121 | + if (!opts["test"]) { |
| 122 | + if (!rl.listenerCount()) { |
| 123 | + rl.on("line", (line) => { |
| 124 | + p.emit("message", line.trim()); |
| 125 | + }); |
| 126 | + } |
| 127 | + } |
| 128 | +} |
| 129 | + |
| 130 | +showCommands("routes"); |
| 131 | +ignite("app/index", "uptime"); |
0 commit comments