compiler.plugin('done', function(){ setTimeout(() => { spinner.stop(); console.log(chalk.bgGreen('\n √ Build done ') + '\n'); console.log(chalk.magenta(`[Tips] visit: http://localhost:${port}/${projectName}/`)); console.log(chalk.magenta(` : http://${ip()}:${port}/${projectName}/`) + '\n'); }, 0); });
/** * @description A function that outputs the wrong log. * @param {Object} result http result * @return {Void} */ function printError(err, queueElement) { console.log(chalk.bold(`${chalk.green(">>>")} [${queueElement.name}] ${chalk.bgGreen(queueElement.options.method)}: ${queueElement.options.url}`)) console.log(chalk.bold(chalk.red('[REQMAN ERROR]: \n\n' + JSON.stringify(err, null, 2)))); console.log("\n"); }
start () { // Initiate the Bot this.bot = new Client() this.bot.on('error', (e) => console.log(chalk.red(e))) // console.log on error this.bot.on('ready', () => { console.log(chalk.bgGreen('Loaded successfully')) console.log("\n\n") console.log(chalk.green(`You can now invite the Bot via \nhttps://discordapp.com/api/oauth2/authorize?client_id=${this.bot.user.id}&permissions=0&scope=bot`)) }) // Add this as binary to bot object this.bot.bin = this // Initiate the Loader const Loader = require(path.join(__dirname, '../../loader/index')) return new Loader(this.bot, this.config) }
this.logger(chalk.bgGreen(` Started SalienScript | Version: ${pkg.version} `)); this.logger(chalk.bgCyan(' Thanks for choosing https://github.com/South-Paw/salien-script-js ')); this.logger(chalk.bgCyan(' Remeber to drop us a ⭐ star on the project if you appreciate this script! '));
}) console.log(chalk.bgGreen(chalk.black(`\n--- ${pluginClass.name} loaded ---`))) console.log(chalk.white(`${pluginClass.description}\n`))
serverCompiler.watch({ // watchOptions 示例 aggregateTimeout: 300, poll: undefined }, (err, stats) => { // 在这里打印 watch/build 结果... console.log(chalk.bgGreen('\n √ Server compile done ') + '\n'); if (err) { console.error(err); return; } if(stats.hasErrors()){ console.log(chalk.red('\n ✖️ Server compile Error ') + '\n'); console.log(stats.toString({ chunks: false, // 使构建过程更静默无输出 colors: true // 在控制台展示颜色 })); } })
console.log( chalk.green("Bumped version to "), chalk.bgGreen.black(bumped) ); }).catch(err => {
compiler.plugin('done', function(){ setTimeout(() => { spinner.stop(); console.log(chalk.bgGreen('\n √ Build done ') + '\n'); console.log(chalk.magenta(`[Tips] visit: http://localhost:${port}/${projectName}/`)); console.log(chalk.magenta(` : http://${ip()}:${port}/${projectName}/`) + '\n'); }, 0); });
compiler.plugin('done', function(){ setTimeout(() => { spinner.stop(); console.log(chalk.bgGreen('\n √ Build done ') + '\n'); console.log(chalk.magenta(`[Tips] visit: http://localhost:${port}/${projectName}/`)); console.log(chalk.magenta(` : http://${ip()}:${port}/${projectName}/`) + '\n'); }, 0); });
serverCompiler.watch({ // watchOptions 示例 aggregateTimeout: 300, poll: undefined }, (err, stats) => { // 在这里打印 watch/build 结果... console.log(chalk.bgGreen('\n √ Server compile done ') + '\n'); if (err) { console.error(err); return; } if(stats.hasErrors()){ console.log(chalk.red('\n ✖️ Server compile Error ') + '\n'); console.log(stats.toString({ chunks: false, // 使构建过程更静默无输出 colors: true // 在控制台展示颜色 })); } })