diff --git a/main.cjs b/main.cjs index dbfcf0e..50cc3f1 100644 --- a/main.cjs +++ b/main.cjs @@ -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.