First working build™️

This commit is contained in:
Chloe Fontenot 🏳️‍⚧️ 2023-03-31 12:33:50 -05:00
parent ff77234c88
commit 46190eb580

View File

@ -109,7 +109,13 @@ client.on('messageCreate', message => {
console.log("Found abbreviation: " + abbr);
console.log("Phrase that matches used acronym: " + phrase);
var rebuildMessageArray = message.content.split(new RegExp(abbr, 'i'));
if (abbr !== "") {
var rebuildMessageArray = message.content.split(new RegExp(abbr, 'i'));
} else {
message.reply("Detected abbreviation, but regex matching broke. Caleb is working on this...");
break;
}
arrayRotate(rebuildMessageArray, true, 1);
rebuildMessageArray.unshift(phrase);
arrayRotate(rebuildMessageArray, true, 2);