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