I'm tired of this...
This commit is contained in:
parent
a1ebdc30de
commit
81e917d9d4
14
main.cjs
14
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.
|
||||
|
Loading…
Reference in New Issue
Block a user