diff --git a/src/localization/en_gb/settings/en_gb_moderation.lang b/src/localization/en_gb/settings/en_gb_moderation.lang index a3e9051..be7e1fe 100644 --- a/src/localization/en_gb/settings/en_gb_moderation.lang +++ b/src/localization/en_gb/settings/en_gb_moderation.lang @@ -2,6 +2,9 @@ [SETTING_FILTER_WHITELIST] 》 Whitelist +[SETTING_FILTER_WHITELISTMODE] +》 Whitelist mode + [SETTING_FILTER_GREYLIST] 》 Greylist diff --git a/src/structure/components/settings/moderation/LinkFilter.js b/src/structure/components/settings/moderation/LinkFilter.js index 4a3ab6e..b944e15 100644 --- a/src/structure/components/settings/moderation/LinkFilter.js +++ b/src/structure/components/settings/moderation/LinkFilter.js @@ -11,6 +11,7 @@ class LinkFilterSetting extends FilterSetting { module: 'moderation', display: 'Link Filter', default: { + whitelistMode: false, enabled: false, silent: false, blacklist: [], @@ -30,6 +31,7 @@ class LinkFilterSetting extends FilterSetting { ], }, definitions: { + whitelistMode: 'BOOLEAN', enabled: 'BOOLEAN', silent: 'BOOLEAN', blacklist: { ARRAY: 'STRING' }, @@ -73,6 +75,11 @@ class LinkFilterSetting extends FilterSetting { name: 'enabled', description: 'Toggle enable state' }), + new CommandOption({ + type: 'BOOLEAN', + name: 'whitelist', + description: 'Toggle whitelist mode' + }), new CommandOption({ type: 'BOOLEAN', name: 'silent', @@ -94,9 +101,11 @@ class LinkFilterSetting extends FilterSetting { const list = opts.list?.value; const enabled = opts.enabled?.value; const silent = opts.silent?.value; + const whitelistMode = opts.whitelist?.value; if (typeof silent === 'boolean') setting.silent = silent; if (typeof enabled === 'boolean') setting.enabled = enabled; + if (typeof whitelistMode === 'boolean') setting.whitelistMode = whitelistMode; if (method === 'edit' && list !== 'actions') return { error: true, index: 'SETTING_FILTER_EDIT_INVALID' }; @@ -157,7 +166,14 @@ class LinkFilterSetting extends FilterSetting { }, { code: true }), inline: true }, - { name: '\u200b', value: '\u200b', inline: true }, + { + name: 'SETTING_FILTER_WHITELISTMODE', + value: guild.format('GENERAL_STATE', { + bool: Boolean(setting.whitelistMode) + }, { code: true }), + inline: true + }, + //{ name: '\u200b', value: '\u200b', inline: true }, { name: 'SETTING_FILTER_WHITELIST', value: setting.whitelist.join(', ') || '**N/A**',