I'm tired of this...

This commit is contained in:
Chloe Fontenot 🏳️‍⚧️ 2024-08-09 20:03:43 -05:00
parent 1c74531942
commit 19dbbb3c3e

View File

@ -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.