lib/DCNLBot.js
/**
     * Loads all commands in the directory
     * @param {String} path The path where the commands are located
     */
Loads all commands in the directory
@param {String} path The path where the commands are located
Loads all commands in the directory @param { String } path The path where the commands are located
loadCommands(path) {
        readdir(path, (err, files) => {
            if (err) console.log(err);
            let jsFiles = files.filter(f => f.split(".").pop() === "js");
            console.log(`Loading ${jsFiles.length} command(s) ..`);
            jsFiles.forEach(cmd => {
                const command = new (require(`../${path}/${cmd}`))(this);
                this.commands.set(command.help.name, command);
                command.conf.aliases.forEach(a => this.aliases.set(a, command.help.name));
            });
        });
        return this;
    }
loadCommands ( path ) { readdir ( path , ( err , files ) => { if ( err ) console . log ( err ) ; let jsFiles = files . filter ( f => f . split ( "." ) . pop ( ) === "js" ) ; console . log ( ` ${ jsFiles . length } ` ) ; jsFiles . forEach ( cmd => { const command = new ( require ( ` ${ path } ${ cmd } ` ) ) ( this ) ; this . commands . set ( command . help . name , command ) ; command . conf . aliases . forEach ( a => this . aliases . set ( a , command . help . name ) ) ; } ) ; } ) ; return this ; }
Loads all commands in the directory
 @param {String} path The path where the commands are located
Loads all commands in the directory @param { String } path The path where the commands are located