From 719746cfc0996411df2d36f37461f99991515119 Mon Sep 17 00:00:00 2001 From: froginalog Date: Sat, 31 Aug 2024 15:28:00 -0400 Subject: [PATCH 01/11] 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 +}); From 22604bbc4bf458c0334bc6340fd9297fef2d25e3 Mon Sep 17 00:00:00 2001 From: nin0dev Date: Mon, 2 Sep 2024 17:22:26 -0400 Subject: [PATCH 02/11] feat: add settings and incoming goodperson --- index.ts | 156 ++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 126 insertions(+), 30 deletions(-) diff --git a/index.ts b/index.ts index f6897ab..cc03759 100644 --- a/index.ts +++ b/index.ts @@ -17,48 +17,144 @@ */ import { addPreSendListener, removePreSendListener } from "@api/MessageEvents"; -import definePlugin from "@utils/types"; +import { definePluginSettings } from "@api/Settings"; import { Devs } from "@utils/constants"; +import definePlugin, { OptionType } from "@utils/types"; +import { FluxDispatcher } from "@webpack/common"; -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"]; +/** * SEXUAL ***/ +const badVerbsSexual = ["fuck", "cum"]; +const badNounsSexual = ["cunt", "yuri", "whore", "dick", "pussy", "slut", "tit", "cum", "cock", "blowjob", "sex", "ass", "furry", "bewbs", "boob", "booba", "boobies", "boobs", "booby", "porn", "pron", "pronhub", "r34", "rape", "raped", "raping", "rapist"]; +/** * FURRY ***/ +const badNounsFurry = ["meow", "miau", "mreow", "mrow", "woof", "nya", ":pleading_catgirl", "purr"]; +const badRegexesFurry = ["mr*eo*w+, mr+p, nya+, mrow+, purr+"]; +/** * BRAINROT ***/ +const badNounsBrainrot = ["mewing", "mew", "skibidi", "gyat", "gyatt", "rizzler", "nettspend", "boykisser", "ohio"]; +/** * SLURS ***/ +const badNounsSlurs = ["retard", "faggot", "fag", "faggots", "fags", "retards"]; +const badRegexesSlurs = ["\\bn{1,}(i|!|1){1,}(b|g){2,}(a|@|e|3){1,}?"]; +/** * GENERAL ***/ +const badVerbsGeneral = ["kill", "destroy"]; +const badNounsGeneral = ["shit", "bullshit", "bitch", "bastard", "die", "brainless"]; +/** * FUN ***/ +const badNounsFun = ["kotlin", "avast"]; +/** * REPLACEMENTS ***/ 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"]; -function replaceBadNouns(content) { - // eslint-disable-next-line quotes - const regex = new RegExp('\\b(' + badNouns.join('|') + ')\\b', 'gi'); - - return content.replace(regex, function (match) { - const randomIndex = Math.floor(Math.random() * badNounsReplacements.length); - return badNounsReplacements[randomIndex]; - }); -} - -function replaceBadVerbs(content) { - // eslint-disable-next-line quotes - const regex = new RegExp('\\b(' + badVerbs.join('|') + ')\\b', 'gi'); - - return content.replace(regex, function (match) { - const randomIndex = Math.floor(Math.random() * badVerbsReplacements.length); - return badVerbsReplacements[randomIndex]; - }); -} - export default definePlugin({ name: "GoodPerson", - description: "Makes you a good person", - authors: [Devs.nin0dev], + description: "Makes you (or others) a good person", + authors: [Devs.nin0dev, Devs.mantikafasi], dependencies: ["MessageEventsAPI"], - + settings: definePluginSettings({ + incoming: { + type: OptionType.BOOLEAN, + description: "Filter incoming messages", + default: true + }, + blockSexual: { + type: OptionType.BOOLEAN, + description: "Block sexual words/hornyspeak", + default: true + }, + blockFurryspeak: { + type: OptionType.BOOLEAN, + description: "Block furryspeak/meowing", + default: true + }, + blockBrainrot: { + type: OptionType.BOOLEAN, + description: "Block things commonly said by Gen Alpha children", + default: true + }, + blockSlurs: { + type: OptionType.BOOLEAN, + description: "Block targeted slurs", + default: true + }, + blockInsults: { + type: OptionType.BOOLEAN, + description: "Block more general insults", + default: true + }, + blockOthers: { + type: OptionType.BOOLEAN, + description: "Block words mantikafasi personally dislikes", + default: true + } + }), async start() { - this.preSend = addPreSendListener((channelId, msg) => { - const newContent = replaceBadVerbs(replaceBadNouns(msg.content)); + this.preSend = addPreSendListener((_channelId, msg) => { + const newContent = this.replaceBadVerbs(this.replaceBadNouns(msg.content)); msg.content = newContent; }); }, - stop() { removePreSendListener(this.preSend); + }, + getEnabledBadNouns() { + const thingToReturn: string[] = []; + if (this.settings.store.blockBrainrot) thingToReturn.push(...badNounsBrainrot); + if (this.settings.store.blockFurryspeak) thingToReturn.push(...badNounsFurry); + if (this.settings.store.blockInsults) thingToReturn.push(...badNounsGeneral); + if (this.settings.store.blockOthers) thingToReturn.push(...badNounsFun); + if (this.settings.store.blockSexual) thingToReturn.push(...badNounsSexual); + if (this.settings.store.blockSlurs) thingToReturn.push(...badNounsSlurs); + return thingToReturn; + }, + getEnabledBadVerbs() { + const thingToReturn: string[] = []; + if (this.settings.store.blockSexual) thingToReturn.push(...badVerbsSexual); + if (this.settings.store.blockInsults) thingToReturn.push(...badVerbsGeneral); + return thingToReturn; + }, + replaceBadNouns(content) { + const regex = new RegExp("\\b(" + this.getEnabledBadNouns().join("|") + ")\\b", "gi"); + + return content.replace(regex, function (match) { + const randomIndex = Math.floor(Math.random() * badNounsReplacements.length); + return badNounsReplacements[randomIndex]; + }); + }, + replaceBadVerbs(content) { + const regex = new RegExp("\\b(" + this.getEnabledBadVerbs().join("|") + ")\\b", "gi"); + + return content.replace(regex, function (match) { + const randomIndex = Math.floor(Math.random() * badVerbsReplacements.length); + return badVerbsReplacements[randomIndex]; + }); + }, + flux: { + async MESSAGE_CREATE + ({ guildId, message }) { + const msg = message; + // @ts-ignore + let newMessageContent = Vencord.Plugins.plugins.GoodPerson.replaceBadVerbs(Vencord.Plugins.plugins.GoodPerson.replaceBadNouns(msg.content)); + if (message.content !== newMessageContent) { + newMessageContent += "\n-# <:husk:1280158956341297225> **GoodPerson made this message good. Reload your client to clear changes**"; + msg.content = newMessageContent; + FluxDispatcher.dispatch({ + type: "MESSAGE_UPDATE", + message: msg, + guildId + }); + } + }, + async MESSAGE_UPDATE + ({ guildId, message }) { + const msg = message; + // @ts-ignore + let newMessageContent = Vencord.Plugins.plugins.GoodPerson.replaceBadVerbs(Vencord.Plugins.plugins.GoodPerson.replaceBadNouns(msg.content)); + if (message.content !== newMessageContent) { + newMessageContent += "\n-# <:husk:1280158956341297225> **GoodPerson made this message good. Reload your client to clear changes**"; + msg.content = newMessageContent; + FluxDispatcher.dispatch({ + type: "MESSAGE_UPDATE", + message: msg, + guildId + }); + } + } } -}); \ No newline at end of file +}); From 724905c8ce866029a8e9a8265a497f2920c0ea4d Mon Sep 17 00:00:00 2001 From: Its3rr0rsWRLD Date: Sat, 7 Sep 2024 06:39:14 -0400 Subject: [PATCH 03/11] Added n word variations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Someone had to add it 😭 Reviewed-on: https://git.nin0.dev///userplugins/vc-goodperson/pulls/3 Co-authored-by: Its3rr0rsWRLD Co-committed-by: Its3rr0rsWRLD --- index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.ts b/index.ts index cc03759..ae7480e 100644 --- a/index.ts +++ b/index.ts @@ -29,9 +29,9 @@ const badNounsSexual = ["cunt", "yuri", "whore", "dick", "pussy", "slut", "tit", const badNounsFurry = ["meow", "miau", "mreow", "mrow", "woof", "nya", ":pleading_catgirl", "purr"]; const badRegexesFurry = ["mr*eo*w+, mr+p, nya+, mrow+, purr+"]; /** * BRAINROT ***/ -const badNounsBrainrot = ["mewing", "mew", "skibidi", "gyat", "gyatt", "rizzler", "nettspend", "boykisser", "ohio"]; +const badNounsBrainrot = ["mewing", "mew", "skibidi", "gyat", "gyatt", "rizzler", "nettspend", "boykisser", "ohio", "rizz"]; /** * SLURS ***/ -const badNounsSlurs = ["retard", "faggot", "fag", "faggots", "fags", "retards"]; +const badNounsSlurs = ["retard", "faggot", "fag", "faggots", "fags", "retards", "n*g", "n*gg*", "n*gg*r"]; const badRegexesSlurs = ["\\bn{1,}(i|!|1){1,}(b|g){2,}(a|@|e|3){1,}?"]; /** * GENERAL ***/ const badVerbsGeneral = ["kill", "destroy"]; From 53217612b81929db00d3235d7dbc61c79af8a310 Mon Sep 17 00:00:00 2001 From: nin0 Date: Sat, 7 Sep 2024 13:54:16 -0400 Subject: [PATCH 04/11] Update index.ts --- index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.ts b/index.ts index ae7480e..bc8995c 100644 --- a/index.ts +++ b/index.ts @@ -26,7 +26,7 @@ import { FluxDispatcher } from "@webpack/common"; const badVerbsSexual = ["fuck", "cum"]; const badNounsSexual = ["cunt", "yuri", "whore", "dick", "pussy", "slut", "tit", "cum", "cock", "blowjob", "sex", "ass", "furry", "bewbs", "boob", "booba", "boobies", "boobs", "booby", "porn", "pron", "pronhub", "r34", "rape", "raped", "raping", "rapist"]; /** * FURRY ***/ -const badNounsFurry = ["meow", "miau", "mreow", "mrow", "woof", "nya", ":pleading_catgirl", "purr"]; +const badNounsFurry = ["meow", "miau", "mreow", "mrow", "woof", "nya", ":pleading_catgirl", "purr", "oomf", "oomfie"]; const badRegexesFurry = ["mr*eo*w+, mr+p, nya+, mrow+, purr+"]; /** * BRAINROT ***/ const badNounsBrainrot = ["mewing", "mew", "skibidi", "gyat", "gyatt", "rizzler", "nettspend", "boykisser", "ohio", "rizz"]; From 3fd131ddcb100a4f6d9e65f104231ac78be2b8b9 Mon Sep 17 00:00:00 2001 From: nin0 Date: Mon, 9 Sep 2024 12:34:06 -0400 Subject: [PATCH 05/11] Update index.ts --- index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.ts b/index.ts index bc8995c..f9a27d1 100644 --- a/index.ts +++ b/index.ts @@ -29,7 +29,7 @@ const badNounsSexual = ["cunt", "yuri", "whore", "dick", "pussy", "slut", "tit", const badNounsFurry = ["meow", "miau", "mreow", "mrow", "woof", "nya", ":pleading_catgirl", "purr", "oomf", "oomfie"]; const badRegexesFurry = ["mr*eo*w+, mr+p, nya+, mrow+, purr+"]; /** * BRAINROT ***/ -const badNounsBrainrot = ["mewing", "mew", "skibidi", "gyat", "gyatt", "rizzler", "nettspend", "boykisser", "ohio", "rizz"]; +const badNounsBrainrot = ["mewing", "mew", "skibidi", "gyat", "gyatt", "rizzler", "nettspend", "boykisser", "ohio", "rizz", "tickle my toes bruh"]; /** * SLURS ***/ const badNounsSlurs = ["retard", "faggot", "fag", "faggots", "fags", "retards", "n*g", "n*gg*", "n*gg*r"]; const badRegexesSlurs = ["\\bn{1,}(i|!|1){1,}(b|g){2,}(a|@|e|3){1,}?"]; From e0488f23bc33abaacc7d7b430f3ee9fd68370819 Mon Sep 17 00:00:00 2001 From: nin0 Date: Sun, 15 Sep 2024 17:38:53 -0400 Subject: [PATCH 06/11] remove more furryspeak --- index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.ts b/index.ts index f9a27d1..9042ecd 100644 --- a/index.ts +++ b/index.ts @@ -26,10 +26,10 @@ import { FluxDispatcher } from "@webpack/common"; const badVerbsSexual = ["fuck", "cum"]; const badNounsSexual = ["cunt", "yuri", "whore", "dick", "pussy", "slut", "tit", "cum", "cock", "blowjob", "sex", "ass", "furry", "bewbs", "boob", "booba", "boobies", "boobs", "booby", "porn", "pron", "pronhub", "r34", "rape", "raped", "raping", "rapist"]; /** * FURRY ***/ -const badNounsFurry = ["meow", "miau", "mreow", "mrow", "woof", "nya", ":pleading_catgirl", "purr", "oomf", "oomfie"]; +const badNounsFurry = ["", "meowing", "meow", "miau", "mreow", "mrow", "woof", "nya", ":pleading_catgirl", "purr", "oomf", "oomfie"]; const badRegexesFurry = ["mr*eo*w+, mr+p, nya+, mrow+, purr+"]; /** * BRAINROT ***/ -const badNounsBrainrot = ["mewing", "mew", "skibidi", "gyat", "gyatt", "rizzler", "nettspend", "boykisser", "ohio", "rizz", "tickle my toes bruh"]; +const badNounsBrainrot = ["mewing", "mew", "skibidi", "gyat", "gyatt", "rizzler", "nettspend", "boykisser", "ohio", "rizz", "tickle my toes bruh", "crack my spine like a whip". "hawk tuah"]; /** * SLURS ***/ const badNounsSlurs = ["retard", "faggot", "fag", "faggots", "fags", "retards", "n*g", "n*gg*", "n*gg*r"]; const badRegexesSlurs = ["\\bn{1,}(i|!|1){1,}(b|g){2,}(a|@|e|3){1,}?"]; From e943fc9460949b6ee8605613e0eedd7070efb3ff Mon Sep 17 00:00:00 2001 From: nin0 Date: Fri, 11 Oct 2024 14:43:20 -0400 Subject: [PATCH 07/11] Update index.ts --- index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.ts b/index.ts index 9042ecd..54eb09f 100644 --- a/index.ts +++ b/index.ts @@ -29,7 +29,7 @@ const badNounsSexual = ["cunt", "yuri", "whore", "dick", "pussy", "slut", "tit", const badNounsFurry = ["", "meowing", "meow", "miau", "mreow", "mrow", "woof", "nya", ":pleading_catgirl", "purr", "oomf", "oomfie"]; const badRegexesFurry = ["mr*eo*w+, mr+p, nya+, mrow+, purr+"]; /** * BRAINROT ***/ -const badNounsBrainrot = ["mewing", "mew", "skibidi", "gyat", "gyatt", "rizzler", "nettspend", "boykisser", "ohio", "rizz", "tickle my toes bruh", "crack my spine like a whip". "hawk tuah"]; +const badNounsBrainrot = ["mewing", "mew", "skibidi", "gyat", "gyatt", "rizzler", "nettspend", "boykisser", "ohio", "rizz", "tickle my toes bruh", "crack my spine like a whip", "hawk tuah"]; /** * SLURS ***/ const badNounsSlurs = ["retard", "faggot", "fag", "faggots", "fags", "retards", "n*g", "n*gg*", "n*gg*r"]; const badRegexesSlurs = ["\\bn{1,}(i|!|1){1,}(b|g){2,}(a|@|e|3){1,}?"]; From 4beec458501738834035c0406481edf7ea854990 Mon Sep 17 00:00:00 2001 From: nin0 Date: Sat, 19 Oct 2024 13:37:18 -0400 Subject: [PATCH 08/11] Update index.ts --- index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.ts b/index.ts index 54eb09f..6f0e02f 100644 --- a/index.ts +++ b/index.ts @@ -37,7 +37,7 @@ const badRegexesSlurs = ["\\bn{1,}(i|!|1){1,}(b|g){2,}(a|@|e|3){1,}?"]; const badVerbsGeneral = ["kill", "destroy"]; const badNounsGeneral = ["shit", "bullshit", "bitch", "bastard", "die", "brainless"]; /** * FUN ***/ -const badNounsFun = ["kotlin", "avast"]; +const badNounsFun = ["kotlin", "avast", "fres"]; /** * REPLACEMENTS ***/ 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"]; From d1611dd0b00d4710b0ab376d4ecca5952c63caea Mon Sep 17 00:00:00 2001 From: nin0 Date: Sat, 19 Oct 2024 17:43:42 -0400 Subject: [PATCH 09/11] Update index.ts --- index.ts | 9 --------- 1 file changed, 9 deletions(-) diff --git a/index.ts b/index.ts index 6f0e02f..8e394b5 100644 --- a/index.ts +++ b/index.ts @@ -25,9 +25,6 @@ import { FluxDispatcher } from "@webpack/common"; /** * SEXUAL ***/ const badVerbsSexual = ["fuck", "cum"]; const badNounsSexual = ["cunt", "yuri", "whore", "dick", "pussy", "slut", "tit", "cum", "cock", "blowjob", "sex", "ass", "furry", "bewbs", "boob", "booba", "boobies", "boobs", "booby", "porn", "pron", "pronhub", "r34", "rape", "raped", "raping", "rapist"]; -/** * FURRY ***/ -const badNounsFurry = ["", "meowing", "meow", "miau", "mreow", "mrow", "woof", "nya", ":pleading_catgirl", "purr", "oomf", "oomfie"]; -const badRegexesFurry = ["mr*eo*w+, mr+p, nya+, mrow+, purr+"]; /** * BRAINROT ***/ const badNounsBrainrot = ["mewing", "mew", "skibidi", "gyat", "gyatt", "rizzler", "nettspend", "boykisser", "ohio", "rizz", "tickle my toes bruh", "crack my spine like a whip", "hawk tuah"]; /** * SLURS ***/ @@ -58,11 +55,6 @@ export default definePlugin({ description: "Block sexual words/hornyspeak", default: true }, - blockFurryspeak: { - type: OptionType.BOOLEAN, - description: "Block furryspeak/meowing", - default: true - }, blockBrainrot: { type: OptionType.BOOLEAN, description: "Block things commonly said by Gen Alpha children", @@ -96,7 +88,6 @@ export default definePlugin({ getEnabledBadNouns() { const thingToReturn: string[] = []; if (this.settings.store.blockBrainrot) thingToReturn.push(...badNounsBrainrot); - if (this.settings.store.blockFurryspeak) thingToReturn.push(...badNounsFurry); if (this.settings.store.blockInsults) thingToReturn.push(...badNounsGeneral); if (this.settings.store.blockOthers) thingToReturn.push(...badNounsFun); if (this.settings.store.blockSexual) thingToReturn.push(...badNounsSexual); From b65f6b33efb2cafbd0db675f01f034137769b26b Mon Sep 17 00:00:00 2001 From: nin0dev Date: Thu, 23 Jan 2025 04:00:11 -0500 Subject: [PATCH 10/11] support managed APIs --- index.ts | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/index.ts b/index.ts index 8e394b5..406e420 100644 --- a/index.ts +++ b/index.ts @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -import { addPreSendListener, removePreSendListener } from "@api/MessageEvents"; import { definePluginSettings } from "@api/Settings"; import { Devs } from "@utils/constants"; import definePlugin, { OptionType } from "@utils/types"; @@ -34,7 +33,7 @@ const badRegexesSlurs = ["\\bn{1,}(i|!|1){1,}(b|g){2,}(a|@|e|3){1,}?"]; const badVerbsGeneral = ["kill", "destroy"]; const badNounsGeneral = ["shit", "bullshit", "bitch", "bastard", "die", "brainless"]; /** * FUN ***/ -const badNounsFun = ["kotlin", "avast", "fres"]; +const badNounsFun = ["kotlin", "avast"]; /** * REPLACEMENTS ***/ 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"]; @@ -76,14 +75,10 @@ export default definePlugin({ default: true } }), - async start() { - this.preSend = addPreSendListener((_channelId, msg) => { - const newContent = this.replaceBadVerbs(this.replaceBadNouns(msg.content)); - msg.content = newContent; - }); - }, - stop() { - removePreSendListener(this.preSend); + onBeforeMessageSend: (c, msg) => { + // @ts-ignore + const newContent = this.replaceBadVerbs(this.replaceBadNouns(msg.content)); + msg.content = newContent; }, getEnabledBadNouns() { const thingToReturn: string[] = []; From e55d79519e401a1ae2b34b8c2797813babfec37e Mon Sep 17 00:00:00 2001 From: nin0dev Date: Mon, 10 Feb 2025 00:14:58 -0500 Subject: [PATCH 11/11] fixes --- index.ts | 55 ++++++++++++++++++++++++------------------------------- 1 file changed, 24 insertions(+), 31 deletions(-) diff --git a/index.ts b/index.ts index 406e420..8e3a5e2 100644 --- a/index.ts +++ b/index.ts @@ -1,20 +1,8 @@ /* - * Vencord, a modification for Discord's desktop app - * Copyright (c) 2024 nin0dev - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . -*/ + * Vencord, a Discord client mod + * Copyright (c) 2025 Vendicated and contributors + * SPDX-License-Identifier: GPL-3.0-or-later + */ import { definePluginSettings } from "@api/Settings"; import { Devs } from "@utils/constants"; @@ -113,8 +101,27 @@ export default definePlugin({ }, flux: { async MESSAGE_CREATE - ({ guildId, message }) { + ({ guildId, message }) { + if(Vencord.Plugins.plugins.GoodPerson.settings?.store.incoming) { + const msg = message; + // @ts-ignore + let newMessageContent = Vencord.Plugins.plugins.GoodPerson.replaceBadVerbs(Vencord.Plugins.plugins.GoodPerson.replaceBadNouns(msg.content)); + if (message.content !== newMessageContent) { + newMessageContent += "\n-# <:husk:1280158956341297225> **GoodPerson made this message good. Reload your client to clear changes**"; + msg.content = newMessageContent; + FluxDispatcher.dispatch({ + type: "MESSAGE_UPDATE", + message: msg, + guildId + }); + } + } + }, + async MESSAGE_UPDATE + ({ guildId, message }) { + if(Vencord.Plugins.plugins.GoodPerson.settings?.store.incoming) { const msg = message; + if(msg.content.includes("-# <:husk:1280158956341297225> **GoodPerson made this message good. Reload your client to clear changes**")) return; // @ts-ignore let newMessageContent = Vencord.Plugins.plugins.GoodPerson.replaceBadVerbs(Vencord.Plugins.plugins.GoodPerson.replaceBadNouns(msg.content)); if (message.content !== newMessageContent) { @@ -126,20 +133,6 @@ export default definePlugin({ guildId }); } - }, - async MESSAGE_UPDATE - ({ guildId, message }) { - const msg = message; - // @ts-ignore - let newMessageContent = Vencord.Plugins.plugins.GoodPerson.replaceBadVerbs(Vencord.Plugins.plugins.GoodPerson.replaceBadNouns(msg.content)); - if (message.content !== newMessageContent) { - newMessageContent += "\n-# <:husk:1280158956341297225> **GoodPerson made this message good. Reload your client to clear changes**"; - msg.content = newMessageContent; - FluxDispatcher.dispatch({ - type: "MESSAGE_UPDATE", - message: msg, - guildId - }); } } }