nexusautobot
v1.0.3
Published
Advanced Process Manager for Discord Bots with Auto-Restart, Error Detection, and Shard Management
Maintainers
Readme
🚀 NexusAutoBot
Advanced Process Manager for Discord Bots - Built specifically for Discord.js with intelligent monitoring, auto-restart, and error detection.
✨ Features
- 🔄 Auto-Restart - Automatically restarts your bot on crash
- 🧠 Intelligent Error Detection - Analyzes errors and determines severity
- 📊 Discord.js Optimized - Built specifically for Discord bots
- 🎯 Live Dashboard - Real-time monitoring with beautiful CLI interface
- 🔔 Discord Webhook Notifications - Get notified directly in Discord
- 🚦 Shard Management - Auto-sharding support for large bots
- 📝 Advanced Logging - Keep track of everything
- ⚡ Zero Config - Works out of the box
📦 Installation
npm install -g nexusautobot🎯 Quick Start
# Start your bot
nexus start bot.js --name my-bot
# View running bots
nexus list
# Open live dashboard
nexus dashboard
# View logs
nexus logs my-bot
# Stop bot
nexus stop my-bot📖 Commands
Start a Bot
nexus start <file> [options]
Options:
-n, --name <name> Bot name
-i, --instances <number> Number of instances (default: 1)
--shard Enable auto-sharding
--webhook <url> Discord webhook URL for notificationsExample:
nexus start bot.js --name "MyDiscordBot" --webhook "https://discord.com/api/webhooks/..."List Running Bots
nexus list
# or
nexus lsView Bot Status
nexus status <name>View Logs
nexus logs <name> [options]
Options:
-f, --follow Follow log output
-n, --lines <number> Number of lines (default: 50)Live Dashboard
nexus dashboard
# or
nexus dashThe dashboard shows:
- 🤖 Running bots with status
- 📜 Live logs
- 📊 CPU & Memory usage
- 📈 System statistics
Press q or ESC to exit.
Stop/Restart Bot
nexus stop <name>
nexus restart <name>Delete Bot
nexus delete <name>
nexus delete-allConfigure Webhook
nexus webhook <name> <webhook-url>Webhook notifications include:
- ⚠️ Critical errors
- 🔄 Auto-restarts
- 🛑 Maximum restart limit reached
- ✅ Bot started/stopped
🎨 Features in Detail
Intelligent Error Detection
NexusAutoBot analyzes errors and categorizes them:
Critical Errors (Auto-restart)
- Invalid token
- Connection failures
- Memory issues
- Fatal Node.js errors
Non-Critical Errors (No restart)
- Rate limits
- Missing permissions
- Temporary Discord API issues
Discord.js Optimized Monitoring
- Gateway ping tracking
- Command usage statistics
- Event monitoring
- API call tracking
- Memory leak detection
- Shard health monitoring
Auto-Sharding Support
nexus start bot.js --shardAutomatically manages shards based on server count and optimizes distribution.
🔧 Configuration
NexusAutoBot stores configuration in ~/.nexusautobot/
config.json- Global settingsprocesses.json- Bot processes data
📊 Example Bot
// bot.js
const { Client, GatewayIntentBits } = require('discord.js');
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent
]
});
client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}`);
});
client.on('messageCreate', (message) => {
if (message.content === '!ping') {
message.reply('Pong!');
}
});
client.login(process.env.TOKEN);Start it:
nexus start bot.js --name ping-bot --webhook <your-webhook>🆚 NexusAutoBot vs PM2
| Feature | NexusAutoBot | PM2 | |---------|-------------|-----| | Discord.js Optimized | ✅ | ❌ | | Intelligent Error Detection | ✅ | ❌ | | Discord Webhook Integration | ✅ | ❌ | | Auto-Sharding | ✅ | ❌ | | Bot-Specific Monitoring | ✅ | ❌ | | General Process Management | ❌ | ✅ |
NexusAutoBot is built specifically for Discord bots, while PM2 is a general-purpose process manager.
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
📝 License
MIT License - see the LICENSE file for details
🙏 Acknowledgments
- Built with ❤️ by the NexusHub Team
- Inspired by PM2 but optimized for Discord bots
🐛 Bug Reports
Found a bug? Open an issue
📧 Support
- GitHub Issues: Issues Page
- Discord: Join our Discord
- Email: [email protected]
🌟 Star History
If you find NexusAutoBot useful, please consider giving it a star on GitHub! ⭐
Made with 💙 for the Discord bot community
