From bf280dccfbc103d05c7dcf63c2105d072e838bd7 Mon Sep 17 00:00:00 2001 From: Kry9toN Date: Sat, 23 Jan 2021 17:07:00 +0700 Subject: [PATCH] make nice to look --- src/krypton.ts | 3 +-- src/utils/functions.ts | 8 -------- start.js | 18 ++++++++++++++++-- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/krypton.ts b/src/krypton.ts index 61dced8..909774e 100644 --- a/src/krypton.ts +++ b/src/krypton.ts @@ -4,7 +4,7 @@ const { const { Collection } = require('discord.js') const { readdirSync } = require('fs') const { join } = require('path') -const { start, success, getGroupAdmins, banner } = require('./utils/functions') +const { start, success, getGroupAdmins } = require('./utils/functions') const { color } = require('./utils/color') const fs = require('fs') const moment = require('moment-timezone') @@ -48,7 +48,6 @@ async function krypton () { client.runtimeDb = new Collection() const cooldowns = new Collection() client.logger.level = 'warn' - console.log(banner.string) await client.on('qr', () => { console.log(color('[', 'white'), color('!', 'red'), color(']', 'white'), color(' Scan the QR code above')) }) diff --git a/src/utils/functions.ts b/src/utils/functions.ts index b182e4b..cbaa12d 100644 --- a/src/utils/functions.ts +++ b/src/utils/functions.ts @@ -57,13 +57,6 @@ const getGroupAdmins = (participants) => { return admins } -const banner = cfonts.render(('KRYPTON|WHATSAPP|BOT'), { - font: 'block', - colors: ['red', 'blue'], - align: 'center', - lineHeight: 2 -}) - const getBuffer = async (url, options) => { try { options || {} @@ -92,7 +85,6 @@ module.exports = { success, processTime, getGroupAdmins, - banner, getBuffer, getRandom } diff --git a/start.js b/start.js index 4fdb547..cbb9798 100644 --- a/start.js +++ b/start.js @@ -1,10 +1,24 @@ const { execSync } = require('child_process') +const cfonts = require('cfonts') +const chalk = require('chalk') + +const color = (text, color) => { + return !color ? chalk.green(text) : chalk.keyword(color)(text) +} + +const banner = cfonts.render(('KRYPTON|WHATSAPP|BOT'), { + font: 'block', + colors: ['red', 'blue'], + align: 'center', + lineHeight: 2 +}) start() function start () { - console.info('[INFO] Compiling source...') + console.info(banner.string) + console.info(color('[INFO] Compiling source...', 'yellow')) execSync('npm run compile') - console.info('[INFO] Done compiling, starting the bot...') + console.info(color('[INFO] Done compiling, starting the bot...', 'green')) require('./dist/krypton.js') }