{"size": 1556, "ext": "js", "max_stars_repo_path": "commands/defaults/help.js", "max_stars_repo_name": "nexus-x86/radius", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "commands/defaults/help.js", "max_issues_repo_name": "nexus-x86/radius", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "commands/defaults/help.js", "max_forks_repo_name": "nexus-x86/radius", "max_forks_repo_forks_event_min_datetime": "2021-06-03T03:10:00.000Z", "max_forks_repo_forks_event_max_datetime": "2021-06-04T00:52:15.000Z"}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": 2, "avg_line_length": 34.5777777778, "max_line_length": 152, "alphanum_fraction": 0.5096401028}
const { Command } = require("discord.js-commando");
const fs = require("fs");
const path = require("path");

const filenames = fs.readdirSync(path.join(process.cwd() + "/commands"), {
    withFileTypes: true
});

module.exports = class helpCommand extends Command {
    constructor(client) {
        super(client, {
            name: "help",
            group: "defaults",
            memberName: "help",
            description: "Get all the commands the bot can do."
        });
    }

    async run(message) {
        var helpStr =
            "I can only read english. Translate the command names to english in order to use them if you are viewing this text in another language. \n";
        filenames.forEach((file) => {
            let filePath = path.join(process.cwd() + "/commands/" + file.name);
            let filenames2 = fs.readdirSync(filePath, { withFileTypes: true });
            helpStr = helpStr + "__" + file.name + "__\n";
            filenames2.forEach((file2) => {
                let filePath2 = path.join(
                    process.cwd() + "/commands/" + file.name + "/" + file2.name
                );
                const exportsFile = require(filePath2);
                const exportsClass = new exportsFile(this.client);
                helpStr =
                    helpStr +
                    "**" +
                    exportsClass.name +
                    ":** " +
                    exportsClass.description +
                    "\n";
            });
        });

        message.channel.send(helpStr);
    }
};
