From 8689dee50a8d6bc9bbf98f9cabf3d1b14ef5a498 Mon Sep 17 00:00:00 2001 From: NoLogicAlan Date: Sun, 25 Oct 2026 03:54:02 +0300 Subject: [PATCH] feat(ui): overhaul remaining embeds for help, queue ops, audio mastering & community - Upgrade %help overview with feature highlights and %help with rich embed inspector - Fix %playnext embed wrapping bug causing [object Object] and add Playing Next badge - Upgrade %trackopt set/get/play with visual cut-window timeline bars - Upgrade %remove and %move with queue change receipt cards - Upgrade %normalize and %volumedefault with EBU R128 mastering and volume slider bars - Upgrade %whoknows with ranked Crown Holder cards and podium medals - Upgrade %invite and %support with rich in-embed markdown links (no button dependencies) - Upgrade voice join and %vote with branded status embeds --- commands/invite.mjs | 15 +++-- commands/lastfm/whoknows.mjs | 32 ++++++---- commands/move.mjs | 19 +++++- commands/normalize.mjs | 23 ++++--- commands/playnext.mjs | 16 ++++- commands/remove.mjs | 30 +++++++++- commands/support.mjs | 16 ++++- commands/trackopt.mjs | 88 +++++++++++++++++++++++---- commands/volumedefault.mjs | 33 ++++++++-- commands/vote.mjs | 4 +- src/commands/HelpHandler.mjs | 96 ++++++++++++++++++++---------- src/music/PlayerLifecycleMixin.mjs | 23 +++++-- src/ui/HelpCommand.mjs | 36 ++++++----- 13 files changed, 332 insertions(+), 99 deletions(-) diff --git a/commands/invite.mjs b/commands/invite.mjs index d1e5f68..ecadf57 100644 --- a/commands/invite.mjs +++ b/commands/invite.mjs @@ -25,8 +25,6 @@ export const command = new CommandBuilder() * @returns {Promise} */ export async function run(message) { - const description = this.t(message, "responses.invite.description"); - const botUser = this.client?.user; const botIcon = botUser?.displayAvatarURL?.() || null; @@ -36,8 +34,17 @@ export async function run(message) { name: this.t(message, "responses.invite.title"), iconURL: botIcon }) - .setDescription(description) - ; + .setTitle("Add Remix to Your Server") + .setDescription( + "High-fidelity 24/7 Music Bot supporting YouTube, Spotify, SoundCloud, Apple Music & Deezer.\n\n" + + "šŸ’Ž **48kHz Hi-Fi Audio** • šŸŽ›ļø **30+ Filters** • ⚔ **Dynamic Normalizer** • šŸ“» **Live Web Radio**\n\n" + + "**Quick Links:**\n" + + "• [āž• **Add Remix to Server**](https://fluxerlist.com/bots/remix)\n" + + "• [šŸ’¬ **Join Support Community**](https://fluxer.gg/remix)" + ) + .setFooter({ text: "Remix • Free & Open-Source Music" }); + + if (botIcon) embed.setThumbnail(botIcon); await message.reply({ embeds: [embed] diff --git a/commands/lastfm/whoknows.mjs b/commands/lastfm/whoknows.mjs index f1cf271..9caf1cb 100644 --- a/commands/lastfm/whoknows.mjs +++ b/commands/lastfm/whoknows.mjs @@ -124,18 +124,30 @@ export async function runWhoknowsActions(msg, data, lastfm, prefix, userId, targ const MEDALS = ["šŸ„‡", "🄈", "šŸ„‰"]; const totalPlays = listeners.reduce((sum, l) => sum + l.playcount, 0); - const lines = listeners.map((l, i) => { - const medal = i < 3 ? MEDALS[i] : ` `; - return `${medal} ${i + 1}. **${l.username}** — **${Utils.formatNumber(l.playcount)}** ${this.t(msg, "responses.lastfm.plays")}`; - }); - - const desc = lines.join("\n").slice(0, 4096); - + const top1 = listeners[0]; const embed = new EmbedBuilder() .setColor(getGlobalColor()) - .setTitle(this.t(msg, "responses.lastfm.whoknowsTitle", { artist: artistName })) - .setDescription(desc) - .setFooter({ text: this.t(msg, "responses.lastfm.whoknowsFooter", { count: listeners.length, plural: listeners.length !== 1 ? "s" : "", totalPlays: Utils.formatNumber(totalPlays) }) }); + .setAuthor({ name: "šŸ‘‘ Server Music Leaderboard" }) + .setTitle(artistName) + .setFooter({ text: `${listeners.length} listener${listeners.length !== 1 ? "s" : ""} • ${Utils.formatNumber(totalPlays)} total plays • %fm` }); + + if (top1) { + embed.addFields({ + name: "šŸ‘‘ Crown Holder (#1)", + value: `**${top1.username}** — **${Utils.formatNumber(top1.playcount)}** ${this.t(msg, "responses.lastfm.plays")}`, + inline: false + }); + } + + const rest = listeners.slice(1); + if (rest.length > 0) { + const lines = rest.map((l, i) => { + const rank = i + 2; + const medal = rank === 2 ? "🄈" : rank === 3 ? "šŸ„‰" : `\`#${rank}\``; + return `${medal} **${l.username}** — **${Utils.formatNumber(l.playcount)}** ${this.t(msg, "responses.lastfm.plays")}`; + }); + embed.setDescription(lines.join("\n").slice(0, 4096)); + } const replyPayload = { embeds: [embed] }; if (statusMsg) statusMsg.edit(replyPayload).catch(() => msg.reply(replyPayload)); diff --git a/commands/move.mjs b/commands/move.mjs index b267d6b..03a1c07 100644 --- a/commands/move.mjs +++ b/commands/move.mjs @@ -4,6 +4,8 @@ */ import { CommandBuilder } from "../src/commands/index.mjs"; +import { EmbedBuilder } from "@fluxerjs/core"; +import { getGlobalColor } from "../src/ui/index.mjs"; /** @type {CommandBuilder} @description Command definition for the move command. */ export const command = new CommandBuilder() @@ -37,6 +39,21 @@ export async function run(message, data) { const to = data.get("to")?.value; if (from === null || from === undefined || from < 1) return message.replyEmbed("Source position must be 1 or greater.").catch(() => {}); if (to === null || to === undefined || to < 1) return message.replyEmbed("Target position must be 1 or greater.").catch(() => {}); + + const queueData = p.queue?.data ?? []; + const track = queueData[from - 1]; const res = p.move(from, to); - message.replyEmbed(res).catch(() => {}); + if (typeof res === "string" && !res.startsWith("Moved")) { + return message.replyEmbed(res).catch(() => {}); + } + + const embed = new EmbedBuilder() + .setColor(getGlobalColor()) + .setAuthor({ name: "šŸ”€ Track Reordered" }) + .setTitle(track?.title?.slice(0, 256) || "Reordered Track") + .setDescription(`Moved from position **#${from}** āž” **#${to}** in the queue.`) + .setFooter({ text: to === 1 ? "Now playing next after the current song • %np" : "%list to view updated queue" }); + + if (track?.thumbnail) embed.setThumbnail(track.thumbnail); + message.reply({ embeds: [embed] }).catch(() => {}); } diff --git a/commands/normalize.mjs b/commands/normalize.mjs index c65eb06..74e10bd 100644 --- a/commands/normalize.mjs +++ b/commands/normalize.mjs @@ -65,13 +65,18 @@ export async function run(message, data) { } } - const embed = new EmbedBuilder().setColor(getGlobalColor()); + const embed = new EmbedBuilder() + .setColor(getGlobalColor()) + .setAuthor({ name: "šŸŽšļø Dynamic Loudness Normalization" }) + .setTitle("EBU R128 Audio Leveling") + .setFooter({ text: "Balances volume differences across YouTube, Spotify & SoundCloud" }); + const statusMsg = newState ? this.t(message, "responses.normalize.statusEnabled") : this.t(message, "responses.normalize.statusDisabled"); const infoMsg = this.t(message, "responses.normalize.info"); - let desc = `${statusMsg}\n\n*${infoMsg}*`; + embed.setDescription(`${statusMsg}\n\n*${infoMsg}*`); if (p) { const current = p.queue?.getCurrent?.(); @@ -80,14 +85,14 @@ export async function run(message, data) { const gain = calculateNormalizationGain(current); const gainDb = (20 * Math.log10(gain)).toFixed(1); const gainSign = gain >= 1 ? "+" : ""; - desc += "\n\n" + this.t(message, "responses.normalize.trackInfo", { - source, - gainDb: `${gainSign}${gainDb}`, - gainPct: (gain * 100).toFixed(0), - effective: Math.round(p.getEffectiveVolume()), - }); + + embed.addFields( + { name: "Track Source", value: source || "Default", inline: true }, + { name: "Gain Offset", value: `${gainSign}${gainDb} dB (${(gain * 100).toFixed(0)}%)`, inline: true }, + { name: "Effective Volume", value: `${Math.round(p.getEffectiveVolume())}%`, inline: true } + ); } } - message.reply({ embeds: [embed.setDescription(desc)] }).catch(() => {}); + message.reply({ embeds: [embed] }).catch(() => {}); } diff --git a/commands/playnext.mjs b/commands/playnext.mjs index f67a38b..d3011b2 100644 --- a/commands/playnext.mjs +++ b/commands/playnext.mjs @@ -70,7 +70,21 @@ export async function run(message, data) { const requester = message.author?.id ?? message.authorId ?? null; const messages = p.playFirst(query, provider, { requester }); messages.on("message", d => { - const embed = new EmbedBuilder().setColor(getGlobalColor()).setDescription(d); + let embed; + if (d instanceof EmbedBuilder) { + embed = d; + } else if (d?.embeds?.[0]) { + embed = d.embeds[0]; + } else { + embed = new EmbedBuilder().setColor(getGlobalColor()).setDescription(String(d)); + } + + /* Set Playing Next author tag on the added track embed */ + const authorName = embed.data?.author?.name || ""; + if (authorName.includes("Added to Queue") || !authorName) { + embed.setAuthor({ name: "⚔ Playing Next • Top of Queue (#1)" }); + } + if (statusMsg) statusMsg.edit({ embeds: [embed] }).catch(() => {}); }); } diff --git a/commands/remove.mjs b/commands/remove.mjs index 2c38e94..9798b7f 100644 --- a/commands/remove.mjs +++ b/commands/remove.mjs @@ -4,6 +4,8 @@ */ import { CommandBuilder } from "../src/commands/index.mjs"; +import { EmbedBuilder } from "@fluxerjs/core"; +import { getGlobalColor } from "../src/ui/index.mjs"; /** @type {CommandBuilder} @description Command definition for the remove command. */ export const command = new CommandBuilder() @@ -35,11 +37,35 @@ export async function run(message, data) { const to = parseInt(rangeMatch[2], 10); if (from < 1 || to < 1) return message.replyEmbed("Queue positions must be 1 or greater.").catch(() => {}); const res = p.removeRange(from - 1, to - 1); - return message.replyEmbed(res).catch(() => {}); + if (typeof res === "string" && !res.includes("Successfully")) { + return message.replyEmbed(res).catch(() => {}); + } + const remaining = p.queue?.size() ?? 0; + const count = Math.abs(to - from) + 1; + const embed = new EmbedBuilder() + .setColor(getGlobalColor()) + .setAuthor({ name: "šŸ—‘ļø Removed from Queue" }) + .setTitle(`Removed ${count} Tracks`) + .setDescription(`Successfully removed positions **#${Math.min(from, to)}** to **#${Math.max(from, to)}** from the queue.`) + .setFooter({ text: `${remaining} track${remaining === 1 ? "" : "s"} remaining in queue • %list` }); + return message.reply({ embeds: [embed] }).catch(() => {}); } const single = parseInt(raw, 10); if (isNaN(single) || single < 1) return message.replyEmbed("Queue position must be 1 or greater.").catch(() => {}); + const queueData = p.queue?.data ?? []; + const track = queueData[single - 1]; const res = p.remove(single - 1); - message.replyEmbed(res).catch(() => {}); + if (typeof res === "string" && res.toLowerCase().includes("out of bounds")) { + return message.replyEmbed(res).catch(() => {}); + } + const remaining = p.queue?.size() ?? 0; + const embed = new EmbedBuilder() + .setColor(getGlobalColor()) + .setAuthor({ name: "šŸ—‘ļø Removed from Queue" }) + .setTitle(track?.title?.slice(0, 256) || "Removed Track") + .setDescription(`Removed track at position **#${single}** from the queue.`) + .setFooter({ text: `${remaining} track${remaining === 1 ? "" : "s"} remaining in queue • %list` }); + if (track?.thumbnail) embed.setThumbnail(track.thumbnail); + return message.reply({ embeds: [embed] }).catch(() => {}); } diff --git a/commands/support.mjs b/commands/support.mjs index d501a23..84d49c2 100644 --- a/commands/support.mjs +++ b/commands/support.mjs @@ -21,12 +21,24 @@ export const command = new CommandBuilder() * @returns {void} */ export function run(msg) { + const botUser = this.client?.user; + const botIcon = botUser?.displayAvatarURL?.() || null; + const embed = new EmbedBuilder() .setColor(getGlobalColor()) + .setAuthor({ + name: "Remix Support Community", + iconURL: botIcon + }) .setTitle(this.t(msg, "responses.support.title")) .setDescription( - this.t(msg, "responses.support.description") + "Need help, want to report a bug, or suggest a new feature? Join our official community server:\n\n" + + "šŸš€ **[Join Support Server (fluxer.gg/remix)](https://fluxer.gg/remix)**\n\n" + + "🟢 **24/7 Community & Staff Assistance**\n" + + "Feature requests, announcements, and audio troubleshooting guides." ) - ; + .setFooter({ text: "Remix Support • fluxer.gg/remix" }); + + if (botIcon) embed.setThumbnail(botIcon); msg.reply({ embeds: [embed] }).catch(() => {}); } diff --git a/commands/trackopt.mjs b/commands/trackopt.mjs index 7637fb0..c19a69d 100644 --- a/commands/trackopt.mjs +++ b/commands/trackopt.mjs @@ -60,6 +60,30 @@ export const command = new CommandBuilder() ) .addAlias("to"); +/** + * @private + * Build a text-based ASCII timeline representation of the cut window. + * @param {number} startMs - Start time in milliseconds. + * @param {number} endMs - End time in milliseconds. + * @param {number} totalMs - Total track duration in milliseconds. + * @returns {string} Formatted timeline string. + */ +function buildTimelineBar(startMs, endMs, totalMs) { + if (!totalMs || totalMs <= 0) return `\`${Utils.prettifyMS(startMs)}\` āž” \`${endMs > 0 ? Utils.prettifyMS(endMs) : "end"}\``; + const totalSlots = 18; + const startSlot = Math.min(totalSlots - 1, Math.floor((startMs / totalMs) * totalSlots)); + const effectiveEnd = endMs > 0 ? endMs : totalMs; + const endSlot = Math.min(totalSlots, Math.max(startSlot + 1, Math.ceil((effectiveEnd / totalMs) * totalSlots))); + + let bar = ""; + for (let i = 0; i < totalSlots; i++) { + if (i < startSlot) bar += "─"; + else if (i >= startSlot && i < endSlot) bar += "ā– "; + else bar += "─"; + } + return `\`${Utils.prettifyMS(startMs)}\` \`[${bar}]\` \`${Utils.prettifyMS(effectiveEnd)}\``; +} + /** * @private * Extract an alias:name token from a parts array, mutating the array in place. @@ -157,14 +181,28 @@ export async function run(msg, data) { } const endLabel = endMs > 0 ? Utils.prettifyMS(endMs) : "full track"; - let desc; - if (result.alias === DEFAULT_ALIAS) { - desc = this.t(msg, "responses.trackopt.saved", { title: current.title, aliasLabel: "", start: Utils.prettifyMS(startMs), end: endLabel }); - } else { - desc = this.t(msg, "responses.trackopt.savedAlias", { title: current.title, alias: result.alias, start: Utils.prettifyMS(startMs), end: endLabel, prefix }); + const timeline = buildTimelineBar(startMs, endMs, trackDuration); + const setEmbed = new EmbedBuilder() + .setColor(getGlobalColor()) + .setAuthor({ name: "āœ‚ļø Custom Track Trim Saved" }) + .setTitle(current.title?.slice(0, 256) || "Track Trim") + .setDescription( + result.alias === DEFAULT_ALIAS + ? this.t(msg, "responses.trackopt.saved", { title: current.title, aliasLabel: "", start: Utils.prettifyMS(startMs), end: endLabel }) + : this.t(msg, "responses.trackopt.savedAlias", { title: current.title, alias: result.alias, start: Utils.prettifyMS(startMs), end: endLabel, prefix }) + ) + .addFields( + { name: "Playback Window", value: timeline, inline: false }, + { name: "Alias", value: `\`${result.alias}\``, inline: true }, + { name: "Active Trim", value: `${Utils.prettifyMS(startMs)} āž” ${endLabel}`, inline: true } + ); + + if (current.thumbnail) setEmbed.setThumbnail(current.thumbnail); + if (result.alias !== DEFAULT_ALIAS) { + setEmbed.setFooter({ text: `Play this cut anytime with: ${prefix}trackopt play ${result.alias}` }); } - return msg.reply({ embeds: [new EmbedBuilder().setColor(getGlobalColor()).setDescription(desc)] }); + return msg.reply({ embeds: [setEmbed] }); } if (subCommand === "get") { @@ -173,15 +211,27 @@ export async function run(msg, data) { return msg.reply({ embeds: [new EmbedBuilder().setColor(ERROR_COLOR).setDescription(this.t(msg, "responses.trackopt.notSet", { title: current.title }))] }); } - let desc = this.t(msg, "responses.trackopt.current", { title: current.title, count: rows.length }) + "\n\n"; - for (const row of rows) { - const aliasLabel = row.alias === DEFAULT_ALIAS ? "default" : row.alias; + const trackDuration = p._getTrackDurationMs(current); + const getEmbed = new EmbedBuilder() + .setColor(getGlobalColor()) + .setAuthor({ name: "āœ‚ļø Saved Track Trims" }) + .setTitle(current.title?.slice(0, 256) || "Track Trims") + .setFooter({ text: `${rows.length} trim profile${rows.length === 1 ? "" : "s"} saved • Apply with ${prefix}trackopt play ` }); + + if (current.thumbnail) getEmbed.setThumbnail(current.thumbnail); + + for (const row of rows.slice(0, 10)) { + const aliasLabel = row.alias === DEFAULT_ALIAS ? "default (auto-apply)" : row.alias; const endStr = row.end_ms > 0 ? Utils.prettifyMS(row.end_ms) : "end"; - const autoTag = row.alias === DEFAULT_ALIAS ? " ← auto" : ""; - desc += this.t(msg, "responses.trackopt.currentEntry", { alias: aliasLabel, start: Utils.prettifyMS(row.start_ms), end: endStr, autoTag }) + "\n"; + const timeline = buildTimelineBar(row.start_ms, row.end_ms, trackDuration); + getEmbed.addFields({ + name: `šŸ·ļø ${aliasLabel}`, + value: `${timeline}\n${Utils.prettifyMS(row.start_ms)} āž” ${endStr}`, + inline: false + }); } - return msg.reply({ embeds: [new EmbedBuilder().setColor(getGlobalColor()).setDescription(desc)] }); + return msg.reply({ embeds: [getEmbed] }); } if (subCommand === "play") { @@ -217,7 +267,19 @@ export async function run(msg, data) { const aliasLabel = safeAlias === DEFAULT_ALIAS ? "default" : safeAlias; const endStr = result.endMs > 0 ? Utils.prettifyMS(result.endMs) : "end"; - return msg.reply({ embeds: [new EmbedBuilder().setColor(getGlobalColor()).setDescription(this.t(msg, "responses.trackopt.applied", { alias: aliasLabel, start: Utils.prettifyMS(result.startMs), end: endStr }))] }); + const trackDuration = p._getTrackDurationMs(current); + const timeline = buildTimelineBar(result.startMs, result.endMs, trackDuration); + + const playEmbed = new EmbedBuilder() + .setColor(getGlobalColor()) + .setAuthor({ name: "āœ‚ļø Track Trim Applied" }) + .setTitle(current.title?.slice(0, 256) || "Track Trim") + .setDescription(this.t(msg, "responses.trackopt.applied", { alias: aliasLabel, start: Utils.prettifyMS(result.startMs), end: endStr })) + .addFields({ name: "Active Cut Range", value: timeline, inline: false }); + + if (current.thumbnail) playEmbed.setThumbnail(current.thumbnail); + + return msg.reply({ embeds: [playEmbed] }); } catch (e) { return msg.reply({ embeds: [new EmbedBuilder().setColor(ERROR_COLOR).setDescription(this.t(msg, "responses.trackopt.applyFailed", { error: e.message }))] }); } diff --git a/commands/volumedefault.mjs b/commands/volumedefault.mjs index 5cbc550..49635ae 100644 --- a/commands/volumedefault.mjs +++ b/commands/volumedefault.mjs @@ -9,6 +9,23 @@ import { getGlobalColor } from "../src/ui/index.mjs"; import { PermissionFlags } from "@fluxerjs/core"; import { MAX_VOLUME } from "../src/utils/UI.mjs"; +/** + * @private + * Build an ASCII slider bar for volume display. + * @param {number} volume + * @param {number} max + * @returns {string} + */ +function buildVolumeSlider(volume, max = MAX_VOLUME) { + const totalSlots = 14; + const filled = Math.min(totalSlots, Math.max(0, Math.round((volume / max) * totalSlots))); + let bar = ""; + for (let i = 0; i < totalSlots; i++) { + bar += i < filled ? "ā– " : "─"; + } + return `\`0%\` \`[${bar}]\` \`${max}%\` • **${volume}%**`; +} + /** @type {CommandBuilder} @description Command definition for the volumedefault command. */ export const command = new CommandBuilder() .setName("volumedefault") @@ -53,13 +70,16 @@ export async function run(message, data) { const currentPlayerVol = Math.round((p.preferredVolume ?? 1) * 100); const pfx = this.handler.getPrefix(message.channel?.guildId ?? message.message?.guildId); embed + .setAuthor({ name: "šŸ”Š Server Default Volume" }) .setTitle(this.t(message, "responses.volumedefault.title")) .setDescription( - this.t(message, "responses.volumedefault.serverDefault", { volume: currentDefault }) + "\n" + - this.t(message, "responses.volumedefault.currentVolume", { volume: currentPlayerVol }) + "\n\n" + - (hasManage + hasManage ? this.t(message, "responses.volumedefault.changeHint", { prefix: pfx, max: MAX_VOLUME }) - : this.t(message, "responses.volumedefault.noPermission")) + : this.t(message, "responses.volumedefault.noPermission") + ) + .addFields( + { name: "Default Volume", value: buildVolumeSlider(currentDefault), inline: false }, + { name: "Active Session Volume", value: `${currentPlayerVol}%`, inline: true } ); } else if (!hasManage) { embed.setDescription(this.t(message, "responses.volumedefault.noPermissionSet")); @@ -70,7 +90,10 @@ export async function run(message, data) { } else { p.setVolume(pct / 100); if (set) set.set("volume", pct); - embed.setDescription(this.t(message, "responses.volumedefault.saved", { volume: pct })); + embed + .setAuthor({ name: "šŸ”Š Server Default Volume Saved" }) + .setDescription(this.t(message, "responses.volumedefault.saved", { volume: pct })) + .addFields({ name: "New Default Level", value: buildVolumeSlider(pct), inline: false }); } } diff --git a/commands/vote.mjs b/commands/vote.mjs index 8a3150a..2b5242a 100644 --- a/commands/vote.mjs +++ b/commands/vote.mjs @@ -169,8 +169,10 @@ export async function run(msg, data) { const embed = new EmbedBuilder() .setColor(getGlobalColor()) + .setAuthor({ name: "šŸ—³ļø Vote for Remix" }) .setTitle(this.t(msg, "responses.vote.voteTitle")) - .setDescription(descLines.join("\n")); + .setDescription(descLines.join("\n")) + .setFooter({ text: `Check your vote status: ${prefix}vote check • %voters` }); return msg.reply({ embeds: [embed] }); } diff --git a/src/commands/HelpHandler.mjs b/src/commands/HelpHandler.mjs index 3d8a6d0..970db44 100644 --- a/src/commands/HelpHandler.mjs +++ b/src/commands/HelpHandler.mjs @@ -7,6 +7,8 @@ import { PageBuilder } from "../ui/Paginators.mjs"; import { Option, Flag } from "./Option.mjs"; +import { EmbedBuilder } from "@fluxerjs/core"; +import { getGlobalColor } from "../ui/index.mjs"; /** * @class HelpHandler @@ -152,52 +154,86 @@ export class HelpHandler { } /** - * Generate detailed help text for a single command. + * Generate detailed help embed for a single command. * @param {import('./CommandBuilder.mjs').CommandBuilder} command * @param {object} msg - * @returns {string} + * @returns {object} Object with embeds array containing the EmbedBuilder. */ getCommandHelp(command, msg) { - const guildId = msg.message.guildId; - let content = `${HelpHandler.capitalise(command.name)}\n`; - content += this.commandDescription(command, msg) + "\n\n"; - content += this.commands.t(guildId, "cmdHandler.help.usage") + "\nšŸ’» `" + this.commandUsage(command, msg) + "`\n\n"; - if (command.examples.length > 0) - content += this.commands.t(guildId, "cmdHandler.help.examples") + "\n- `" + command.examples.map(e => this.commands.format(e, guildId)).join("`\n- `") + "`\n\n"; + const guildId = msg.message?.guildId ?? msg.channel?.guildId; + const prefix = this.commands.getPrefix(guildId); + const category = command.category ? command.category.toLowerCase() : "general"; + + const embed = new EmbedBuilder() + .setColor(getGlobalColor()) + .setAuthor({ name: `Command Help • ${prefix}${command.name}` }) + .setTitle(HelpHandler.capitalise(command.name)) + .setDescription(this.commandDescription(command, msg) || "No description provided.") + .addFields({ + name: `šŸ’» ${this.commands.t(guildId, "cmdHandler.help.usage")}`, + value: `\`${this.commandUsage(command, msg)}\``, + inline: false + }); + + if (command.examples.length > 0) { + embed.addFields({ + name: `šŸ’” ${this.commands.t(guildId, "cmdHandler.help.examples")}`, + value: command.examples.map(e => `\`${this.commands.format(e, guildId)}\``).join("\n"), + inline: false + }); + } + if (command.aliases.length > 1) { - content += this.commands.t(guildId, "cmdHandler.help.aliases") + "\n"; - command.aliases.forEach(alias => { content += "- " + alias + "\n"; }); - content += "\n"; + embed.addFields({ + name: `šŸ·ļø ${this.commands.t(guildId, "cmdHandler.help.aliases")}`, + value: command.aliases.map(a => `\`${a}\``).join(", "), + inline: true + }); } + if (command.subcommands.length > 0) { - content += this.commands.t(guildId, "cmdHandler.help.subcommands") + "\n"; - command.subcommands.forEach(s => { - const optCount = s.options.length > 0 ? "; (`" + this.commands.t(guildId, "cmdHandler.help.optionCount", { $count: s.options.length }) + "`)" : ""; - content += "- " + s.name + ": " + (this.commandDescription(s, msg) || "").split("\n")[0] + optCount + "\n"; + const subs = command.subcommands.map(s => { + const optCount = s.options.length > 0 ? ` (\`${s.options.length} options\`)` : ""; + return `• **${s.name}**: ${(this.commandDescription(s, msg) || "").split("\n")[0]}${optCount}`; + }).join("\n"); + embed.addFields({ + name: `šŸ“‚ ${this.commands.t(guildId, "cmdHandler.help.subcommands")}`, + value: subs.slice(0, 1024), + inline: false }); - content += "\n"; } else if (command.options.length > 0) { - content += this.commands.t(guildId, "cmdHandler.help.arguments") + "\n"; - command.options.forEach(o => { - const optional = ((o.required) ? "" : "?"); + const optLines = command.options.map(o => { + const optional = o.required ? "" : " *(optional)*"; const flag = (o instanceof Flag) ? "-" : ""; + const desc = (o.description || "").split("\n")[0]; if (o.type === "choice") { const choiceDisplay = Option.formatChoicesInline(o.choices); - const aliasDisplay = o.aliases.filter(a => a !== null).join('`, `'); - content += "- **" + flag + o.name + "**" + optional + ": " + (o.description || "").split("\n")[0] + ";\n - " + this.commands.t(guildId, "cmdHandler.help.allowedValues") + choiceDisplay + "\n - " + this.commands.t(guildId, "cmdHandler.help.aliasesLabel") + "`" + aliasDisplay + "`\n"; - } else { - content += "- **" + flag + o.name + "**" + optional + ": " + (o.description || "").split("\n")[0] + "\n - " + this.commands.t(guildId, "cmdHandler.help.aliasesLabel") + "`" + o.aliases.join("`, `") + "`\n"; + return `• **${flag}${o.name}**${optional}: ${desc}\n ā”” Values: \`${choiceDisplay}\``; } - content += "\n"; + return `• **${flag}${o.name}**${optional}: ${desc}`; + }).join("\n"); + embed.addFields({ + name: `āš™ļø ${this.commands.t(guildId, "cmdHandler.help.arguments")}`, + value: optLines.slice(0, 1024), + inline: false }); - content += "\n"; } + if (command.requirements.length > 0) { - content += this.commands.t(guildId, "cmdHandler.help.requirements") + "\n"; - command.requirements.forEach(r => { - content += "- " + r.getPermissions().map(e => this.commands.t(guildId, "cmdHandler.help.permission", { $permission: e })).join("\n- "); - }); + const perms = command.requirements.map(r => + r.getPermissions().map(e => this.commands.t(guildId, "cmdHandler.help.permission", { $permission: e })).join(", ") + ).filter(Boolean).join(", "); + if (perms) { + embed.addFields({ + name: `šŸ”’ ${this.commands.t(guildId, "cmdHandler.help.requirements")}`, + value: perms.slice(0, 1024), + inline: false + }); + } } - return content.trim(); + + embed.setFooter({ text: `Type ${prefix}help for full command list • Category: ${category}` }); + + return { embeds: [embed] }; } } diff --git a/src/music/PlayerLifecycleMixin.mjs b/src/music/PlayerLifecycleMixin.mjs index 5b2fb8d..ded1e22 100644 --- a/src/music/PlayerLifecycleMixin.mjs +++ b/src/music/PlayerLifecycleMixin.mjs @@ -360,7 +360,7 @@ const PlayerLifecycleMixin = { } catch(e) { logger.warn("[PlayerManager] Failed to save announcement channel ID:", e?.message); } - message.reply(this._t(message, "responses.join.alreadyJoined", { channel: cid })); + message.reply({ embeds: [new EmbedBuilder().setColor(getGlobalColor()).setDescription(this._t(message, "responses.join.alreadyJoined", { channel: cid }))] }); return existing; } } @@ -557,7 +557,8 @@ const PlayerLifecycleMixin = { }); }); - const statusMsg = await message.reply(this._t(message, "responses.join.joining")).catch(() => null); + const joiningEmbed = new EmbedBuilder().setColor(getGlobalColor()).setDescription(this._t(message, "responses.join.joining")); + const statusMsg = await message.reply({ embeds: [joiningEmbed] }).catch(() => null); try { await player.join(cid); @@ -565,7 +566,13 @@ const PlayerLifecycleMixin = { this._indexPlayer(channel.guildId ?? getMessageGuildId(message), cleanChannelId); this._pendingJoins.delete(cleanChannelId); - await statusMsg?.edit?.(this._t(message, "responses.join.joined", { channel: cid })).catch(() => {}); + const joinedEmbed = new EmbedBuilder() + .setColor(getGlobalColor()) + .setAuthor({ name: "🟢 Connected to Voice" }) + .setDescription(this._t(message, "responses.join.joined", { channel: cid })) + .setFooter({ text: "Play music anytime with %play " }); + + await statusMsg?.edit?.({ content: null, embeds: [joinedEmbed] }).catch(() => {}); const guildId = cleanId(channel.guildId ?? getMessageGuildId(message)); this._restorePlayerVolume(player, guildId); @@ -584,7 +591,12 @@ const PlayerLifecycleMixin = { this.playerMap.set(cleanChannelId, player); this._indexPlayer(channel.guildId ?? getMessageGuildId(message), cleanChannelId); - await statusMsg?.edit?.(this._t(message, "responses.join.joined", { channel: cid })).catch(() => {}); + const joinedEmbed = new EmbedBuilder() + .setColor(getGlobalColor()) + .setAuthor({ name: "🟢 Connected to Voice" }) + .setDescription(this._t(message, "responses.join.joined", { channel: cid })) + .setFooter({ text: "Play music anytime with %play " }); + await statusMsg?.edit?.({ content: null, embeds: [joinedEmbed] }).catch(() => {}); const retryGuildId = cleanId(channel.guildId ?? getMessageGuildId(message)); this._restorePlayerVolume(player, retryGuildId); @@ -602,7 +614,8 @@ const PlayerLifecycleMixin = { } else { errorMsg = this._t(message, "responses.join.joinFailed", { error: err.message }); } - await statusMsg?.edit?.(errorMsg).catch(() => {}); + const errorEmbed = new EmbedBuilder().setColor(getGlobalColor()).setDescription(errorMsg); + await statusMsg?.edit?.({ content: null, embeds: [errorEmbed] }).catch(() => {}); this.playerMap.delete(cleanChannelId); this._unindexPlayer(channel.guildId ?? getMessageGuildId(message), cleanChannelId); player.destroy(); diff --git a/src/ui/HelpCommand.mjs b/src/ui/HelpCommand.mjs index 719a288..0434721 100644 --- a/src/ui/HelpCommand.mjs +++ b/src/ui/HelpCommand.mjs @@ -47,15 +47,18 @@ const HELP_TABS = [ */ function _helpHomeContent(prefix) { return ( - "**Welcome to the Remix help page.**\n\n" + - "Remix is an open-source music bot. It supports a variety of " + - "streaming services and has many features.\n\n" + - "We hope you enjoy using Remix!\n\n" + - "To get started, just click on the reactions below to find out " + - "more about the commands. In the case that reactions don't work " + - "for you, there's also the possibility to look through them by " + - `using \`${prefix}help \` :)\n\n` + - `**Tip:** Click the tab emojis to switch sections.` + "**Remix** is a high-fidelity 24/7 music bot supporting YouTube, Spotify, SoundCloud, Deezer, and more.\n\n" + + "**✨ Core Highlights**\n" + + "• **48kHz Hi-Fi Audio** — Crystal-clear audio stream pipeline\n" + + "• **30+ Audio Filters** — Bassboost, 8D, Nightcore, Vaporwave, Equalizer\n" + + "• **Dynamic Normalizer** — EBU R128 loudness leveling across music sources\n" + + "• **24/7 Web Radio** — Over 30,000 global live radio stations\n\n" + + "**šŸ“‚ Command Categories**\n" + + "šŸ  • **Home** — Quick bot overview & status\n" + + "šŸŽµ • **Music** — Playback, queue, search, filters (`" + prefix + "play`, `" + prefix + "skip`, `" + prefix + "queue`)\n" + + "šŸ”§ • **Utility** — Settings, 24/7 voice, ping, vote (`" + prefix + "settings`, `" + prefix + "ping`)\n" + + "ā„¹ļø • **Support** — Community server & assistance\n\n" + + "šŸ’” **Tip:** Click the tab emojis below to switch sections, or use `" + prefix + "help ` for detailed info." ); } @@ -65,12 +68,13 @@ function _helpHomeContent(prefix) { */ function _helpSupportContent() { return ( - "If you need help with anything or encounter any issues, hop over to " + - "our support server **[Remix HQ](https://fluxer.gg/remix)**!\n" + - "Alternatively, you can write a dm to any of the following people:\n\n" + - "- **Fantic** (Community Manager)\n" + - "- **Shadow** (Lead Developer)\n" + - "- **NoLogicAlan** (Lead Developer)" + "Need help, want to report a bug, or suggest new features?\n\n" + + "šŸ’¬ **[Join Remix Support Server](https://fluxer.gg/remix)**\n\n" + + "**Team & Maintainers:**\n" + + "• **Fantic** — Community Manager\n" + + "• **Shadow** — Lead Developer\n" + + "• **NoLogicAlan** — Lead Developer\n\n" + + "You can also use `%invite` to add Remix to your server." ); } @@ -97,7 +101,7 @@ function _helpBuildCategoryPages(tab, allCmds, prefix) { let page = ""; slice.forEach((cmd, j) => { const d = (cmd.description || "No description.").split("\n")[0]; - page += `${i + j + 1}. **${cmd.name}**: ${d}\n`; + page += `\`${prefix}${cmd.name}\` — ${d}\n`; }); page += `\nTo learn more about a command, run \`${prefix}help \`!`; if (cmds.length > HELP_CMDS_PER_PAGE)