mirror of
https://github.com/Equicord/Equicord.git
synced 2025-03-31 12:41:58 -04:00
Remove GodMode
This commit is contained in:
parent
4e026852cc
commit
721dfef42a
3 changed files with 1 additions and 135 deletions
|
@ -10,7 +10,7 @@ You can join our [discord server](https://discord.gg/5Xh2W87egW) for commits, ch
|
|||
|
||||
### Extra included plugins
|
||||
<details>
|
||||
<summary>153 additional plugins</summary>
|
||||
<summary>151 additional plugins</summary>
|
||||
|
||||
### 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
|
||||
|
|
|
@ -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<string>();
|
||||
|
||||
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(
|
||||
<Menu.MenuSeparator />,
|
||||
<Menu.MenuCheckboxItem
|
||||
id="bgm-toggle-god-mode"
|
||||
label="God Mode"
|
||||
checked={checked}
|
||||
action={() => {
|
||||
if (checked)
|
||||
godModeEnabledGuilds.delete(guild.id);
|
||||
else
|
||||
godModeEnabledGuilds.add(guild.id);
|
||||
setChecked(!checked);
|
||||
}}
|
||||
></Menu.MenuCheckboxItem>
|
||||
);
|
||||
};
|
||||
|
||||
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,
|
||||
}
|
||||
});
|
|
@ -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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
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: () => { }
|
||||
});
|
Loading…
Add table
Reference in a new issue