mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-15 08:22:37 +02:00
Formatting
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
const commando = require('discord.js-commando');
|
||||
|
||||
module.exports = class RockPaperScissors extends commando.Command {
|
||||
constructor(Client){
|
||||
constructor(Client) {
|
||||
super(Client, {
|
||||
name: 'rps',
|
||||
aliases: [
|
||||
@@ -15,47 +15,51 @@ module.exports = class RockPaperScissors extends commando.Command {
|
||||
}
|
||||
|
||||
async run(message) {
|
||||
if(message.channel.type !== 'dm') {
|
||||
if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
if (message.channel.type !== 'dm') {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
}
|
||||
console.log("[Command] " + message.content);
|
||||
let [rps] = message.content.toLowerCase().split(" ").slice(1);
|
||||
let response = ['Paper', 'Rock', 'Scissors'];
|
||||
response = response[Math.floor(Math.random() * response.length)];
|
||||
if(rps === undefined) {
|
||||
if (rps === undefined) {
|
||||
message.channel.send(":x: Error! Your message contains nothing!");
|
||||
} else if(rps.includes("rock")) {
|
||||
if(response === "Rock") {
|
||||
}
|
||||
else if (rps.includes("rock")) {
|
||||
if (response === "Rock") {
|
||||
message.channel.send("Rock! Aw, it's a tie!");
|
||||
}
|
||||
if(response === "Paper") {
|
||||
if (response === "Paper") {
|
||||
message.channel.send("Paper! Yes! I win!");
|
||||
}
|
||||
if(response === "Scissors") {
|
||||
if (response === "Scissors") {
|
||||
message.channel.send("Scissors! Aw... I lose...");
|
||||
}
|
||||
} else if(rps.includes("paper")) {
|
||||
if(response === "Rock") {
|
||||
}
|
||||
else if (rps.includes("paper")) {
|
||||
if (response === "Rock") {
|
||||
message.channel.send("Rock! Aw... I lose...");
|
||||
}
|
||||
if(response === "Paper") {
|
||||
if (response === "Paper") {
|
||||
message.channel.send("Paper! Aw, it's a tie!");
|
||||
}
|
||||
if(response === "Scissors") {
|
||||
if (response === "Scissors") {
|
||||
message.channel.send("Scissors! Yes! I win!");
|
||||
}
|
||||
} else if(rps.includes("scissors")) {
|
||||
if(response === "Rock") {
|
||||
}
|
||||
else if (rps.includes("scissors")) {
|
||||
if (response === "Rock") {
|
||||
message.channel.send("Rock! Yes! I win!");
|
||||
}
|
||||
if(response === "Paper") {
|
||||
if (response === "Paper") {
|
||||
message.channel.send("Paper! Aw... I lose...");
|
||||
}
|
||||
if(response === "Scissors") {
|
||||
if (response === "Scissors") {
|
||||
message.channel.send("Scissors! Aw, it's a tie!");
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
message.channel.send(":x: Error! Your choice is not Rock, Paper, or Scissors!");
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user