return and await

This commit is contained in:
Daniel Odendahl Jr
2017-03-23 13:16:59 +00:00
parent cea110ce4b
commit 7c0a39ec5c
83 changed files with 295 additions and 264 deletions
+11 -11
View File
@@ -23,43 +23,43 @@ module.exports = class RockPaperScissors extends commando.Command {
let response = ['Paper', 'Rock', 'Scissors'];
response = response[Math.floor(Math.random() * response.length)];
if (!rps) {
message.channel.send(":x: Error! Your message contains nothing!");
return message.channel.send(":x: Error! Your message contains nothing!");
}
else if (rps.includes("rock")) {
if (response === "Rock") {
message.channel.send("Rock! Aw, it's a tie!");
return message.channel.send("Rock! Aw, it's a tie!");
}
if (response === "Paper") {
message.channel.send("Paper! Yes! I win!");
return message.channel.send("Paper! Yes! I win!");
}
if (response === "Scissors") {
message.channel.send("Scissors! Aw... I lose...");
return message.channel.send("Scissors! Aw... I lose...");
}
}
else if (rps.includes("paper")) {
if (response === "Rock") {
message.channel.send("Rock! Aw... I lose...");
return message.channel.send("Rock! Aw... I lose...");
}
if (response === "Paper") {
message.channel.send("Paper! Aw, it's a tie!");
return message.channel.send("Paper! Aw, it's a tie!");
}
if (response === "Scissors") {
message.channel.send("Scissors! Yes! I win!");
return message.channel.send("Scissors! Yes! I win!");
}
}
else if (rps.includes("scissors")) {
if (response === "Rock") {
message.channel.send("Rock! Yes! I win!");
return message.channel.send("Rock! Yes! I win!");
}
if (response === "Paper") {
message.channel.send("Paper! Aw... I lose...");
return message.channel.send("Paper! Aw... I lose...");
}
if (response === "Scissors") {
message.channel.send("Scissors! Aw, it's a tie!");
return message.channel.send("Scissors! Aw, it's a tie!");
}
}
else {
message.channel.send(":x: Error! Your choice is not Rock, Paper, or Scissors!");
return message.channel.send(":x: Error! Your choice is not Rock, Paper, or Scissors!");
}
}
};