Telegram Expense Tracker

Expense_Bot is an single-entry accounting bot for Telegram, created for their 2016 #BotPrize competition. It is built with NodeJS and RethinkDB. Expense_Bot leverages several packages in the rich npm ecosystem to create Excel spreadsheets for data export and pie charts for visualization. It implements a state machine in RethinkDB to maintain context for incoming messages. This can be modelled by the flowchart below.

To read more about the technical detail behind Expense_Bot, check out my blog post "Building a Chat Bot for Fun and Profit".


Expense_Bot flowchart


/start - Returns this list of commands
/newaccount - Create a new account
/accounts - List accounts
/transaction - Log transaction (expense or income)
/history - List previous transaction history
/charts - View a chart image summary of your expenses and income
/spreadsheet - Download full data
/delete - Delete a transaction (expense or income)
/deleteaccount - Delete an account
/deleteall - Delete all info Expense_Bot knows about you
/cancel - Cancel current operation