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.
78 lines
2.7 KiB
JavaScript
78 lines
2.7 KiB
JavaScript
/**
|
|
* @module commands/resume
|
|
* @description Resume paused playback in the current voice channel.
|
|
*/
|
|
|
|
import { CommandBuilder } from "../src/commands/index.mjs";
|
|
import { EmbedBuilder } from "@fluxerjs/core";
|
|
import { Utils } from "../src/utils/Utils.mjs";
|
|
|
|
/**
|
|
* @type {CommandBuilder}
|
|
* @description Command definition for the resume command.
|
|
*/
|
|
export const command = new CommandBuilder()
|
|
.setName("resume")
|
|
.setDescription("Resume the playback in your voice channel", "commands.resume")
|
|
.setCategory("music");
|
|
|
|
/**
|
|
* Run handler for the resume command.
|
|
* Resumes playback and sends a confirmation embed.
|
|
*
|
|
* @param {object} message - The command message wrapper.
|
|
* @returns {Promise<void>}
|
|
*/
|
|
export async function run(message) {
|
|
const p = await this.getPlayer(message, false, true, false);
|
|
if (!p) return;
|
|
|
|
const current = p.queue.getCurrent();
|
|
if (!p.connection || !current) {
|
|
const embed = new EmbedBuilder()
|
|
.setColor(0xe9196c)
|
|
.setAuthor({ name: `▶️ ${this.t(message, "responses.resume.resumedTitle")}` })
|
|
.setDescription(this.t(message, "responses._common.nothingPlaying"));
|
|
return message.reply({ embeds: [embed] });
|
|
}
|
|
|
|
const prefix = this.handler.getPrefix(message.message?.guildId ?? message.channel?.guildId) || "%";
|
|
|
|
if (!p._paused) {
|
|
const embed = new EmbedBuilder()
|
|
.setColor(0xe9196c)
|
|
.setAuthor({ name: `▶️ ${this.t(message, "responses.resume.resumedTitle")}` })
|
|
.setDescription(this.t(message, "responses.resume.notPaused"))
|
|
.setFooter({ text: this.t(message, "responses.resume.pauseHint", { prefix }) });
|
|
return message.reply({ embeds: [embed] });
|
|
}
|
|
|
|
p.resume();
|
|
p._autoPausedEmpty = false;
|
|
p._serverMutedAutoPaused = false;
|
|
const elapsed = p.getCurrentElapsedDuration();
|
|
const trackUrl = current.spotifyUrl || current.url || null;
|
|
const rawAuthor = current.artist || (typeof current.author === "object" ? current.author?.name : current.author);
|
|
|
|
let desc = trackUrl
|
|
? `**[${Utils.truncate(current.title || this.t(message, "responses.play.unknownTrack"), 50)}](${trackUrl})**`
|
|
: `**${Utils.truncate(current.title || this.t(message, "responses.play.unknownTrack"), 50)}**`;
|
|
|
|
if (rawAuthor) {
|
|
desc += `\n${this.t(message, "responses.play.byAuthor", { author: rawAuthor })}`;
|
|
}
|
|
|
|
const embed = new EmbedBuilder()
|
|
.setColor(0xe9196c)
|
|
.setAuthor({ name: `▶️ ${this.t(message, "responses.resume.resumedTitle")}` })
|
|
.setTitle(this.t(message, "responses.resume.resumedAt", { time: elapsed }))
|
|
.setDescription(desc)
|
|
.setFooter({ text: this.t(message, "responses.resume.pauseHint", { prefix }) });
|
|
|
|
if (current.thumbnail) {
|
|
embed.setThumbnail(current.thumbnail);
|
|
}
|
|
|
|
message.reply({ embeds: [embed] }).catch(() => {});
|
|
}
|