@syed-abdullah-shah/wa-bot-cli
v1.0.0
Published
A powerful, anti-ban protected WhatsApp bot CLI built with Baileys
Maintainers
Readme
💬 WhatsApp Bot CLI
A powerful, anti-ban protected WhatsApp bot
✨ Features
🚀 Quick Start
📋 Prerequisites
| Requirement | Version |
| ------------------------------------------------------------------------------------------------------- | -------------- |
| | 18+ |
|
| Latest |
|
| Active Account |
📦 Installation
# Clone the repository
git clone <your-repo-url>
cd WA
# Install dependencies
npm install
# Copy environment file
cp .env.example .env
# Edit .env with your settings
nano .env⚙️ Configuration
Edit .env file:
# Bot Settings
BOT_PREFIX=!
BOT_NAME=MyBot
OWNER_NUMBER=1234567890
# Authentication (choose one)
USE_PAIRING_CODE=false # Set to true for phone number auth
PHONE_NUMBER=1234567890 # Required if USE_PAIRING_CODE=true▶️ Running the Bot
# Development mode (with hot reload)
npm run dev
# Production mode
npm run build
npm start🔑 Authentication
QR Code (default):
- Run
npm run dev - Scan the QR code with WhatsApp (Settings > Linked Devices > Link a Device)
Pairing Code (alternative):
- Set
USE_PAIRING_CODE=trueandPHONE_NUMBER=your_numberin.env - Run
npm run dev - Enter the 8-digit code in WhatsApp (Settings > Linked Devices > Link with phone number)
📝 Commands
| Command | Description | Access |
| -------------------- | ------------------------------- | ----------- |
| !ping | Check if bot is responsive | 🌐 Everyone |
| !help | List all available commands | 🌐 Everyone |
| !info | Show bot information | 🌐 Everyone |
| !uptime | Show bot uptime | 🌐 Everyone |
| !stats | Show detailed statistics | 👑 Owner |
| !ban @user | Ban a user from using the bot | 👑 Owner |
| !broadcast <msg> | Broadcast message to all chats | 👑 Owner |
| !reload | Reload commands without restart | 👑 Owner |
📁 Project Structure
WA/
├── src/
│ ├── commands/ # Bot commands
│ ├── config/ # Configuration
│ ├── core/ # Connection & client
│ ├── handlers/ # Message handlers
│ ├── services/ # Anti-ban services
│ ├── types/ # TypeScript types
│ └── utils/ # Utilities
├── docs/ # Documentation
├── data/auth/ # Session storage
├── logs/ # Log files
└── scripts/ # CLI tools💡 Use Cases
See docs/USE-CASES.md for detailed use cases including:
| Use Case | Description | | ---------------------- | ------------------------------ | | 🎧 Customer Support | Automated customer service bot | | 🔔 Notification System | Send alerts and notifications | | 👥 Group Management | Manage WhatsApp groups | | 🤖 Personal Assistant | AI-powered personal helper | | 🛒 E-commerce | Order tracking and support |
📚 Documentation
| Document | Description | | ------------------------------------------- | ------------------------- | | 📖Configuration Guide | All configuration options | | 📋Commands Reference | Complete command list | | 💡Use Cases | Implementation examples | | 🔧API Reference | Developer API docs | | 🔍Troubleshooting | Common issues & fixes |
🖥️ CLI Commands
npm run dev # Start in development mode
npm run build # Build for production
npm run start # Start production build
npm run clean # Clean all cache
npm run clean:auth # Clean auth data only
npm run status # Check bot status
npm run config # Show current configuration🛡️ Anti-Ban Features
This bot includes multiple anti-ban protections:
┌─────────────────────────────────────────────────────────────────┐
│ ANTI-BAN PROTECTION LAYERS │
├─────────────────────────────────────────────────────────────────┤
│ ⏱️ Rate Limiting │ Per-user, per-group, and global │
│ ⏳ Response Delays │ Randomized delays (2-5 seconds) │
│ ⌨️ Typing Simulation │ Shows typing indicator │
│ 🔍 Duplicate Detection│ Prevents sending duplicates │
│ 🟢 Presence Updates │ Periodic online status updates │
│ 📬 Message Queue │ Spreads messages over time │
└─────────────────────────────────────────────────────────────────┘🔐 Environment Variables
See docs/CONFIGURATION.md for all available options.
🤝 Contributing
Contributions are welcome! Here's how to get started:
- 🍴 Fork the repository
- 🌿 Create your feature branch (
git checkout -b feature/amazing-feature) - 💾 Commit your changes (
git commit -m 'Add amazing feature') - 📤 Push to the branch (
git push origin feature/amazing-feature) - 🔃 Open a Pull Request
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
⚠️ Disclaimer
Note: This bot is for educational purposes only. Use responsibly and in accordance with WhatsApp's Terms of Service. The developers are not responsible for any misuse or account bans.
Built with ❤️ using Baileys
