|
|
@ -148,6 +148,9 @@ client.on('messageCreate', message => {
|
|
|
|
|
|
|
|
|
|
|
|
client.on('messageUpdate', (undefined, newMessage) => {
|
|
|
|
client.on('messageUpdate', (undefined, newMessage) => {
|
|
|
|
//checkMessage(newMessage, false);
|
|
|
|
//checkMessage(newMessage, false);
|
|
|
|
|
|
|
|
if (message.author.id == "1091120267851485215") {
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
if (typeof message !== undefined) {
|
|
|
|
if (typeof message !== undefined) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -182,10 +185,7 @@ function getMatchingPhrase(inputString, targetCharacter) {
|
|
|
|
|
|
|
|
|
|
|
|
global.clenseDegeneracy = function clenseDegeneracy(message) {
|
|
|
|
global.clenseDegeneracy = function clenseDegeneracy(message) {
|
|
|
|
function normalizeString(str) {
|
|
|
|
function normalizeString(str) {
|
|
|
|
// Define a mapping of characters to 's'
|
|
|
|
const sMap = { '$': 's', '5': 's', 'š': 's', 'ß': 's'};
|
|
|
|
const sMap = { '$': 's', '5': 's', 'š': 's'};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Replace similar characters with 's'
|
|
|
|
|
|
|
|
return str.split('').map(char => sMap[char] || char).join('');
|
|
|
|
return str.split('').map(char => sMap[char] || char).join('');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
let checkString = normalizeString(message.content.toLowerCase());
|
|
|
|
let checkString = normalizeString(message.content.toLowerCase());
|
|
|
@ -204,8 +204,6 @@ function getMatchingPhrase(inputString, targetCharacter) {
|
|
|
|
checkString = checkString.replace(/[^a-zA-Z0-9]/g, '');
|
|
|
|
checkString = checkString.replace(/[^a-zA-Z0-9]/g, '');
|
|
|
|
console.log(checkString);
|
|
|
|
console.log(checkString);
|
|
|
|
checkLoop(message, 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.
|
|
|
|
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.
|
|
|
|