Easy Anti Spam
NPM
The principal function for this package is handle all URLs sended by users on a server and delete it if you want.
Support
You can contact us on your Discord server
Installation
Using NPM:
npm install easyantispam
Using Yarn (Linux):
yarn add easyantispam
Examples
Basic use
const Discord = require('discord.js');
const client = new Discord.Client();
const EasyAntiSpam = require('easyantispam');
Easy = new EasyAntiSpam.Config({ type: 2, antiStaff: false, warningMessage: `Message to advice` });
client.once('ready', () => console.log('Bot is online!'));
client.on('message', async message => {
Easy.run(message);
});
client.login('TOKEN_HERE');
API
The Config is to initialize the Anti Spam system.
The run() is placed inside the message event to analyze all received messages.
Config(options: EasyAntiSpamOptions) returns Promise
EasyAntiSpamOptions
- List of options can be found here.
run(message)
message
- The message to be analyzed.
Options
Properties marked with ?
are optional.
EasyAntiSpamOptions
{
type: 1
dm?: true/false,
antiStaff?: true/false,
warningMessage?: "Here is your warning message"
}
warningMessageOptions
{author}
- Returns a mentioned author of the message.
License
MIT