How to build a Telegram expense tracker bot

By the Botable team

A Telegram expense tracker bot logs spending from a single message — "12.40 lunch" — categorises it, and reports totals on request. Describe your categories and currency and Botable builds the ledger and the reports.

What is a expense tracker bot?

A Telegram expense bot beats a budgeting app on the only metric that matters for expense tracking, which is whether you actually log the expense. Opening an app, choosing a category and tapping save is enough friction that most people stop within a fortnight; typing "12.40 lunch" into a chat you already have open is not. So the parsing is the product: a single free-text line should resolve to an amount, a category and a date without follow-up questions, guessing the category from the word and defaulting the date to today. Everything else is reporting on top of a simple ledger — one row per entry with amount, category, note and timestamp. Two things are worth asking for that people forget: an edit path, because the last entry is frequently wrong, and multi-currency, because the moment you travel a single-currency ledger silently becomes nonsense.

What commands does it have?

Commands a expense tracker bot typically has, and what each one does
CommandWhat it does
12.40 lunchLogs an expense with no command at all
/todayEverything logged today, with a total
/monthMonthly total broken down by category
/undoRemoves the last entry
/exportSends the ledger as a CSV

What do you need before you start?

  • A Telegram bot token from @BotFather
  • Your categories — six or seven, not thirty
  • A base currency, and whether you need more than one

How do you build it?

How should logging an expense feel?

Like sending a message, not filling a form. Ask for a bare line — amount then description — to be accepted with no command prefix. Every required keystroke measurably reduces how often the thing gets used, and an expense tracker that is not used is just a database.

How does it choose a category?

From the description, against your category list, with a fallback of "other" rather than a question. Getting it wrong occasionally and being correctable is far better than interrogating the user on every coffee.

Why does an undo matter so much?

Because the entry you most want to fix is always the one you just made — a typo in the amount, the wrong category. Ask for /undo and an edit of the last entry explicitly; without them people abandon the ledger rather than correct it.

What about more than one currency?

Store the amount and the currency on every row, and convert only at report time. Storing pre-converted values bakes in whatever rate applied that day and makes the history unfixable later.

A prompt you can use as-is

Paste this into Botable and adjust the details. It is specific on purpose — a vague description produces a vague bot.

Build an expense tracker bot. Accept a bare message like "12.40 lunch" with no command: parse the amount, guess the category from my list (food, transport, bills, shopping, health, other), default the date to today, and confirm in one short line. /today, /week and /month report totals with a category breakdown. /undo removes the last entry and /edit corrects it. Store the currency on each row and convert only when reporting. /export sends a CSV.

Build this bot

Who is this bot for?

  • Anyone who has abandoned three budgeting apps for the same reason
  • Freelancers logging deductible spend as it happens
  • Travellers tracking a trip budget across currencies

What goes wrong with this kind of bot?

  • Requiring a command prefix to log is the main reason these get abandoned
  • Pre-converting currency at write time destroys the history; store the original
  • Thirty categories is a taxonomy nobody uses; six is a habit

Questions about expense tracker bots

Can it read receipt photos?

It can accept the photo and store it against the entry. Extracting the total automatically is a separate capability — describe it explicitly if you want it, and expect to confirm the parsed amount rather than trust it silently.

Can two people share one ledger?

Yes. Run it in a shared group and store the ledger against the chat rather than the user, with each entry tagged by who logged it. That is also the shape you want for splitting household costs.

All twelve build guides