mirror of
https://github.com/remix-bot/fluxer.git
synced 2026-11-24 06:01:44 -05:00
feat(ui): upgrade queue, search, lyrics, and radio embeds
- Transform %queue / %list with Now Playing thumbnail, ranked item cards, and localized footer - Enhance %search with provider icons, artist metadata, and localized cancel options - Polish %lyrics with album thumbnail, Synced badge, and structured header - Redesign %radio directory with command pills and localized pagination controls - Standardize brand color 0xe9196c across all player commands - Add complete translations across all 6 locales (en, ar-SA, ckb, tr, de-DE, pt-BR)
This commit is contained in:
1 parent
b7f20fcb02
commit
2494bf79d6
11 files changed
+158
-71
No files matched your search
+34
-14
@@ -39,9 +39,12 @@ export async function run(message, data) {
|
||||
|
||||
const current = p.queue.getCurrent();
|
||||
const totalTracks = p.queue.size();
|
||||
const prefix = this.handler.getPrefix(message.message?.guildId ?? message.channel?.guildId) || "%";
|
||||
|
||||
if (!current && totalTracks === 0) {
|
||||
const embed = new EmbedBuilder().setColor(getGlobalColor()).setDescription(this.t(message, "responses.list.empty", { prefix: this.handler.getPrefix(message.message?.guildId ?? message.channel?.guildId) }));
|
||||
const embed = new EmbedBuilder()
|
||||
.setColor(0xe9196c)
|
||||
.setDescription(this.t(message, "responses.list.empty", { prefix }));
|
||||
return message.reply({ embeds: [embed] });
|
||||
}
|
||||
|
||||
@@ -54,23 +57,31 @@ export async function run(message, data) {
|
||||
|
||||
const buildEmbed = (page) => {
|
||||
const safePage = (isNaN(page) || page < 1) ? 1 : Math.min(Math.floor(page), totalPages);
|
||||
const loopState = p.queue.songLoop ? "🔂 Song" : p.queue.loop ? "🔁 Queue" : "🛑 Off";
|
||||
const loopState = p.queue.songLoop
|
||||
? `🔂 ${this.t(message, "responses.play.loopSongLabel")}`
|
||||
: p.queue.loop
|
||||
? `🔄 ${this.t(message, "responses.play.loopQueueLabel")}`
|
||||
: this.t(message, "responses.play.loopOffLabel");
|
||||
|
||||
let desc = "";
|
||||
|
||||
const remaining = p.getQueueRemainingTime();
|
||||
desc += `📋 **${totalTracks} track${totalTracks !== 1 ? "s" : ""} in queue** • ⏱️ \`${remaining}\`\n`;
|
||||
const pluralStr = totalTracks === 1 ? this.t(message, "responses.play.trackSingle") : this.t(message, "responses.play.trackPlural");
|
||||
const headerStr = this.t(message, "responses.list.tracksCount", { count: totalTracks, plural: pluralStr });
|
||||
desc += `📋 **${headerStr}** • ⏱️ ` + "`" + remaining + "`" + "\n";
|
||||
|
||||
if (current) {
|
||||
const elapsed = p.getCurrentElapsedDuration();
|
||||
const total = p.getCurrentDuration();
|
||||
const link = current.spotifyUrl || current.url || "";
|
||||
let title = current.title ?? "Unknown";
|
||||
let title = current.title ?? this.t(message, "responses.play.unknownTrack");
|
||||
if (title.length > 50) title = title.slice(0, 47) + "...";
|
||||
const titleFmt = link ? `[${title}](${link})` : title;
|
||||
const rawAuthor = current.artist || (typeof current.author === "object" ? current.author?.name : current.author);
|
||||
const authorStr = rawAuthor ? ` • ${rawAuthor}` : "";
|
||||
|
||||
desc += "\n" + this.t(message, "responses.list.nowPlaying") + "\n";
|
||||
desc += `${titleFmt} • \`${elapsed} / ${total}\`\n`;
|
||||
desc += `\n▶️ **${this.t(message, "responses.list.nowPlayingHeader")}:**\n`;
|
||||
desc += `${titleFmt}${authorStr} • ` + "`" + elapsed + " / " + total + "`" + "\n";
|
||||
}
|
||||
|
||||
desc += `\n`;
|
||||
@@ -78,26 +89,35 @@ export async function run(message, data) {
|
||||
if (totalTracks === 0) {
|
||||
desc += this.t(message, "responses.list.emptyInline");
|
||||
} else {
|
||||
desc += `**${this.t(message, "responses.list.upNextHeader")}:**\n`;
|
||||
const { items, start } = p.queue.getPage(safePage, PAGE_SIZE);
|
||||
|
||||
items.forEach((vid, i) => {
|
||||
const index = String(start + i + 1).padStart(2, " ");
|
||||
const index = start + i + 1;
|
||||
const dur = vid.duration ? p.getDuration(vid.duration) : "?:??";
|
||||
const link = vid.spotifyUrl || vid.url || "";
|
||||
let title = vid.title ?? "Unknown";
|
||||
let title = vid.title ?? this.t(message, "responses.play.unknownTrack");
|
||||
if (title.length > 45) title = title.slice(0, 42) + "...";
|
||||
title = link ? `[${title}](${link})` : title;
|
||||
const upNext = (start + i === 0) ? " ▶" : "";
|
||||
desc += `\`${index}.\` ${title}${upNext} • \`${dur}\`\n`;
|
||||
const rawAuthor = vid.artist || (typeof vid.author === "object" ? vid.author?.name : vid.author);
|
||||
const authorStr = rawAuthor ? ` • ${rawAuthor}` : "";
|
||||
desc += "`#" + index + "` " + `**${title}**${authorStr} • ` + "`" + dur + "`" + "\n";
|
||||
});
|
||||
}
|
||||
|
||||
return new EmbedBuilder()
|
||||
.setColor(getGlobalColor())
|
||||
const footerText = `${this.t(message, "responses.list.pageFooter", { page: safePage, totalPages, loopState })} • ${this.t(message, "responses.play.controlsHint", { prefix })}`;
|
||||
|
||||
const builder = new EmbedBuilder()
|
||||
.setColor(0xe9196c)
|
||||
.setAuthor({ name: this.t(message, "responses.list.queueTitle") })
|
||||
.setDescription(desc.trim())
|
||||
.setFooter({ text: `Page ${safePage}/${totalPages} • ${loopState}` })
|
||||
;
|
||||
.setFooter({ text: footerText });
|
||||
|
||||
if (current?.thumbnail) {
|
||||
builder.setThumbnail(current.thumbnail);
|
||||
}
|
||||
|
||||
return builder;
|
||||
};
|
||||
|
||||
new QueuePaginator(message, this.messages, this.client)
|
||||
|
||||
Reference in new issue
Block a user