index.js
/**
     * 
     * @param {string} directory - directory to search
     * @returns {Promise<Object>} returns the loaded scripts files
     */
@param {string} directory - directory to search
@returns {Promise} returns the loaded scripts files
@param { string } directory - directory to search @returns { Promise } returns the loaded scripts files
async loadModules(directory) {
        const scriptsLoader = await ScriptLoader(Client, Path.join(__dirname, directory));
        scripts = scriptsLoader.scripts;
        commands = scriptsLoader.commands;
        await registerInteractionCommmands(Client, commands.InteractionCommands, config.guildId, false);
        for(const script in scripts) {
            if(!scripts[script]?.onLoad) continue;
            await Promise.resolve(scripts[script].onLoad(Client));
        }
        return scriptsLoader;
    }
async loadModules ( directory ) { const scriptsLoader = await ScriptLoader ( Client , Path . join ( __dirname , directory ) ) ; scripts = scriptsLoader . scripts ; commands = scriptsLoader . commands ; await registerInteractionCommmands ( Client , commands . InteractionCommands , config . guildId , false ) ; for ( const script in scripts ) { if ( ! scripts [ script ] ?. onLoad ) continue ; await Promise . resolve ( scripts [ script ] . onLoad ( Client ) ) ; } return scriptsLoader ; }
@param {string} directory - directory to search
 @returns {Promise<Object>} returns the loaded scripts files
@param { string } directory - directory to search @returns { Promise<Object > } returns the loaded scripts files
// Execute .loaded method of every scripts