From 3a8d089a6b77cab811fa28416a999d50076c544e Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Mon, 28 Mar 2022 01:41:22 +0300 Subject: [PATCH] mention filter setting --- .../components/settings/moderation/MentionFilter.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/structure/components/settings/moderation/MentionFilter.js b/src/structure/components/settings/moderation/MentionFilter.js index 30f16c0..574bb0a 100644 --- a/src/structure/components/settings/moderation/MentionFilter.js +++ b/src/structure/components/settings/moderation/MentionFilter.js @@ -39,7 +39,7 @@ class MentionFilter extends FilterSetting { type: 'BOOLEAN' }), new CommandOption({ - name: 'unqiue', + name: 'unique', description: 'Mentions for the same user count as one', type: 'BOOLEAN' }), @@ -88,7 +88,7 @@ class MentionFilter extends FilterSetting { if (method && list) { - if (list.value === 'actions') this._action(interaction, method.value, setting[list.value]); + if (list.value === 'actions') return this._action(interaction, method.value, setting[list.value]); else if (method.value === 'list') return { message: setting[list.value].join(', ') }; const { guild } = interaction; @@ -121,6 +121,11 @@ class MentionFilter extends FilterSetting { } + _createTrigger(message, action, actionObject) { + // TODO allow different actions based on amount of mentions + actionObject.trigger = 'generic'; + } + fields(guild) { const setting = guild._settings[this.name]; return [ @@ -141,7 +146,7 @@ class MentionFilter extends FilterSetting { { name: 'GENERAL_UNIQUE', value: guild.format('GENERAL_STATE', { - bool: setting.unique + bool: Boolean(setting.unique) }, { code: true }), inline: true },