An AI-powered Telegram bot for personal finance tracking — built with
Google Apps Script + Gemini API + Google Sheets.
💬 Record your daily expenses naturally → get smart reports & friendly AI feedback.
💸 100% free, serverless, and open source.
🌍 Runs entirely on Google infrastructure — no hosting or backend required.
| Language | File | Description |
|---|---|---|
| 🇻🇳 Vietnamese | src/gemini-bot.vi.gs | Full Vietnamese version |
| 🌍 English | src/gemini-bot.en.gs | Full English version |
Each version is a stand-alone file — just copy it into Google Apps Script, set your keys, and deploy.
No external servers, no database setup — everything runs on your Google account.
| Feature | Description |
|---|---|
| 🤖 Natural text input | Type “bought coffee 35k” or “got salary 10m” — the bot understands it |
| 🧠 AI parsing | Gemini detects type (income/expense), amount, note, and category |
| 🗂️ Auto categorization | Food, Transport, Shopping, Bills, etc. |
| 📊 Instant reports | /report, /reportday, /reportmonth, /reportcategory, /topcategory |
| ⏰ Daily automation | Reminders at 20:00, daily report at 21:00 |
| 💾 Google Sheets | Secure, exportable, and fully owned by you |
| 💬 AI replies | Friendly, emotional, and human-like feedback |
| 💸 Completely free | Uses only free Google services — no hidden costs |
User → Telegram Bot → Google Apps Script → Gemini API → Google Sheets
✅ Fully serverless architecture — everything executes under your Google account.
No VM, VPS, or paid hosting required.
gemini-finance-bot/
├── README.md
├── LICENSE
├── src/
│ ├── gemini-bot.en.gs
│ └── gemini-bot.vi.gs
├── assets/
│ ├── demo-telegram.png
│ ├── sheet-sample.png
│ └── setup-guide.png
└── .gitignore- Open @BotFather in Telegram
- Send
/newbot→ follow the steps → copy your BOT_TOKEN - (Optional) Configure your bot:
| Command | Purpose |
|---|---|
/mybots |
List your bots |
/deletebot |
Delete a bot |
/setdescription |
Set bot description |
/setabouttext |
Short “About” info |
/setuserpic |
Upload bot profile picture |
You’ll need this to send reports or identify users.
- Send
/startto your bot - Visit:
https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getUpdates - Look for
"chat":{"id":...}→ that’s your CHAT_ID
This variable defines where the bot will send automatic reminders and daily reports.
You can use:
- Your personal Chat ID (for solo tracking)
- Or a group Chat ID (for family/team usage)
In your Apps Script code, find this line:
const ADMIN_CHAT_ID = "YOUR_CHAT_ID";Replace "YOUR_CHAT_ID" with your actual Chat ID (the value you found earlier).
If it’s a group chat, the ID usually starts with a minus sign (e.g. -5037557217).
🕒 The bot will automatically send:
- Daily reminder at 20:00 → “It’s time to log your expenses!”
- Daily summary at 21:00 → your total income & expenses of the day
- Go to Google Sheets
- Create a sheet named Transactions
- Copy the ID from its URL:
https://docs.google.com/spreadsheets/d/<SHEET_ID>/edit
- Visit Google AI Studio
- Click Create API key
- Copy your GEMINI_KEY
⚠️ Note: Gemini API has a free quota — no billing needed for personal use.
- Go to https://script.google.com
- Create a new project → name it
Gemini Finance Bot - Copy all code from:
- English → src/gemini-bot.en.gs
- Vietnamese → src/gemini-bot.vi.gs
- Replace your credentials:
const BOT_TOKEN = "YOUR_TELEGRAM_TOKEN"; const GEMINI_KEY = "YOUR_GEMINI_API_KEY"; const SHEET_ID = "YOUR_SHEET_ID"; const ADMIN_CHAT_ID = "YOUR_CHAT_ID";
- In Apps Script, click Deploy → New deployment
- Choose Web App
- Configure:
- Execute as → Me
- Who has access → Anyone
- Click Deploy → Copy your Web App URL
In your browser:
https://api.telegram.org/bot<YOUR_BOT_TOKEN>/setWebhook?url=<YOUR_SCRIPT_URL>
✅ You should see:
{"ok":true,"result":true,"description":"Webhook was set"}| Action | URL / Command |
|---|---|
| Check Webhook Info | https://api.telegram.org/bot<TOKEN>/getWebhookInfo |
| Delete Webhook | https://api.telegram.org/bot<TOKEN>/deleteWebhook |
| Get Updates | https://api.telegram.org/bot<TOKEN>/getUpdates |
| Send Test Message | https://api.telegram.org/bot<TOKEN>/sendMessage?chat_id=<ID>&text=Hello |
In Apps Script → Triggers (⏰ icon), add these:
| Function | Time | Purpose |
|---|---|---|
dailyReminderJob |
20:00 | Daily “log your expenses” reminder |
dailyReportJob |
21:00 | Daily financial summary |
👤 User:
bought coffee 35k at Highland
🤖 Bot:
✅ Recorded: expense 35,000₫ — coffee at Highland
☕ “That’s a nice treat! Enjoy your drink 😋”
📅 Daily Report
💰 Income: 10,000,000₫
💸 Expense: 2,750,000₫
🟢 Balance: +7,250,000₫
Nice budgeting today! 🎯
| Tool | Purpose |
|---|---|
| Google Apps Script | Serverless backend |
| Gemini API | AI natural language understanding |
| Telegram Bot API | Chat interface |
| Google Sheets | Data storage & reporting |
See how Gemini Finance Bot works in action!
Interact naturally with the bot — record your expenses or income instantly.
All transactions are stored in your Google Sheet — organized, filterable, and exportable.
✅ 100% free to use
✅ Runs on free-tier Google Apps Script and Gemini API
✅ No external server or database required
✅ Open-source under MIT License
Anyone can fork, customize, or expand this bot with zero hosting costs.
MIT License © 2025 Nghia Nguyen
Pull requests are welcome!
If you find bugs or have ideas → open an Issue 🚀
If you like this project, please give it a ⭐ — it helps others find it!
💚 Gemini Finance Bot is 100% free, open-source, and runs entirely on Google Apps Script — no hosting, no fees, no setup hassle.
Made by Nghia Nguyen for the community 🌏