Skip to content

About

Enhanced fork of rustplusplus with advanced crafting features and storage integration

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

discord reddit donate on ko-fi

donate on ko-fi

rustplusplus Enhanced ~ Advanced Rust+ Discord Bot

rustplusplus Enhanced is a comprehensive fork of the original rustplusplus by Alexemanuelol, enhanced by me with a little help from Claude, featuring advanced crafting features, storage integration, and optimization tools.

This NodeJS Discord Bot uses the rustplus.js library to utilize the power of the Rust+ Companion App with additional Quality-of-Life features and enhanced functionality.

Enhanced Features

Original Features

  • Control Smart Switches or Groups of Smart Switches via Discord or In-Game Team Chat
  • Setup Smart Alarms to notify in Discord or In-Game Team Chat whenever they are triggered
  • Use Storage Monitors to keep track of Tool Cupboard Upkeep or Large Wooden Box/Vending Machine content
  • Head over to the Information Text Channel to see all sorts of information about the server and team member status
  • Communicate with teammates from Discord to In-Game and vice versa
  • Keep track of other teams on the server with the Player Tracker
  • Extensive QoL Commands that can be used In-Game or from Discord

Enhanced Features

  • Advanced Crafting Analysis - Comprehensive crafting calculation system with optimization tools
  • Enhanced Storage Integration - Advanced storage monitoring and management capabilities
  • Automatic Reconnection System - Robust connection management with health monitoring
  • API Systems - Extended API integration for better server connectivity
  • Optimization Tools - Performance enhancements and resource optimization
  • TypeScript Support - Full TypeScript implementation for better code quality
  • Enhanced Error Handling - Improved error management and logging systems
  • πŸ†• Current Item Data - Item names, ids and stack sizes from the game files, recipes and recycling from the open rust-items-json dataset (see Item Data below)
  • πŸ†• Base Watch - A cameras channel with snapshots from your own cameras and turrets (/camera watch), refreshed every 5 minutes, and a list of the players outside the team they spotted. While the whole team is offline, strangers on camera and items taken from storage monitors are posted in the alerts channel, together with smart alarm triggers and decay warnings, so the busier activity channel can be muted
  • πŸ†• Team tools - /kick a team member from Discord, team map pins with labels on /map
  • πŸ†• AI Assistant - Ask game questions in-game (!ai) or via /ai β€” answers from live server state + the scraped item/monument database; works with any OpenAI-compatible endpoint (Ollama, GROQ, Gemini)

Quick Start

Development Commands

Starting the Bot

npm start

Type Checking

npm test

This runs TypeScript compiler with --noEmit flag to check for type errors without generating output.

Installation

npm install

Note: Uses npm-force-resolutions for dependency resolution.

Updates

# Windows
update.bat

# Linux/Mac
./update.sh

Architecture Overview

Core Structure

  • Entry Point: index.ts - Initializes Discord bot and creates necessary directories
  • Main Bot Class: src/structures/DiscordBot.js - Extends Discord.Client with custom functionality
  • Event Handlers: src/discordEvents/ - Discord event handlers (ready, messageCreate, etc.)
  • Command System: src/commands/ - Slash commands for Discord interactions
  • Rust+ Integration: src/structures/RustPlus.js - Handles Rust+ API connections
  • Smart Device Management: src/handlers/ - Various handlers for smart devices and features

Key Components

Discord Integration

  • Uses Discord.js v14 with gateway intents for guilds, messages and members
  • Slash commands system with interaction handlers
  • Multi-language support via internationalization

Rust+ API Integration

  • FCM (Firebase Cloud Messaging) listeners for push notifications
  • Rust+ connections through Facepunch's relay (game servers refuse direct connections since November 2026)
  • Smart device control (switches, alarms, storage monitors)

Data Storage

  • Instance-based configuration system
  • JSON-based settings and templates
  • Logging system with Winston
  • Credential management for authentication

Key Technologies

  • Runtime: Node.js with TypeScript
  • Discord: Discord.js v14
  • Rust+ API: Custom rustplus.js library
  • Image Processing: Jimp
  • Authentication: FCM push notifications

Item Data

