A powerful, modular Discord bot written in Node.js with modern slash commands, dynamic module loading, and extensive management tools.
- 📦 Fully modular — Every feature is a standalone
.jsfile inmodules/ - 🧩 Dynamic slash commands with autocomplete support
- 🔄 Runtime module management — enable/disable/reload modules without restarting
- 🛠️ Rich admin tools — settings, webhooks, presence, shell access, message cleanup, etc.
- 📜 Comprehensive documentation — see
MODULES.mdfor full details on every module - 🐳 Full Docker support —
docker.sh(interactive), node:22-alpine, proper volume layout, no .env mount leaks
Universal-Discord-Bot/
├── modules/ # All bot features (26+ modules)
├── config.json # Bot configuration + per-bot settings
├── .env # Bot tokens (JSON format, gitignored)
├── docker.sh # Interactive Docker manager (recommended)
├── docker-compose.yml # Compose file (auto-updated by docker.sh for chosen bot)
├── Dockerfile
├── docker-entrypoint.sh # Volume permission fix + drops privileges to node user
├── .dockerignore # Keeps secrets and junk out of the image
├── setup.sh # Interactive first-run (Node path)
├── main.js
├── README.md
├── MODULES.md
├── TODO.md
└── ...
The easiest way to get started is using the setup script:
chmod +x setup.sh
./setup.shThe script will:
- Check for Node.js and install dependencies (
npm install) - Create
.env(if missing) with proper JSON format - Prompt for bot name and bot token
- Automatically add the bot to
config.json - Offer to start the bot immediately
If you prefer manual setup:
-
Install dependencies
npm install
-
Create
.env(JSON format):{ "MyBot": "YOUR_BOT_TOKEN_HERE" } -
Configure
config.json— Add your bot under thebotsobject:"bots": { "MyBot": { "modules_folder": "modules", "enabled_modules": [], "disabled_modules": [] } }
-
Run the bot
# Interactive menu node main.js # Direct start node main.js --bot MyBot # With debug logging node main.js --bot MyBot --debug
- MODULES.md — Complete documentation for all 26+ modules (highly recommended)
- TODO.md — Planned features and development roadmap
The bot supports running multiple instances from a single installation:
// .env
{
"SkyNET": "token1...",
"HelperBot": "token2..."
}Then start with:
node main.js --bot SkyNETOnce the bot is running, use these powerful slash commands:
/modules list— See all modules and their status/modules enable <name>/modules disable <name>/modules reload— Hot-reload all commands
See MODULES.md for the full list of available modules (including powerful ones like /rm, /webhooks, /music, /shell, /info, etc.).
- Node.js >=22.12 (required by @discordjs/voice)
- yt-dlp (for
/ytand/musicmodules) - FFmpeg (for voice features in
/music) - Appropriate Discord bot permissions (Manage Messages, Manage Webhooks, etc.)
Production-ready Docker support is included.
Recommended: Use the interactive manager:
chmod +x docker.sh
./docker.shIt handles:
- Choosing which bot from your JSON
.env - Building with the correct Node 22 + yt-dlp + ffmpeg image
- Creating the clean
./docker/volume layout - Permanently setting
container_name+--botargument (no reverting) - Injecting the JSON
.envsafely viadocker cpafter start (never as a volume)
Key design guarantees:
.env(JSON tokens) is never a bind mount or volume.- Docker Compose is explicitly told to ignore the local
.env(--env-file /dev/null). - All persistent data lives only under
./docker/{logs,downloads,backups,dm-logs,config}. - Runs as non-root
nodeuser after volume permissions are fixed at startup. - Uses
node:22-alpine(satisfies@discordjs/voicerequirement).
./docker.sh
# Then choose option 1 (Up)See the full "Docker Support" section inside the interactive docker.sh help or the comments in Dockerfile / docker-compose.yml for advanced usage.
Earlier attempts that mounted .env or temporarily renamed it to .env.bak caused EISDIR crashes (main.js saw a directory instead of the JSON file). The current design (copy after start + --env-file /dev/null) completely eliminates that class of problem.
- New modules go into
modules/ - Follow the existing pattern (export
{ data, execute }) - Use
client.isAdmin()for privileged actions - Document new modules in
MODULES.md
This is a complete, modern rewrite of the original Python bot in Node.js (discord.js v14, slash commands only). All major modules have been ported and improved, with rich admin tooling and first-class Docker support.
For the exhaustive per-module reference, see MODULES.md.
"Not as good as other bots, but good enough!"