title: Start/Stop a Discord-Bot in nodejs
body: <p>I would like to create a command to start and stop my test Discord-Bot but have no idea on how to do a stop command. Maybe anyone can help me there? Here is my code.</p>
  <pre><code>if(args[0] === &quot;start&quot;) {
          child.exec(&quot;node test.js&quot;, (error, stdout, stderr) =&gt; {
              if (error) {
                  console.log(`error: ${error.message}`);
                  return;
              }
              if (stderr) {
                  console.log(`stderr: ${stderr}`);
                  return;
              }
              console.log(`stdout: ${stdout}`);
          });
          
      }else {
          if(args[0] === &quot;stop&quot;) {
              //stop the bot
          }
      }
  </code></pre>