Advanced Telegram bot built with Node.js and Telegraf for performing mass actions in groups.
- π« BanAll - Ban all group members
- β UnbanAll - Unban all banned members
- π’ KickAll - Kick all members from group
- π MuteAll - Mute all members instantly
- π UnmuteAll - Unmute all members
- π Stats - Get detailed group statistics
- π‘οΈ Admin Protection - Automatically excludes admins
- β‘ Fast & Efficient - Optimized performance
- π― Error Handling - Robust error management
- Node.js 18 or higher
- Telegram Bot Token (from @BotFather)
- MongoDB (optional)
git clone https://github.com/PbxBad/Banall
cd Banallnpm installCreate a .env file:
BOT_TOKEN=your_bot_token_here
OWNER_ID=your_telegram_user_id
MONGODB_URI=mongodb://localhost:27017/telegram-bot
BOT_USERNAME=YourBotUsernameDevelopment:
npm run devProduction:
npm start| Command | Description | Admin Only |
|---|---|---|
/start |
Start the bot & show welcome | No |
/help |
Show help message | No |
/stats |
Get group statistics | No |
/banall |
Ban all members | Yes |
/unbanall |
Unban all members | Yes |
/kickall |
Kick all members | Yes |
/muteall |
Mute all members | Yes |
/unmuteall |
Unmute all members | Yes |
# Clone repository
git clone https://github.com/PbxBad/Banall
# Navigate to directory
Banall
# Install dependencies
npm install
# Create .env file
cp .env.example .env
# Edit .env with your credentials
nano .env
# Start bot
npm start# Build Docker image
docker build -t telegram-bot .
# Run container
docker run -d --env-file .env telegram-bot# Login to Heroku
heroku login
# Create new app
heroku create your-bot-name
# Set environment variables
heroku config:set BOT_TOKEN=your_token
heroku config:set OWNER_ID=your_id
# Deploy
git push heroku main# Required
BOT_TOKEN=1234567890:ABCdefGHIjklMNOpqrsTUVwxyz
OWNER_ID=123456789
# Optional
MONGODB_URI=mongodb://localhost:27017/bot
BOT_USERNAME=YourBot
LOG_LEVEL=infoThe bot needs these admin permissions:
- β Delete messages
- β Ban users
- β Restrict members
- β Invite users
// Check if user is admin
await isAdmin(ctx)
// Check if bot is admin
await isBotAdmin(ctx)
// Ban user
await ctx.telegram.banChatMember(chatId, userId)
// Mute user
await ctx.telegram.restrictChatMember(chatId, userId, {
can_send_messages: false
})- Group Management - Manage large groups efficiently
- Moderation - Quick mass actions for raids/spam
- Administration - Bulk user management
- Testing - Test bot features in groups
-
Telegram Limits: Due to API limitations, some features work differently:
- BanAll: May require members to send messages first
- Large groups: Pagination required for 10k+ members
-
Permissions: Bot must be admin with appropriate permissions
-
Rate Limits: Telegram enforces rate limits on mass actions
- Never share your bot token
- Use environment variables
- Keep dependencies updated
- Validate user permissions
- Log all actions
# Check if bot is running
pm2 list
# Check logs
npm run logs
# Restart bot
pm2 restart bot- Ensure bot is admin
- Check bot has ban/mute permissions
- Verify user is admin
Total Users: 1000+
Active Groups: 50+
Commands Executed: 10,000+
Uptime: 99.9%
Contributions are welcome!
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing) - Commit changes (
git commit -m 'Add feature') - Push to branch (
git push origin feature/amazing) - Open Pull Request
This project is licensed under the MIT License - see LICENSE file.
- Name: BadMunda
- Telegram: @BadMundaXD
- GitHub: @badmunda
- Support Group: @PBX_CHAT
- Updates Channel: @PBX_UPDATE
- Add database support
- Implement user warnings
- Add custom commands
- Anti-spam features
- Multi-language support
- Web dashboard
- Analytics system
β Star this repo if you found it useful!
Made with β€οΈ by BadMunda