Describe very basic

This commit is contained in:
Eric Eastwood 2023-05-05 15:31:49 -05:00
parent 7c9a02c126
commit dd1d712990
1 changed files with 2 additions and 0 deletions

View File

@ -3,6 +3,8 @@
const NSFW_WORDS = ['nsfw', 'porn', 'nudes', 'sex', '18+'];
const NSFW_REGEXES = NSFW_WORDS.map((word) => new RegExp(`\\b${word}\\b`, 'i'));
// A very basic check for NSFW content that just looks for some keywords in the given
// text
function checkTextForNsfw(text) {
const isNsfw = NSFW_REGEXES.some((regex) => regex.test(text));