WIP: index.ts update #2

Draft
froginalog wants to merge 1 commit from froginalog/vc-goodperson:main into main
Showing only changes of commit 719746cfc0 - Show all commits

View file

@ -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"];
Review

dont remove meow woof and other bad furryspeak

dont remove meow woof and other bad furryspeak
Review

that was a mistake (but also awww mannnnn)

that was a mistake (but also awww mannnnn)
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"];
Review

readd mantika and stuff to bad nouns

readd mantika and stuff to bad nouns
Review

that was a mistake

that was a mistake
const badVerbsReplacements = ["move", "draw", "deconstruct", "fly", "fart", "teach", "display", "plug", "explode", "run", "walk", "freeze", "beat", "free", "brush", "allocate", "date", "melt", "breed", "educate", "injure", "change"];
Review

keep undress, finish, Anime, Anime girl, bath, virus, bathroom, mom

keep undress, finish, Anime, Anime girl, bath, virus, bathroom, mom
Review

only if you make it toggleable, doesn't even have to be default false, but undress and bath can be incredibly terrible if said instead of a simple swear word, example: I will kill you, I will undress you, this could end up in someone being banned, could it not? I'm not as opposed to anime and anime girl though

only if you make it toggleable, doesn't even have to be default false, but undress and bath can be incredibly terrible if said instead of a simple swear word, example: I will kill you, I will undress you, this could end up in someone being banned, could it not? I'm not as opposed to anime and anime girl though
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);
}
});
});