struct/client.js
/**
   * Load event files to this client instance
   * @param {LoadEventSettings} settings The settings for loading the events
   * @returns {void}
   */
Load event files to this client instance
@param {LoadEventSettings} settings The settings for loading the events
@returns {void}
Load event files to this client instance @param { LoadEventSettings } settings The settings for loading the events @returns { void }
loadEvents(settings = {}){
    const log = settings.log && typeof settings.log === 'boolean';
    const bypass = settings.bypass && typeof settings.bypass === 'boolean';
    function check(){
      if (!bypass){ process.exit(); } else { return true; };
    };
    if (typeof settings.parent !== 'string'){
      if (log){
         consoleUtil.warn('Events parent folder not set, reverting to default directory \'events\'');
      } else {
      };
      settings.parent = 'events';
    };
    let files = null;
    try {
      const load = (dirs) => {
      const events = readdirSync(`./${settings.parent}/${dirs}/`).filter((d) => d.endsWith("js"));
  for (const file of events) {
      const evt = require(`../events/${dirs}/${file}`);
      const eName = file.split(".")[0];
      this.on(eName, evt.bind(null, this));
  }
        consoleUtil.success(`Loaded ${events.length} events of ${dirs}.`)
 };
     settings.dirs?.forEach(x => load(x))
    } catch (e) {
     consoleUtil.warn("Error while loading events. ")
        console.log(e)
   }
  }
loadEvents ( settings = { } ) { const log = settings . log && typeof settings . log === 'boolean' ; const bypass = settings . bypass && typeof settings . bypass === 'boolean' ; function check ( ) { if ( ! bypass ) { process . exit ( ) ; } else { return true ; } ; } ; if ( typeof settings . parent !== 'string' ) { if ( log ) { consoleUtil . warn ( 'Events parent folder not set, reverting to default directory \'events\'' ) ; } else { } ; settings . parent = 'events' ; } ; let files = null ; try { const load = ( dirs ) => { const events = readdirSync ( ` ${ settings . parent } ${ dirs } ` ) . filter ( ( d ) => d . endsWith ( "js" ) ) ; for ( const file of events ) { const evt = require ( ` ${ dirs } ${ file } ` ) ; const eName = file . split ( "." ) [ 0 ] ; this . on ( eName , evt . bind ( null , this ) ) ; } consoleUtil . success ( ` ${ events . length } ${ dirs } ` ) } ; settings . dirs ?. forEach ( x => load ( x ) ) } catch ( e ) { consoleUtil . warn ( "Error while loading events. " ) console . log ( e ) } }
Load event files to this client instance
 @param {LoadEventSettings} settings The settings for loading the events
 @returns {void}
Load event files to this client instance @param { LoadEventSettings } settings The settings for loading the events @returns { void }
// Do nothing...