lib/DCNLBot.js
/**
     * Loads all events in the directory
     * @param {String} path The path where the events are located
     */
Loads all events in the directory
@param {String} path The path where the events are located
Loads all events in the directory @param { String } path The path where the events are located
loadEvents(path) {
        readdir(path, (err, files) => {
            if (err) console.log(err);
            let jsFiles = files.filter(f => f.split(".").pop() === "js");
            console.log(`Loading ${jsFiles.length} event(s) ..`);
            jsFiles.forEach(evt => {
                const event = new (require(`../${path}/${evt}`))(this);
                super.on(evt.split(".")[0], (...args) => event.run(...args));
            });
        });
        return this;
    }
loadEvents ( 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 ( evt => { const event = new ( require ( ` ${ path } ${ evt } ` ) ) ( this ) ; super . on ( evt . split ( "." ) [ 0 ] , ( ... args ) => event . run ( ... args ) ) ; } ) ; } ) ; return this ; }
Loads all events in the directory
 @param {String} path The path where the events are located
Loads all events in the directory @param { String } path The path where the events are located