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[] = [];