Fix All the Crap

This commit is contained in:
Daniel Odendahl Jr
2017-03-25 04:52:59 +00:00
parent ebfbf31787
commit cb4abd7ac4
12 changed files with 42 additions and 59 deletions
+2 -4
View File
@@ -15,9 +15,6 @@ module.exports = class RockPaperScissors extends commando.Command {
key: 'choice',
prompt: 'Rock, Paper, or Scissors?',
type: 'string',
validate: (str) => {
str.toLowerCase() === 'rock' || str.toLowerCase() === 'paper' || str.toLowerCase() === 'scissors';
}
}]
});
}
@@ -27,7 +24,7 @@ module.exports = class RockPaperScissors extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
console.log(`[Command] ${message.content}`);
let rps = args.choice;
let rps = args.choice.toLowerCase();
let response = ['Paper', 'Rock', 'Scissors'];
response = response[Math.floor(Math.random() * response.length)];
if (rps.includes("rock")) {
@@ -63,5 +60,6 @@ module.exports = class RockPaperScissors extends commando.Command {
return message.channel.send("Scissors! Aw, it's a tie!");
}
}
else return message.channel.send(':x: Error! Please enter rock, paper, or scissors!');
}
};