Add additional stories

This commit is contained in:
Chloe Fontenot 🏳️‍⚧️ 2023-04-07 10:58:19 -05:00
parent 602491698d
commit cf0840a541

View File

@ -272,11 +272,12 @@ global.madlibNextPrompt = function madlibNextPrompt(client, iteration, selectedS
// Send a message in the gameChannel with the next prompt. // Send a message in the gameChannel with the next prompt.
const channel = client.channels.cache.get(madlibState.gameChannel); const channel = client.channels.cache.get(madlibState.gameChannel);
let aAn; let aAn;
let verbArray = ["a", "e", "i", "o", "u"]; let vowelArray = ["a", "e", "i", "o", "u"];
if (phrase[iteration].toLowerCase().charAt(0).includes(verbArray.charAt(0))) { aAn = "a ";
aAn = "an "; for (let i = 0; i < vowelArray.length; ++i) {
} else { if (phrase[iteration].toLowerCase().startsWith(vowelArray)) {
aAn = "a "; aAn = "an ";
}
} }
channel.send("Give me " + aAn + phrase[iteration] + ":\n(" + (phrase.length - iteration) + " words remain)"); channel.send("Give me " + aAn + phrase[iteration] + ":\n(" + (phrase.length - iteration) + " words remain)");
} }