From effc1810fcf41fa2af77f45ee3d9397ce9872631 Mon Sep 17 00:00:00 2001 From: Mirco Wittrien Date: Thu, 10 Sep 2020 19:09:50 +0200 Subject: [PATCH] stuff --- Library/_res/BDFDB.data.json | 11 +++++++++++ Plugins/BDFDB.js | 15 ++++++++------- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/Library/_res/BDFDB.data.json b/Library/_res/BDFDB.data.json index 729c480310..2a9d6e1ada 100644 --- a/Library/_res/BDFDB.data.json +++ b/Library/_res/BDFDB.data.json @@ -1,4 +1,15 @@ { + "requires": ["child_process", "electron", "fs", "path", "process", "request"], + "DiscordObjects": { + "Channel": {"props": ["getRecipientId", "isManaged", "getGuildId"]}, + "Guild": {"props": ["getIconURL", "getMaxEmojiSlots", "getRole"]}, + "Invite": {"props": ["getExpiresAt", "isExpired"]}, + "Message": {"props": ["getReaction", "getAuthorName", "getChannelId"]}, + "Messages": {"props": ["jumpToMessage", "hasAfterCached", "forEach"]}, + "Relationship": {"protos": ["comparator"], "array": true}, + "Timestamp": {"props": ["add", "dayOfYear", "hasAlignedHourOffset"]}, + "User": {"props": ["hasFlag", "isLocalBot", "isClaimed"]}, + }, "ModuleUtilsConfig": { "PatchTypes": [ "before", diff --git a/Plugins/BDFDB.js b/Plugins/BDFDB.js index 90c8e006f3..245dfb9b3c 100644 --- a/Plugins/BDFDB.js +++ b/Plugins/BDFDB.js @@ -2328,13 +2328,6 @@ } catch (err) {BDFDB.LogUtils.error("Could not render react element! " + err);} }; - InternalBDFDB.setDefaultProps = function (component, defaultProps) { - if (BDFDB.ObjectUtils.is(component)) component.defaultProps = Object.assign({}, component.defaultProps, defaultProps); - }; - InternalBDFDB.loadPatchedComp = function (path) { - let comp = BDFDB.ReactUtils.getValue(window.BDFDB, `LibraryComponents.${path}`); - if (comp && comp.prototype && comp.prototype.BDFDBpatch) return comp; - }; BDFDB.sameProto = function (a, b) { if (a != null && typeof a == "object") return a.constructor && a.constructor.prototype && typeof a.constructor.prototype.isPrototypeOf == "function" && a.constructor.prototype.isPrototypeOf(b); @@ -7059,6 +7052,14 @@ } }, 100); + InternalBDFDB.setDefaultProps = function (component, defaultProps) { + if (BDFDB.ObjectUtils.is(component)) component.defaultProps = Object.assign({}, component.defaultProps, defaultProps); + }; + InternalBDFDB.loadPatchedComp = function (path) { + let comp = BDFDB.ReactUtils.getValue(window.BDFDB, `LibraryComponents.${path}`); + if (comp && comp.prototype && comp.prototype.BDFDBpatch) return comp; + }; + var InternalComponents = {NativeSubComponents: {}, LibraryComponents: {}}, reactInitialized = LibraryModules.React && LibraryModules.React.Component; let openedItem;