Configuration - niekcandaele/CSGO-RankMe-stats GitHub Wiki

.env file

This file is used to store secret configuration values such as the Discord bot token and database credentials.

Copy the example file to a new file.

cp .env.example .env

Let's edit this file. nano is the easiest editor to use but feel free to use any other text editor.

nano .env

You will see we need database connection details and a discord token.

  • MySQL connection data

These details are the same as what you have configured in the stats plugin.

  • Discord Token

To get a discord token, you must create a bot here. I wont go into too much detail in this guide, you can Google if you need more info or use this guide by Reactiflux.

After filling all these config variables, your .env file should look similar to this:

MYSQL_DB=CSGO
MYSQL_TABLE=rankme
MYSQL_HOST=192.168.1.100
MYSQL_PORT=3306
MYSQL_PASSWORD=secretpassword
MYSQL_USER=stats
DISCORD_TOKEN=NTAxxxxxxMTk3NDIxNTY5.DtA7kA.ZN7FjscdxxxxxxjlntZliOxUo

Config.json

You can also edit some functional configurations in the config.json file. Most of these fields should be self-explanatory.

HistoricalData

  • "enabled": true,

    Controls whether this module is enabled or not.. duh :)

  • "intervalCron": "0 0 * * *",

    The interval between data collection is done in cron format. The above configuration will run once a day, at midnight. You can configure this to your own liking (for example, 0 */12 * * * will run twice a day)

  • "keepDataForMs": 2678400000,

    How long to keep data. This value is expressed in milliseconds so get your calculators ready

  • "tableName": "historicalData"

    The table where historical data will be saved. If it does not exist yet, it will be created (assuming the DB user has the correct permissions)