removeplugins

This commit is contained in:
poslop
2022-08-02 18:34:34 -05:00
parent 2dec028e59
commit 3cfb01919f
2 changed files with 21 additions and 28 deletions

View File

@@ -3,7 +3,7 @@
"changeLogs": { "changeLogs": {
"BDFDB": "2.3.2", "BDFDB": "2.3.2",
"CreationDate": "1.4.6", "CreationDate": "1.4.6",
"EditRoles": "1.0.8", "EditRoles": "1.0.9",
"ImageUtilities": "4.7.4", "ImageUtilities": "4.7.4",
"NotificationSounds": "3.6.8", "NotificationSounds": "3.6.8",
"PinDMs": "1.9.1" "PinDMs": "1.9.1"

View File

@@ -2,7 +2,7 @@
* @name EditRoles * @name EditRoles
* @author DevilBro * @author DevilBro
* @authorId 278543574059057154 * @authorId 278543574059057154
* @version 1.0.8 * @version 1.0.9
* @description Allows you to locally edit Roles * @description Allows you to locally edit Roles
* @invite Jx3TjNS * @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien * @donate https://www.paypal.me/MircoWittrien
@@ -17,25 +17,17 @@ module.exports = (_ => {
"info": { "info": {
"name": "EditRoles", "name": "EditRoles",
"author": "DevilBro", "author": "DevilBro",
"version": "1.0.8", "version": "1.0.9",
"description": "Allows you to locally edit Roles" "description": "Allows you to locally edit Roles"
}, },
"changeLog": { "changeLog": {
"fixed": { "fixed": {
"Icons": "Work again" "Remove Icon": "Now works again"
} }
} }
}; };
return (window.Lightcord && !Node.prototype.isPrototypeOf(window.Lightcord) || window.LightCord && !Node.prototype.isPrototypeOf(window.LightCord) || window.Astra && !Node.prototype.isPrototypeOf(window.Astra)) ? class { return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
getName () {return config.info.name;}
getAuthor () {return config.info.author;}
getVersion () {return config.info.version;}
getDescription () {return "Do not use LightCord!";}
load () {BdApi.alert("Attention!", "By using LightCord you are risking your Discord Account, due to using a 3rd Party Client. Switch to an official Discord Client (https://discord.com/) with the proper BD Injection (https://betterdiscord.app/)");}
start() {}
stop() {}
} : !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
getName () {return config.info.name;} getName () {return config.info.name;}
getAuthor () {return config.info.author;} getAuthor () {return config.info.author;}
getVersion () {return config.info.version;} getVersion () {return config.info.version;}
@@ -117,7 +109,10 @@ module.exports = (_ => {
} }
}}); }});
BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.RoleIconUtils, "getRoleIconData", {after: e => { BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.RoleIconUtils, "getRoleIconData", {after: e => {
if (e.returnValue && e.methodArguments[0].id && changedRoles[e.methodArguments[0].id] && changedRoles[e.methodArguments[0].id].icon) return {customIconSrc: changedRoles[e.methodArguments[0].id].icon}; if (e.returnValue && e.methodArguments[0].id && changedRoles[e.methodArguments[0].id]) {
if (changedRoles[e.methodArguments[0].id].icon) return {customIconSrc: changedRoles[e.methodArguments[0].id].icon};
else if (changedRoles[e.methodArguments[0].id].removeIcon) return {customIconSrc: null};
}
}}); }});
BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.RoleIconUtils, "canGuildUseRoleIcons", {after: e => { BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.RoleIconUtils, "canGuildUseRoleIcons", {after: e => {
if (e.returnValue === false && Object.keys(e.methodArguments[0].roles).some(roleId => changedRoles[roleId] && changedRoles[roleId].icon)) return true; if (e.returnValue === false && Object.keys(e.methodArguments[0].roles).some(roleId => changedRoles[roleId] && changedRoles[roleId].icon)) return true;
@@ -170,20 +165,18 @@ module.exports = (_ => {
} }
onUserContextMenu (e) { onUserContextMenu (e) {
let [children, index] = BDFDB.ContextMenuUtils.findItem(e.returnvalue, {id: "roles"}); if (e.subType == "useUserRolesItems") {
if (index > -1 && children[index].props && BDFDB.ArrayUtils.is(children[index].props.children)) for (let child of children[index].props.children) { let [children, index] = BDFDB.ContextMenuUtils.findItem(e.returnvalue, {id: "roles"});
if (child && child.props && typeof child.props.label == "function") { if (index > -1 && children[index].props && BDFDB.ArrayUtils.is(children[index].props.children)) for (let child of children[index].props.children) {
let renderLabel = child.props.label; if (child && child.props && typeof child.props.label == "function") {
child.props.label = (...args) => { let renderLabel = child.props.label;
let label = renderLabel(...args); child.props.label = (...args) => {
let onContextMenu = typeof label.props.onContextMenu == "function" ? label.props.onContextMenu : (_ => {}); let label = renderLabel(...args);
label.props.onContextMenu = event => { let onContextMenu = typeof label.props.onContextMenu == "function" ? label.props.onContextMenu : (_ => {});
BDFDB.LibraryModules.ContextMenuUtils.openContextMenu(event, function (e) { label.props.onContextMenu = event => BDFDB.LibraryModules.ContextMenuUtils.openContextMenu(event, e => BDFDB.ReactUtils.createElement(BDFDB.ModuleUtils.findByName("DeveloperContextMenu"), Object.assign({}, e2, {id: child.props.id})));
return BDFDB.ReactUtils.createElement(BDFDB.ModuleUtils.findByName("DeveloperContextMenu"), Object.assign({}, e, {id: child.props.id})); return label;
});
}; };
return label; }
};
} }
} }
} }
@@ -413,7 +406,7 @@ module.exports = (_ => {
BDFDB.ReactUtils.forceUpdate(instance); BDFDB.ReactUtils.forceUpdate(instance);
} }
else instance.checkTimeout = BDFDB.TimeUtils.timeout(_ => { else instance.checkTimeout = BDFDB.TimeUtils.timeout(_ => {
BDFDB.LibraryRequires.request(url, (error, response, result) => { BDFDB.LibraryRequires.request(url, {agentOptions: {rejectUnauthorized: false}}, (error, response, result) => {
delete instance.checkTimeout; delete instance.checkTimeout;
if (instance.props.disabled) { if (instance.props.disabled) {
delete instance.props.success; delete instance.props.success;