https://github.com/supportclass/lfg-filter
Word filter for NodeCG
https://github.com/supportclass/lfg-filter
Last synced: 3 months ago
JSON representation
Word filter for NodeCG
- Host: GitHub
- URL: https://github.com/supportclass/lfg-filter
- Owner: SupportClass
- License: mit
- Created: 2014-12-18T22:42:09.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2020-05-06T02:19:09.000Z (over 5 years ago)
- Last Synced: 2025-06-09T00:05:32.555Z (8 months ago)
- Language: HTML
- Homepage:
- Size: 59.6 KB
- Stars: 5
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# lfg-filter
This is a [NodeCG](http://github.com/nodecg/nodecg) bundle.
[](https://travis-ci.org/SupportClass/lfg-filter)
This bundle provides `wordfilter` and `emailfilter` objects that other bundles can use to check if a string contains profanity or if an email address is blacklisted.
It also has a dashboard panel that allows the end user to add and remove phrases from the blacklists. **By default, the blacklists are empty.**
## Installation
- Install to `nodecg/bundles/lfg-filter`
- Run NodeCG, open your dashboard, and use the Filter panel to edit the blacklists
## Usage
Add `lfg-filter` as a `bundleDependency` in your bundle's [`nodecg.json`](https://github.com/nodecg/nodecg/wiki/nodecg.json)
Then add the following to your bundle's extension:
```javascript
var wordfilter = nodecg.extensions['lfg-filter'].wordfilter;
var emailfilter = nodecg.extensions['lfg-filter'].emailfilter;
// Returns 'true' if the string contains profanity
if (wordfilter.blacklisted('this is a string')) {
console.log('bad words found');
} else {
console.log('squeaky clean');
}
// Returns 'true' if the address is blacklisted
if (emailfilter.blacklisted('test@example.com')) {
console.log('email blacklisted');
} else {
console.log('looks good to me, chief');
}
```
### License
lfg-filter is provided under the MIT license, which is available to read in the [LICENSE][] file.
[license]: LICENSE