0

I've seen someone who has a bot that sends a message in a log channel when it crashes, so someone knows how to send a message in a channel when my discord bot crashes?

Viciox
  • 19
  • 1
  • Does this answer your question? [Catch all uncaughtException for Node js app](https://stackoverflow.com/questions/40867345/catch-all-uncaughtexception-for-node-js-app) – esqew Aug 01 '22 at 16:12
  • Whenever a bot crashes it will not be able to do anything before you restart the process. The message sending would have to occur once the bot restarts, you'll need to have some sort of global variable to keep track of unexpected process ends to know whether the bot crashed or was intentionally turned off. – Elitezen Aug 01 '22 at 16:21

1 Answers1

0

There is technically no way because the process (bot) is stopped. However, you can avoid the crashing by catching it then logging it to a channel. You can also use another process to see when the bot “Crashes”

Here is more info: Catch all uncaughtException for Node js app

Kief
  • 61
  • 1
  • 11