src/commands/help/help.js
// generates the command menu holding all for the author visible commands
generates the command menu holding all for the author visible commands
generates the command menu holding all for the author visible commands
async create_command_menu(msg) {
        let options = [{
            label: await gt(msg, s + "menu.all_label"),
            value: "all",
            description: await gt(msg, s + "menu.all_description")
        }]
        for (const command of msg.client.commands) {
            if (msg.client.config.help.show_only_permitted_commands && !await msg.client.helper.is_permitted(msg, command[1])) continue
            let name = await msg.client.mods.name.get(msg, command[1])
            let description = msg.client.helper.trim_text(await msg.client.mods.description.get(msg, command[1]), 50, true)
            options.push({
                label: name,
                value: name,
                description: description
            })
        }
        const menu = await new MessageSelectMenu()
            .setCustomId('help')
            .setPlaceholder(await gt(msg, s + "menu.placeholder"))
            .addOptions(options)
        menu.message = msg
        return new MessageActionRow().addComponents(menu)
    }
async create_command_menu ( msg ) { let options = [ { label : await gt ( msg , s + "menu.all_label" ) , value : "all" , description : await gt ( msg , s + "menu.all_description" ) } ] for ( const command of msg . client . commands ) { if ( msg . client . config . help . show_only_permitted_commands && ! await msg . client . helper . is_permitted ( msg , command [ 1 ] ) ) continue let name = await msg . client . mods . name . get ( msg , command [ 1 ] ) let description = msg . client . helper . trim_text ( await msg . client . mods . description . get ( msg , command [ 1 ] ) , 50 , true ) options . push ( { label : name , value : name , description : description } ) } const menu = await new MessageSelectMenu ( ) . setCustomId ( 'help' ) . setPlaceholder ( await gt ( msg , s + "menu.placeholder" ) ) . addOptions ( options ) menu . message = msg return new MessageActionRow ( ) . addComponents ( menu ) }
generates the command menu holding all for the author visible commands
generates the command menu holding all for the author visible commands