-
Notifications
You must be signed in to change notification settings - Fork 0
/
anti-spam.js
26 lines (23 loc) · 1.59 KB
/
anti-spam.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
const Discord = require('discord.js');
const client = new Discord.Client();
const AntiSpam = require('discord-anti-spam');
const antiSpam = new AntiSpam({
warnThreshold: 3, // Amount of messages sent in a row that will cause a warning.
kickThreshold: 7, // Amount of messages sent in a row that will cause a ban.
banThreshold: 7, // Amount of messages sent in a row that will cause a ban.
maxInterval: 2000, // Amount of time (in milliseconds) in which messages are considered spam.
warnMessage: '{@user}, Please stop spamming.', // Message that will be sent in chat upon warning a user.
kickMessage: '**{user_tag}** has been kicked for spamming.', // Message that will be sent in chat upon kicking a user.
banMessage: '**{user_tag}** has been banned for spamming.', // Message that will be sent in chat upon banning a user.
maxDuplicatesWarning: 7, // Amount of duplicate messages that trigger a warning.
maxDuplicatesKick: 10, // Amount of duplicate messages that trigger a warning.
maxDuplicatesBan: 12, // Amount of duplicate messages that trigger a warning.
exemptPermissions: [ 'ADMINISTRATOR'], // Bypass users with any of these permissions.
ignoreBots: true, // Ignore bot messages.
verbose: true, // Extended Logs from module.
ignoredUsers: [], // Array of User IDs that get ignored.
// And many more options... See the documentation.
});
client.on('ready', () => console.log(`Logged in as ${client.user.tag}.`));
client.on('message', (message) => antiSpam.message(message));
client.login('NjkzOTIzMDg4NzYwNDM4ODM0.XoFwxg.YjWVR0JbfZhdcWzdfojFmLJ7SlA');