@ZynoxSlash
this is what i updated to but still doest show the expected output
// Display command categories if no specific command is provided
const categories = Object.keys(categorizedCommands);
// Create the initial embed
const helpEmbed = new EmbedBuilder()
.setColor('#5865F2') // Discord's blurple color
.setTitle('📜 Command List')
.setDescription('Select a category to view its commands:')
.setThumbnail(interaction.client.user.displayAvatarURL())
.setTimestamp(); // Adds a timestamp at the bottom
// Function to update the embed with commands from a specific category
const updateEmbed = (category) => {
const commandList = categorizedCommands[category]
.map(command => {
let commandDisplay = `**/${command.data.name}**: ${command.data.description}`;
// Handle subcommands
if (command.data.options && command.data.options.length > 0) {
const subcommandsDisplay = command.data.options
.filter(option => option.type === 1) // Subcommand type
.map(subcommand => {
const subcommandOptions = (subcommand.options || [])
.map(subOpt =>
` - **/${command.data.name} ${subcommand.name} ${subOpt.name}**: ${subOpt.description}`
)
.join('\n');
return ` - **/${command.data.name} ${subcommand.name}**: ${subcommand.description}` +
(subcommandOptions ? `\n${subcommandOptions}` : '');
})
.join('\n');
commandDisplay += `\n${subcommandsDisplay}`;
}
return commandDisplay;
})
.join('\n') || 'No commands available.';
helpEmbed.setTitle(`📋 Commands in ${category.charAt(0).toUpperCase() + category.slice(1)}`)
.setDescription(commandList);
};```