diff --git a/src/CommandManager.cpp b/src/CommandManager.cpp index 255a3df..33324c5 100644 --- a/src/CommandManager.cpp +++ b/src/CommandManager.cpp @@ -25,9 +25,12 @@ namespace Echoion::Core try { auto prefix = manager_.getPrefix(); - std::string helpMsg = std::format( - "\xf0\x9f\x8e\xb5 **Echoion Bot Help**\n\n"); - helpMsg += std::format("Prefix: `{}`\n\n", prefix); + std::string helpMsg = + "# \xf0\x9f\x8e\xb5 Echoion Bot Help\n\n"; + helpMsg += std::format( + "> [!TIP]\n> Prefix is `{}` \xe2\x80\x94 e.g. " + "`{}play lofi`\n\n", + prefix, prefix); // Get commands visible to this client auto visibleCommands = @@ -42,35 +45,52 @@ namespace Echoion::Core grouped[cmd->getCategory()].push_back({name, cmd}); } + // Per-category icon for the collapsible section header. + auto categoryEmoji = + [](CommandCategory c) -> std::string_view { + switch (c) { + case CommandCategory::Music: + return "\xf0\x9f\x8e\xb5"; // music note + case CommandCategory::Queue: + return "\xf0\x9f\x93\x9c"; // scroll + case CommandCategory::Playback: + return "\xe2\x8f\xaf"; // play/pause + case CommandCategory::Utility: + return "\xf0\x9f\x94\xa7"; // wrench + case CommandCategory::Admin: + return "\xf0\x9f\x9b\xa0"; // tools + } + return ""; + }; + for (const auto& [cat, cmds] : grouped) { - helpMsg += - std::format("**{} Commands**\n", toString(cat)); + // Collapsible section per category (TS6 supports + //
/). Blank lines around the inner + // content let the Markdown render inside the block. + helpMsg += std::format( + "
\n{} {} Commands\n\n", + categoryEmoji(cat), toString(cat)); for (const auto& [name, cmd] : cmds) { - // Format: prefix!command usage if (!cmd->getUsage().empty()) { - helpMsg += std::format("`{}{}` {}\n", - prefix, - name, - cmd->getUsage()); + helpMsg += std::format("`{}{}` {}\n", prefix, + name, cmd->getUsage()); } else { helpMsg += std::format("`{}{}`\n", prefix, name); } - // Description helpMsg += std::format("> {}\n", cmd->getDescription()); - // Aliases auto aliases = cmd->getAliases(); if (!aliases.empty()) { helpMsg += "> Aliases: "; for (size_t i = 0; i < aliases.size(); ++i) { - helpMsg += std::format( - "`{}{}`", prefix, aliases[i]); - if (i < aliases.size() - 1) { - helpMsg += ", "; + helpMsg += std::format("`{}{}`", prefix, + aliases[i]); + if (i + 1 < aliases.size()) { + helpMsg += " \xc2\xb7 "; // middot } } helpMsg += "\n"; @@ -78,6 +98,8 @@ namespace Echoion::Core helpMsg += "\n"; } + + helpMsg += "
\n\n"; } ctx.reply(helpMsg);