feat(status): implement public status channel system with live telemetry, automated incident tracking, and multi-language support

- StatusChannelManager Service:
  • Implement dedicated public status channel manager with periodic self-updating live telemetry card.
  • Report real-time Fluxer gateway latency, uptime, active music sessions, listener counts, guild footprint, and subsystem statuses.
  • Add visual Unicode progress bars for RAM (process RSS vs. system total) and CPU utilization across CPU cores.
  • Add dual-color incident lifecycle management:
    - 🔴 Incident Outage embeds with start timestamp, severity level, investigating status, and optional role mentions.
    - ✅ Incident Resolution embeds with automatic downtime duration calculation and stable verification.
  • Wire automated incident triggers into Bot lifecycle (Lavalink node disconnect/reconnect, process shutdown) and GatewayHandler (gateway drops and ready/resumed reconnects).
- Owner Diagnostic Command:
  • Add `statustest` owner-only command with subcommands:
    - `refresh`: Force an immediate update and edit of the live status card.
    - `incident <target> [reason]`: Simulate subsystem outage alerts.
    - `resolve <target> [note]`: Simulate incident resolution with calculated downtime.
- Complete Multi-Language Localization:
  • Add full translations for `statustest` and `statusChannel` across all 6 supported locales:
    - English (`en.json`)
    - German (`de-DE.json`)
    - Portuguese (`pt-BR.json`)
    - Turkish (`tr.json`)
    - Arabic (`ar-SA.json`)
    - Central Kurdish (`ckb.json`)
  • Wire `StatusChannelManager` and `statustest` to dynamically resolve translated strings via `remix.locale.translate`.
This commit is contained in:
NoLogicAlan committed 2026-11-10 02:31:48 +03:00
1 parent e3dd7ad914
commit 36139837ba
11 files changed
+986 -7

No files matched your search

+14 -1
View File
@@ -30,6 +30,7 @@ import { GatewayHandler } from "../voice/gateway/GatewayHandler.mjs";
import { LastFmManager } from "../services/lastfm/LastFmManager.mjs";
import { FluxerListManager } from "../services/FluxerListManager.mjs";
import { TrackOptionsManager } from "../services/TrackOptionsManager.mjs";
import { StatusChannelManager } from "../services/StatusChannelManager.mjs";
import { TrackStats } from "../music/TrackStats.mjs";
import { configureBilibili } from "../music/bilibili/index.mjs";
import { configureAudio } from "../music/audio/AudioSettings.mjs";
@@ -270,6 +271,7 @@ class Remix {
this.lastfm = new LastFmManager(config.lastfm, sharedPromisePool);
this.fluxerlist = new FluxerListManager(config.fluxerlist);
this.trackOptions = new TrackOptionsManager(sharedPool);
this.statusChannel = new StatusChannelManager(this, config.statusChannel);
/* Gateway activity timestamps and status tracking */
this._lastGatewayHeartbeat = Date.now();
@@ -373,21 +375,31 @@ class Remix {
this.lavalink = new LavalinkManager(config.nodelink ?? {}, client, { id: botId, username: client.user?.username ?? "bot" });
this.lavalink.on("ready", () => {
logger.lavalink("[Lavalink] Session ready");
this.statusChannel?.resolveIncident("audioNode");
if (this._hasBooted) {
this.players?.resumeAllOnNodeReconnect?.();
}
});
this.lavalink.on("nodeReconnect", () => {
this.statusChannel?.resolveIncident("audioNode");
if (this._hasBooted) {
this.players?.resumeAllOnNodeReconnect?.();
}
});
this.lavalink.on("nodeDisconnect", (node, reason) => {
this.statusChannel?.triggerIncident("audioNode", `Audio engine disconnected: ${reason || "Connection dropped"}`);
});
this.lavalink.on("nodeError", (node, err) => {
this.statusChannel?.triggerIncident("audioNode", `Audio engine error: ${err?.message || "Unreachable"}`);
});
await this.lavalink.init();
this.playerContext.lavalink = this.lavalink;
}
this.gatewayHandler.onReady();
this._hasBooted = true;
this.statusChannel?.start();
this.statusChannel?.resolveIncident("gateway");
this.fluxerlist?.startAutoStats?.(client);
@@ -802,8 +814,9 @@ class Remix {
logger.error("[Shutdown] Failed to close Dashboard DB:", e.message);
}
// 6. Stop 24/7 watchdog
/* 6. Stop 24/7 watchdog and status channel */
try {
this.statusChannel?.destroy?.();
this.gatewayHandler?.stop247Watchdog?.();
} catch (e) {
logger.warn("[Shutdown] Watchdog stop error:", e?.message);