Files
xiao/commands/games/slots.js
T
Daniel Odendahl Jr 74fa836044 Minor Code Improvements
2017-05-03 01:03:59 +00:00

29 lines
998 B
JavaScript

const { Command } = require('discord.js-commando');
const slotThing = [':grapes:', ':tangerine:', ':pear:', ':cherries:'];
module.exports = class SlotsCommand extends Command {
constructor(client) {
super(client, {
name: 'slots',
group: 'games',
memberName: 'slots',
description: 'Play slots.'
});
}
run(msg) {
const slotOne = slotThing[Math.floor(Math.random() * slotThing.length)];
const slotTwo = slotThing[Math.floor(Math.random() * slotThing.length)];
const slotThree = slotThing[Math.floor(Math.random() * slotThing.length)];
if (slotOne === slotTwo && slotOne === slotThree)
return msg.say(
`${slotOne}|${slotTwo}|${slotThree}
Wow! You won! Great job... er... luck!`
);
return msg.say(
`${slotOne}|${slotTwo}|${slotThree}
Aww... You lost... Guess it's just bad luck, huh?`
);
}
};