How would i kill a process? I have a code that will run a discord bot but when i kill the process the bot will still be on but wont receive any input.
var open = true; const { exec, spawn } = require('child_process'); var proc = null; function runbot() { if(open){ open = false; proc = spawn('node', [object+"\Workroom\bot.js"]); document.getElementById("runbutton").textContent = "STOP"; }else{ open = true; proc.kill('SIGINT'); document.getElementById("runbutton").textContent = "RUN"; } }
1.4m articles
1.4m replys
5 comments
57.0k users