Skip to content
Snippets Groups Projects
Commit bbb7bda6 authored by Reviath's avatar Reviath
Browse files

Update commands/slots.js, commands/roulette.js files

parent 1fe1dc2b
No related branches found
No related tags found
No related merge requests found
......@@ -12,6 +12,7 @@ let colour = args[0];
let money = parseInt(args[1]);
let moneydb = await db.fetch(`Balance_${user.id}`)
let random = Math.floor(Math.random() * 37);
let moneyhelp = new Discord.MessageEmbed()
.setColor('BLUE')
.setDescription(`<a:x_:801038779955150888> Specify an amount | .roulette <color> <amount>`);
......@@ -29,34 +30,39 @@ if (colour == "b" || colour.includes("black")) colour = 0;
else if (colour == "r" || colour.includes("red")) colour = 1;
else if (colour == "g" || colour.includes("green")) colour = 2;
else return message.channel.send(colorbad);
msg = await message.channel.send(`You have placed ${money} to ${colour}`);
setTimeout( async function() {
if (random == 0 && colour == 2) {
money *= 15
db.add(`Balance_${user.id}`, money)
let moneyEmbed1 = new Discord.MessageEmbed()
.setColor("RED")
.setDescription(`<a:green:802056552672002059> You won ${money} coins\n\nMultiplier: 15x`);
message.channel.send(moneyEmbed1)
msg.edit(moneyEmbed1)
} else if (isOdd(random) && colour == 1) {
money = parseInt(money * 1.5)
db.add(`Balance_${user.id}`, money)
let moneyEmbed2 = new Discord.MessageEmbed()
.setColor("RED")
.setDescription(`<a:red_star:801039507385483306> You won ${money} coins\n\nMultiplier: 1.5x`);
message.channel.send(moneyEmbed2)
msg.edit(moneyEmbed2)
} else if (!isOdd(random) && colour == 0) {
money = parseInt(money * 2)
db.add(`Balance_${user.id}`, money)
let moneyEmbed3 = new Discord.MessageEmbed()
.setColor("RED")
.setDescription(`<a:black:802055864890425344> You won ${money} coins\n\nMultiplier: 2x`);
message.channel.send(moneyEmbed3)
msg.edit(moneyEmbed3)
} else {
db.subtract(`Balance_${user.id}`, money)
let moneyEmbed4 = new Discord.MessageEmbed()
.setColor("RED")
.setDescription(`<a:x_:801038779955150888> You lost ${money} coins\n\nMultiplier: 0x`);
message.channel.send(moneyEmbed4)
msg.edit(moneyEmbed4)
}
}, 5000)
}
module.exports.help = {
......
......@@ -23,15 +23,16 @@ let slots = ["<a:blue_fire:801857759989465170>", "<a:orange_fire:801858052163895
else{
cfNumber = number;
};
msg = await message.channel.send('Sloting...');
if (slots[result1] === slots[result2] && slots[result1] === slots[result3]) {
setTimeout( async function() {
let embed = new Discord.MessageEmbed()
.setFooter('You won!', icon)
.setTitle(':slot_machine: Slots :slot_machine:')
.addField('Result:', slots[result1] + slots[result2] + slots[result3], true)
.addField(`You won `,`${cfNumber*2}`)
.setColor(0xF4E842)
message.channel.send(embed).then(db.add(`Balance_${message.author.id}`, cfNumber));
msg.edit(embed).then(db.add(`Balance_${message.author.id}`, cfNumber));
} else {
let embed2 = new Discord.MessageEmbed()
.setFooter('You lost!', icon)
......@@ -39,7 +40,8 @@ let slots = ["<a:blue_fire:801857759989465170>", "<a:orange_fire:801858052163895
.addField('Result:', slots[result1] + slots[result2] + slots[result3], true)
.setColor(0xF4E842)
.addField(`You lost `,`${cfNumber}`)
message.channel.send(embed2).then(db.subtract(`Balance_${message.author.id}`, cfNumber));
msg.edit(embed2).then(db.subtract(`Balance_${message.author.id}`, cfNumber));
}, 5000)
}
}
module.exports.help = {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment