mention filter setting

This commit is contained in:
Erik 2022-03-28 01:41:22 +03:00
parent 343f451541
commit 3a8d089a6b
Signed by: Navy.gif
GPG Key ID: 811EC0CD80E7E5FB

View File

@ -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
},