A fast, modular, open-source WhatsApp bot framework for developers.
Build your own feature-rich WhatsApp bot in minutes — no experience required.
Features · Quick Start · Commands · Contributing · Docs
🐺 WOLFTECH — WhatsApp Bot Framework is a free, open-source WhatsApp bot framework built on top of Baileys — the most popular unofficial WhatsApp Web API library for Node.js. It gives developers a clean, well-structured starting point to build their own WhatsApp bots without dealing with the complexity of raw WebSocket connections, session management, or message parsing.
Whether you want to build a group management bot, a customer support bot, an automation tool, or just learn how WhatsApp bots work under the hood — WOLFTECH gives you the foundation.
🎯 Built for developers by developers. Fork it, extend it, make it yours.
- 🔌 Plug-and-play command system — drop a
.jsfile into thecommands/folder and it's live - 📁 Auto command loader — scans all subfolders and registers commands automatically at startup
- 🔐 Pairing code & Session ID login — no QR code scanning needed
- 👑 Owner/JID management — smart JID resolution including
@lid(linked devices) - 🛡️ Rate limit protection — built-in cooldown system to prevent spam abuse
- 👥 Group event detection — detects new members joining groups in real time
- 👁️ Status watcher — auto-view and auto-react to WhatsApp statuses
- 🔄 Auto-reconnect — exponential backoff reconnection on disconnect
- 🌐 Multi-platform — runs on Local/VPS, Heroku, Render, Replit, Railway, and more
- 📋 Live message logging — colour-coded terminal logs for every incoming DM and group message
- 🤖 Public/Private/Group-only modes — control who can use your bot
- 💬 Prefixed & prefixless modes — supports both
.commandand rawcommandstyles - 🧩 Category-based commands — organise commands into folders by category automatically
| Layer | Technology |
|---|---|
| Runtime | Node.js 18+ (ESM) |
| WhatsApp API | @whiskeysockets/baileys |
| Terminal UI | chalk |
| Environment | dotenv |
| Module system | ES Modules (import/export) |
- Node.js v18 or higher
- A WhatsApp account (personal or dedicated bot number)
- Git
git clone https://github.com/YOUR_USERNAME/wolftech-bot.git
cd wolftech-botnpm installcp .env.example .envEdit .env with your settings:
BOT_NAME=WOLFTECH
PREFIX=.node index.jsOn first run you will see the login menu:
🐺 WOLFTECH v1.1.3 - LOGIN SYSTEM
1) Pairing Code Login (Recommended)
2) Clean Session & Start Fresh
3) Use Session ID from Environment
Choose option 1, enter your phone number (with country code, no +), then enter the pairing code shown in your WhatsApp under Settings → Linked Devices → Link a Device.
wolftech-bot/
├── index.js # Main entry point — bot core
├── .env # Environment variables
├── .env.example # Environment variable template
├── owner.json # Auto-generated — stores owner JID
├── prefix_config.json # Auto-generated — stores current prefix
│
├── commands/ # 📁 All commands live here
│ ├── general/ # General-purpose commands
│ │ ├── ping.js
│ │ └── help.js
│ ├── group/ # Group management commands
│ │ ├── ban.js
│ │ ├── add.js
│ │ └── antidemote.js
│ ├── automation/ # Automation commands
│ │ ├── autoreactstatus.js
│ │ └── autoviewstatus.js
│ └── utility/ # Utility commands
│ └── getjid.js
│
├── lib/ # Shared helpers/utilities
│ └── menuHelper.js
│
├── data/ # Auto-generated runtime data
│ ├── welcome_data.json
│ └── member_detection.json
│
└── session/ # Auto-generated — Baileys session files
This is the heart of WOLFTECH. The entire command system is designed so that adding a new command is as simple as creating a new file.
When the bot starts, loadCommandsFromFolder('./commands') is called. It:
- Recursively scans every subfolder inside
commands/ - Imports every
.jsfile it finds (skipping.test.jsand.disabled.jsfiles) - Reads the
name,alias, andcategoryfrom each exported module - Registers the command into a global
Mapso it can be looked up in milliseconds - Groups commands by their folder name (subfolder = category) for the
helpcommand
This means you never have to register a command manually. Just create the file.
Every command is a single .js file with a default export:
// commands/general/ping.js
export default {
name: 'ping', // command name (how users call it)
description: 'Check bot speed', // shown in help menu
category: 'general', // auto-set from folder name
aliases: ['p', 'test'], // alternative names users can type
ownerOnly: false, // set true to restrict to bot owner
async execute(sock, msg, args, prefix, context) {
const chatId = msg.key.remoteJid;
await sock.sendMessage(chatId, {
text: `🏓 Pong! Bot is alive.`
}, { quoted: msg });
}
};Every command receives a context object as the 5th argument, giving you access to the entire bot state without importing anything:
async execute(sock, msg, args, prefix, context) {
const {
OWNER_NUMBER, // owner's phone number
OWNER_JID, // owner's WhatsApp JID
BOT_NAME, // bot name from .env
VERSION, // bot version string
isOwner, // function — call isOwner() → true/false
jidManager, // JID resolution & owner management class
store, // in-memory message store
statusDetector, // status watcher instance
updatePrefix, // function to change the prefix live
getCurrentPrefix, // function to get the current prefix
rateLimiter, // rate limit protection instance
memberDetector, // group member detection instance
isPrefixless, // boolean — true if bot is in prefixless mode
} = context;
}Just create a new subfolder inside commands/. It becomes a category automatically:
commands/
└── myfeature/
├── mycommand.js # category = 'myfeature'
└── anothercommand.js
export default {
name: 'restart',
ownerOnly: true, // ← non-owners get a rejection message automatically
async execute(sock, msg, args, prefix, context) {
// only the bot owner reaches this code
}
};Rename the file to include .disabled.:
commands/general/ping.disabled.js ← skipped by the loader
WOLFTECH supports two login methods:
No QR code. Enter your phone number and WhatsApp gives you an 8-digit code to type in the app under Settings → Linked Devices.
If you've previously generated a session, export it as a base64 string or WOLF-BOT:... prefixed string and set it in your environment:
SESSION_ID=WOLF-BOT:eyJub2lzZUtleS...The bot will authenticate automatically without any prompts — perfect for cloud deployments.
WhatsApp JIDs (Jabber IDs) are the unique identifiers for every user, group, and channel. WOLFTECH handles all JID types correctly:
| JID Type | Example | Meaning |
|---|---|---|
@s.whatsapp.net |
254712345678@s.whatsapp.net |
Regular user |
@g.us |
120363xxxxxx@g.us |
Group chat |
@lid |
12345:67@lid |
Linked/companion device |
@newsletter |
xxx@newsletter |
WhatsApp Channel |
@lid JIDs are companion device identifiers that don't contain a phone number. WOLFTECH resolves them back to real phone JIDs using a 4-step fallback chain:
- Group participant metadata (has
phoneNumberon some builds) - Baileys signal repository LID→PN mapping
- Global
lidPhoneCacheif populated sock.store.contactslookup
Every incoming message is printed in a structured, colour-coded log:
DM (green):
╭─────────────────────────────────────
│ 🐺 WOLFTECH LOG #12
├─────────────────────────────────────
│ 👤 Name : Silent Wolf
│ ☎️ Number : +254785471416
│ 🆔 JID : 254785471416@s.whatsapp.net
│ 💬 Msg : .menu
│ 🕒 Time : 18:42:11
│ 📩 Type : DM
╰─────────────────────────────────────
Group message (green):
╭──────────────────────────────────────────
│ 🐺 WOLFTECH LOG #13
├──────────────────────────────────────────
│ 👥 Group : Wolf Empire
│ 👤 Sender : Silent Wolf
│ ☎️ Number : +254785471416
│ 🆔 JID : 120363xxxxxx@g.us
│ 💬 Msg : Hello everyone
│ 🕒 Time : 18:44:03
│ 📩 Type : GROUP
╰──────────────────────────────────────────
# Install PM2 for process management
npm install -g pm2
# Start with PM2
pm2 start index.js --name wolftech
# Auto-restart on reboot
pm2 startup
pm2 saveSet these environment variables on your platform:
BOT_NAME=WOLFTECH
PREFIX=.
SESSION_ID=WOLF-BOT:your_session_string_hereThe platform is auto-detected and shown in the .connect command output.
Control who can use your bot at runtime:
| Mode | Behaviour |
|---|---|
public |
Everyone can use commands |
private |
Only the owner can use commands |
group-only |
Only works in groups |
maintenance |
Only ping, help, status, uptime work |
silent |
No responses at all (stealth mode) |
Contributions are welcome and appreciated. Here's how to get started:
- Fork the repository
- Create a feature branch:
git checkout -b feature/my-new-command - Write your command in the appropriate
commands/subfolder - Test it locally
- Commit with a clear message:
git commit -m 'feat: add weather command' - Push and open a Pull Request
- New commands (games, utilities, group tools, AI integrations)
- Bug fixes and stability improvements
- Platform-specific deployment guides
- Translations / localisation
- Unit tests
Please read CONTRIBUTING.md before submitting.
Q: Is this against WhatsApp's Terms of Service?
A: Using unofficial APIs carries inherent risk. Use a dedicated bot number, not your personal account. WOLFTECH is provided for educational and development purposes.
Q: My session keeps disconnecting. What do I do?
A: Try option 2 (Clean Session) from the login menu, then re-pair. Persistent disconnects are usually caused by running the same session on multiple devices simultaneously.
Q: Can I add AI / ChatGPT to my bot?
A: Yes — create a command that calls the OpenAI API (or any other) and sends the response back. The command system is completely flexible.
Q: How do I run multiple bots?
A: Clone the repo into separate folders, give each its own session/ directory and .env file, and run them as separate processes.
Q: Does it work on Windows?
A: Yes. Node.js and all dependencies are cross-platform.
This project is licensed under the MIT License — see LICENSE for details.
You are free to use, modify, and distribute this code for personal or commercial projects. Attribution is appreciated but not required.
WOLFTECH is an independent open-source project. It is not affiliated with, endorsed by, or connected to WhatsApp LLC or Meta Platforms Inc. in any way. Use responsibly and at your own risk.
Made with ❤️ for the developer community
⭐ Star this repo if it helped you · 🍴 Fork it to make it yours · 🐛 Open an issue if something breaks
