From 719746cfc0996411df2d36f37461f99991515119 Mon Sep 17 00:00:00 2001 From: froginalog Date: Sat, 31 Aug 2024 15:28:00 -0400 Subject: [PATCH] Update index.ts --- index.ts | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/index.ts b/index.ts index f6897ab..64e34d6 100644 --- a/index.ts +++ b/index.ts @@ -20,28 +20,34 @@ import { addPreSendListener, removePreSendListener } from "@api/MessageEvents"; import definePlugin from "@utils/types"; import { Devs } from "@utils/constants"; -const badVerbs = ["fuck", " cum", "kill", "destroy"]; -const badNouns = ["meow", "woof", "nya", ":pleading_catgirl", "cunt", "shit", "bullshit", "ass", "bitch", "nigga", "hell", "whore", "dick", "piss", "pussy", "slut", "tit", "cum", "cock", "retard", "blowjob", "bastard", "kotlin", "die", "sex", "nigger", "brainless", "mant", "manti", "mantik", "mantika", "mantikaf", "mantikafa", "mantikafas", "mantikafasi", "boykisser", "mewing", "mew", "skibidi", "gyat", "gyatt", "rizzler", "avast", "yuri"]; -const badVerbsReplacements = ["love", "eat", "deconstruct", "marry", "fart", "teach", "display", "plug", "explode", "undress", "finish", "freeze", "beat", "free", "brush", "allocate", "date", "melt", "breed", "educate", "injure", "change"]; -const badNounsReplacements = ["pasta", "kebab", "cake", "potato", "woman", "computer", "java", "hamburger", "monster truck", "osu!", "Ukrainian ball in search of gas game", "Anime", "Anime girl", "good", "keyboard", "NVIDIA RTX 3090 Graphics Card", "storm", "queen", "single", "umbrella", "mosque", "physics", "bath", "virus", "bathroom", "mom", "owner", "airport", "Avast Antivirus Free"]; +const badVerbs = ["fuck", " cum", "kill", "destroy", "orgasm", "orgasming"]; +const badNouns = ["fag","fucking","dickhead", "motherfucker", "sigma", "asshole", "cunt", "shit", "bullshit", "ass", "bitch", "nigga", "hell", "whore", "dick", "piss", "pussy", "slut", "tit", "cum", "cock", "retard", "blowjob", "bastard", "kotlin", "die", "sex", "nigger", "brainless", "mant", "mew", "skibidi", "gyat", "rizzler", "avast", "yuri", "faggot"]; +const badVerbsReplacements = ["move", "draw", "deconstruct", "fly", "fart", "teach", "display", "plug", "explode", "run", "walk", "freeze", "beat", "free", "brush", "allocate", "date", "melt", "breed", "educate", "injure", "change"]; +const badNounsReplacements = ["pasta", "kebab", "cake", "potato", "woman", "computer", "java", "hamburger", "monster truck", "osu!", "Ukrainian ball in search of gas game", "cheese", "wheat", "good", "keyboard", "NVIDIA RTX 3090 Graphics Card", "storm", "queen", "single", "umbrella", "mosque", "physics", "desk", "virus", "bathroom", "corn", "owner", "airport", "Avast Antivirus Free"]; -function replaceBadNouns(content) { - // eslint-disable-next-line quotes - const regex = new RegExp('\\b(' + badNouns.join('|') + ')\\b', 'gi'); +function replaceBadNouns(content: string): string { + const regex = new RegExp('\\b(' + badNouns.join('|') + ')(s)?\\b', 'gi'); - return content.replace(regex, function (match) { + return content.replace(regex, function (match, p1, p2) { const randomIndex = Math.floor(Math.random() * badNounsReplacements.length); - return badNounsReplacements[randomIndex]; + let replacement = badNounsReplacements[randomIndex]; + if (p2) { + replacement += 's'; // Keep the plural 's' if the match was plural + } + return replacement; }); } -function replaceBadVerbs(content) { - // eslint-disable-next-line quotes - const regex = new RegExp('\\b(' + badVerbs.join('|') + ')\\b', 'gi'); +function replaceBadVerbs(content: string): string { + const regex = new RegExp('\\b(' + badVerbs.join('|') + ')(s)?\\b', 'gi'); - return content.replace(regex, function (match) { + return content.replace(regex, function (match, p1, p2) { const randomIndex = Math.floor(Math.random() * badVerbsReplacements.length); - return badVerbsReplacements[randomIndex]; + let replacement = badVerbsReplacements[randomIndex]; + if (p2) { + replacement += 's'; // Keep the plural 's' if the match was plural + } + return replacement; }); } @@ -61,4 +67,4 @@ export default definePlugin({ stop() { removePreSendListener(this.preSend); } -}); \ No newline at end of file +}); -- 2.45.2