What you will build
- A Telegram bot that receives a document (invoice or receipt) and replies with key details.
- Processing powered by Google’s “Flash” model.
What you need
A Telegram bot token saved asTELEGRAM_BOT_TOKEN in your project environment (Project Settings → Environment or .env.local).
- In Telegram, chat with @BotFather, run
/newbot, name it, and copy the token once.
GEMINI_API_KEY in your env.
- Go to ai.google.dev → Get an API key.
- Create/select a project and generate a key with access to the Flash model.
- Copy the key once and store it as
GEMINI_API_KEY.
Create Project Prompt
Plan A Feature Prompt
Ideas after the initial build
- Add currency normalization and totals-with-tax breakdowns.
- Store a short log of the last few documents with their summaries.
- Support multiple file types (PDF, image) and compress images before upload.
- Let users ask follow-up questions about the parsed document.