diff --git a/index.js b/index.js index fc85e64..66d9b9d 100644 --- a/index.js +++ b/index.js @@ -152,7 +152,7 @@ async function startBot(accountName) { return new Promise((resolve, reject) => { // const childProcess = spawn('bash', ['-c', `${commandPrefix} ${commandSuffix}`], { stdio: 'inherit' }); const childProcess = spawn('bash', ['-c', `${commandPrefix} ${commandSuffix}`], { - stdio: ['pipe', 'pipe', 'pipe'], + stdio: ['inherit', 'pipe', process.stderr], }); childProcess.stdout.on('data', (data) => { @@ -179,6 +179,10 @@ async function startBot(accountName) { } }); + childProcess.on('close', (code) => { + console.log(`[${accountName}] Child process exited with code ${code}`); + }); + childProcess.on('error', (err) => { consoleLog(`[${host}] Failed to start bot for ${accountName}.`, 'error'); reject(err);