From 721dfef42adeb1d5129e5eaf083db3095e9681f8 Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Tue, 4 Mar 2025 21:50:12 -0500 Subject: [PATCH] Remove GodMode --- README.md | 4 +- src/equicordplugins/betterGodMode/index.tsx | 99 --------------------- src/equicordplugins/godMode/index.ts | 33 ------- 3 files changed, 1 insertion(+), 135 deletions(-) delete mode 100644 src/equicordplugins/betterGodMode/index.tsx delete mode 100644 src/equicordplugins/godMode/index.ts diff --git a/README.md b/README.md index 256cc430..b8ccc067 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ You can join our [discord server](https://discord.gg/5Xh2W87egW) for commits, ch ### Extra included plugins
-153 additional plugins +151 additional plugins ### All Platforms - AllCallTimers by MaxHerbold & D3SOX @@ -22,7 +22,6 @@ You can join our [discord server](https://discord.gg/5Xh2W87egW) for commits, ch - BetterActivities by D3SOX, Arjix, AutumnVN - BetterAudioPlayer by Creations - BetterBanReasons by Inbestigator -- BetterGodMode by TheArmagan - BetterInvites by iamme - BetterQuickReact by Ven & Sqaaakoi - BetterUserArea by Samwich @@ -64,7 +63,6 @@ You can join our [discord server](https://discord.gg/5Xh2W87egW) for commits, ch - GifRoulette by Samwich - Glide by Samwich - GlobalBadges by HypedDomi & Hosted by Wolfie -- GodMode by Tolgchu - GoogleThat by Samwich - HideChatButtons by iamme - HideMessage by Hanzy diff --git a/src/equicordplugins/betterGodMode/index.tsx b/src/equicordplugins/betterGodMode/index.tsx deleted file mode 100644 index 4ca09824..00000000 --- a/src/equicordplugins/betterGodMode/index.tsx +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Vencord, a Discord client mod - * Copyright (c) 2025 Vendicated and contributors - * SPDX-License-Identifier: GPL-3.0-or-later - */ - -import { NavContextMenuPatchCallback } from "@api/ContextMenu"; -import { EquicordDevs } from "@utils/constants"; -import definePlugin from "@utils/types"; -import { GuildStore, Menu, PermissionStore, React } from "@webpack/common"; -import { Guild } from "discord-types/general"; - -const NeedsToBePatchedFns = [ - "can", - "canAccessMemberSafetyPage", - "canAccessGuildSettings", - "canBasicChannel", - "canImpersonateRole", - "canManageUser", - "canWithPartialContext", - "getGuildVersion", - "getChannelsVersion", - "getChannelPermissions", - "getHighestRole", - "initialize", - "constructor", - "isRoleHigher" -]; - -let OriginalFns; - -const godModeEnabledGuilds = new Set(); - -function getGuildIdFromArgs(args: any[]): string | null { - for (const arg of args) { - if (typeof arg === "string" && GuildStore.getGuild(arg)) - return arg; - if (arg?.guild_id && GuildStore.getGuild(arg.guild_id)) - return arg.guild_id; - if (arg?.guildId && GuildStore.getGuild(arg.guildId)) - return arg.guildId; - if (arg?.id && GuildStore.getGuild(arg.id)) - return arg.id; - } - return null; -} - -const ContextMenuPatch: NavContextMenuPatchCallback = (children, { guild }: { guild: Guild; }) => { - const [checked, setChecked] = React.useState(godModeEnabledGuilds.has(guild.id)); - - children.push( - , - { - if (checked) - godModeEnabledGuilds.delete(guild.id); - else - godModeEnabledGuilds.add(guild.id); - setChecked(!checked); - }} - > - ); -}; - -export default definePlugin({ - name: "BetterGodMode", - description: "Get all permissions on any guild. Option to toggle per-guild basis (client-side).", - authors: [EquicordDevs.TheArmagan], - start: () => { - OriginalFns = Object.fromEntries( - NeedsToBePatchedFns.map(fnName => [fnName, PermissionStore[fnName]]) - ); - - NeedsToBePatchedFns.forEach(fnName => { - PermissionStore[fnName] = function (...args: any[]) { - const guildId = getGuildIdFromArgs(args); - if (guildId && godModeEnabledGuilds.has(guildId)) - return true; - return OriginalFns[fnName].apply(this, args); - }; - }); - }, - - stop: () => { - if (!OriginalFns) return; - - godModeEnabledGuilds.clear(); - NeedsToBePatchedFns.forEach(fnName => { - PermissionStore[fnName] = OriginalFns[fnName]; - }); - }, - - contextMenus: { - "guild-context": ContextMenuPatch, - } -}); diff --git a/src/equicordplugins/godMode/index.ts b/src/equicordplugins/godMode/index.ts deleted file mode 100644 index 388ccd5d..00000000 --- a/src/equicordplugins/godMode/index.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Vencord, a modification for Discord's desktop app - * Copyright (c) 2022 Vendicated and contributors - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . -*/ - -import { EquicordDevs } from "@utils/constants"; -import definePlugin from "@utils/types"; -import { PermissionStore } from "@webpack/common"; - -export default definePlugin({ - name: "GodMode", - description: "Get all permissions (client-side).", - authors: [EquicordDevs.Tolgchu], - - start: () => { - ["can", "canAccessMemberSafetyPage", "canAccessGuildSettings", "canBasicChannel", "canImpersonateRole", "canManageUser", "canWithPartialContext", "getGuildVersion", "getChannelsVersion", "getChannelPermissions", "getHighestRole", "initialize", "constructor", "isRoleHigher"].forEach(a => PermissionStore.__proto__[a] = () => !0); - }, - - stop: () => { } -});