structures/bot/Loader.js
/**
   * Loads the events folder.
   *
   * @param {*} folder the relative path to the events folder, i suggest keeping it in the default location 'events'.
   */
Loads the events folder.
@param {*} folder the relative path to the events folder, i suggest keeping it in the default location 'events'.
Loads the events folder . @param { * } folder the relative path to the events folder i suggest keeping it in the default location ' events ' .
loadEvents(folder) {
    klaw(folder).on('data', (file) => {
      const eventFile = path.parse(file.path);
      if (!eventFile.ext || eventFile.ext !== '.js') return;
      const response = this.loadEvent(eventFile.dir, `${eventFile.name}${eventFile.ext}`);
      if (response) console.error(response);
    });
  }
loadEvents ( folder ) { klaw ( folder ) . on ( 'data' , ( file ) => { const eventFile = path . parse ( file . path ) ; if ( ! eventFile . ext || eventFile . ext !== '.js' ) return ; const response = this . loadEvent ( eventFile . dir , ` ${ eventFile . name } ${ eventFile . ext } ` ) ; if ( response ) console . error ( response ) ; } ) ; }
Loads the events folder.
Loads the events folder .