A Discord bot with web dashboard for The Digital Den server.
npm installCreate a .env-dis file in the root directory (or in the parent directory if deploying to hosting):
DISCORD_TOKEN=your_discord_bot_token_here
CLIENT_ID=your_discord_client_id_here
CLIENT_SECRET=your_discord_client_secret_here
REDIRECT_URI=https://yourdomain.com/auth/callback
SESSION_SECRET=your_random_session_secret_here
PORT=3000
GUILD_ID=your_guild_id_optionalOption A: Quick Start (Windows)
start-bot.batOption B: Manual Start
node index.jsFor complete setup, monitoring, and troubleshooting instructions, see:
- BOT_OPERATIONS.md - Complete operations guide
- ✅ Discord bot with slash commands
- ✅ Web dashboard with Discord OAuth
- ✅ Moderation commands (ban, lock, unlock)
- ✅ Auto-restart on crash (with PM2)
- ✅ Heartbeat monitoring
- ✅ File-based logging
- ✅ Graceful shutdown handling
├── index.js # Main bot entry point
├── start-bot.bat # Quick start script (Windows)
├── monitor.js # Health check & auto-restart script
├── ecosystem.config.js # PM2 configuration
├── src/
│ ├── bot/
│ │ ├── commands/ # Slash commands
│ │ └── events/ # Bot events
│ └── web/
│ ├── routes/ # Web routes
│ └── views/ # EJS templates
└── logs/ # Bot logs (auto-generated)
# Install PM2
npm install -g pm2
# Start with PM2
pm2 start ecosystem.config.js
# Enable auto-start on reboot
pm2 startup
pm2 saveSet up a cron job to run every minute:
* * * * * cd /path/to/bot && node monitor.jsSee BOT_OPERATIONS.md for detailed instructions.
Check bot health:
# View status file
type bot-status.json
# View logs
type logs\bot.log
type logs\errors.logIf bot goes offline:
- Check
logs/errors.logfor errors - Verify
.env-disfile exists and has correct values - Restart using
start-bot.batorpm2 restart hima-bot - Run
node monitor.jsto check health and auto-restart
For detailed troubleshooting, see BOT_OPERATIONS.md.
Private project for The Digital Den server.