Requirements: node.js (version 12.20.0 or later)
//TODO: env vars (dotenv files supported)
//TODO: config file schema description
Install dependencies: npm i
Build & start program: npm start
- create a (simple, but capable) service/bot to monitor game servers
- get gamedig & steam api server info (eg.: server name, map, players, etc.)
- relay real time server information to various channels via APIs (eg.: discord, telegram, slack etc.)
- should be able to host on a free service (target atm. is cloudno.de (nodejs 12.20.1))
- graciously add more features based on community feedback
Get support on discord or on github.
More detailed customization options and additional features will be added as requested.
- optional player list
- with configurable fields. eg.: time,name,ping,score
- configurable field & order to sort by
- max length for player names & nr of players
- custom embed fields for discord
- configurable timezone for graph x-axis
- refresh on reaction
- watched players (notify when a watched player enters/leaves the server)
- detect server restart, notify when player number crosses a threshold
- bot commands (reinit message, cleanup, start/stop, configure)
- more integrations: slack, ms teams, twillio (email, sms)
- web ui to manage & configure the servers and bots
- put custom information in the channel name (online status indicator, number of players, map)
You can fork (copy) this repo on github, and automatically deploy your configuration or other changes as a cloud service.
Part 1: create and setup cloudno.de repo
- register account
- create app: https://cloudno.de/myapps?new //TODO: create app, make sure to set the latest node.js version and leave server.js as entry point;
- provision app
- copy https git URL from app
- go to profile copy your token
- add username and as authentication to the URL like
https://username:[email protected]/git/username/xyz
; save it for later (github) - go to application --> manage --> environment
- set
DATA_PATH=/mnt/
in cloud app env
//go to https://cloudno.de/account --> API tokens // on github: goto settings --> secrets --> actions and setupCLOUDNODE_REPO_URL
secret with the full URL
//TODO: create discord bot;
- create app
- create bot
- under the bots name you should seee a token or an option to reset token
- check message content intent
- oauth2 --> url generator --> check bot as scopes; create bot invite link with permissions: view channels, send messages, message history, embed links, add reaction (85056),
- invite bot to servers(guilds)
- create bot auth token, copy it
- setup
DISCORD_BOT_TOKEN
in cloud app env - //CONFIG: find and copy then setup channel ids in config
//TODO: get token from botfather and setup as TELEGRAM_BOT_TOKEN
in cloud app env; get chat id from getidsbot and setup chat ids in config
//TODO: request a web api key and setup as STEAM_WEB_API_KEY
in cloud app env; set appId fields in config
//TODO: fork this repo
- hit fork button
- repo settings page --> actions --> general: allow all actions (if no confirmation comes up, disable then re-enable all actions)
- switch to the
cloud
branch of your fork; (git checkout -b cloud
) - create a new config file (and setup
GSW_CONFIG
in cloud app env to point to it) or edit config/default.config.json and save it - commit and push your changes (
git add . && git commit -m :shipit: && git push origin cloud
)
You can also just use the github web editor to make changes to the default config file, just make sure to switch to the cloud
branch to have it automatically deployed.
Commiting your changes and pushing your commits to github will trigger github actions to push your files to cloudno.de and restart the app
A few web endpoints are available to clear out service data.
Make sure to configure a proper SECRET
env var to enable these!
Removes all stored game server data:
- population history configured by
PLAYERS_HISTORY_HOURS
The bot has no cleanup functionality, left over messages must be removed manually.
If the original message created by the bot gets deleted, you need to flush the bot data to reinitialize the message.
The bot has no cleanup functionality, left over messages must be removed manually.
If the original message created by the bot gets deleted, you might need to flush the bot data to reinitialize the message.
npm i
npm run dev
- discord.js v12 (discord API v8)
- got v11