Discord Integration Refactor, Theming & backup retention improvements, uptime reporting on webUI, Go 1.26 upgrade, SSUICLI improvements#157
Conversation
…> Split the ListenToSlashCommands condition into two parts
… Community links - Implement styled embed display for connected players - Add clickable Steam Community profile links for each player - Send initial panel on bot startup with proper message cleanup - Fix message editing to properly update embeds
…n under the exeption message as this has been broken / unused since v4 anyway
…l for improved clarity since the old SendMessageToErrorChannel with error button (message tracking) was removed
…ly flags that hide some commands when only using "help" or "h"
…nd-localization Fix Discord button interaction issues and Improve "Save Name" input labels
Enhances backup retention logic with daily, weekly, and monthly tracking to optimize backup management. Also improves backup file handling by adding logging for corrupt or missing files.
Enhance the game server status indicator on the WebUI by including uptime in the /v2/server/status api HTTP response and displaying it in the web UI.
…ssuicli Update the Go version to 1.26 and introduce two new developer commands for testing and pprof profiling. Also improves the help command to include descriptions and visibility controls for developer-intended commands.
There was a problem hiding this comment.
Pull request overview
This PR improves Discord interaction handling and Discord UI panels, enhances backup retention behavior and robustness when reading backups, and adds game server uptime reporting to the WebUI (plus CLI/dev tooling updates and a Go toolchain bump).
Changes:
- Fix Discord slash-command handling so non-command interactions aren’t prematurely acknowledged, and redesign the connected players panel as an embed.
- Improve backup retention logic (daily/weekly/monthly tracking) and skip/log corrupt or malformed backup files instead of failing the full scan.
- Add server uptime to
/api/v2/server/statusand display it in the WebUI; update CLI command registry/help output and add dev commands (heap profile + connected players panel test).
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/web/http.go | Adds uptime to the status API response and formats it for UI display. |
| src/managers/detectionmgr/handlers.go | Routes exception notifications to the (renamed) Discord error-channel send function. |
| src/managers/backupmgr/getbackups.go | Logs and skips corrupt/missing-metadata backup files during safe-backup enumeration. |
| src/managers/backupmgr/cleanup.go | Improves retention logic with true daily/weekly/monthly tracking and avoids day-of-month collisions. |
| src/discordbot/sendMessage.go | Renames error-channel send function and removes old unused tracked-message helper. |
| src/discordbot/interface.go | Sends the connected players panel on Discord bot startup. |
| src/discordbot/handleSlashcommands.go | Ensures only slash commands are handled by the slash-command listener (prevents button interaction race). |
| src/discordbot/handleReactions.go | Removes unused exception reaction handler code and related imports. |
| src/discordbot/connectedplayers.go | Redesigns connected players panel into an embed with Steam profile links; adds startup panel sender. |
| src/config/config.go | Bumps app version to 5.13.0. |
| src/cli/ssuicli.go | Enhances command registration with descriptions/dev-only flag and improves the help output formatting/filtering. |
| src/cli/devcommands.go | Adds heap profile dump and a connected-players panel test command. |
| src/cli/commands.go | Updates command registrations to include descriptions and dev-only visibility controls. |
| go.mod | Bumps Go toolchain version to 1.26. |
| UIMod/onboard_bundled/ui/index.html | Adds an uptime display element to the home/status header. |
| UIMod/onboard_bundled/localization/sv-SE.json | Updates Save Name help text to clarify new-save creation behavior. |
| UIMod/onboard_bundled/localization/en-US.json | Fixes a typo and updates Save Name help text for clarity. |
| UIMod/onboard_bundled/localization/de-DE.json | Updates Save Name help text to clarify new-save creation behavior. |
| UIMod/onboard_bundled/assets/js/server-api.js | Displays uptime from the status API when the server is running. |
| UIMod/onboard_bundled/assets/css/home.css | Styles the new uptime display element. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/discordbot/connectedplayers.go
Outdated
| embed := buildConnectedPlayersEmbed(nil) | ||
| sendOrEditConnectedPlayersEmbed(channelID, embed) | ||
| clearMessagesAboveLastN(channelID, 1) | ||
| logger.Discord.Info("Connected players panel sent successfully") |
There was a problem hiding this comment.
sendConnectedPlayersPanel logs "sent successfully" unconditionally. If sendOrEditConnectedPlayersEmbed fails (it only logs internally), this produces a misleading success log and still calls clearMessagesAboveLastN. Consider returning an error from sendOrEditConnectedPlayersEmbed (or a boolean) and only logging success / running cleanup when the send/edit actually succeeded.
| logger.Discord.Info("Connected players panel sent successfully") | |
| logger.Discord.Info("Connected players panel send attempted; performed cleanup of previous messages") |
| // Get the full path | ||
| fullPath := filepath.Join(m.config.SafeBackupDir, filename) | ||
|
|
||
| // Get the save time from the file | ||
| // Unzip the save file and open the world_meta.xml file inside | ||
| r, err := zip.OpenReader(fullPath) | ||
| if err != nil { | ||
| return err | ||
| logger.Backup.Warnf("Skipping corrupt/unreadable backup file %s: %s", fullPath, err.Error()) | ||
| return nil |
There was a problem hiding this comment.
fullPath is rebuilt with filepath.Join(m.config.SafeBackupDir, filename), which ignores the path argument from filepath.WalkDir. Since backups are copied into SafeBackupDir preserving relative paths (see backupmgr/manager.go), this can point to a non-existent file for backups located in subdirectories, causing them to be skipped and breaking restore/cleanup ordering. Use the path parameter (or otherwise preserve subdirectories) as the full path for the file being walked.
There was a problem hiding this comment.
SSUI v5.13.1 🔧 Remote Galaxy
This release fixes Discord button interaction stability, redesigns the connected players panel with rich embeds, adds server uptime display on the WebUI, improves backup retention logic, upgrades SSUI to Go 1.26, and brings SSUICLI quality-of-life improvements.
🤖 Discord Improvements
Refactor of the Discord Integration
Tip
The good news: Functionality will not be disrupted by below changes, and you don't need to reconfigure anything.
The config package migrates old keys to new keys.
Caution
The SavesChannel and ErrorChannel where Deprecated.
Those events are now sent to the StatusChannel, which is now called EventLogChannel.
Caution
The ConnectionListChannel and ServerInfoPanelChannel have been combined into a unified StatusPanelChannel.
Note
The configured ConnectionListChannel will be migrated and reused as the StatusPanelChannel
The configured StatusChannel will be migrated and reused as the EventLogChannel
The configured ServerInfoPanelChannel is now unused in favor of the unified StatusPanelChannel
You can safely delete the now unused channels SavesChannel, ErrorChannel and ServerInfoPanelChannel from your Discord.
- Deprecated dedicated saves channel in favor of evens channel and Consolidated server info and connected players panels into a single status panel,
sendServerStatusPanel, which now handles player connection updates and server info / password gathering.
Connected Players Panel Redesign
The connected players panel has been completely redesigned — gone is the plain-text code block, replaced with a rich Discord embed:
- Player names are now clickable links to their Steam profiles
- Color-coded: panel green when players are online, grey when empty
- Shows player count and a "Last updated" timestamp
Fixes and improvements:
- Fixed a bug where Discord button interactions (e.g., on the server info panel) were prematurely acknowledged due to a combined condition in the slash command handler. The handler now correctly separates interaction type checks, preventing button presses from being swallowed silently.
- Updated localization keys on UI for Discord channels to be more informative
- fixed the "Error sending log to Discord; Message cannot be empty" bug
🌐 WebUI:
Implement a theme engine for user-customizable themes
This builds upon the theming preparations already done with the xmas update:
- Added a new theme editor UI to the config page for customizing theme colors and presets.
- Added functionality for importing and exporting themes in JSON format.
- Created some preset themes (reused the themes from SSUI v7/SteamServerUI)
⏱️ Uptime on WebUI
Server uptime is now displayed directly on the web UI dashboard next to the status indicator. The /v2/server/status API response now includes an uptime field with a human-readable format (e.g., 1d2h3m4s).
💾 Backup Retention System Improvements
Enhanced the backup retention logic for more accurate and reliable cleanup:
- Fixed a bug where backups from different months but the same day-of-month (e.g., Jan 15 and Feb 15) were incorrectly treated as the "same day" — now uses full calendar day comparison (year + day-of-year)
- The "keep last N" backups now properly update daily/weekly/monthly retention trackers, preventing redundant keeps
- Corrupt or unreadable backup files are now logged and skipped instead of causing the entire backup scan to fail
🖥️ SSUICLI Improvements
- All commands now have descriptions shown in
helpoutput - Commands are split into user and dev categories — run
help devto see developer commands if necessary. - Help output is now cleanly formatted with aligned columns and color coding
- New dev commands:
dumpheapprofile— dump a pprof heap profile for debuggingtestserverstatuspaneldiscord— sends a fake player list to test the Discord connected players panel
🪲 Bug Fixes & Minor Improvements
- Fixed typo in admin password info text ("Leavy" → "Leave")
- Enhanced "Save Name" config UI label in all localizations to reflect "creates a new save" for less experienced / new users and clarify that changing the value to a non-existent folder name creates a new save
Full Changelog: v5.12.3...v5.13.1
|
need to update workflows from go 1.25.7 to 1.26 before i release this E: Done, see commits below |
- Renamed and updated channel names: - `StatusChannel` to `EventLogChannel` - `ConnectionListChannel` to `GetStatusPanelChannel` - Corresponding functions were also renamed. - The config package migrates old keys to new keys for minimal disruption. - Deprecated dedicated saves channel in favor of evens channel and Consolidated server info and connected players panels into a single status panel, `sendServerStatusPanel`, which now handles player connection updates and server info / password gathering. - Updated all references in the codebase to use the new channel names and functions - Removed the `connectedplayers.go` and `serverinfopanel.go` files as their functionality has been integrated into the new status panel (serverstatuspanel.go) - Adjusted html templates and localization variables to reflect the new channel structure. - Updated localization keys for discord channels to be more informative
…e handling to use event log channel instead
This builds upton the theming preperations already done with the xmas update. - Added a new theme editor UI for customizing theme colors and presets. - Introduced a theme engine to manage themes via CSS variables and localStorage. - Updated CSS variables for better organization and added derived variables. - Enhanced console messages to use theme colors dynamically. - Integrated theme editor into the configuration page - Added functionality for importing and exporting themes in JSON format. - Created preset themes for quick theme application. - Also fixes "Error sending log to Discord" bug
feat: Implement theme editor and engine for user-customizable themes
…Console) Remove Pause command from SSCM command input (Console) Fixes #145
Address the Discord button interaction issue by splitting the slash command handler condition to prevent premature acknowledgment of interactions. Additional improvements include redesigning the connected players panel and updating error handling functions for clarity.
Enhance the "Save Name" input label on the config page to clarify that changing the value creates a new save.
Enhance the game server status indicator on the WebUI by including uptime in the /v2/server/status api HTTP response and displaying it in the web UI.
Enhances backup retention logic with daily, weekly, and monthly tracking to optimize backup management. Also improves backup file handling by adding logging for corrupt or missing files.
Update the Go version to 1.26 and introduce two new developer commands for testing and pprof profiling to SSUICLI. Also improves the help command to include descriptions and visibility controls for developer-intended commands.
Refactor Discord Channel Configuration
Renamed and updated channel names:
StatusChanneltoEventLogChannelConnectionListChanneltoGetStatusPanelChannelDeprecated dedicated saves channel in favor of evens channel and Consolidated server info and connected players panels into a single status panel,
sendServerStatusPanel, which now handles player connection updates and server info / password gathering.Updated all references in the codebase to use the new channel names and functions
Removed the
connectedplayers.goandserverinfopanel.gofiles as their functionality has been integrated into the new status panel (serverstatuspanel.go)Adjusted html templates and localization variables to reflect the new channel structure.
Updated localization keys for discord channels to be more informative
Bumps go version to 1.26 (cutting edge)
Fixes #144, Fixes #151, Raises #156