1.0.0 ā€¢ Published 3 years ago

anti-spam-system-discord v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

anti-spam-system

Version Documentation License: MIT

Easy to use anti-spam system for discord inspired by discord-anti-spam

Install

npm install anti-spam-system

Usage

const Discord = require('discord.js');
const client = new Discord.Client();
const AntiSpamSys = require('discord-anti-spam');
const antiSpamSys = new AntiSpamSys({
	warnThreshold: 3, // Amount of messages sent in a row that will cause a warning.
	muteThreshold: 4, // Amount of messages sent in a row that will cause a mute
	kickThreshold: 7, // Amount of messages sent in a row that will cause a kick.
	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.
	muteMessage: '**{user_tag}** has been muted for spamming.',// Message that will be sent in chat upon muting 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.
	ignoredUsers: [], // Array of User IDs that get ignored.
	muteRoleName: "Muted", // Name of the role that will be given to muted users!
	removeMessages: true // If the bot should remove all the spam messages when taking action on a user!
	// And many more options... See the documentation.
});

client.once('ready', () => {
console.log('Ready')
client.user.setActivity('for spam', {type: 'WATCHING'})
});

client.on('message', message => antiSpam.message(message)); 

client.login('YOUR_TOKEN_HERE');

Run tests

Author

šŸ‘¤ AidanTheSister#0001

šŸ“ License

Copyright Ā© 2021 AidanTheSister#0001.

This project is MIT licensed.