1.1.4 • Published 6 years ago

discord-spam-protector v1.1.4

Weekly downloads
8
License
ISC
Repository
github
Last release
6 years ago

discord-anti-spam.js

An extremely simple module to prevent spam on your discord server based on the [project by Michael-J-Scofield.

Installation

This module assumes you already have a basic Discord.js bot setup.

Once you've done this, setting the anti spam up will be very easy. And you can follow the code below to get started!

var antispam = require("discord-spam-protector");

antispam(bot, {
  warnBuffer: 3, //Maximum amount of messages allowed to send in the interval time before getting warned.
  maxBuffer: 5, // Maximum amount of messages allowed to send in the interval time before getting banned.
  interval: 1000, // Amount of time in ms users can send a maximum of the maxBuffer variable before getting banned.
  warningMessage: "stop spamming or I'll whack your head off.", // Warning message send to the user indicating they are going to fast.
  banMessage: "has been banned for spamming, anyone else?", // Ban message, always tags the banned user in front of it.
  maxDuplicatesWarning: 7,// Maximum amount of duplicate messages a user can send in a timespan before getting warned
  maxDuplicatesBan: 10, // Maximum amount of duplicate messages a user can send in a timespan before getting banned
  deleteMessagesAfterBanForPastDays: 7, // Delete the spammed messages after banning for the past x days.
  logChannel: "id of channel" //Leave empty for log messages to be posted in the same channel the message was removed from
});

That's it. enjoy not being raided :)

If you have any issues, bugs or trouble setting the module up. feel free to open an issue on Github