Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
A web-based dashboard for broadcasting messages to WhatsApp groups with intelligent safety rules.
- Dashboard (Val Town) — Web UI + API. Serves the dashboard page and stores state in blob storage.
- Bot (Termux) — Runs
whatsapp-web.json your phone. Connects to WhatsApp, polls the dashboard for commands, and reports status back.
┌─────────────────┐ poll commands ┌──────────────────┐
│ Val Town │ ◄──────────────────── │ Termux Bot │
│ Dashboard │ ────────────────────► │ (whatsapp-web.js)│
│ (this val) │ report status │ (your phone) │
└─────────────────┘ └──────────────────┘
- 📱 Scan QR code directly in browser
- ✏️ Write/edit broadcast message with
{group}placeholder - ▶️ Start, ⏸️ Pause/Resume, ⏹️ Stop controls
- 📊 Real-time progress (sent, remaining, progress bar)
- 📋 Activity log
- 🟢 Bot online/offline indicator
| Method | Path | Description |
|---|---|---|
| GET | /api/status | Current state (polled by dashboard every 2s) |
| POST | /api/message | Update broadcast message |
| POST | /api/start | Start broadcasting |
| POST | /api/pause | Toggle pause/resume |
| POST | /api/stop | Stop and reset |
| POST | /api/bot-update | Bot reports status + gets command |
| GET | /api/command | Bot polls for commands |
| POST | /api/command/ack | Bot acknowledges command |
| POST | /api/reset | Full state reset |
- ⏱️ Random delays: 30–90 seconds between messages
- 📦 Batch cooldown: 2 hours after every 12 messages
- 📅 Daily limit: 50 messages per day
- 🕘 Working hours: 9 AM – 9 PM only
- ⌨️ Typing simulation before each message
- 💾 Progress persistence via Val Town blob storage
Your dashboard is live at the URL shown in main.tsx's endpoint.
Install Termux from F-Droid (not Play Store), then run:
pkg update && pkg upgrade -y pkg install nodejs git python build-base -y npm install whatsapp-web.js qrcode
Download termux-bot.js from this val, then:
node termux-bot.js
- Open the dashboard URL in your browser
- The bot will send a QR code — scan it with WhatsApp
- Write your message (use
{group}for personalization) - Hit Start
| File | Purpose |
|---|---|
main.tsx | HTTP handler — API routes + static file serving |
index.html | Dashboard UI |
style.css | Dark theme styling |
script.js | Frontend polling and controls |
termux-bot.js | Bot script for Termux (download and run on phone) |
- Use a spare/secondary WhatsApp number
- Keep daily limit low (20–30) for the first few days
- If you see rate limit errors, stop immediately and increase delays