Never be caught off guard again!
A high-performance Discord bot built with Bun to integrate Rust game servers with Discord.
- Map & Heatmap: Generate real-time server maps with monuments and player markers. Visualize player death patterns with heatmaps.
- Shop Search: Search for items in vending machines across the map, filtered by buy/sell price and stock levels.
- Leaderboards: Track AFK time and death statistics for players on your server.
- Smart Notifications: Real-time push notifications from RustPlus (alarms, switches, storage monitors) via FCM integration.
- Battlemetrics Watchlist: Monitor specific players and get notified of their activity.
- Modular Architecture: Built with discordx and Bun for performance and scalability.
- Discord Bot Token: Create one at the Discord Developer Portal.
- Required Intents: Guilds, GuildMembers, GuildMessages, Message Content.
- RustPlus Credentials: You will need your Steam ID, Player Token, and FCM (GCM) Tokens (Android ID and Security Token) to receive push events.
- Bun: The project is optimized for the Bun runtime.
The following variables must be defined in your .env file or deployment dashboard:
- BOT_TOKEN: Your Discord bot token.
- NODE_ENV: Set to production for live environments.
Optional (initial connection):
- RUSTPLUS_SERVER: Rust server IP/Hostname.
- RUSTPLUS_PORT: Rust server Port.
- RUSTPLUS_PLAYER_ID: Your Steam ID.
- RUSTPLUS_PLAYER_TOKEN: Your Player Token.
-
Clone the repository:
git clone https://github.com/your-username/rusty.git cd rusty -
Configure Environment Variables: Copy .env.example to .env and fill in your details.
cp .env.example .env
-
Install Dependencies:
bun install
-
Generate Protobufs:
bun run generate
Start the bot in development mode with hot-reloading:
bun run devThe project is production-ready with a lightweight Alpine-based Bun Docker image.
docker-compose up --build -dThe application state and credentials are automatically persisted in a Docker volume (bot-data) mapped to /app/data.
- View Logs: docker-compose logs -f bot
- Stop Bot: docker-compose down
This project is optimized for Railway using the provided Dockerfile.
- Fork this repository.
- Create a New Project on Railway.
- Select GitHub Repo and choose your forked repository.
- Configure Variables:
- Add all required Environment Variables (BOT_TOKEN, etc.) in the Railway "Variables" tab.
- Persistent Storage:
- Go to the "Settings" tab of your service.
- Add a Volume and mount it to
/app/data. This is critical to ensure your credentials and server state are not lost between deployments.
- Deploy: Railway will automatically detect the Dockerfile and start the build process.
| Command | Description |
|---|---|
| /map | Generate the current server map (Monuments/Markers optional). |
| /heatmap | Generate a heatmap of deaths within a time range (24h/3d/7d). |
| /shop search | Search for items in vending machines. |
| /afk_leaderboard | Show players with the most AFK time. |
| /death_leaderboard | Show players with the most deaths. |
| /devices list | List all paired RustPlus devices (Alarms, Switches). |
| /watchlist add | Add a player to the Battlemetrics watchlist. |
A GitHub Actions workflow is included in .github/workflows/docker.yml to automatically build and push the Docker image to GitHub Packages (GHCR) on every push to main or upon creating a version tag.
Made for the Rust Community.