-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathindex.js
28 lines (23 loc) · 825 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
const chalk = require('chalk')
const path = require('path')
const moment = require('moment')
const { Crystal } = require('sylphy')
require('longjohn')
require('dotenv-safe').config({
path: path.join(__dirname, '.env'),
allowEmptyValues: true
})
const isSelfbot = process.env.SELFBOT === 'true'
if (isSelfbot) {
require('./src/selfbot')
} else {
const cluster = new Crystal(path.join('src', 'bot.js'), parseInt(process.env.PROCESS_COUNT, 10))
const timestamp = () => `[${chalk.grey(moment().format('HH:mm:ss'))}]`
cluster.on('clusterCreate', id =>
console.log(`${timestamp()} [MASTER]: CLUSTER ${chalk.cyan.bold(id)} ONLINE`)
)
cluster.createClusters().then(
() => console.log(`${timestamp()} [MASTER]: ` + chalk.magenta('We\'re live, ladies and gentlemen.')),
err => console.error(err)
)
}