Changed stdio
This commit is contained in:
6
index.js
6
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);
|
||||
|
||||
Reference in New Issue
Block a user