Item names, ids and stack sizes come from the game's own item definitions (Bundles/items in a Rust install); recipes, research costs and recycling yields come from rust-items-json by bobosneefdev (MIT licence, extracted from the game files). To refresh them on a PC with Rust installed:

node src/util/itemData/update.js --rust-dir "D:/SteamLibrary/steamapps/common/Rust"

Then commit src/staticFiles and rebuild the image. The AI knowledge files in AI/ are rebuilt from these at startup.

Documentation

Documentation can be found here. The documentation explains the features as well as how to setup the bot, so make sure to take a look at it πŸ˜‰

Credentials

You can get your credentials by running the rustplusplus credential application. Download it here

Running via Docker

docker run --rm -it -v ${pwd}/credentials:/app/credentials -v ${pwd}/instances:/app/instances -v ${pwd}/logs:/app/logs -e RPP_DISCORD_CLIENT_ID=111....1111 -e RPP_DISCORD_TOKEN=token --name rpp nuallan/rustplusplus-forked

or

docker-compose up -d

Make sure you use the correct values for DISCORD_CLIENT_ID as well as DISCORD_TOKEN in the docker command/docker-compose.yml

Environment Variables

  • RPP_DISCORD_CLIENT_ID - Discord application client ID
  • RPP_DISCORD_TOKEN - Discord bot token
  • RPP_STEAM_API_KEY - (Optional) Free Steam Web API key; lets trackers find a server's address by name
  • RPP_AI_ENABLED - (Optional) Enable/disable the AI assistant (default: true; set false to disable)
  • RPP_AI_BASE_URL - (Optional) OpenAI-compatible endpoint, e.g. http://host.docker.internal:11434/v1 for Ollama (default: http://localhost:11434/v1)
  • RPP_AI_API_KEY - (Optional) API key for the AI endpoint (leave empty for Ollama)
  • RPP_AI_MODEL - (Optional) Model name (default: llama3.1)
  • RPP_AI_KNOWLEDGE_DIR - (Optional) Extra editable AI knowledge folder, e.g. /app/knowledge mounted as a volume
  • RPP_AI_MAX_TOKENS - (Optional) Max answer tokens (default: 1500)
  • RPP_AI_TEMPERATURE - (Optional) Sampling temperature (default: 0.3)
  • RPP_AI_TIMEOUT_MS - (Optional) AI request timeout in ms (default: 120000)

See docker-compose.yml for a fully commented example and the ai block of config/index.js for the complete RPP_AI_* list (tool calling, device control, memory, alerts).

Project Structure

rustplusplus-enhanced/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ commands/       # Discord slash commands
β”‚   β”œβ”€β”€ discordEvents/  # Discord event handlers
β”‚   β”œβ”€β”€ handlers/       # Feature-specific handlers
β”‚   β”œβ”€β”€ structures/     # Core classes (DiscordBot, RustPlus, etc.)
β”‚   β”œβ”€β”€ util/          # Utility functions and helpers
β”‚   β”œβ”€β”€ languages/     # Internationalization files
β”‚   β”œβ”€β”€ resources/     # Static assets (images, fonts)
β”‚   └── staticFiles/   # Game data files (items, recipes, etc.)
β”œβ”€β”€ docs/              # Documentation and setup guides
β”œβ”€β”€ config/            # Configuration files
β”œβ”€β”€ credentials/       # User authentication data (created at runtime)
β”œβ”€β”€ instances/         # Server-specific configurations (created at runtime)
β”œβ”€β”€ logs/             # Application logs (created at runtime)
β”œβ”€β”€ index.ts          # Main entry point
β”œβ”€β”€ package.json      # Dependencies and scripts
└── tsconfig.json     # TypeScript configuration

Configuration Notes

  • The bot requires Rust+ credentials obtained via the companion app
  • Each Discord server requires pairing with a Rust game server
  • Smart devices must be paired in-game before Discord control
  • The bot maintains persistent connections to monitor real-time events
  • Multi-language support requires proper locale configuration

Thanks to

liamcottle@GitHub - for the rustplus.js library.
.Vegas.#4844@Discord - for the awesome icons!
Alexemanuelol@GitHub - for the original rustplusplus project.

About

Enhanced fork of rustplusplus with advanced crafting features and storage integration

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages