I'm tired of this...

This commit is contained in:
Chloe Fontenot 🏳️‍⚧️ 2024-08-09 19:45:35 -05:00
parent a1ebdc30de
commit 81e917d9d4

View File

@ -181,9 +181,19 @@ function getMatchingPhrase(inputString, targetCharacter) {
} }
global.clenseDegeneracy = function clenseDegeneracy(message) { global.clenseDegeneracy = function clenseDegeneracy(message) {
if (message.content.includes("ussy")) { let checkString = message.content;
message.delete(); 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. 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.