-
Notifications
You must be signed in to change notification settings - Fork 7
/
index.js
31 lines (29 loc) · 976 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
29
30
31
console.log('Starting . . .')
require('dotenv').config(), require('rootpath')(), require('./server')
const { spawn: spawn } = require('child_process'), path = require('path'), colors = require('@colors/colors/safe'), CFonts = require('cfonts')
process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = '0'
process.on('uncaughtException', console.error)
function start() {
let args = [path.join(__dirname, 'client.js'), ...process.argv.slice(2)]
let p = spawn(process.argv[0], args, { stdio: ['inherit', 'inherit', 'inherit', 'ipc'] })
.on('message', data => {
if (data == 'reset') {
console.log('Restarting...')
p.kill()
delete p
}
})
.on('exit', code => {
console.error('Exited with code:', code)
start()
})
}
CFonts.say('NEOXR BOT', {
font: 'tiny',
align: 'center',
colors: ['system']
}), CFonts.say('Github : https://github.com/neoxr/neoxr-bot', {
colors: ['system'],
font: 'console',
align: 'center'
}), start()