From 1cb8431a02476d88f90d21105e46d53a178b65c6 Mon Sep 17 00:00:00 2001 From: hawkeye7662 <82515230+hawkeye7662@users.noreply.github.com> Date: Fri, 29 Dec 2023 17:59:28 +0530 Subject: [PATCH] Fix loose matching for automod (#428) Added a missing closing bracket for the regex to work. Co-authored-by: Almeida --- backend/src/plugins/Automod/triggers/matchWords.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/plugins/Automod/triggers/matchWords.ts b/backend/src/plugins/Automod/triggers/matchWords.ts index c5ca79fce..1deb64e5b 100644 --- a/backend/src/plugins/Automod/triggers/matchWords.ts +++ b/backend/src/plugins/Automod/triggers/matchWords.ts @@ -54,7 +54,7 @@ export const MatchWordsTrigger = automodTrigger()({ const looseMatchingThreshold = Math.min(Math.max(trigger.loose_matching_threshold, 1), 64); const patterns = trigger.words.map((word) => { let pattern = trigger.loose_matching - ? [...word].map((c) => escapeStringRegexp(c)).join(`(?:\\s*|.{0,${looseMatchingThreshold})`) + ? [...word].map((c) => escapeStringRegexp(c)).join(`(?:\\s*|.{0,${looseMatchingThreshold}})`) : escapeStringRegexp(word); if (trigger.only_full_words) {