Socket
Socket
Sign inDemoInstall

easyantispam

Package Overview
Dependencies
0
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    easyantispam

Easy Anti Spam package used for Discord Bots to prevent invites link from other servers


Version published
Maintainers
1
Created

Readme

Source

Easy Anti Spam

NPM Version GitHub issues NPM License NPM Downloads Discord 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'); // Js
// TypeScript: import EasyAntiSpam from "easyantispam";

Easy = new EasyAntiSpam.Config({ type: 2, antiStaff: false, warningMessage: `Message to advice` }); // Config variables

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 // 1: Only Discord Invites, 2: All URLS
    dm?: true/false, // If you want to send a DM with his/her message. False by default.
    antiStaff?: true/false, // If you want to delete staff urls or not. False by default.
    warningMessage?: "Here is your warning message" // You have different options found in warningMessageOptions section.
}

warningMessageOptions

  • {author} - Returns a mentioned author of the message.

License

MIT

Keywords

FAQs

Last updated on 31 Dec 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc