From 62ed990f5b2235131164f4e519a47fd116eff62e Mon Sep 17 00:00:00 2001 From: Slara <162091285+slara6804@users.noreply.github.com> Date: Sat, 26 Jul 2025 21:26:34 +0200 Subject: [PATCH] Update index.ts --- plugins/nsfwbypass/src/index.ts | 35 +++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/plugins/nsfwbypass/src/index.ts b/plugins/nsfwbypass/src/index.ts index 73309f5..7538c36 100644 --- a/plugins/nsfwbypass/src/index.ts +++ b/plugins/nsfwbypass/src/index.ts @@ -1,2 +1,33 @@ -// If Vmuser won't delete this.. .. -// Improved version from Vencore. +import { findByStoreName, findByProps } from "@vendetta/metro"; +import { after, instead } from "@vendetta/patcher"; + +const NSFWStuff = findByProps("isNSFWInvite"); +const UserStore = findByStoreName("UserStore"); + +let patches = []; + +export default { + onLoad: () => { + patches.push(instead("handleNSFWGuildInvite", NSFWStuff, () => false)); + patches.push(instead("isNSFWInvite", NSFWStuff, () => false)); + patches.push(instead("shouldNSFWGateGuild", NSFWStuff, () => false)); + + // User store patch to modify nsfwAllowed property + patches.push(after("getCurrentUser", UserStore, (_, user) => { + if (user?.hasOwnProperty("nsfwAllowed")) { + user.nsfwAllowed = true; + } + if (user?.hasOwnProperty("ageVerificationStatus")) { + user.ageVerificationStatus = 3; // VERIFIED_ADULT + } + return user; + })); + }, + + onUnload: () => { + for (const unpatch of patches) { + unpatch(); + } + patches = []; + } +};