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

master
Chloe Fontenot 🏳️‍⚧️ 2023-04-07 10:58:23 +07:00
commit ae69e50b30
1 changed files with 6 additions and 5 deletions

@ -272,11 +272,12 @@ global.madlibNextPrompt = function madlibNextPrompt(client, iteration, selectedS
// Send a message in the gameChannel with the next prompt.
const channel = client.channels.cache.get(madlibState.gameChannel);
let aAn;
let verbArray = ["a", "e", "i", "o", "u"];
if (phrase[iteration].toLowerCase().charAt(0).includes(verbArray.charAt(0))) {
aAn = "an ";
} else {
let vowelArray = ["a", "e", "i", "o", "u"];
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)");
}