DEV Community

John Wick
John Wick

Posted on

How to Give Your Bot a Public Uptime Page Your Users Can Check

A tutorial for adding a public-facing uptime page to a Discord or Telegram bot, so users can check status themselves instead of asking you.

How to Give Your Bot a Public Uptime Page Your Users Can Check

"Is the bot down?" is one of the most common messages a bot maintainer gets, and answering it manually — every time, in every server, for every person who asks — doesn't scale past a handful of users. This tutorial covers giving your bot a public page people can check themselves, with real uptime history instead of just your word for it.

Table of Contents

  1. Why a Status Page Beats Answering DMs
  2. Step 1: Install StayPresent
  3. Step 2: Confirm the Default Page Is Already Live
  4. Step 3: Customize the Page for Your Bot
  5. Step 4: Share the Link Where Users Will Find It
  6. Step 5 (Optional): Decide What's Public vs Admin-Only
  7. Step 6 (Optional): Name Multiple Bots Clearly
  8. Verifying What Users Actually See
  9. FAQs
  10. Conclusion

Why a Status Page Beats Answering DMs

Every time someone asks "is the bot down" and you have to manually check and reply, that's a small tax on your time — and if you're asleep, at work, or just not looking at Discord, the honest answer they get is silence, which reads as worse than an actual outage. A public page answers the question the moment it's asked, without you doing anything.

Step 1: Install StayPresent

pip install staypresent[prod]
Enter fullscreen mode Exit fullscreen mode

Step 2: Confirm the Default Page Is Already Live

If you're already running your bot through StayPresent, you likely already have this — a status page is served automatically at /status the moment staypresent.run() starts:

import staypresent

staypresent.run("bot.py")
# https://your-app.example.com/status is already live
Enter fullscreen mode Exit fullscreen mode

No extra code required for the basic version — uptime percentages, current status, and incident history are all generated automatically from data StayPresent already tracks.

Step 3: Customize the Page for Your Bot

import staypresent

staypresent.web.status(
    title="MyBot Status",
    copyright="MyBot Team",
    footer_links=[
        {"label": "Support Server", "url": "https://discord.gg/yourinvite"},
    ],
    mode="auto",
)

staypresent.run("bot.py")
Enter fullscreen mode Exit fullscreen mode

Step 4: Share the Link Where Users Will Find It

Once it's live, the actual work is just making sure people know it exists:

  • Pin it in your support channel.
  • Add it to your bot's /about or /help command output.
  • Link it in your bot's Discord "About Me" or bio.

The page itself requires no maintenance after this — it updates live, automatically, with no manual step on your end.

Step 5 (Optional): Decide What's Public vs Admin-Only

By default, the page shows overall status, uptime, and plain-language incident descriptions to everyone — appropriate for a public audience. Deeper technical detail (exit codes, a recent log tail) is gated behind an admin key:

import os
import staypresent

staypresent.web.status(
    api_key=os.getenv("STATUS_ADMIN_KEY"),
)
Enter fullscreen mode Exit fullscreen mode

Set your own key so only you (not a randomly generated, log-only key) can access that deeper view.

Step 6 (Optional): Name Multiple Bots Clearly

If your project actually runs several bots behind the scenes, label each one so the public page makes sense to someone who isn't familiar with your file structure:

staypresent.run(bots=[
    {"file": "main_bot.py", "services_name": "MyBot"},
    {"file": "backup_bot.py", "services_name": "Backup Bot"},
])
Enter fullscreen mode Exit fullscreen mode

Verifying What Users Actually See

Open the page in a private/incognito browser window (so you're seeing it the way a logged-out visitor would) and confirm: the overall status is clear, uptime numbers are showing, and nothing sensitive (internal exit codes, log content) is visible without logging in as admin.

FAQs

Does this require my bot's own database?
No — everything on the page comes from data StayPresent already tracks for its own crash recovery; there's nothing separate to store or maintain.

Can users see exactly why the bot crashed?
Not by default — the public view shows that an incident happened and its plain-language status, not raw exit codes or logs. That detail is reserved for the admin view.

Will this slow my bot down?
No — serving the status page is a lightweight part of the same HTTP server StayPresent already runs for your platform's health check.

Conclusion

A public uptime page turns "is the bot down?" from a question only you can answer into something users can check themselves, any time, with real data instead of a guess. With StayPresent, the basic version needs no setup at all — /status is live the moment your bot is — and a few optional lines let you brand it and control exactly what's public.

pip install staypresent[prod]
Enter fullscreen mode Exit fullscreen mode

Top comments (0)