Merge branch 'master' of ssh://gitea.calebfontenot.com:25566/CCF_100/NoMoreAcronyms
This commit is contained in:
commit
ae69e50b30
11
main.cjs
11
main.cjs
@ -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 {
|
||||
aAn = "a ";
|
||||
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)");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user