Removed useless )
This commit is contained in:
parent
b208a5af8f
commit
a65b2c9087
1 changed files with 65 additions and 65 deletions
|
@ -1,65 +1,65 @@
|
||||||
const { Command } = require('discord-akairo');
|
const { Command } = require('discord-akairo');
|
||||||
|
|
||||||
class rpsCommand extends Command {
|
class rpsCommand extends Command {
|
||||||
constructor() {
|
constructor() {
|
||||||
super('rps', {
|
super('rps', {
|
||||||
aliases: ['rps', 'rockpapersci'],
|
aliases: ['rps', 'rockpapersci'],
|
||||||
category: 'minigame',
|
category: 'minigame',
|
||||||
clientPermissions: ['SEND_MESSAGES'],
|
clientPermissions: ['SEND_MESSAGES'],
|
||||||
args: [
|
args: [
|
||||||
{
|
{
|
||||||
id: 'selection',
|
id: 'selection',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
match: 'rest',
|
match: 'rest',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
description: {
|
description: {
|
||||||
content: 'Simply rock paper scissors\nCredit to: druid#0425 (276882603158798336))',
|
content: 'Simply rock paper scissors\nCredit to: druid#0425 (276882603158798336)',
|
||||||
usage: '[rock/paper/scissors]',
|
usage: '[rock/paper/scissors]',
|
||||||
examples: ['rock']
|
examples: ['rock']
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async exec(message, args) {
|
async exec(message, args) {
|
||||||
let pcHand = Math.floor((Math.random()*3)+1);
|
let pcHand = Math.floor((Math.random()*3)+1);
|
||||||
let playerHand = args.selection;
|
let playerHand = args.selection;
|
||||||
|
|
||||||
switch (playerHand) {
|
switch (playerHand) {
|
||||||
case 'rock':
|
case 'rock':
|
||||||
if (pcHand==1) {
|
if (pcHand==1) {
|
||||||
message.channel.send('You both chose rock!');
|
message.channel.send('You both chose rock!');
|
||||||
} else if (pcHand==2) {
|
} else if (pcHand==2) {
|
||||||
message.channel.send('The bot chose paper, you lose!');
|
message.channel.send('The bot chose paper, you lose!');
|
||||||
} else {
|
} else {
|
||||||
message.channel.send('The bot chose scissors, you win!');
|
message.channel.send('The bot chose scissors, you win!');
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'paper':
|
case 'paper':
|
||||||
if (pcHand==1) {
|
if (pcHand==1) {
|
||||||
message.channel.send('You both chose paper!');
|
message.channel.send('You both chose paper!');
|
||||||
} else if (pcHand==2) {
|
} else if (pcHand==2) {
|
||||||
message.channel.send('The bot chose scissors, you lose!');
|
message.channel.send('The bot chose scissors, you lose!');
|
||||||
} else {
|
} else {
|
||||||
message.channel.send('The bot chose rock, you win!');
|
message.channel.send('The bot chose rock, you win!');
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'scissors':
|
case 'scissors':
|
||||||
if (pcHand==1) {
|
if (pcHand==1) {
|
||||||
message.channel.send('You both chose scissors!');
|
message.channel.send('You both chose scissors!');
|
||||||
} else if (pcHand==2) {
|
} else if (pcHand==2) {
|
||||||
message.channel.send('The bot chose rock, you lose!');
|
message.channel.send('The bot chose rock, you lose!');
|
||||||
} else {
|
} else {
|
||||||
message.channel.send('The bot chose paper, you win!');
|
message.channel.send('The bot chose paper, you win!');
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
message.channel.send(`You entered ${playerHand} which is an incorrect choice.`);
|
message.channel.send(`You entered ${playerHand} which is an incorrect choice.`);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = rpsCommand;
|
module.exports = rpsCommand;
|
||||||
|
|
Loading…
Reference in a new issue