-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathindex.js
More file actions
47 lines (32 loc) Β· 1 KB
/
index.js
File metadata and controls
47 lines (32 loc) Β· 1 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*####################################
F E N I X - V 15
MADE BY F E N I X ID SERVER
β
WhatsApp: wa.me/94773010580
π₯ Github: https://github.com/Fenix-server
π₯ Github: https://github.com/Botdevillozan
π€ Youtube https://youtube.com/@fenix_programmer
#####################################*/
const {
spawn
} = require('child_process')
const path = require('path')
function start() {
let args = [path.join(__dirname, 'main.js'), ...process.argv.slice(2)]
console.log([process.argv[0], ...args].join('\n'))
let p = spawn(process.argv[0], args, {
stdio: ['inherit', 'inherit', 'inherit', 'ipc']
})
.on('message', data => {
if (data == 'reset') {
console.log('Restarting Bot...')
p.kill()
start()
delete p
}
})
.on('exit', code => {
console.error('Exited with code:', code)
if (code == '.' || code == 1 || code == 0) start()
})
}
start()