Skip to content

Commit

Permalink
Fix loose matching for automod (#428)
Browse files Browse the repository at this point in the history
Added a missing closing bracket for the regex to work.

Co-authored-by: Almeida <[email protected]>
  • Loading branch information
hawkeye7662 and almeidx authored Dec 29, 2023
1 parent e7eacb3 commit 1cb8431
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backend/src/plugins/Automod/triggers/matchWords.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const MatchWordsTrigger = automodTrigger<MatchResultType>()({
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) {
Expand Down

0 comments on commit 1cb8431

Please sign in to comment.