2
0
mirror of https://github.com/thedevs-network/the-guard-bot synced 2025-08-22 18:08:51 +00:00
the-guard-bot/utils/spamwatch.js
Wojciech Pawlik 1074615927
Add spamwatch
2020-04-03 21:59:25 +02:00

17 lines
358 B
JavaScript

// @ts-check
'use strict';
const { Client } = require('spamwatch');
const { config } = require('./config');
// eslint-disable-next-line func-names
exports.shouldKick = (function () {
if (!config.spamwatch) {
return () => false;
}
const client = new Client(config.spamwatch.token, config.spamwatch.host);
return ({ id }) => client.getBan(id);
}());