Update index.ts
This commit is contained in:
parent
ecb82133de
commit
62ed990f5b
1 changed files with 33 additions and 2 deletions
|
|
@ -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 = [];
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue