How to exit all shards and main process?

Hey, I am trying to make a console command that exits all shards and main process but process.exit(0) only exits main process.
2 Replies
megatank58
megatank583y ago
You could try sending a signal to the main process to shutdown?
Ashu
AshuOP3y ago
async exec() {
logger.info(chalk.yellow(`Bot shutting down!`));
this.manager.shards.forEach((shard) => {
shard.kill();
logger.info(chalk.yellow(`Killed shard ${shard.id}`));
});
process.exit(0);
}
async exec() {
logger.info(chalk.yellow(`Bot shutting down!`));
this.manager.shards.forEach((shard) => {
shard.kill();
logger.info(chalk.yellow(`Killed shard ${shard.id}`));
});
process.exit(0);
}
I did this, seems to be working fine
Want results from more Discord servers?
Add your server