Update index.ts
This commit is contained in:
parent
8807abce2e
commit
719746cfc0
1 changed files with 21 additions and 15 deletions
36
index.ts
36
index.ts
|
@ -20,28 +20,34 @@ import { addPreSendListener, removePreSendListener } from "@api/MessageEvents";
|
||||||
import definePlugin from "@utils/types";
|
import definePlugin from "@utils/types";
|
||||||
import { Devs } from "@utils/constants";
|
import { Devs } from "@utils/constants";
|
||||||
|
|
||||||
const badVerbs = ["fuck", " cum", "kill", "destroy"];
|
const badVerbs = ["fuck", " cum", "kill", "destroy", "orgasm", "orgasming"];
|
||||||
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 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 = ["love", "eat", "deconstruct", "marry", "fart", "teach", "display", "plug", "explode", "undress", "finish", "freeze", "beat", "free", "brush", "allocate", "date", "melt", "breed", "educate", "injure", "change"];
|
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", "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 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) {
|
function replaceBadNouns(content: string): string {
|
||||||
// eslint-disable-next-line quotes
|
const regex = new RegExp('\\b(' + badNouns.join('|') + ')(s)?\\b', 'gi');
|
||||||
const regex = new RegExp('\\b(' + badNouns.join('|') + ')\\b', 'gi');
|
|
||||||
|
|
||||||
return content.replace(regex, function (match) {
|
return content.replace(regex, function (match, p1, p2) {
|
||||||
const randomIndex = Math.floor(Math.random() * badNounsReplacements.length);
|
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) {
|
function replaceBadVerbs(content: string): string {
|
||||||
// eslint-disable-next-line quotes
|
const regex = new RegExp('\\b(' + badVerbs.join('|') + ')(s)?\\b', 'gi');
|
||||||
const regex = new RegExp('\\b(' + badVerbs.join('|') + ')\\b', 'gi');
|
|
||||||
|
|
||||||
return content.replace(regex, function (match) {
|
return content.replace(regex, function (match, p1, p2) {
|
||||||
const randomIndex = Math.floor(Math.random() * badVerbsReplacements.length);
|
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() {
|
stop() {
|
||||||
removePreSendListener(this.preSend);
|
removePreSendListener(this.preSend);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue