Skip to content

aattwwss/telegram-expense-bot

Repository files navigation

telegram-expense-bot

Add To Telegram

Add @MyXpensesBot on telegram.

How To Self Host

Prerequisite

  1. Create a telegram bot using BotFather.
  2. Optional. If using webhook, register the domain of the server you are hosting this bot on.
curl https://api.telegram.org/bot=<token>/setWebhook?url=<domain>
  1. A postgres database and init the database with the init.sql.

Run the bot

  1. Clone the repo
git clone https://github.com/aattwwss/telegram-expense-bot
  1. Create local env file
cd telegram-expense-bot
touch .env.local
  1. Edit and save local env file with your own configurations
vim .env.local
  1. Run the server and bot
go run main.go

Without docker

export .env.local
go run main.go

With docker

./start.sh

Privacy

This bot does not store any personal information other than your telegram user id.

Features

  • Sign up as a new user from new chat with bot
  • Add a transaction as current user
  • Selection of category when adding transaction
  • Delete last entry by using /undo command
  • Calculate transaction per month
  • Triggered from /stats, default fetch from current month.
  • /stats [month] [year]
  • View transactions by using /list command
  • Allow user to change timezone. (default Asia/Singapore)
  • Allow user to change currency. (default SGD)
  • Export transactions to file

Dev / Infra

  • Fix image deployed on github container repository not reachable by telegram server

Optimisation

  • Don't return cancel button when next and prev button is not returned. (for transaction list)
  • Show page number in transaction list
  • Delete message context stored in database after a period of time
  • Store data of inline keyboard somewhere else to bypass the 64 bytes size limit

Misc

  • Consolidate SQL to the latest schema
  • Prepare docker compose for self hosted guide
  • Prepare self hosted guide

Support

If you have any questions or problems, email me at telegram.expense.bot@gmail.com

About

An open source telegram bot to track your expenses.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages