improvements to regex filter
This commit is contained in:
parent
63a50d6140
commit
4934b8fad9
@ -116,7 +116,7 @@ module.exports = class AutoModeration extends Observer {
|
||||
// _matcher: locally used variable for which word in the list triggered it |
|
||||
// type: which detection type matched it
|
||||
let filterResult = { filter: 'word', match: null, matched: false, matcher: null, _matcher: null, preset: false };
|
||||
const words = content.toLowerCase().split(' ').filter((elem) => elem.length);
|
||||
const words = content.toLowerCase().replace(/[,?.!]/gu, '').split(' ').filter((elem) => elem.length);
|
||||
// Remove any potential bypass characters
|
||||
//const _words = words.map((word) => word.replace(/[.'*_?+"#%&=-]/gu, ''));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user