This commit is contained in:
Mirco Wittrien 2020-01-28 12:03:25 +01:00
parent a910cdb5fb
commit 2adb5b6575
2 changed files with 4 additions and 3 deletions

View File

@ -982,7 +982,7 @@
strings.push(getExport);
getExport = true;
}
return InternalBDFDB.findModule("string", JSON.stringify(strings), m => strings.every(string => typeof m == "function" && (m.toString().indexOf(string) > -1 || m.originalsource && m.originalsource.toString().indexOf(string) > -1)), getExport);
return InternalBDFDB.findModule("string", JSON.stringify(strings), m => strings.every(string => typeof m == "function" && (m.toString().indexOf(string) > -1 || m.__originalMethod && m.__originalMethod.toString().indexOf(string) > -1 || m.__originalFunction && m.__originalFunction.toString().indexOf(string) > -1)), getExport);
};
BDFDB.ModuleUtils.findByPrototypes = function (...protoprops) {
protoprops = protoprops.flat(10);
@ -1150,7 +1150,7 @@
return modulefunction == "render" && data.returnValue === undefined ? null : data.returnValue;
};
for (let key of Object.keys(originalfunction)) module[modulefunction][key] = originalfunction[key];
module[modulefunction].originalsource = originalfunction;
module[modulefunction].__originalMethod = originalfunction;
module[modulefunction].isBDFDBpatched = true;
}
for (let type in patchfunctions) if (typeof patchfunctions[type] == "function") {
@ -1508,6 +1508,7 @@
var DiscordObjects = {};
DiscordObjects.Channel = BDFDB.ModuleUtils.findByPrototypes("getRecipientId", "isManaged", "getGuildId");
DiscordObjects.Guild = BDFDB.ModuleUtils.findByPrototypes("getIconURL", "getMaxEmojiSlots", "getRole");
DiscordObjects.Invite = BDFDB.ModuleUtils.findByPrototypes("getExpiresAt", "isExpired");
DiscordObjects.Message = BDFDB.ModuleUtils.findByPrototypes("getReaction", "getAuthorName", "getChannelId");
DiscordObjects.Messages = BDFDB.ModuleUtils.findByPrototypes("jumpToMessage", "hasAfterCached", "forEach");
DiscordObjects.Timestamp = BDFDB.ModuleUtils.findByPrototypes("add", "dayOfYear", "hasAlignedHourOffset");

File diff suppressed because one or more lines are too long