mirror of
https://github.com/tiennm99/openai-status-bot.git
synced 2026-10-11 03:13:41 +00:00
e10fe0c8838b118360b4e8af98998b9e7ec62839
openai-status-bot
Telegram bot that watches OpenAI Status every minute and sends updates to subscribed chats. State and subscriptions are stored in Redis.
Features
- Checks OpenAI status on a configurable interval, default
1m - Notifies subscribers about new incident updates
- Notifies subscribers when component status changes
- Supports incident-only, component-only, and component-filtered subscriptions
- Uses Redis for subscribers, delivery state, component checkpoints, and seen incident update versions
- Supports Telegram supergroup topics via
message_thread_id - Clears an existing Telegram webhook before long polling, for migration from webhook deployments
- Includes Docker Compose for local Redis + bot runtime
Bot Commands
| Command | Description |
|---|---|
/start |
Subscribe current chat or topic |
/stop |
Unsubscribe current chat or topic |
/status [component] |
Show current OpenAI status, optionally for one component |
/components |
Show all OpenAI component statuses |
| `/subscribe <incident | component |
| `/subscribe component <name | id |
/history [count] |
Show recent incidents, default 5, max 10 |
/uptime |
Show component health overview |
/info |
Show chat ID and subscription settings |
/help |
Show command help |
Quick Start
cp .env.example .env
# edit .env and set TELEGRAM_BOT_TOKEN
docker compose up --build
For local development without Docker:
go mod tidy
go run ./cmd/openai-status-bot
Configuration
| Variable | Default | Description |
|---|---|---|
TELEGRAM_BOT_TOKEN |
required | Telegram bot token from BotFather |
REDIS_ADDR |
localhost:6379 |
Redis address |
REDIS_PASSWORD |
empty | Redis password |
REDIS_DB |
0 |
Redis database number, valid 0-15 |
OPENAI_STATUS_BASE_URL |
https://status.openai.com |
OpenAI status page base URL |
POLL_INTERVAL |
1m |
Status check interval, valid 5s-1h |
HTTP_TIMEOUT |
10s |
HTTP request timeout, valid 1s-5m |
LOG_LEVEL |
info |
debug, info, warn/warning, or error |
Notes
The first successful poll seeds Redis and does not send historical incidents. Notifications start from later changes.
Incident update dedupe tracks the update content/version, so edited Statuspage updates can notify again. Delivery is checkpointed after successful fan-out; retryable Telegram failures may be retried on a later poll without advancing the global checkpoint.
Description
Telegram bot that polls OpenAI Status and sends Redis-backed status alerts
Readme
367 KiB
0 Stars
1 Watchers
0 Forks
Languages
Go
99.7%
Dockerfile
0.3%