diff --git a/main.cjs b/main.cjs index 1b1cdac..bd57d7b 100644 --- a/main.cjs +++ b/main.cjs @@ -183,20 +183,20 @@ function getMatchingPhrase(inputString, targetCharacter) { global.clenseDegeneracy = function clenseDegeneracy(message) { let checkString = message.content.toLowerCase(); let checkArray = ["ussy", "u$sy", "us$y", "u$$y"]; - function checkLoop(content) { + function checkLoop(message, content) { console.log("Checking " + content + "..."); for (let i = 0; i < checkArray.length; i++) { - if (message.content.includes(checkArray[i])) { + if (content.includes(checkArray[i])) { message.delete(); return; } } } - checkLoop(checkString); + checkLoop(message, checkString); console.log(checkString); checkString = checkString.replace(/[^a-zA-Z0-9]/g, ''); console.log(checkString); - checkLoop(checkString); + checkLoop(message, 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.