Farming Simulator 25 - Discord Bot
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.
Screenshots
Discord embed in english
![discord_en.png](misc%2Fimages%2Fdiscord_en.png)
Discord embed in german
![discord_de.png](misc%2Fimages%2Fdiscord_de.png)
Terminal output (NodeJS)
![bot_terminal.png](misc%2Fimages%2Fbot_terminal.png)
Requirements
- 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.
Installation Guide
Step 1: Create a Discord Bot
- 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 on Add 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," select Administrator
.
- 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
Step 2: Configure the Bot
- 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
.
- 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.
Running the Bot
Option 1: Run Inside a Docker Container (Recommended)
- 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.
Option 2: Run Without Docker (Using Node.js)
- 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.