A simple discord bot for the LS25 / FS25 / Farming Simulator 25 (with docker support) for server status updates in discord embeds. 🚜
Find a file
2024-12-01 12:34:50 +01:00
.github/workflows Changed package name to match the repository url 2024-11-26 13:02:57 +01:00
misc Added demo configuration for en/ger language 2024-11-26 10:44:34 +01:00
source Implemented version checking for the discord bot and increased version to 0.1.6 2024-12-01 12:34:50 +01:00
.gitignore Added docker compose file for running in local instance 2024-11-17 01:21:48 +01:00
config.example-de.json Added demo configuration for en/ger language 2024-11-26 10:44:34 +01:00
config.example-en.json Added demo configuration for en/ger language 2024-11-26 10:44:34 +01:00
docker-compose.yml Made the discord service starter async for the node engine and added regularly restarts within docker 2024-12-01 12:06:19 +01:00
Dockerfile Switched the package manager from npm to pnpm for faster dependency resolving 2024-11-28 09:50:31 +01:00
LICENSE.md Added Open-Source-License and formatted the README file 2024-11-18 18:18:41 +01:00
package.json Implemented version checking for the discord bot and increased version to 0.1.6 2024-12-01 12:34:50 +01:00
pnpm-lock.yaml Switched the package manager from npm to pnpm for faster dependency resolving 2024-11-28 09:50:31 +01:00
README.md Made the discord service starter async for the node engine and added regularly restarts within docker 2024-12-01 12:06:19 +01:00
SETTINGS.md Rewrite of the README, outsourced the settings in SETTINGS.md 2024-11-26 13:20:51 +01:00
tsconfig.json First commit of the bot; Created documentation in README 2024-11-15 21:26:20 +01:00

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

Discord embed in german

discord_de.png

Terminal output (NodeJS)

bot_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

  1. Open the Discord Developer Portal.
  2. Click on New Application and give your application a name.
  3. Navigate to the Bot section in the left menu and click on Add Bot.
  4. Copy the bot token by clicking Copy (you'll need this later).
  5. Go to the OAuth2 > URL Generator section in the left menu.
  6. Under "Scopes," select bot, and under "Bot Permissions," select Administrator.
  7. 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

  1. Clone the repository to your server
  2. 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.
  3. 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

  1. Navigate to the root directory of the cloned repository.
  2. Build and start the container:
    docker-compose up -d --build
    
  3. The bot should now be running and posting server stats to the specified Discord channel.

Option 2: Run Without Docker (Using Node.js)

  1. Navigate to the root directory of the cloned repository.
  2. Install dependencies:
    npm install
    
  3. Start the bot:
    npm start
    
  4. 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.