A WhatsApp bot built with Go and whatsmeow that helps friends split bills easily.
- Create and manage bills in WhatsApp groups
- Add participants and items
- Send a photo of your bill to extract items and amounts automatically (using OpenAI API)
- Calculate how much each person owes
- Send private WhatsApp messages to each participant when a bill is closed, showing their share and payment instructions
- Multi-language support: English and Indonesian (see
/lang
command) - Translation system for easy localization
-
Ensure you have Go 1.16+ installed
-
Clone the repository
-
Install dependencies:
go mod tidy
-
Build the application:
go build -o build/split-billing-bot cmd/main.go
- When you start the bot, it also runs a web server at http://localhost:8080/.
- Open this page in your browser to view and scan the WhatsApp QR code for login.
-
Run the application:
./build/split-billing-bot
-
Open your browser and go to http://localhost:8080/ to view the QR code.
-
Scan the QR code with WhatsApp to log in.
-
The bot will now process commands in your chats.
/new [name]
- Create a new bill/add [item] [amount]
- Add an item to the current bill (optional)- Send a photo of your bill to add all items at once (optional, requires OpenAI API key)
/join [bill_name]
- Join the current bill as a participant (optional)/calculate
- Calculate and show how much each person owes in the current bill/close
- Close the current bill and send private messages to all participants/help
- Show available commands/lang [indonesia|english]
- Change bot language preference for this chat
/new Sarapan
- Each person types
/join
to participate - Send a photo of your bill to add all items at once (optional)
/calculate
/close
when done (each participant receives a private message with their share)
- Add image processing for bill images using LLM
- Send message to the participants WhatsApp number when bill is closed
- When user types
/join
, send message to the user that they have joined the bill - Add bill name to the
/join
command - Add bill name to the
/calculate
command - Add bill name to the
/close
command - Add bill name to the
/help
command - Change the database server to use PostgreSQL
- Use Docker to containerize the application
- Use GitHub Actions to deploy the application to a VPS
- Add unit tests
- Add integration tests
- The bot supports English and Indonesian. Use
/lang indonesia
or/lang english
to switch. - To add a new language, edit or add files in
internal/translations/
following the existing structure. - It's not perfect, but it works.
Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.
If you find a bug or have a feature request, please open an issue on GitHub.
MIT