feat: add setup endpoint to register bot commands and webhook

GET /webhook/setup/:secret registers commands with Telegram
and sets webhook URL in one step.
This commit is contained in:
2026-04-08 23:31:11 +07:00
parent 68b9604598
commit 37c2a01677
4 changed files with 51 additions and 5 deletions

View File

@@ -30,6 +30,7 @@ Cloudflare Workers with two entry points exported from `src/index.js`:
| Method | Path | Handler | Purpose |
|--------|------|---------|---------|
| GET | `/` | inline | Health check |
| GET | `/webhook/setup/:secret` | `bot-setup.js` | One-time: register bot commands + set Telegram webhook |
| POST | `/webhook/telegram` | `bot-commands.js` | grammY `webhookCallback("cloudflare-mod")` |
| POST | `/webhook/status/:secret` | `statuspage-webhook.js` | Receives Statuspage webhooks |