Discord Integration - SteamServerUI/StationeersServerUI GitHub Wiki

StationeersServerUI offers comprehensive Discord integration, allowing you to monitor and manage your server directly from Discord.

Features

Real-Time Monitoring

  • View server status and console output directly in Discord
  • Receive notifications for server events such as:
    • Player connections/disconnections
    • Exceptions and errors
    • Server status changes

Server Management Commands

  • Start, stop, and restart the server
  • Restore backups
  • Ban and unban players by their Steam ID
  • Update server files (currently supports the stable branch only)

Access Control

  • Utilize Discord's role system for granular access control
  • Restrict server management commands to specific roles

Discord Notifications

The bot can send notifications for the following events:

  • Server Ready: Notifies when the server status changes to ready
  • Player Connection/Disconnection: Alerts when a player connects or disconnects
  • Exceptions and Errors: Sends notifications when exceptions or errors are detected
  • Player List: Provides a table of connected players and their Steam IDs

Setup Instructions

  1. Create a Discord Bot

    • Head to the Discord Developer Portal and log in with your Discord account.
    • Click New Application, give it a name (e.g., "MyStationeersBot"), and hit Create.
    • Go to the Bot tab, click Add Bot, and confirm with Yes, do it!.
    • Customize your bot’s name or icon if you want (optional).
    • Important: Under Privileged Gateway Intents, enable Message Content Intent (toggle it ON and save). This is required for the bot to read legacy commands like !start.
  2. Obtain the Bot Token

    • In the Bot tab, find the Token section and click Copy.
    • Paste it somewhere secure (like a private text file)—never share this, as it’s your bot’s key to Discord.
  3. Invite the Bot to Your Server

    • Go to the OAuth2 tab, then URL Generator.
    • Under Scopes, check bot.
    • Under Bot Permissions, select at least:
      • View Channels
      • Send Messages
      • Read Message History
      • Embed Links
      • Use Slash Commands (for /start, /stop, etc.)
    • Copy the generated URL, paste it in a browser, pick your server (you need “Manage Server” perms), and click Authorize.
    • Your bot should now appear in your server’s member list (offline until you run StationeersServerUI with the token and Discord Enabled).
  4. Configure the Bot in the Server Control UI

    • In the StationeersServerUI web interface, click on the Config button

    • On the **Discord Config page, check the Discord Enabled checkbox.

    • Enter the bot's token in the Discord Token field

    • Create a Discord Server if not already done

    • Create the following Discord channels:

      • Server Control Channel (for commands)
      • Server Status Channel
      • Server Log Channel
      • Control Panel Channel
      • Error Channel
    • Input the Channel IDs on the Config Page:

      • Server Control Channel ID: For sending commands to the bot
      • Server Status Channel ID: For receiving server status notifications
      • Server Log Channel ID: For viewing real-time console output
      • Control Panel Channel ID: For the Control Panel
      • Error Channel ID: For the Error Channel
      • Same Channel: While you could use the same channel for all streams, I highly discourage you to do so.

    Note: To get a channel's ID, enable developer mode in discord, right-click on the channel and select Copy ID

  5. Restart the Application

    • Close the application and run the executable again to enable / disable discord. (Will fix)

Discord Commands

Command Description
/start Starts the server
/stop Stops the server
/restore <index> Restores a backup at the specified index
/list [limit] Lists recent backups (defaults to 5 if number not specified)
/ban <SteamID> Bans a player by their SteamID
/unban <SteamID> Unbans a player by their SteamID
/help Displays help information for the bot commands

Next Steps

⚠️ **GitHub.com Fallback** ⚠️