Telegram AI Digest (cron)¶
Verified status as of March 28, 2026. Runtime note: FastFN auto-installs function-local dependencies from
requirements.txt/package.json; host runtimes are required infastfn dev --native, whilefastfn devdepends on a running Docker daemon.
Quick View¶
- Complexity: Intermediate
- Typical time: 15-30 minutes
- Use this when: you want scheduled Telegram digests with optional AI summary
- Outcome: digest flow runs with correct secrets and schedule
This function fetches recent messages from a Telegram group, summarizes them with OpenAI, and sends the digest back to the chat.
Function¶
- Function:
telegram-ai-digest - Route:
/telegram-ai-digest - Methods:
GET - Schedule: defined per function in
<FN_FUNCTIONS_ROOT>/telegram-ai-digest/fn.config.json
Configure secrets¶
Edit <FN_FUNCTIONS_ROOT>/telegram-ai-digest/fn.env.json:
TELEGRAM_BOT_TOKEN(required)TELEGRAM_CHAT_ID(required)OPENAI_API_KEY(required)
Cron schedule¶
The cron schedule is defined per function in fn.config.json:
To disable:
Manual test¶
Response example¶
Flow Diagram¶
flowchart LR
A["Client request"] --> B["Route discovery"]
B --> C["Policy and method validation"]
C --> D["Runtime handler execution"]
D --> E["HTTP response + OpenAPI parity"]
Objective¶
Clear scope, expected outcome, and who should use this page.
Prerequisites¶
- FastFN CLI available
- Runtime dependencies by mode verified (Docker for
fastfn dev, OpenResty+runtimes forfastfn dev --native)
Validation Checklist¶
- Command examples execute with expected status codes
- Routes appear in OpenAPI where applicable
- References at the end are reachable
Troubleshooting¶
- If runtime is down, verify host dependencies and health endpoint
- If routes are missing, re-run discovery and check folder layout
See also¶
Last reviewed:
March 28, 2026
·
Docs on fastfn.dev