Compare commits

...
Sign in to create a new pull request.

4 commits
main ... main

Author SHA1 Message Date
e55d79519e
fixes 2025-02-10 00:14:58 -05:00
b65f6b33ef
support managed APIs 2025-01-23 04:00:11 -05:00
d1611dd0b0 Update index.ts 2024-10-19 17:43:42 -04:00
4beec45850 Update index.ts 2024-10-19 13:37:18 -04:00

View file

@ -1,22 +1,9 @@
/*
* 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 <https://www.gnu.org/licenses/>.
*/
* Vencord, a Discord client mod
* Copyright (c) 2025 Vendicated and contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { addPreSendListener, removePreSendListener } from "@api/MessageEvents";
import { definePluginSettings } from "@api/Settings";
import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types";
@ -25,9 +12,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 = ["<a:meowing:1284972816906846298>", "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 +42,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",
@ -84,19 +63,14 @@ 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[] = [];
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);
@ -127,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) {
@ -140,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
});
}
}
}