MCPcopy Index your code
hub / github.com/codebymitch/TitanBot / createInitialHelpMenu

Function createInitialHelpMenu

src/commands/Core/help.js:51–139  ·  view source on GitHub ↗
(client)

Source from the content-addressed store, hash-verified

49}
50
51export async function createInitialHelpMenu(client) {
52 const commandsPath = path.join(__dirname, "../../commands");
53 const categoryDirs = (
54 await fs.readdir(commandsPath, { withFileTypes: true })
55 )
56 .filter((dirent) => dirent.isDirectory())
57 .map((dirent) => dirent.name)
58 .sort();
59
60 const options = [
61 {
62 label: "📋 All Commands",
63 description: "Browse every available command in a single list",
64 value: ALL_COMMANDS_ID,
65 },
66 ...categoryDirs.map((category) => {
67 const categoryName = formatCategoryName(category);
68 const icon = CATEGORY_ICONS[categoryName] || "🔍";
69 return {
70 label: `${icon} ${categoryName}`,
71 description: `View commands in the ${categoryName} category`,
72 value: category,
73 };
74 }),
75 ];
76
77 const botName = client?.user?.username || "Bot";
78 const embed = createEmbed({
79 title: `📖 ${botName} Help`,
80 description: 'Set up your server, pick what to enable, then browse commands below.',
81 color: 'primary',
82 thumbnail: client.user?.displayAvatarURL?.({ size: 1024 }),
83 fields: [
84 {
85 name: '🚀 Getting Started',
86 value: [
87 '**1. Launch setup** — Run `/configwizard` to configure prefix, mod role, and logs.',
88 '**2. Enable systems** — Use `/commands dashboard` to turn categories on or off.', '**3. Browse commands** — Use the menu below to view categories and commands.',
89 ].join('\n'),
90 inline: false,
91 },
92 {
93 name: 'ℹ️ How It Works',
94 value: [
95 '• Dashboard commands manage each feature visually',
96 '• Settings are saved per server',
97 '• Slash commands and prefixes both work once enabled',
98 ].join('\n'),
99 inline: false,
100 },
101 {
102 name: '\u200B',
103 value: `-# ${botName} is [open source](https://youtu.be/1jCZX8s3bJE?si=NPOYx-vxVE1I5vJK)`,
104 inline: false,
105 },
106 ],
107 });
108

Callers 2

executeFunction · 0.90
executeFunction · 0.85

Calls 3

createEmbedFunction · 0.90
createSelectMenuFunction · 0.90
formatCategoryNameFunction · 0.70

Tested by

no test coverage detected