Discord bots
Your bot checks in every 45 seconds. If it goes quiet, or some of its shards drop, you hear about it, even when Discord still shows it online.
- In your project, add a monitor and choose Discord bot.
- Copy the token it shows you and save it as an environment variable called
STATUSBEAT_TOKEN. It's only shown once, but you can make a new one later. - Add it to your bot: one line with our package for JavaScript or Python, or ready-made code for other languages. Start your bot and it checks in within seconds.
npm install @statusbeat/sdkimport { Client, GatewayIntentBits } from 'discord.js';
import { monitor } from '@statusbeat/sdk';
const client = new Client({ intents: [GatewayIntentBits.Guilds] });
monitor(client, { token: process.env.STATUSBEAT_TOKEN });
client.login(process.env.DISCORD_TOKEN);discord.js v14 on Node 18+, including TypeScript. With a ShardingManager or discord-hybrid-sharding, keep this line in your bot file: the process holding shard 0 reports every shard.
Shards
Every shard is tracked on its own. The monitor page shows each one with its status and ping. If some shards disconnect while the rest of the bot keeps running, the bot is marked as a partial outage and you're alerted once they've been offline for 2 minutes. Quick reconnects never alert anyone.
Want your users to see it too? Turn on Show shards publicly in the monitor's settings to add a count like 15/16 shards online to your status page and live Discord message.
Every option reports all the shards its client runs: AutoShardedClient in Python, a ShardManager in JDA, DiscordShardedClient in Discord.Net, and serenity's shard manager. Running shards in separate processes? With discord.js and a ShardingManager or discord-hybrid-sharding, the process holding shard 0 reports every shard for you. Elsewhere, make one monitor per process.
What your bot sends us
Its ping, how many servers it's in, each shard's status, how much memory it's using, and which library it runs on. Nothing about your servers, channels, users, or messages.
How long until it's marked down
You choose how often your bot checks in, from every 30 seconds to every 5 minutes. If we hear nothing for twice that long, we mark it down. You can change that wait in the monitor's settings.
Restarting without an alert
Schedule maintenance in the dashboard before you restart, and nobody gets alerted. With our JavaScript package you can also call stop() on what monitor() returns, just before shutting down.