An open-source, modular, and event-driven omnichannel bot engine designed for WhatsApp, Telegram, and Discord. Built with Node.js (ESM), Prisma, and a robust adapter-based architecture.
Bobabot provides a unified interface for multiple messaging platforms. By utilizing a "Universal Context" pattern, developers can write a single plugin that functions seamlessly across WhatsApp, Telegram, and Discord.
- Multi-Platform Support: Built-in adapters for WhatsApp (Baileys), Telegram (Telegraf), and Discord (Oceanic.js).
- Universal Context: Abstracted message object ('m') that standardizes replies, media sending, and reactions.
- Stateless Architecture: Database-first approach using Prisma ORM (SQLite/PostgreSQL).
- Event-Driven: Centralized EventBus for cross-component communication.
- REST API: Built-in Hono API for broadcasting messages, checking status, and managing users.
- Admin Tools: Comprehensive in-chat and API-based user management (Premium, Bans, Limits).
- Security: Idempotency features to prevent duplicate message processing and optional API authentication.
- Node.js >= 20.0.0
- npm or yarn
- An active database (SQLite is default)
Clone the repository and install dependencies:
git clone https://github.com/Leuthra/bobabot.git
cd bobabot
npm installCopy the example environment file and fill in your credentials:
cp .env.example .envKey configuration variables:
WA_SESSION_ID: Unique name for your WhatsApp session.TG_BOT_TOKEN: Your Telegram Bot API token.DISCORD_BOT_TOKEN: Your Discord Bot token.BOT_OWNER: Your platform ID (e.g., your WhatsApp LID or Telegram ID).API_SECRET: Secret key for Bearer authentication on API endpoints.
Run Prisma migrations to set up your database:
npx prisma db push
npx prisma generateStart the engine:
npm startFor development with hot-reload:
npm run devThe bot exposes a REST API on the port specified in .env (default: 3000).
GET /api/status: Health check and system status.POST /api/broadcast: Send messages to all users across all platforms.GET /api/users: Retrieve registered user list.PATCH /api/users/:id: Update user status (e.g., set premium or ban).
The project uses Vitest for unit testing.
npm testThis project is licensed under the MIT License - see the LICENSE file for details.