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: [
// Permission lockout, just set the check to true
{
find: "Messages.SELF_DENY_PERMISSION_BODY",
find: ".showPermissionLockoutModal(",
replacement: [
{
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
{
find: "Messages.ONBOARDING_CHANNEL_THRESHOLD_WARNING",
find: ".ONBOARDING_CHANNEL_THRESHOLD_WARNING",
replacement: [
{
match: /case 1:if\((?=!\i\.sent.{20,30}Messages\.CANNOT_CHANGE_CHANNEL_PERMS)/,
replace: "$&false&&"
// are we java yet?
match: /(?<=(?:isDefaultChannelThresholdMetAfterDelete|checkDefaultChannelThresholdMetAfterChannelPermissionDeny):function\(\)\{)return \i(?=\})/g,
replace: "return () => true"
}
],
predicate: () => settings.store.onboarding