Merge branch 'slash-commands' of https://github.com/GalacticBot/New-GBot into slash-commands

This commit is contained in:
Erik 2022-07-29 00:48:38 +03:00
commit aee6d87574
Signed by untrusted user: Navy.gif
GPG Key ID: 811EC0CD80E7E5FB
2 changed files with 7 additions and 3 deletions

View File

@ -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. The following words are already tied to an action and were skipped.
`{words}` `{words}`
[SETTING_WORDFILTER_INVALID]
No valid values supplied.
// Linkfilter // Linkfilter
[SETTING_LINKFILTER_HELP] [SETTING_LINKFILTER_HELP]
Configure the link filtering behaviour for your server. Configure the link filtering behaviour for your server.

View File

@ -135,8 +135,9 @@ class WordFilterSetting extends FilterSetting {
} }
if (params.length && invalid.length) index += '_SOME'; if (params.length && invalid.length) index += '_SOME';
} else if (list === 'presets') { } else if (list === 'presets') {
for (const word of words) { for (let word of words) {
if (FilterPresets.regex[word]) params.push(FilterPresets.regex[word]); word = word.toLowerCase();
if (FilterPresets.regex[word]) params.push(...FilterPresets.regex[word]);
else invalid.push(word); else invalid.push(word);
} }
list = 'regex'; list = 'regex';
@ -147,7 +148,7 @@ class WordFilterSetting extends FilterSetting {
if (!params.length) { if (!params.length) {
if (['roles', 'channels'].includes(list.value)) if (['roles', 'channels'].includes(list.value))
return { error: true, index: 'RESOLVE_FAIL', params: { type: list === 'bypass' ? 'roles' : 'channels' } }; 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)); 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('`, `') } }; return { index, params: { updated: list, modified: params.filter((o) => modified.includes(o.id || o)).map((o) => o.name || o).join('__, __'), invalid: invalid.join('`, `') } };