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-11-26 12:57:30 +01:00
.github/workflows Changed branch to main 2024-11-26 12:57:30 +01:00
misc Added demo configuration for en/ger language 2024-11-26 10:44:34 +01:00
source Logging with timestamp, obtaining more details for #6 2024-11-26 10:35:56 +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 Added docker compose file for running in local instance 2024-11-17 01:21:48 +01:00
Dockerfile Added demo configuration for en/ger language 2024-11-26 10:44:34 +01:00
LICENSE.md Added Open-Source-License and formatted the README file 2024-11-18 18:18:41 +01:00
package-lock.json Moved the JSON schema dependency as dev requirement 2024-11-16 17:18:45 +01:00
package.json Set version on 0.1.3 2024-11-26 10:36:26 +01:00
README.md Changed README for expandable screenshots (in different languages) 2024-11-26 10:53:36 +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 will post the server stats of a Farming Simulator 25 server to a Discord channel. The bot will post the server name, server password, server time, and the player count. The bot will update the server stats every x seconds ( configurable).

Screenshots

Discord embed in english

discord_en.png

Discord embed in german

discord_de.png

How it works

The bot is written in Node.js and uses the discord.js library to interact with the Discord API. It uses the XML-Feed from the Farming Simulator 25 server to get the server stats (you can find the feed URL in the web interface of the server).

bot_terminal.png

Requirements

  • Node.js - if you want to run the bot without Docker
  • NPM - if you want to run the bot without Docker
  • Docker (optional) - if you want to run the bot in a Docker container

Install the bot

Create a Discord bot

  1. Open the Discord Developer Portal
  2. Click on New Application
  3. Name your application
  4. Click on Bot in the left menu
  5. Click on Copy to copy the bot token
  6. Click on Installation in the left menu
  7. Add the Permission 'Administrator' to the bot guild installation (bottom of the page)
  8. Click on Copy to copy the URL to install the bot to a guild
  9. Your installation link url should look like this: https://discord.com/oauth2/authorize?client_id=CLIENT_ID

Configure the bot

  1. Clone the repository to your server
  2. Move the config.example-de.json or config.example-en.json to config.json (depending on your language)
  3. Fill in the required fields in the config.json file, do not delete fields, just leave them empty for default values
  4. All fields with a (*) are required fields for the bot to work. The other fields are optional and can be left by default
- Key - - Description -
(*) application.serverPassword The password to join the server (or leave empty)
(*) application.serverStatsUrl The feed URL to the server stats (from the web interface from the server)
(*) application.serverMapUrl The feed URL to the server map (from the web interface from the server)
(*) application.updateIntervalSeconds The interval in seconds to update the server stats
(*) discord.channelId The channel id where the bot should post the server stats
(*) discord.botToken The bot token from the Discord Developer Portal
translation.discordEmbed.title The title of the Discord embed
translation.discordEmbed.descriptionOnline The description when the server is online
translation.discordEmbed.descriptionOffline The description when the server is offline
translation.discordEmbed.descriptionUnknown The description when the server status is unknown
translation.discordEmbed.titleServerName The title of the server name
translation.discordEmbed.titleServerPassword The title of the server password
translation.discordEmbed.titleServerTime The title of the server time
translation.discordEmbed.titlePlayerCount The title of the player count
translation.discordEmbed.noPlayersOnline The message when no players are online
translation.discordEmbed.titleServerMap The title of the server map
translation.discordEmbed.titleServerMods The title of the server mods
translation.common.monthJanuary The month January in the language of the server
translation.common.monthFebruary The month February in the language of the server
translation.common.monthMarch The month March in the language of the server
translation.common.monthApril The month April in the language of the server
translation.common.monthMay The month May in the language of the server
translation.common.monthJune The month June in the language of the server
translation.common.monthJuly The month July in the language of the server
translation.common.monthAugust The month August in the language of the server
translation.common.monthSeptember The month September in the language of the server
translation.common.monthOctober The month October in the language of the server
translation.common.monthNovember The month November in the language of the server
translation.common.monthDecember The month December in the language of the server

Run inside a Docker container

  1. Run docker-compose up -d --build in the root directory of the repository
  2. The bot should be running now and posting the server stats to the Discord channel

Run without Docker (Node.js)

  1. Clone the repository to your server
  2. Run npm install
  3. Run npm start
  4. The bot should be running now and posting the server stats to the Discord channel
  5. If you close the terminal, the bot will stop running