Telegram monitor
Your Worker is running. Connect your Telegram bot here.
- In Cloudflare → Worker → Settings → Variables and Secrets, set
TG_BOT_TOKEN and your numeric TG_CHAT_ID.
- Add
TG_WEBHOOK_SECRET: a random password of 32 letters/numbers. Save it and click Deploy. Existing TELEGRAM_* names also work; TG_* takes priority.
- Send
/start to your bot in Telegram. Enter the same webhook secret below and click Connect Telegram + Menu.
For your private chat, no separate admin ID is needed. For a group, set TG_ADMIN_ID to your personal Telegram user ID.
The token stays in Cloudflare. This form sends your setup secret only to this Worker. Connecting removes the old webhook, keeps pending messages, then installs the new webhook and menus and sends a confirmation to your chat.
Ready.
Monitoring needs a D1 binding named DB, the supplied schema.sql, and a Cron Trigger set to */10 * * * *. The menu can work before the database is ready.