diff --git a/commands/games/mathgame.js b/commands/games/mathgame.js index f0b78e08..5b57277e 100644 --- a/commands/games/mathgame.js +++ b/commands/games/mathgame.js @@ -13,7 +13,16 @@ module.exports = class MathGameCommand extends commando.Command { args: [{ key: 'difficulty', prompt: 'What difficulty should the math game be? Easy, Medium, Hard, or Extreme?', - type: 'string' + type: 'string', + validate: difficulty => { + if (difficulty.toLowerCase() !== 'easy' || difficulty.toLowerCase() !== 'medium' || difficulty.toLowerCase() !== 'hard' || difficulty.toLowerCase() !== 'extreme') { + return 'Please set the difficulty to either `easy`, `medium`, `hard`, or `extreme`.'; + } + return true; + }, + parse: (str) => { + str.toLowerCase(); + } }] }); } @@ -23,8 +32,7 @@ module.exports = class MathGameCommand extends commando.Command { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; } console.log(`[Command] ${message.content}`); - let level = args.difficulty.toLowerCase(); - if (level !== 'easy' || level !== 'medium' || level !== 'hard' || level !== 'extreme') return message.channel.send(':x: Error! Please set the difficulty to either easy, medium, hard, or extreme!'); + let level = args.difficulty; let randomType = ['+', '-', '*']; randomType = randomType[Math.floor(Math.random() * randomType.length)]; let randomValue; diff --git a/commands/response/motivate.js b/commands/response/motivate.js index 2b4c9315..16c33266 100644 --- a/commands/response/motivate.js +++ b/commands/response/motivate.js @@ -15,7 +15,8 @@ module.exports = class MotivateCommand extends commando.Command { args: [{ key: 'thing', prompt: 'What do you want to motivate?', - type: 'string' + type: 'string', + default: '' }] }); } diff --git a/commands/response/name.js b/commands/response/name.js index 8347ec08..fbfee313 100644 --- a/commands/response/name.js +++ b/commands/response/name.js @@ -31,7 +31,7 @@ module.exports = class RandomNameGen extends commando.Command { randomFirstFemale = randomFirstFemale[Math.floor(Math.random() * randomFirstFemale.length)]; let randomLast = ["Walker", "Tworni", "Ross", "Smith", "Odendahl", "Deere", "Brown", "Williams", "Jones", "Miles", "Moss", "Roberto", "McFly", "McDonald", "Lewis", "Armstrong", "Stevenson", "Schwarzenegger", "Robinson", "Parker", "Piper", "Johnson", "Brantley", "Stewart", "Ree", "Talbot", "Seville", "Peace", "Spielberg", "Baggins", "Wilborn", "Vankirk", "Shireman", "Jimerson", "Masters", "Hack", "Satcher", "Younkin", "Aguila", "Duffey", "Burgin", "Highfall", "Wee", "Solari", "Tomaselli", "Basler", "Difranco", "Latch", "Rives", "Dolan", "Abraham", "Holter", "Portugal", "Lininger", "Holst", "Mccroy", "Follmer", "Hotchkiss", "Gassaway", "Wang", "Agron", "Raasch", "Gourd", "Czaja", "Marquart", "Papadopoulos", "Ringer", "Lax", "Sperling", "Galusha", "Alston"]; randomLast = randomLast[Math.floor(Math.random() * randomLast.length)]; - let gender = args.gender; + let gender = args.gender.toLowerCase(); if (gender === "male") { return message.channel.send(`${randomFirstMale} ${randomLast}`); }