A Telegram bot for bill splitting. Supports an unlimited number of debtors/creditors on a bill and calculates the minimum number of transactions necessary to settle everyone's accounts. The bot supports various currencies and locales, allowing users to manage expenses in their preferred settings. Bill exports are designed for easy import into spreadsheet applications like Google Sheets.
- Add the bot to a group (works best with admin privileges)
/pay: Initiates the wizard for adding payments/add_payment: Adds a payment for you or another user/revert_payment: Removes a previously added payment/bill_stats: Displays the current totals and required transactions/close_bill: Closes the current bill when all payments are completed (a new bill will start automatically after this). A CSV export of payments will be generated after the bill is closed./set_locale: Sets internationalization settings, including locale, currency, and time zone/export_payments: Generates a CSV export of payments. The values are formatted for easy import into spreadsheets (e.g., Google Sheets) based on localization settings.
- Create the bot through BotFather to obtain the bot API token
- Run
cp .env.example .env.local - Complete the fields in
.env.local - Set up environment variables for the current session using
source .env.local - Execute
iex -S mix
- Clone the repository:
git clone https://github.com/peterhass/abrechnomat_bot.git repo - Build and set up the service:
make build && make service - Update the configuration at:
~/.config/abrechnomat_bot - Initialize the database if needed:
DB_CREATE=true ~/.local/share/abrechnomat_bot/bin/abrechnomat_bot start_iex - Start the service:
systemctl --user start abrechnomat_bot.service
- Backup the database
Mnesia.<username>@<hostname> - Pull the latest changes:
git pull - Build and re-install the service:
make build && make service - Restart the service
systemctl --user restart abrechnomat_bot.service - Check logs:
journalctl --user -u abrechnomat_bot.service -r
- Generate pre-filled PayPal links for final payments (requires users to configure their PayPal account)
- Implement a tipping mechanism for the bot provider (possibly post-bill completion)
- Handle edge cases: Users joining or leaving the group while a bill is open
