A WhatsApp bot for splitting expenses and tracking shared balances, built with Node.js and whatsapp-web.js.
Add +918799743633 to your WhatsApp group and msg /help
No Meta developer account, no API keys, no webhooks — just scan a QR code once and the bot is live.
- Node.js (v18+)
- whatsapp-web.js — runs a real WhatsApp Web session
- better-sqlite3 — persistent SQLite storage (balances survive restarts)
- PM2 — recommended for VPS deployment
/split <amount> [by <person> <amount>] [<person> owes <amount>] [for <description>]
| Example | What it does |
|---|---|
/split 600 |
Splits ₹600 equally among everyone in the group |
/split 600 @Mohit @Vipul and me |
Splits ₹600 equally among only those three people |
/split 600 for dinner |
Same as above but tags the expense "dinner" |
/split 4000 by me 3000 by @Vipul 1000, @Vipul owes 2500, @Mohit owes 1500 for groceries |
Custom contributions and custom debts |
/paid <amount> [to/from @person]
| Example | What it does |
|---|---|
/paid 200 to @Mohit |
You paid Mohit ₹200 |
/paid 200 from @Mohit |
Mohit paid you ₹200 |
/paid 500 from @Vipul to @Mohit |
Vipul paid Mohit ₹500 directly |
/paid @Mohit to me |
Clear everything Mohit owes you |
/got <amount> from @person
Mirror of /paid — use whichever reads more naturally.
/balances
/balances @Mohit
Shows the minimum set of payments needed to settle all debts in the group.
/history
/history 10
/history @Mohit
/history 10 @Mohit
Default count is 5, maximum is 20.
/delete → list recent transactions with numbers
/delete 2 → delete transaction #2 and reverse its balance impact
/resetall → shows a summary and asks for confirmation
/resetall confirm → permanently clears all transactions and balances
Download and install Node.js v18 or newer from https://nodejs.org.
git clone https://github.com/YOUR_USERNAME/splitwala-webjs.git
cd splitwala-webjs
npm installnpm startOn the first run, a QR code appears in the terminal.
Open WhatsApp on your phone → Linked Devices → Link a Device → scan the QR code.
After that, your session is saved in .wwebjs_auth/ and the bot starts automatically on future runs.
Install PM2 globally:
npm install -g pm2Start with PM2:
pm2 start ecosystem.config.js
pm2 save
pm2 startup # follow the printed command to auto-start on rebootView logs:
pm2 logs splitwalaOn the first run after deploying, attach to the logs to scan the QR code:
pm2 logs splitwala --lines 50- Data is stored in
data/splitwala.db(SQLite) — balances persist across restarts - Each group and DM has its own isolated balance sheet
- Use
me,i, ormyselfto refer to yourself in any command .wwebjs_auth/holds your WhatsApp session — keep it private and back it up