|
|
|
@ -81,15 +81,15 @@ function matchAbbr(abbrTarget) {
|
|
|
|
|
console.log("Looking for: " + abbrTarget);
|
|
|
|
|
for (var abbr in abbreviationKey.target_phrases) {
|
|
|
|
|
if (abbreviationKey.target_phrases[abbr] == abbrTarget) {
|
|
|
|
|
console.log("abbrTarget:" + typeof(abbrTarget));
|
|
|
|
|
console.log("abbr: " + typeof(abbr));
|
|
|
|
|
console.log("abbrTarget: " + typeof (abbrTarget));
|
|
|
|
|
console.log("abbr: " + typeof (abbr));
|
|
|
|
|
return abbr;
|
|
|
|
|
} else {
|
|
|
|
|
console.log("abbrTarget:" + typeof(abbrTarget));
|
|
|
|
|
console.log("abbr: " + typeof(abbr));
|
|
|
|
|
console.log("abbrTarget: " + typeof (abbrTarget));
|
|
|
|
|
console.log("abbr: " + typeof (abbr));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function replyMessage(message, correctedMessage) {
|
|
|
|
@ -109,7 +109,9 @@ client.on('messageCreate', message => {
|
|
|
|
|
if (abbreviationKey.target_phrases[matchMessageArray[i]] !== undefined) {
|
|
|
|
|
//Return key
|
|
|
|
|
var phrase = abbreviationKey.target_phrases[matchMessageArray[i]];
|
|
|
|
|
var abbr = matchAbbr(phrase);
|
|
|
|
|
|
|
|
|
|
var abbr = matchAbbr(phrase); //abbreviationKey.target_phrases[phrase];
|
|
|
|
|
console.log(typeof(abbr));
|
|
|
|
|
|
|
|
|
|
console.log("Found abbreviation: " + abbr);
|
|
|
|
|
console.log("Phrase that matches used acronym: " + phrase);
|
|
|
|
|