From 45bb1af0112c0671b77a49d7a6dea398e18fbd38 Mon Sep 17 00:00:00 2001 From: Rawir <45668076+Rawiros@users.noreply.github.com> Date: Tue, 1 Aug 2023 05:32:29 +0200 Subject: [PATCH] MuteNewGuild: Support lurked guilds (#1546) Co-authored-by: Rawiros <45668076+Rawiros@users.noreply.github.com01~> --- src/plugins/muteNewGuild.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/plugins/muteNewGuild.tsx b/src/plugins/muteNewGuild.tsx index c1e43013..e77f64aa 100644 --- a/src/plugins/muteNewGuild.tsx +++ b/src/plugins/muteNewGuild.tsx @@ -36,7 +36,7 @@ const settings = definePluginSettings({ description: "Suppress All Role @mentions", type: OptionType.BOOLEAN, default: true - }, + } }); export default definePlugin({ @@ -50,6 +50,13 @@ export default definePlugin({ match: /INVITE_ACCEPT_SUCCESS.+?;(\i)=null.+?;/, replace: (m, guildId) => `${m}$self.handleMute(${guildId});` } + }, + { + find: "{joinGuild:function", + replacement: { + match: /guildId:(\w+),lurker:(\w+).{0,20}\)}\)\);/, + replace: (m, guildId, lurker) => `${m}if(!${lurker})$self.handleMute(${guildId});` + } } ], settings,