Fixed case bug

This commit is contained in:
Brandon Rozek 2016-08-17 16:41:46 -04:00
parent 7defad2af6
commit 21f8f3c057

View file

@ -56,9 +56,10 @@ module.exports = new Command("Hangman", condition, function(text, send, userData
if (guessedLetters.indexOf(letter) !== -1) {
send("You already guessed this letter");
} else {
if (word.toLowerCase().indexOf(letter.toLowerCase()) !== -1) {
letterIndex = word.toLowerCase().indexOf(letter.toLowerCase());
if (letterIndex !== -1) {
send("The letter is in the word!");
correctLetters.push(letter);
correctLetters.push(word[letterIndex]);
} else {
send("The letter is not in the word..");
}