JSPM

ez-antiswear

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 7
  • Score
    100M100P100Q50089F
  • License MIT

Package Exports

  • ez-antiswear

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 (ez-antiswear) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

ez-antiswear

A package for discord anti-swear support a lot of languages.

Installation

`npm i ez-antiswear`

Usage

const AntiSwear = require("ez-antiswear"),
  filterAR = new AntiSwear("ar"),
  filterEN = new AntiSwear("en");
const Discord = require("discord.js");
const client = new Discord.Client();
client.on("ready", () => {
  console.log(`Logged in as ${client.user.tag}!`);
});

client.on("message", async message => {
  if (!message.guild || !message.content) return;
  if (filterAR.check(message.content) || filterEN.check(message.content)) {
    return message.delete();
  }
});

client.login("token");

Supported Languages

ar - cs - da - de - en - eo - es - fa - fi - fil - fr - hi - hu - it - ja - kab - ko - nl - no - pl - pt

Filter

Filter constructor.

Parameters

  • list array Instantiate filter with custom list
isProfaneLike

Determine if a single word is profane or looks profane.

Parameters

  • word string String to evaluate for profanity.
replaceWord

Replace a word with placeHolder characters;

Parameters

  • string string String to replace.
clean

Evaluate a string for profanity and return an edited version.

Parameters

  • string string Sentence to filter.
count

Count a string for profanity and return the count.

Parameters

  • string string Sentence to filter.
check

Check a string for profanity and return an Boolean value.

Parameters

  • string string Sentence to filter.