kennethrisa / discord-rustserverstatus

Updates activity status on discord bot and displays how many players are connect to your rust server from rest api
MIT License
22 stars 15 forks source link

Discord bot that displayes online players

Docker Automated build Docker Pulls Docker Build Status Build Status

Discord-bot

Bot

Updates activity status on discord bot and displays how many players are connected to your game server that support gamedig / rest api sites and webrcon.

This was first created for the game Rust, but it also now support any games that support gamedig or from rest api from the sites below.

Written in nodejs and requires npm and nodejs version ^16.09.

You can run it on windows, macOS, linux or docker, se the installation for more info.

Changelog

Changelog

Configuration

example_config.json

Location: config/serverX.json (default on first startup: config/server1.json)

{
  "debug" : false,
  "token"  : "your token here",
  "apiSite" : 4,
  "apiUrl" : "https://full uri here",
  "serverIp": "",
  "serverPort": "28015",
  "enableRcon" : "0",
  "rconhost"   : "",
  "rconport"   : "",
  "rconpass"   : "",
  "prefix" : "!",
  "roles"  :  ["Administrator", "admins"],
  "queueMessage"  :  "currently waiting in queue.",
  "statusType" : "",
  "updateInterval" : "1"
}

Installation:

Install Windows only from command prompt (Manuall start)

Windows only: Install the app as a windows service.

Linux only: Start bot always using forever

Create your discord-bot and invite it to your server:

Docker

Using gamedig:
docker run --name discord-rustserverstatus --restart=unless-stopped \
   -e token="your token here" \
   -e apiSite=4 \
   -e serverIp=1.1.1.1 \
   -e serverPort=28015 \
   -e roles="Administrator" \
   kenrisa/discord-rustserverstatus:latest

docker run --name discord-rustserverstatus --restart=unless-stopped \
   -e token=your_token_here \
   -e apiSite=1 \
   -e apiUrl="https://full uri here" \
   -e enableRcon=1 \
   -e rconhost=yourip \
   -e rconport=28016 \
   -e rconpass="yourpassword" \
   -e prefix="!" \
   -e roles="Administrator" \
   -e queueMessage="currently waiting in queue" \
   -e statusType=""
   -e updateInterval="3" \
   kenrisa/discord-rustserverstatus:latest

Using with volumes and support for multiple bots: Remove environment, and only have volumes:

version: '2' services: bot: build: . image: kenrisa/discord-rustserverstatus container_name: discord-rustserverstatus restart: unless-stopped volumes:

* You can also build the image your self using the docker-compose

git clone https://github.com/kennethrisa/discord-rustserverstatus.git docker-compose build docker-compose up -d