A versatile WhatsApp bot designed to manage and enhance communication within a college or community group, built using Go and the whatsmeow library.
To host and run this bot, you need:
- A Dedicated WhatsApp Account: The bot operates by linking to a WhatsApp account (like WhatsApp Web). This account must remain logged in, active, and should ideally be a separate number specifically for the bot.
- Docker & Docker Compose: For the easiest setup and hosting.
The easiest way to get remy-bot running and ensure its session data persists is by using Docker Compose.
Before building, you must configure the bot's settings by editing the config.json file in the root directory.
{
"database": "data/remy.db",
"session_dir": "data/session",
"prefix": ".",
"target_group_name": "Test Group", // <--- IMPORTANT: Change this to your target group's name
"timezone": "Asia/Kolkata"
}Either use build the docker image yourself from the provided Dockerfile or pull the docker image of the bot from DockerHub:
# compose.yml
services:
remy-bot:
image: kaezr/remy-bot:latest
restart: unless-stopped
volumes:
- remy_data:/app/data
- ./config.json:/app/config.json
volumes:
remy_data:docker compose up -dSince this is the first time running the bot, you need to link the WhatsApp account. The bot will print a QR code to the container's logs.
- View Logs: Access the live logs to find the QR code:
docker compose logs -f
- Scan: Use the WhatsApp account you wish to dedicate to the bot to Link a Device (WhatsApp on your phone -> Settings/Menu -> Linked Devices).
- Wait: Once the QR code is scanned and the connection is successful, the log messages will show a connection status. You can stop viewing the logs with
Ctrl+C. The bot will continue running in the background.
If you prefer to build and run the application without Docker, you can use the standard Go commands (provided in a Makefile).
make buildmake run