Fix PermissionFreeWill

This commit is contained in:
Vendicated 2023-10-25 20:14:39 +02:00
parent 465a87f66b
commit 3a7c27253b
No known key found for this signature in database
GPG key ID: D66986BAF75ECF18

View file

@ -31,7 +31,7 @@ export default definePlugin({
patches: [ patches: [
// Permission lockout, just set the check to true // Permission lockout, just set the check to true
{ {
find: "Messages.SELF_DENY_PERMISSION_BODY", find: ".showPermissionLockoutModal(",
replacement: [ replacement: [
{ {
match: /case"DENY":.{0,50}if\((?=\i\.\i\.can)/, match: /case"DENY":.{0,50}if\((?=\i\.\i\.can)/,
@ -42,11 +42,12 @@ export default definePlugin({
}, },
// Onboarding, same thing but we need to prevent the check // Onboarding, same thing but we need to prevent the check
{ {
find: "Messages.ONBOARDING_CHANNEL_THRESHOLD_WARNING", find: ".ONBOARDING_CHANNEL_THRESHOLD_WARNING",
replacement: [ replacement: [
{ {
match: /case 1:if\((?=!\i\.sent.{20,30}Messages\.CANNOT_CHANGE_CHANNEL_PERMS)/, // are we java yet?
replace: "$&false&&" match: /(?<=(?:isDefaultChannelThresholdMetAfterDelete|checkDefaultChannelThresholdMetAfterChannelPermissionDeny):function\(\)\{)return \i(?=\})/g,
replace: "return () => true"
} }
], ],
predicate: () => settings.store.onboarding predicate: () => settings.store.onboarding