Code Improvements

This commit is contained in:
Daniel Odendahl Jr
2017-04-17 21:57:35 +00:00
parent 45ba18bea9
commit 9dd0589de5
46 changed files with 73 additions and 209 deletions
+2 -3
View File
@@ -49,7 +49,7 @@ module.exports = class MathGameCommand extends Command {
}
const value1 = Math.floor(Math.random() * value) + 1;
const value2 = Math.floor(Math.random() * value) + 1;
const expression = value1 + operation + value2;
const expression = `${value1} ${operation}${value2}`;
const solved = math.eval(expression);
const embed = new RichEmbed()
.setTitle('You have **ten** seconds to answer:')
@@ -65,8 +65,7 @@ module.exports = class MathGameCommand extends Command {
return message.say(`Aw... Too bad, try again next time!\nThe correct answer is: ${solved}`);
}
return message.say(`Good Job! You won! ${solved} is the correct answer!`);
}
catch (err) {
} catch (err) {
return message.say(`Aw... Too bad, try again next time!\nThe correct answer is: ${solved}`);
}
}