Your bot is restarted automatically when it crashes, but a bot that crashes every few minutes, or cannot start at all, needs you. Crash alerts send a message to a Discord channel of yours when that happens.
Setting it up
- In Discord, pick a channel only you (or your team) can see. Open its settings, then Integrations, and create a webhook. Click it and press Copy Webhook URL.
- In the panel, open Startup and paste it into Crash alert webhook.
- Restart the bot.
A message saying Crash alerts are on arrives in that channel straight away, so you know it works. The console says so too.
What an alert contains
- How it stopped: the exit code, or that it ran out of memory, and how long it had been running.
- A hint, when the error is one we recognise: a rejected token, a missing package, privileged intents, a rate limit.
- The last lines your bot printed. Anything that looks like a Discord token, your bot token or your Git token is replaced with
[hidden]first, and webhook links with[webhook]. - A link to your server in the panel.
When you get one
- When the bot stops without being told to: a crash, an error at startup, running out of memory, or the program simply finishing.
- Not when you press Stop or Restart, and not when the server is suspended.
- Not when nothing could be started at all (no file to run, a Bot file that is not there, a clone that was refused). The server waits at Starting with the reason in the console instead.
- At most one every 5 minutes and 30 a day, so a bot stuck crashing does not flood the channel.
Without a webhook
If your bot stops on its own and is still stopped three hours later, we email the account address once, with the reason if the console showed one. At most one of those a week per server. A crash alert is quicker: it arrives the moment the bot stops.
Turning it off
Clear the box on Startup, or delete the webhook in Discord. If the webhook is deleted, the console says alerts could not be sent.
Anyone with the link can post
A webhook link lets whoever has it post in that channel. Treat it like a password: do not put it in your code or your repository. If it leaks, delete the webhook in Discord and make a new one.
Something here wrong or out of date? Tell us and it gets fixed.