misc fixes

This commit is contained in:
Erik 2020-11-12 00:58:47 +02:00
parent cfbc651fa0
commit d0d97173a4
3 changed files with 3 additions and 5 deletions

View File

@ -268,14 +268,11 @@ module.exports = class LinkFilter extends FilterSetting {
const domains = await resolver.resolveDomains(params.map((word) => word.toLowerCase()));
const removed = [];
for (const domain of [...domains]) {
console.log(domain)
const existing = actions.find((ac) => ac.trigger.includes(domain));
console.log(existing)
if (!existing) continue;
domains.splice(domains.indexOf(domain), 1);
removed.push(domain);
}
console.log(domains)
actionObject.trigger = domains;
if (removed.length) message.formattedRespond('S_LINKFILTER_DOMAIN_IN_ACTION', { params: { domains: removed.join('`, `') } });
}

View File

@ -40,7 +40,8 @@ class ModerationLogsSetting extends Setting {
const result = await this.client.resolver.list(
setting.infractions,
Object.keys(InfractionResolves),
params, this.client.resolver.resolveInfractions.bind(this.client.resolver)
params,
this.client.resolver.resolveInfractions.bind(this.client.resolver)
);
if(result) {

View File

@ -117,7 +117,7 @@ module.exports = class FilterSetting extends Setting {
}
}
//Which words should trigger the action?
//What should trigger the action?
//Implemented in the subclass
const result = await this._createTrigger(message, action, actionObject, setting);
if (result && result.error) return result;