Advanced WhatsApp Bot with modular architecture, built with Node.js and whatsapp-web.js.
- π§ Modular command system
- π Built-in dashboard
- β‘ Rate limiting
- π Auto-restart functionality
- π₯ Group management
- π― Role-based permissions
- π± Multi-device support
- π Cloud deployment ready
-
Run the deployment script:
# On Windows ./deploy.bat # On Linux/Mac chmod +x deploy.sh ./deploy.sh
-
Follow the script instructions to push to GitHub
-
Connect your GitHub repository to Render
- Node.js 16+
- npm or yarn
- Git
# Clone the repository
git clone https://github.com/YOUR_USERNAME/whatsapp-bot.git
cd whatsapp-bot
# Install dependencies
npm install
# Configure the bot
cp config.json config.local.json
# Edit config.local.json with your settings
# Start the bot
npm start{
"bot": {
"name": "WhatsApp Bot",
"prefix": "!",
"version": "2.0.0"
},
"adminBot": [
"YOUR_PHONE_NUMBER@c.us"
]
}NODE_ENV=production
PORT=10000
BOT_PREFIX=!
DASHBOARD_ENABLED=true
!help- Show available commands!prefix- Show current prefix!ping- Check bot responsiveness
!restart- Restart the bot!eval <code>- Execute JavaScript code!cmd <command>- Execute system commands
Access the web dashboard at:
- Local:
http://localhost:3000 - Production:
https://your-app-name.onrender.com
- Fork this repository
- Connect to Render
- Configure environment variables
- Deploy!
# Install Heroku CLI
heroku create your-app-name
git push heroku main# Using PM2
npm install -g pm2
pm2 start ecosystem.config.js
pm2 save
pm2 startup- Never commit sensitive data
- Use environment variables for production
- Implement rate limiting
- Validate all inputs
- Keep dependencies updated
whatsapp-bot/
βββ commands/ # Bot commands
βββ events/ # Event handlers
βββ scripts/ # Helper scripts
βββ data/ # Bot data storage
βββ logs/ # Log files
βββ config.json # Configuration
βββ index.js # Main bot file
- Create a new file in
commands/ - Export command configuration
- Implement
onStartfunction - Restart bot to load
- Create a new file in
events/ - Export event configuration
- Implement event handlers
- Restart bot to load
module.exports = {
config: {
name: "commandname",
role: 0, // 0: User, 1: Admin, 2: Owner
shortDescription: "Command description",
longDescription: "Detailed description",
category: "category",
guide: "Usage guide",
coolDown: 5
},
onStart: async ({ message, args, client }) => {
// Command logic here
}
};module.exports = {
config: {
name: "eventname",
version: "1.0.0",
description: "Event description"
},
execute: async (client, ...args) => {
// Event logic here
}
};The bot checks for updates automatically. To update:
git pull origin main
npm install
npm restart- Download latest version
- Backup your config
- Replace files
- Restore config
- Restart bot
- QR Code not appearing: Check logs for errors
- Commands not working: Verify prefix and permissions
- Bot not responding: Check WhatsApp Web connection
- Memory issues: Restart bot or upgrade hosting
NODE_ENV=development npm start- Documentation: Check the deployment guide
- Issues: Report on GitHub Issues
- Community: Join our Discord/Telegram group
This project is licensed under the MIT License - see the LICENSE file for details.
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
If you find this project useful, please consider giving it a star!
- whatsapp-web.js - WhatsApp Web API
- Render - Deployment platform
- All contributors and users
Made with β€οΈ by Rahaman Leon
Happy Botting! π€