Package Exports
- discord-censor
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (discord-censor) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Discord-Censor
People curse too much in your discord server?
Use this npm package to censor their messages and keep your discord server friendly for all ages (unless you wanted to ....)
Installation 
npm i discord-censor
yarn add discord-censor
Features
The package has total 3 features
An array for bad words (badwords)
A function to check for those words in messages (check)
A function to replace bad words from messages (censor)
Usage 
Badwords (array)
You might want to interact with the badwords array to change it's content if needed.
By default, it has 500 about bad words stored in it
To interact with the array, see the code example below
const censor = require(discord-censor);
console.log(censor.badwords) //prints all the badwords in the array
const index = censor.badwords.indexOf('Word'); // Replace word with any word you would like to remove from array
censor.badwords.splice(index, 1); //Removes 'Word' from array
Check
It is a very handy function and returns value as true or false
To understand it better, see the code example below
const censor = require(discord-censor);
const CurseOrNot = censor.check("Is it a curse?")
console.log(CurseOrNot) //Prints False
const censor = require(discord-censor);
const CurseOrNot = censor.check("Is it a fuckin curse?")
console.log(CurseOrNot) //Prints true
Censor
This function will check for curses and replaces them by itself
It has two parameters
const censor = require(discord-censor);
censor.censor('The string you want to censor', 'censored word will be replaced by this (This parameter is optional)')
For more information, let's see the example code below
const censor = require(discord-censor);
const censored = censor.censor('I am fuckin cursing right now', '🤬')
console.log(censored) //prints "I am 🤬 cursing right now"