Unitech / pm2

Node.js Production Process Manager with a built-in Load Balancer.
https://pm2.keymetrics.io/docs/usage/quick-start/
Other
41.33k stars 2.61k forks source link

[Discord]Treat "invalid bot tokens" as error #4847

Open Sasiko opened 4 years ago

Sasiko commented 4 years ago

At the moment, the process will continue to run even if the bot has invalid token. This send unecessary amount of requests to discord which can potentially lead to rate limits. Can pm2 instead just detect invalid bot token as error and stop the process rather than having it running?

isimplydonotexist commented 3 years ago

This is not related to PM2 in any way, I don't see why they would even consider adding such a feature.

BannerBomb commented 3 years ago

@Sasiko

  1. PM2 isn't made for just discord bots.
  2. PM2 is a process manager and made to restart a process when it goes down, not to kill the process. If you want the process to be killed then you don't need PM2 for your program in which you can then exit the process when the error happens manually.
  3. Providing an invalid token to the client is the users issue which you should not be doing anyways.
  4. When programming it's the programmers responsibility to handle the errors that happen not for a package to handle them for you.

I doubt the developers will add anything that is specific for just discord bots since PM2 is meant to handle several types of things.