From 89ded967ce33723f0c5b7edac2022fac0241a57c Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Wed, 8 May 2024 20:40:46 -0400 Subject: [PATCH] added ModViewBypass --- src/userplugins/ModViewBypass/index.tsx | 44 +++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 src/userplugins/ModViewBypass/index.tsx diff --git a/src/userplugins/ModViewBypass/index.tsx b/src/userplugins/ModViewBypass/index.tsx new file mode 100644 index 00000000..d6330508 --- /dev/null +++ b/src/userplugins/ModViewBypass/index.tsx @@ -0,0 +1,44 @@ +/* + * Vencord, a Discord client mod + * Copyright (c) 2024 Vendicated and contributors + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +import { Devs } from "@utils/constants"; +import definePlugin from "@utils/types"; + +export default definePlugin({ + name: "ModViewBypass", + description: "Open the mod view sidebar in guilds you don't have moderator permissions in, or where the experiment is disabled.", + authors: [Devs.Sqaaakoi], + patches: [ + { + find: "canAccessGuildMemberModViewWithExperiment:", + replacement: { + match: /canAccessGuildMemberModViewWithExperiment:function\(\){return\s\i/, + replace: "canAccessGuildMemberModViewWithExperiment:function(){return ()=>true;", + }, + }, + { + find: "useCanAccessGuildMemberModView:", + replacement: { + match: /\i.default.hasAny\(/, + replace: "true; (", + }, + }, + { + find: "isInGuildMemberModViewExperiment:", + replacement: { + match: /isInGuildMemberModViewExperiment:function\(\){return\s\i/, + replace: "isInGuildMemberModViewExperiment:function(){return ()=>true;", + }, + }, + { + find: "useGuildMemberModViewExperiment:", + replacement: { + match: /useGuildMemberModViewExperiment:function\(\){return\s\i/, + replace: "useGuildMemberModViewExperiment:function(){return ()=>true;", + }, + }, + ], +});