I'm tired of this...

master
Chloe Fontenot 🏳️‍⚧️ 2024-08-09 19:45:35 +07:00
parent a1ebdc30de
commit 81e917d9d4
1 changed files with 12 additions and 2 deletions

@ -181,9 +181,19 @@ function getMatchingPhrase(inputString, targetCharacter) {
}
global.clenseDegeneracy = function clenseDegeneracy(message) {
if (message.content.includes("ussy")) {
message.delete();
let checkString = message.content;
let checkArray = ["ussy", "u$sy", "us$y"];
function checkLoop(content) {
for (let i = 0; i < checkArray.length; i++) {
if (message.content.includes(checkArray[i])) {
message.delete();
return;
}
}
}
checkLoop(checkString);
checkString.replace(/[^A-Z0-9]+/ig, "");
checkLoop(checkString);
}
/*
Main bot logic. Check for abbreviations by splitting the message at any non-word characters, then if we find a match, create a new array, replace the abbreviation with the phrase, then call replyMessage() and reply to the original message with the corrected one.