79191634

Date: 2024-11-15 08:51:58
Score: 1
Natty:
Report link

@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);
            };```
Reasons:
  • Long answer (-1):
  • Has code block (-0.5):
  • User mentioned (1): @ZynoxSlash
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Siddharth Sinha