diff --git a/structure/client/components/settings/moderation/WordFilter.js b/structure/client/components/settings/moderation/WordFilter.js index 49b6ce4..584d6c5 100644 --- a/structure/client/components/settings/moderation/WordFilter.js +++ b/structure/client/components/settings/moderation/WordFilter.js @@ -77,9 +77,10 @@ module.exports = class WordFilter extends FilterSetting { } else if (['explicit', 'fuzzy', 'regex', 'whitelist'].includes(method)) { - const [first, ...rest] = args; // First arg should skip sanitisation - if (method === 'regex') args = rest.map((arg) => Util.sanitiseRegex(arg, ['?', '\\', '(', ')', '|', '\\[', '\\]', '.', '-', '<'])); - const resolved = await resolver.resolveMethod([first, ...args], { + // eslint-disable-next-line prefer-const + let [first, ...rest] = args; // First arg should skip sanitisation + if (method === 'regex') rest = rest.map((arg) => Util.sanitiseRegex(arg, ['?', '\\', '(', ')', '|', '\\[', '\\]', '.', '-', '<'])); + const resolved = await resolver.resolveMethod([first, ...rest], { existing: setting[method], allowedMethods: ['add', 'remove', 'set', 'reset', 'list'] });