mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-11 15:57:50 +02:00
Remove all useless async
This commit is contained in:
@@ -14,7 +14,7 @@ module.exports = class RockPaperScissors extends commando.Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(message) {
|
||||
run(message) {
|
||||
if (message.channel.type !== 'dm') {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
}
|
||||
@@ -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!");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user