From 64c7581286d90ec7fd9a447bf440e5706bd942aa Mon Sep 17 00:00:00 2001 From: Lewis Crichton Date: Tue, 3 Oct 2023 17:46:17 +0100 Subject: [PATCH] feat(permissionfreewill): onboarding deletion --- src/plugins/permissionFreeWill/README.md | 5 +++++ src/plugins/permissionFreeWill/index.ts | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/src/plugins/permissionFreeWill/README.md b/src/plugins/permissionFreeWill/README.md index ca30575ff..04c526b73 100644 --- a/src/plugins/permissionFreeWill/README.md +++ b/src/plugins/permissionFreeWill/README.md @@ -7,3 +7,8 @@ you don't want to do this") and onboarding requirements ("Making this change wil This plugin will let you create permissions in servers that **WILL** lock you out of channels until an administrator can resolve it for you. Please be careful with the overwrites you are making and check carefully. + +## Community Server Channels + +Community Server channels (i.e., `#rules` and `#moderator-only`) are actually mandatory and their existence is enforced +by the API, therefore this plugin cannot remove the restrictions behind them. diff --git a/src/plugins/permissionFreeWill/index.ts b/src/plugins/permissionFreeWill/index.ts index f3fdf159a..80d546d69 100644 --- a/src/plugins/permissionFreeWill/index.ts +++ b/src/plugins/permissionFreeWill/index.ts @@ -50,6 +50,17 @@ export default definePlugin({ } ], predicate: () => settings.store.onboarding + }, + // Onboarding deletion + { + find: "Messages.DELETE_DEFAULT_CHANNEL_BODY", + replacement: [ + { + match: /if\((?=null!=\i.{5,20}Messages.DELETE_DEFAULT_CHANNEL_BODY)/, + replace: "$&false&&" + } + ], + predicate: () => settings.store.onboarding } ], settings