<commit_before>import fs from "fs";
import walk from "walk-sync";
import inquirer from "inquirer";

let descriptionsToPathsMap = {};
let pluginQuestions = [];

let questions = [
    {
        type: "input",
        name: "TELEGRAM_TOKEN",
        message: "What's the bot token?",
        validate: token => /\d+:\w+/.test(token) ? true : "Please insert a valid token. You can get one from @BotFather."
    },
    {
        type: "checkbox",
        name: "activePlugins",
        message: "What plugins would you like to enable?",
        // Find every file in the plugins folder.
        choices: walk(`${__dirname}/plugins`)
            // Use only .js files.
            .filter(item => /\.js$/i.test(item))
            .map(path => {
                // Remove the extension.
                path = path.replace(/\.js$/i, "");
                let plugin;

                try {
                    plugin = require(`${__dirname}/plugins/${path}`, false).default.plugin;
                } catch (e) {
                    return {
                        name: ` ${path}.js`,
                        disabled: "needs additional packages"
                    };
                }

                let string = " " + plugin.name + (plugin.description ? ` - ${plugin.description}` : "");<commit_msg>Display error message for disabled plugins in installer<commit_after>import fs from "fs";
import walk from "walk-sync";
import inquirer from "inquirer";

let descriptionsToPathsMap = {};
let pluginQuestions = [];

let questions = [
    {
        type: "input",
        name: "TELEGRAM_TOKEN",
        message: "What's the bot token?",
        validate: token => /\d+:\w+/.test(token) ? true : "Please insert a valid token. You can get one from @BotFather."
    },
    {
        type: "checkbox",
        name: "activePlugins",
        message: "What plugins would you like to enable?",
        // Find every file in the plugins folder.
        choices: walk(`${__dirname}/plugins`)
            // Use only .js files.
            .filter(item => /\.js$/i.test(item))
            .map(path => {
                // Remove the extension.
                path = path.replace(/\.js$/i, "");
                let plugin;

                try {
                    plugin = require(`${__dirname}/plugins/${path}`, false).default.plugin;
                } catch (e) {
                    return {
                        name: ` ${path}.js`,
                        disabled: e.message
                    };
                }

                let string = " " + plugin.name + (plugin.description ? ` - ${plugin.description}` : "");
{'fraction_non_alphanumeric': 0.13931297709923665, 'fraction_numerical': 0.0, 'mean_word_length': 1.5226179018286814, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2592357', 'n_tokens_mistral': 716, 'n_tokens_neox': 675, 'n_words': 195}