Merge branch 'master' of ssh://gitea.calebfontenot.com:25566/CCF_100/NoMoreAcronyms

This commit is contained in:
Chloe Fontenot 🏳️‍⚧️ 2023-04-07 10:58:23 -05:00
commit ae69e50b30

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 = "an ";
} else {
aAn = "a "; aAn = "a ";
for (let i = 0; i < vowelArray.length; ++i) {
if (phrase[iteration].toLowerCase().startsWith(vowelArray)) {
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)");
} }