mirror of
https://github.com/remix-bot/fluxer.git
synced 2026-11-24 06:01:44 -05:00
feat(ui): upgrade playback action embeds
- Redesign %skip with skipped track thumbnail, elapsed time, and up-next preview - Upgrade %pause and %resume with rich track cards and timestamp badges - Add visual volume meter gauge (0-150%) to %volume - Modernize %loop with single-track and queue-loop status badges - Enhance %autoplay with status pills and recommendation engine details - Polish %shuffle and %clear with queue reorder summaries and track counts - Full translations added across all 6 locales (en, ar-SA, ckb, tr, de-DE, pt-BR)
This commit is contained in:
1 parent
2494bf79d6
commit
8874ed1ec6
14 files changed
+477
-102
No files matched your search
+37
-5
@@ -5,7 +5,7 @@
|
||||
|
||||
import { CommandBuilder } from "../src/commands/index.mjs";
|
||||
import { EmbedBuilder } from "@fluxerjs/core";
|
||||
import { getGlobalColor } from "../src/ui/index.mjs";
|
||||
import { Utils } from "../src/utils/Utils.mjs";
|
||||
|
||||
/**
|
||||
* @type {CommandBuilder}
|
||||
@@ -26,10 +26,42 @@ export const command = new CommandBuilder()
|
||||
export async function run(message) {
|
||||
const p = await this.getPlayer(message, false, true, false);
|
||||
if (!p) return;
|
||||
const res = p.resume();
|
||||
|
||||
const current = p.queue.getCurrent();
|
||||
if (!p.connection || !current) {
|
||||
const embed = new EmbedBuilder().setColor(0xe9196c).setDescription(this.t(message, "responses._common.nothingPlaying"));
|
||||
return message.reply({ embeds: [embed] });
|
||||
}
|
||||
|
||||
if (!p._paused) {
|
||||
const embed = new EmbedBuilder().setColor(0xe9196c).setDescription(this.t(message, "responses.resume.alreadyPlaying") || "Already playing!");
|
||||
return message.reply({ embeds: [embed] });
|
||||
}
|
||||
|
||||
p.resume();
|
||||
const elapsed = p.getCurrentElapsedDuration();
|
||||
const trackUrl = current.spotifyUrl || current.url || null;
|
||||
const rawAuthor = current.artist || (typeof current.author === "object" ? current.author?.name : current.author);
|
||||
const prefix = this.handler.getPrefix(message.message?.guildId ?? message.channel?.guildId) || "%";
|
||||
|
||||
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(getGlobalColor())
|
||||
.setDescription(res)
|
||||
;
|
||||
.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(() => {});
|
||||
}
|
||||
Reference in new issue
Block a user