feat(embeds): upgrade settings, 24/7 watchdog, and lastfm info embeds

- Upgrade %settings get to modular categorized Server Control Dashboard
- Upgrade %247 panel to live voice watchdog and connection health monitor
- Upgrade %fm profile to Last.fm music identity card with user avatar and stats
- Upgrade %fm artistinfo to artist spotlight card with tags, bio, and plays matrix
- Upgrade %fm cover to high-resolution album artwork gallery frame
- Add complete translations across all 6 locales (0 missing keys)
This commit is contained in:
NoLogicAlan committed 2026-10-25 04:16:36 +03:00
1 parent 63433816c4
commit 36b27d466b
11 files changed
+418 -332

No files matched your search

+63 -15
View File
@@ -12,7 +12,8 @@
*/
import { cleanId } from "../../src/ui/index.mjs";
import { EmbedBuilder } from "@fluxerjs/core";
import { cleanId, getGlobalColor } from "../../src/ui/index.mjs";
import { isPlayerConnectionDead } from "../../src/utils/Helpers247.mjs";
import { isValidFluxerId, MAX_247_CHANNELS, embed, tWrap } from "./utils.mjs";
@@ -161,11 +162,56 @@ function build247PanelDescription(set, ctx, guildId, justToggledId = null) {
export function build247Panel(set, ctx, guildId, justToggledId = null) {
const t = tWrap(ctx, guildId);
const prefix = ctx.handler.getPrefix(guildId);
const channels = [...get247Channels(set)];
const panelKey = (k, vars = {}) => t("responses.settings.247Panel." + k, vars);
return embed(
build247PanelDescription(set, ctx, guildId, justToggledId),
{ title: panelKey("title"), footer: panelKey("footerLine", { prefix }) }
);
const watchdog = ctx.gatewayHandler;
const watchdogOn = watchdog?.isWatchdog247Running?.() === true;
const sweepSeconds = Math.round((watchdog?._247WatchdogInterval ?? 60_000) / 1000);
const panelEmbed = new EmbedBuilder()
.setColor(getGlobalColor())
.setAuthor({ name: panelKey("watchdogAuthor") })
.setTitle(panelKey("watchdogTitle"))
.setFooter({ text: panelKey("watchdogFooter", { prefix }) });
if (channels.length === 0) {
panelEmbed.setDescription(
panelKey("disabledLine") + "\n\n" +
panelKey("allChannelsDisabled") + "\n\n" +
panelKey("disabledHint", { prefix })
);
} else {
const statuses = channels
.map(id => channelStatus(ctx, guildId, id, t))
.sort((a, b) => a.order - b.order);
const lines = statuses.map(s =>
s.line + (justToggledId && s.line.includes("<#" + cleanId(justToggledId) + ">") ? " \u2190" : "")
);
const allConnected = statuses.every(s => s.state === "connected");
const statusHeader = (channels.length === 1 && allConnected
? panelKey("enabledLine")
: panelKey(channels.length === 1 ? "activeChannels_one" : "activeChannels_other", { count: channels.length }));
panelEmbed.setDescription(statusHeader + "\n\n" + lines.join("\n"));
panelEmbed.addFields(
{
name: panelKey("watchdogFieldRecovery"),
value: watchdogOn ? panelKey("watchdogRecoveryArmed", { seconds: sweepSeconds }) : panelKey("autoRecoveryDisabledLine"),
inline: true
},
{
name: panelKey("watchdogFieldInactivity"),
value: panelKey("watchdogInactivitySuppressed"),
inline: true
}
);
}
return { embeds: [panelEmbed] };
}
/**
* Disable 24/7 mode for a specific channel.
@@ -269,17 +315,19 @@ export async function handle247Toggle(ctx, message, set, guildId) {
if (channels.has(id)) {
await disable247(ctx, set, guildId, userChannelId);
return message.reply(embed(
panelKey("confirmDisabled", { channel: "<#" + id + ">" }) + "\n\n" +
build247PanelDescription(set, ctx, guildId, null),
{ title: panelKey("title") }
));
const panel = build247Panel(set, ctx, guildId, null);
panel.embeds[0].setDescription(
panelKey("confirmDisabled", { channel: "<#" + id + ">" }) + "\n\n" +
panel.embeds[0].description
);
return message.reply(panel);
}
await enable247(ctx, set, guildId, userChannelId);
return message.reply(embed(
panelKey("confirmEnabled", { channel: "<#" + id + ">" }) + "\n\n" +
build247PanelDescription(set, ctx, guildId, id),
{ title: panelKey("title") }
));
const panel = build247Panel(set, ctx, guildId, id);
panel.embeds[0].setDescription(
panelKey("confirmEnabled", { channel: "<#" + id + ">" }) + "\n\n" +
panel.embeds[0].description
);
return message.reply(panel);
}
+3 -1
View File
@@ -27,7 +27,7 @@ const BOOL_TRUE = new Set(["true", "1", "yes", "on", "enable", "enabled"]);
/** @private @type {Set<string>} Strings that evaluate to boolean false. */
const BOOL_FALSE = new Set(["false", "0", "no", "off", "disable", "disabled"]);
/** @private @type {Set<string>} Setting keys that use boolean display formatting. */
export const BOOL_SETTINGS = new Set(["songAnnouncements", "voteSkip"]);
export const BOOL_SETTINGS = new Set(["songAnnouncements", "voteSkip", "normalize"]);
/** @private @type {Set<string>} Available locale codes, populated at load time. */
export let VALID_LOCALES = new Set(["en"]);
@@ -138,6 +138,7 @@ export function prettifySettingLabel(key, t, guildId) {
locale: "responses.settings.labelLocale",
stay_247: "responses.settings.label247",
volume: "responses.settings.labelVolume",
normalize: "responses.settings.labelNormalize",
voteSkip: "responses.settings.labelVoteSkip",
voteSkipThreshold: "responses.settings.labelVoteSkipThreshold",
};
@@ -149,6 +150,7 @@ export function prettifySettingLabel(key, t, guildId) {
locale: "Locale",
stay_247: "24/7 mode",
volume: "Default volume",
normalize: "Volume normalization",
voteSkip: "Vote to skip",
voteSkipThreshold: "Vote to skip threshold",
};