-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathindex.js
36 lines (34 loc) · 837 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
32
33
34
35
36
console.log('[SYSTEM] Starting Bot...')
let { spawn } = require('child_process')
let path = require('path')
const CFonts = require('cfonts')
CFonts.say('WHATSAPP BOT', {
font: 'chrome',
align: 'center',
gradient: ['red', 'magenta']
})
CFonts.say('\'termux-whatsapp-bot\' By @rvnzxpl', {
font: 'console',
align: 'center',
gradient: ['red', 'magenta']
})
function start() {
let args = [path.join(__dirname, 'nzwa.js'), ...process.argv.slice(2)]
CFonts.say([process.argv[0], ...args].join(' '), {
font: 'console',
align: 'center',
gradient: ['red', 'magenta']
})
let p = spawn(process.argv[0], args, {
stdio: ['inherit', 'inherit', 'inherit', 'ipc']
})
.on('message', data => {
if (data == 'reset') {
console.log('RESET')
p.kill()
start()
delete p
}
})
}
start()