This bot periodically updates a Discord channel with stats from a Farming Simulator 25 server. It posts the server name, password, time, and player count. Written in Node.js, it uses the discord.js library to interact with Discord and fetches server stats via the XML feed (accessible through the server's web interface). The update interval is configurable.
- Node.js: Required if you want to run the bot without Docker.
- NPM: Required if you want to run the bot without Docker.
- Docker (optional): Use Docker if you prefer running the bot in a containerized environment.
- Open the Discord Developer Portal.
- Click on
New Application
and give your application a name. - Navigate to the
Bot
section in the left menu and click onAdd Bot
. - Copy the bot token by clicking
Copy
(you'll need this later). - Go to the
OAuth2
>URL Generator
section in the left menu. - Under "Scopes," select
bot
, and under "Bot Permissions," selectAdministrator
. - Copy the generated URL to invite the bot to your Discord server.
- The URL should look like this:
https://discord.com/oauth2/authorize?client_id=CLIENT_ID&scope=bot&permissions=8
- The URL should look like this:
- Clone the repository to your server
- Locate the configuration files:
- Use either
config.example-de.json
(for German)config.example-en.json
(for English)
- Rename the chosen file to
config.json
.
- Use either
- Open
config.json
and fill in the required fields:- Refer to
SETTINGS.md
for detailed descriptions of each field. - Fields marked with
(*)
are important to check; other fields can be left empty for default values.
- Refer to
-
Navigate to the root directory of the cloned repository.
-
Build and start the container:
docker-compose up -d --build
-
The bot should now be running and posting server stats to the specified Discord channel.
-
Navigate to the root directory of the cloned repository.
-
Install dependencies:
npm install
-
Start the bot:
npm start
-
The bot should now be running and posting server stats to the specified Discord channel.
- Note: Closing the terminal will stop the bot. Use a process manager like PM2 to keep it running.