mirror of
https://github.com/remix-bot/fluxer.git
synced 2026-11-23 21:52:45 -05:00
feat(ui): overhaul remaining embeds for help, queue ops, audio mastering & community
- Upgrade %help overview with feature highlights and %help <command> 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
This commit is contained in:
1 parent
4c3c04bd7d
commit
8689dee50a
13 files changed
+332
-99
No files matched your search
@@ -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] };
|
||||
}
|
||||
}
|
||||
@@ -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 <song>" });
|
||||
|
||||
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 <song>" });
|
||||
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();
|
||||
|
||||
+20
-16
@@ -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 <page number>\` :)\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 <command>` 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 <command name>\`!`;
|
||||
if (cmds.length > HELP_CMDS_PER_PAGE)
|
||||
|
||||
Reference in new issue
Block a user