A modular Discord bot system built with discord.js v14, running three independent bots in a single Node.js process.
π Readme (EN) Β· Readme (DE)
| Bot | Purpose |
|---|---|
| Commands Bot | Server management slash commands: rules, roles, information, orders, support, admin tools, utility |
| Events Bot | Guild event logging, context menus, automated message handling |
| Minigames Bot | 12 interactive minigames with a shared points & reward system |
All three bots run in parallel. If one crashes, it automatically restarts after 10 seconds without affecting the others.
- Node.js >= 18 (built-in
fetchrequired for the Trivia API) - npm
- A Discord application with three bot tokens (one per bot)
- A Discord server (guild) with the required roles and channels configured
# 1. Clone the repository
git clone https://github.com/MSK-Scripts/discord-multibot-js.git
cd discord-multibot-js
# 2. Install dependencies
npm install
# 3. Configure environment variables
cp .env.example .env
# β Fill in your tokens, IDs and database credentials in .env
# 4. Start all bots
node main.jsA ready-to-use systemd unit file is included at multibot-js.service.
1. Adjust the paths and user in the file if necessary (default: user deploy, path /home/deploy/discord_multibot_js).
2. Copy the service file to systemd:
sudo cp multibot-js.service /etc/systemd/system/3. Reload systemd and enable the service:
sudo systemctl daemon-reload
sudo systemctl enable multibot-js
sudo systemctl start multibot-js4. Check the status:
sudo systemctl status multibot-jsUseful commands:
# View live logs
journalctl -u multibot-js -f
# Restart after update
sudo systemctl restart multibot-js
# Stop the bots
sudo systemctl stop multibot-jsNote: The service reads the
.envfile viaEnvironmentFile=. Make sure the file exists at the configured path and is readable by the service user.
All configuration is done via a .env file in the root directory. Copy .env.example and fill in the values.
COMMANDS_BOT_TOKEN=your_commands_bot_token
EVENTS_BOT_TOKEN=your_events_bot_token
MINIGAMES_BOT_TOKEN=your_minigames_bot_token
GUILD_ID=your_guild_id# Logging & channels
LOG_CHANNEL_ID=
FEEDBACK_CHANNEL_ID=
MEMBER_COUNT_CHANNEL_ID=
# Role IDs
MEMBER_ROLE_ID=
TEAM_ROLE_ID=
GIVEAWAY_NOTIFY_ROLE_ID=
GARAGE_ROLE_ID=
HANDCUFFS_ROLE_ID=
STORAGE_ROLE_ID=
VEHICLEKEYS_ROLE_ID=
# Database (for /backup_database)
DB_HOST=localhost
DB_USER=
DB_PASS=
DB_NAME=es_extended| Command | Description | Role-restricted |
|---|---|---|
/information |
Posts a branded server information embed | β Manager / Founder |
/rules |
Posts the server rules with Verification & Giveaway Notify buttons | β Manager / Founder |
/roles |
Posts script update notification role buttons | β Manager / Founder |
/script_guides |
Links to documentation for a chosen script | β Support+ |
/donation |
Displays donation options with payment links | β Manager / Founder |
/order_terms |
Sends the terms of service PDF with Accept / Reject buttons | β Developer / Manager / Founder |
/order_price |
Shows an order price with Accept / Reject buttons | β Developer / Manager / Founder |
/send_message |
Sends a custom message to any channel via modal | β Manager / Founder |
/send_embed |
Sends a fully customizable embed to any channel | β Manager / Founder |
/backup_database |
Creates a MySQL database backup and uploads it to the log channel | β Founder |
/ping |
Shows bot latency and API response time | β |
/userinfo |
Shows info and minigame points for a user | β |
/clear |
Bulk-deletes up to 100 messages | β Team |
/random |
Picks a random number in a given range (for guess games) | β Team |
/rg |
Guess the currently active secret number | β |
/flachwitz |
Posts a random flat joke from the local collection | β |
/add_flachwitz |
Adds a new joke to the collection | β Team |
Persistent role-toggle buttons (survive bot restarts):
β Verificationβ assigns the Member roleπ Giveaway Notifyβ toggles the Giveaway notification roleβ° Garage / Handcuffs / Storage / Vehicle Keysβ toggles script update notification roles
Guild logging β All events are posted as colored embeds to the configured log channel:
| Category | Events logged |
|---|---|
| Members | Join, Leave, Kick, Ban, Unban, Timeout set/removed |
| Roles | Role Added (incl. added by), Role Removed (incl. removed by) |
| Username / Nickname | Username changed, Nickname changed |
| Messages | Edited, Deleted (incl. deleted by), Bulk delete (incl. deleted by) |
| Channels | Created, Deleted, Updated (name, topic, slowmode, NSFW) |
| Roles | Created, Deleted, Updated (name, color, permissions diff) |
| Voice | Joined, Left, Moved, Server Muted/Unmuted, Server Deafened/Undeafened |
| Invites | Created (with max uses & expiry), Deleted |
- Auto-reply β Automatically responds when non-team members mention "Musiker15"
- Feedback embed β Messages posted in the feedback channel are auto-converted to branded embeds and the original is deleted
- Context menus (right-click on messages):
π Comment Feedbackβ Adds a moderator comment to a feedback embed and DMs the authorπ¬ Answer a Messageβ Sends a reply to any message via modalβοΈ Edit Messageβ Edits a bot message via modalπΌοΈ Edit Embedβ Edits a bot embed (title, description, thumbnail, image, footer) via modal
All minigames are session-based (no global state) and award or deduct points on each outcome.
| Command | Description |
|---|---|
/8ball |
Magic 8-Ball β asks a yes/no question |
/dice |
Roll a die β d4 to d100, 1β10 dice |
/flipcoin |
Flip a coin β Heads or Tails |
/rps |
Rock Paper Scissors vs. the bot |
/slots |
Slot machine with animated spin and 7 symbol tiers |
/trivia |
Multiple-choice trivia (OpenTrivia DB + local fallback) |
/hangman |
Classic Hangman with letter-modal input |
/wordle |
Wordle β guess the 5-letter word in 6 tries |
/tictactoe |
TicTacToe β Easy / Medium / Minimax Hard AI |
/connect4 |
Connect Four β bot AI with win/block/center logic |
/blackjack |
Blackjack β Hit, Stand, Double Down vs. the dealer |
/points |
Shows your current point balance with a progress bar |
Points are stored persistently in data/points.json. Each game awards or deducts points depending on the outcome and difficulty. Reward milestones automatically assign Discord roles and notify the user.
Default reward thresholds:
| Points | Reward |
|---|---|
| 500 | π₯ Bronze Player |
| 1,500 | π₯ Silver Player |
| 4,000 | π₯ Gold Player |
| 10,000 | π Diamond Player |
Point values per game are configurable in bots/minigames/points_config.json.
discord_multibot_js/
βββ main.js β Starts all 3 bots, handles auto-restart
βββ package.json
βββ .env β Not committed (see .gitignore)
βββ .github/
β βββ dependabot.yml β Weekly dependency update checks
βββ core/
β βββ config.js β Environment config
β βββ utils.js β Shared helpers (makeEmbed, readJson, β¦)
β βββ pointsManager.js β Points read/write + reward notifications
βββ data/
β βββ points.json β Persistent user points (auto-created)
β βββ backups/ β Database backup files (auto-created, auto-deleted)
βββ assets/ β Static files, e.g. terms PDF
βββ bots/
βββ commands/
β βββ bot.js
β βββ commands/
β βββ community.js β /information, /rules, /roles
β βββ admin.js β /backup_database, /send_message, /send_embed
β βββ support.js β /script_guides
β βββ orders.js β /donation, /order_terms, /order_price
β βββ utility.js β /ping, /userinfo, /clear
β βββ minigames.js β /random, /rg, /flachwitz, /add_flachwitz
βββ events/
β βββ bot.js
β βββ handlers/
β βββ logging.js
β βββ messageHandler.js
β βββ contextMenus.js
βββ minigames/
βββ bot.js
βββ points_config.json
βββ commands/
βββ eightball.js
βββ dice.js
βββ flipcoin.js
βββ rps.js
βββ slots.js
βββ trivia.js
βββ hangman.js
βββ wordle.js
βββ tictactoe.js
βββ connect4.js
βββ blackjack.js
βββ points.js
| Package | Version |
|---|---|
| discord.js | ^14.26.4 |
| dotenv | ^16.6.1 |
Dependency updates are monitored automatically via Dependabot (weekly, grouped).
- Website: msk-scripts.de
- Documentation: docu.msk-scripts.de
- GitHub: github.com/MSK-Scripts
- Discord: discord.gg/5hHSBRHvJE
Β© MSK Scripts β Musiker15