improvements to regex filter

This commit is contained in:
Erik 2021-06-23 11:49:59 +03:00
parent 63a50d6140
commit 4934b8fad9
No known key found for this signature in database
GPG Key ID: 7E862371D3409F16

View File

@ -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, ''));