This commit is contained in:
Erik 2022-09-01 18:40:43 +03:00
parent 37d69f315e
commit 9ca14d5e39
Signed by: Navy.gif
GPG Key ID: 811EC0CD80E7E5FB

View File

@ -212,12 +212,13 @@ module.exports = class AutoModeration extends Observer {
filterResult.filter = 'word';
log += `\nFilter result: ${inspect(filterResult)}`;
if (!silent) {
const res = await this.client.rateLimiter.limitSend(msg.channel, wrapper.format('W_FILTER_DELETE', { user: author.id }), undefined, 'wordFilter').catch(catcher(255));
if (!silent && channel.permissionsFor(this.client.user)?.has('SendMessages')) {
const res = await this.client.rateLimiter.limitSend(msg.channel, wrapper.format('W_FILTER_DELETE', { user: author.id }), undefined, 'wordFilter').catch(() => null);
//const res = await msg.formattedRespond('W_FILTER_DELETE', { params: { user: author.id } });
//if (res) res.delete({ timeout: 10000 }).catch(catcher(240));
setTimeout(() => {
res.delete?.().catch(() => { /**/ });
res?.delete?.().catch(() => { /**/ });
}, 10000);
}
this.client.rateLimiter.queueDelete(msg.channel, msg).catch(() => null);