make linkfilter use ratelimiter

This commit is contained in:
Erik 2021-06-21 12:00:28 +03:00
parent 2927c6fb43
commit aad813d8ac
No known key found for this signature in database
GPG Key ID: 7E862371D3409F16

View File

@ -327,7 +327,7 @@ module.exports = class AutoModeration extends Observer {
const member = message.member || await guild.members.fetch(author.id).catch();
const { resolver } = this.client;
const settings = await guild.settings();
const { linkFilter: setting, moderationPoints } = settings;
const { linkFilter: setting } = settings;
const { bypass, ignore, actions, silent, enabled, blacklist, whitelist, mode } = setting;
if (!enabled) return;
const roles = member?.roles.cache.map((r) => r.id) || [];
@ -389,7 +389,7 @@ module.exports = class AutoModeration extends Observer {
return act.trigger === 'generic';
});
if (!action) return msg.delete();
if (!action) this.client.rateLimiter.queueDelete(msg.channel, msg);
msg.filtered.sanctioned = true;
this.client.rateLimiter.queueDelete(msg.channel, msg);