forked from Galactic/galactic-bot
mention filter setting
This commit is contained in:
parent
343f451541
commit
3a8d089a6b
@ -39,7 +39,7 @@ class MentionFilter extends FilterSetting {
|
|||||||
type: 'BOOLEAN'
|
type: 'BOOLEAN'
|
||||||
}),
|
}),
|
||||||
new CommandOption({
|
new CommandOption({
|
||||||
name: 'unqiue',
|
name: 'unique',
|
||||||
description: 'Mentions for the same user count as one',
|
description: 'Mentions for the same user count as one',
|
||||||
type: 'BOOLEAN'
|
type: 'BOOLEAN'
|
||||||
}),
|
}),
|
||||||
@ -88,7 +88,7 @@ class MentionFilter extends FilterSetting {
|
|||||||
|
|
||||||
if (method && list) {
|
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(', ') };
|
else if (method.value === 'list') return { message: setting[list.value].join(', ') };
|
||||||
|
|
||||||
const { guild } = interaction;
|
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) {
|
fields(guild) {
|
||||||
const setting = guild._settings[this.name];
|
const setting = guild._settings[this.name];
|
||||||
return [
|
return [
|
||||||
@ -141,7 +146,7 @@ class MentionFilter extends FilterSetting {
|
|||||||
{
|
{
|
||||||
name: 'GENERAL_UNIQUE',
|
name: 'GENERAL_UNIQUE',
|
||||||
value: guild.format('GENERAL_STATE', {
|
value: guild.format('GENERAL_STATE', {
|
||||||
bool: setting.unique
|
bool: Boolean(setting.unique)
|
||||||
}, { code: true }),
|
}, { code: true }),
|
||||||
inline: true
|
inline: true
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user