A simple WhatsApp bot that automatically mentions all participants in a group when someone sends the exact message "@all". It uses the @whiskeysockets/baileys library for WhatsApp connection and qrcode-terminal for easy authentication right in your terminal.
- Node.js (v20+ recommended)
pnpm(ornpm)- Docker & Docker Compose (optional, for containerized execution)
Note: Baileys is stable using pnpm or npm, if you using bun baileys will not working correctly.
- Install dependencies
pnpm install
- Compile the TypeScript code
pnpm run build
- Start the bot
pnpm run start
- Link your device
- A QR Code will appear in the terminal.
- Open WhatsApp on your phone, go to Linked Devices, and scan the QR code.
- Your session will be saved in the
sessionfolder.
To run the bot in the background using Docker and ensure it auto-restarts on failure:
- Start the container
docker-compose up -d
- View the QR code for initial login
(Scan the QR code from the logs. Press
docker logs -f wa-tagall
Ctrl+Cto exit the log view once connected.)
Note: The
sessionfolder is mounted as a volume. This means your login state is preserved even if the container is restarted or rebuilt!
When a message containing exactly "@all" is sent in a group where the bot is a member (or admin), the bot will fetch the group metadata and reply with a message saying "@all", tagging every single participant in the group.