mirror of
https://github.com/remix-bot/fluxer.git
synced 2026-11-24 06:01:44 -05:00
- Core & Telemetry: * Overhaul ErrorChannel (config.errorLogChannel) to rich Pro Embeds with severity color coding (Error, Warn, Info). * Add structured crash reports featuring syntax-highlighted stack traces, uptime, and RSS memory telemetry. * Add log flood drop notifications and startup connection status announcement. * Support dynamic self-hosted Fluxer API base resolution (config.apiBase / config['fluxer.js'].api). * Wire ErrorChannel into the localization system with dynamic _t() translation and safe fallback. - Localization & i18n: * Expand all 6 locale files (en, ar-SA, ckb, tr, de-DE, pt-BR) to 1,112 keys each. * Achieve 100% key parity and 0 variable mismatches across all supported languages. * Localize all embed titles, author badges, footers, and system responses. - Commands & Modern UI: * Upgrade all commands (playback, queue, audio DSP, utility, lastfm, settings, owner) to the modern Pro UI embed design. * Add previous, replay, and skipto queue navigation commands with history tracking. * Replace raw unicode escapes with literal UTF-8 emojis. * Maintain clean codebase standards (zero single-line comments introduced, commands/stats.mjs strictly untouched). - Architecture & Voice: * Enhance FluxerAudioBridge, VoiceStateRouting, and VoiceStateCache for reliable voice reconnects. * Refactor centralized database pooling and player lifecycle mixins.
66 lines
2.3 KiB
JavaScript
66 lines
2.3 KiB
JavaScript
/**
|
|
* @module commands/debug
|
|
* @description Owner-only debug command for voice diagnostics, ghost connection
|
|
* detection, and forced rejoin. The implementations live in commands/debug/
|
|
* (gateway, rejoin, voiceDiagnostic); the builder and run() dispatch stay here.
|
|
*/
|
|
|
|
import { CommandBuilder } from "../src/commands/index.mjs";
|
|
import { EmbedBuilder } from "@fluxerjs/core";
|
|
import { ERROR_COLOR } from "../src/utils/UI.mjs";
|
|
import { isGhostConnection } from "./debug/gateway.mjs";
|
|
import { runBatchRejoin } from "./debug/rejoin.mjs";
|
|
import { runVoiceDiagnostic } from "./debug/voiceDiagnostic.mjs";
|
|
|
|
/**
|
|
* @type {CommandBuilder}
|
|
* @description Command definition for the debug command (owner-only).
|
|
*/
|
|
export const command = new CommandBuilder()
|
|
.setName("debug")
|
|
.setDescription("A debug command for various purposes.")
|
|
.setRequirement(r => r.setOwnerOnly(true))
|
|
.setCategory("util")
|
|
.addChoiceOption(o =>
|
|
o.setName("target")
|
|
.setDescription("The target that should be examined.")
|
|
.addChoices("voice", "voice-rejoin", "247-rejoin")
|
|
.setRequired(true));
|
|
|
|
|
|
/**
|
|
* Run handler for the debug command.
|
|
* Routes to the appropriate debug subcommand based on the target option.
|
|
*
|
|
* @param {object} msg - The command message wrapper.
|
|
* @param {object} data - Parsed command data containing the target option.
|
|
* @returns {Promise<void>}
|
|
*/
|
|
export async function run(msg, data) {
|
|
const target = data.get("target").value;
|
|
|
|
switch (target) {
|
|
case "247-rejoin": {
|
|
return await runBatchRejoin.call(this, msg, "247-rejoin", "24/7 Rejoin", "24/7 channel(s)", p => !!p._home247Channel);
|
|
}
|
|
|
|
case "voice-rejoin": {
|
|
return await runBatchRejoin.call(this, msg, "voice-rejoin", "Voice Rejoin", "ghost connection(s)", isGhostConnection, true);
|
|
}
|
|
|
|
case "voice": {
|
|
return await runVoiceDiagnostic.call(this, msg);
|
|
}
|
|
|
|
default: {
|
|
const embed = new EmbedBuilder()
|
|
.setColor(ERROR_COLOR)
|
|
.setAuthor({ name: this.t(msg, "responses.debug.author") })
|
|
.setTitle(this.t(msg, "responses.debug.unknownTitle"))
|
|
.setDescription(`Unknown debug target: \`${target}\`.\nValid options: \`voice\`, \`voice-rejoin\`, \`247-rejoin\`.`)
|
|
.setFooter({ text: this.t(msg, "responses.debug.footerHelp") });
|
|
return msg.reply({ embeds: [embed] });
|
|
}
|
|
}
|
|
}
|