Update 0BDFDB.plugin.js

This commit is contained in:
Mirco Wittrien 2023-10-25 11:33:54 +02:00
parent 11c20db477
commit de8739cd78
1 changed files with 48 additions and 46 deletions

View File

@ -2,7 +2,7 @@
* @name BDFDB
* @author DevilBro
* @authorId 278543574059057154
* @version 3.4.1
* @version 3.4.2
* @description Required Library for DevilBro's Plugins
* @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien
@ -1290,7 +1290,7 @@ module.exports = (_ => {
if (all) found.push(defaultExport ? r : req.c[i]);
else return defaultExport ? r : req.c[i];
}
else for (let key of Object.keys(m)) if (key.length < 4 && m[key] && !!(r = filter(m[key]))) {
else if (Object.keys(m).length < 400) for (let key of Object.keys(m)) if (m[key] && !!(r = filter(m[key]))) {
if (all) found.push(defaultExport ? r : req.c[i]);
else return defaultExport ? r : req.c[i];
}
@ -2258,10 +2258,11 @@ module.exports = (_ => {
if (!module[methodName]) module[methodName] = _ => {return null};
let patches = module[methodName].BDFDB_Patches || {};
for (let type in patchMethods) {
if (!patches[type]) {
const originalMethod = module[methodName].__originalFunction || module[methodName];
const internalData = (Object.entries(InternalData.LibraryModules).find(n => n && n[0] && LibraryModules[n[0]] == module && n[1] && n[1]._originalModule && n[1]._mappedItems[methodName]) || [])[1];
const name = internalData && internalData[0] || config.name || (module.constructor ? (module.constructor.displayName || module.constructor.name) : "module");
try {
if (!patches[type]) {
const originalMethod = module[methodName].__originalFunction || module[methodName];
const mainCancel = BdApi.Patcher[type](Internal.name, internalData && internalData._originalModule || module, internalData && internalData._mappedItems[methodName] || methodName, function(...args) {
let callInsteadAfterwards = false, stopInsteadCall = false;
const data = {
@ -2304,6 +2305,7 @@ module.exports = (_ => {
};
patches[type].plugins[patchPriority][pluginId].pluginName = pluginName;
patches[type].plugins[patchPriority][pluginId].pluginVersion = pluginVersion;
} catch (err) {BDFDB.LogUtils.error(["Could not patch Component!", `"${type}" Patch of ${methodName} in ${name}`, err], plugin);}
}
}
if (BDFDB.ObjectUtils.is(plugin) && !config.once && !config.noCache) {