Tweaked code a little in an attempt to prevent a bug
This commit is contained in:
parent
d078d12a79
commit
b5e60c2aa0
3
main.ts
3
main.ts
@ -110,6 +110,7 @@ client.on('messageCreate', message => {
|
||||
let correctedMessage = message.content;
|
||||
let matchDetected = false;
|
||||
for (let i = 0; i < matchMessageArray.length; ++i) {
|
||||
var rebuildMessageArray = [];
|
||||
//console.log("Corrected Message: " + correctedMessage);
|
||||
if (abbreviationKey.target_phrases[matchMessageArray[i]] !== undefined) {
|
||||
matchDetected = true;
|
||||
@ -121,7 +122,7 @@ client.on('messageCreate', message => {
|
||||
console.log("Found abbreviation: " + abbr);
|
||||
console.log("Phrase that matches used acronym: " + phrase);
|
||||
if (abbr !== "") {
|
||||
var rebuildMessageArray = correctedMessage.split(new RegExp(abbr, 'i'));
|
||||
rebuildMessageArray = correctedMessage.split(new RegExp(abbr, 'i'));
|
||||
} else {
|
||||
message.reply("Detected abbreviation, but regex matching broke. Caleb is working on this...");
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user