easyantispam
Advanced tools
Comparing version 1.0.1 to 1.1.0
{ | ||
"name": "easyantispam", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "Easy Anti Spam package used for Discord Bots to prevent invites link from other servers", | ||
"main": "index.js", | ||
"main": "src/index.js", | ||
"types": "typings/index.d.ts", | ||
"scripts": { | ||
@@ -26,7 +27,5 @@ "test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"homepage": "https://github.com/thekevinava/EasyAntiSpam#readme", | ||
"dependencies": { | ||
"discord.js": "^12.5.1" | ||
}, | ||
"homepage": "https://thekevinava.gitbook.io/easyantispam/", | ||
"dependencies": {}, | ||
"devDependencies": {} | ||
} |
# Easy Anti Spam | ||
<p> | ||
<img alt="NPM Version" src="https://img.shields.io/npm/v/easyantispam"> | ||
<img alt="GitHub issues" src="https://img.shields.io/github/issues/KevinavaDev/EasyAntiSpam"> | ||
<img alt="NPM License" src="https://img.shields.io/npm/l/easyantispam"> | ||
<img alt="NPM Downloads" src="https://img.shields.io/npm/dt/easyantispam"> | ||
<a href="https://www.npmjs.com/package/easyantispam"><img alt="NPM Version" src="https://img.shields.io/npm/v/easyantispam"></a> | ||
<a href="https://github.com/thekevinava/EasyAntiSpam/issues"><img alt="GitHub issues" src="https://img.shields.io/github/issues/KevinavaDev/EasyAntiSpam"></a> | ||
<a href="https://www.npmjs.com/package/easyantispam"><img alt="NPM License" src="https://img.shields.io/npm/l/easyantispam"></a> | ||
<a href="https://www.npmjs.com/package/easyantispam"><img alt="NPM Downloads" src="https://img.shields.io/npm/dt/easyantispam"></a> | ||
<a href="https://discord.gg/gAFRJpasj5"><img alt="Discord" src="https://img.shields.io/discord/791333925968412703?color=%237289DA&label=Discord&logo=discord"></a> | ||
<a href="https://www.npmjs.com/package/easyantispam">NPM</a> | ||
</p> | ||
The principal function for this package is handle all URLs sended by users on a server and delete it if you want. | ||
- [Support](#support) | ||
- [Installation](#installation) | ||
- [Examples](#examples) | ||
- [Basic Use](#basic-use) | ||
- [API](#api) | ||
- [Options](#options) | ||
- [License](#license) | ||
# Support | ||
You can contact us on your [Discord server](https://discord.gg/gAFRJpasj5) | ||
# Installation | ||
@@ -31,8 +41,11 @@ Using NPM: | ||
const client = new Discord.Client(); | ||
const AntiSpam = require('easyantispam'); | ||
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 => { | ||
AntiSpam(client, message); | ||
Easy.run(message); | ||
}); | ||
@@ -43,2 +56,35 @@ | ||
# 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<boolean> | ||
- `EasyAntiSpamOptions` - List of options can be found [here](#options). | ||
### run(message) | ||
- `message` - The message to be analyzed. | ||
# Options | ||
Properties marked with `?` are optional. | ||
### EasyAntiSpamOptions | ||
```js | ||
{ | ||
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 | ||
@@ -45,0 +91,0 @@ |
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
6621
0
5
58
92
0
- Removeddiscord.js@^12.5.1
- Removed@discordjs/collection@0.1.6(transitive)
- Removed@discordjs/form-data@3.0.1(transitive)
- Removedabort-controller@3.0.0(transitive)
- Removedasynckit@0.4.0(transitive)
- Removedcombined-stream@1.0.8(transitive)
- Removeddelayed-stream@1.0.0(transitive)
- Removeddiscord.js@12.5.3(transitive)
- Removedevent-target-shim@5.0.1(transitive)
- Removedmime-db@1.52.0(transitive)
- Removedmime-types@2.1.35(transitive)
- Removednode-fetch@2.7.0(transitive)
- Removedprism-media@1.3.5(transitive)
- Removedsetimmediate@1.0.5(transitive)
- Removedtr46@0.0.3(transitive)
- Removedtweetnacl@1.0.3(transitive)
- Removedwebidl-conversions@3.0.1(transitive)
- Removedwhatwg-url@5.0.0(transitive)
- Removedws@7.5.9(transitive)