spamnya

1.1.1 • Public • Published

spamnya

a spam detector for discord.js bots

Usage

  const Discord = require('discord.js')
  const spam = require('spamnya')
  let client = new Discord.Client()

  client.on('message', (message) => {
    //initiate the detector and log the chats with max 50 logged chats
    spam.log(message, 50)

    if(spam.tooQuick(3, 1000)){
      // when someone send 3 chats in less than a second
    }

    if(spam.sameMessages(3, 60000)){
      // when someone send 3 identical chats within a minute
    }
  })

Readme

Keywords

none

Package Sidebar

Install

npm i spamnya

Weekly Downloads

0

Version

1.1.1

License

MIT

Unpacked Size

4.06 kB

Total Files

4

Last publish

Collaborators

  • rainqubit