diff --git a/src/localization/en_gb/settings/en_gb_moderation.lang b/src/localization/en_gb/settings/en_gb_moderation.lang index bb5b748..1f516fd 100644 --- a/src/localization/en_gb/settings/en_gb_moderation.lang +++ b/src/localization/en_gb/settings/en_gb_moderation.lang @@ -350,6 +350,9 @@ __Letting this prompt time out will make the action a **generic** one.__ The following words are already tied to an action and were skipped. `{words}` +[SETTING_WORDFILTER_INVALID] +No valid values supplied. + // Linkfilter [SETTING_LINKFILTER_HELP] Configure the link filtering behaviour for your server. diff --git a/src/structure/components/settings/moderation/WordFilter.js b/src/structure/components/settings/moderation/WordFilter.js index 78df6e5..26c49f2 100644 --- a/src/structure/components/settings/moderation/WordFilter.js +++ b/src/structure/components/settings/moderation/WordFilter.js @@ -135,8 +135,9 @@ class WordFilterSetting extends FilterSetting { } if (params.length && invalid.length) index += '_SOME'; } else if (list === 'presets') { - for (const word of words) { - if (FilterPresets.regex[word]) params.push(FilterPresets.regex[word]); + for (let word of words) { + word = word.toLowerCase(); + if (FilterPresets.regex[word]) params.push(...FilterPresets.regex[word]); else invalid.push(word); } list = 'regex'; @@ -147,7 +148,7 @@ class WordFilterSetting extends FilterSetting { if (!params.length) { if (['roles', 'channels'].includes(list.value)) return { error: true, index: 'RESOLVE_FAIL', params: { type: list === 'bypass' ? 'roles' : 'channels' } }; - return { error: true, index }; + return { error: true, index: 'SETTING_WORDFILTER_INVALID' }; } const { modified } = this[method](setting[list], params.map((o) => o.id || o)); return { index, params: { updated: list, modified: params.filter((o) => modified.includes(o.id || o)).map((o) => o.name || o).join('__, __'), invalid: invalid.join('`, `') } };