2021-09-17 18:28:39 +02:00
|
|
|
const { MessageEmbed } = require("discord.js");
|
2021-06-12 12:53:51 +02:00
|
|
|
module.exports = {
|
|
|
|
name: "slots",
|
|
|
|
usage: "(Number)",
|
|
|
|
timeout: 5000,
|
|
|
|
description: "Win more coins by slots",
|
|
|
|
category: "Economy",
|
2021-09-17 18:28:39 +02:00
|
|
|
options: [
|
|
|
|
{
|
2021-11-18 18:56:42 +01:00
|
|
|
type: 4,
|
2021-09-17 18:28:39 +02:00
|
|
|
name: "cp",
|
2021-11-18 18:56:42 +01:00
|
|
|
description: "The number of CP you want to slots",
|
2021-09-17 18:28:39 +02:00
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
run: async (client, interaction, args) => {
|
2021-11-18 18:56:42 +01:00
|
|
|
const max = 100000;
|
2021-06-12 12:53:51 +02:00
|
|
|
const slots = [
|
2021-07-13 05:17:39 +02:00
|
|
|
"<:blushca:852174555513618502>",
|
|
|
|
"<:abusecat:853501068074942464>",
|
|
|
|
"<:dumbcat:855462498550415362>",
|
2021-06-12 12:53:51 +02:00
|
|
|
];
|
|
|
|
const slotOne = slots[Math.floor(Math.random() * slots.length)];
|
|
|
|
const slotTwo = slots[Math.floor(Math.random() * slots.length)];
|
|
|
|
const slotThree = slots[Math.floor(Math.random() * slots.length)];
|
|
|
|
const slotfour = slots[Math.floor(Math.random() * slots.length)];
|
|
|
|
const slotfive = slots[Math.floor(Math.random() * slots.length)];
|
|
|
|
const slotsix = slots[Math.floor(Math.random() * slots.length)];
|
|
|
|
const slotseven = slots[Math.floor(Math.random() * slots.length)];
|
|
|
|
const sloteight = slots[Math.floor(Math.random() * slots.length)];
|
|
|
|
const slotnine = slots[Math.floor(Math.random() * slots.length)];
|
2021-11-18 18:56:42 +01:00
|
|
|
const ar = [1.3, 1.5, 1.7, 1.9, 2.1, 2.3, 2.5, 2.7, 2.9, 3.1, 3.3, 3.5];
|
|
|
|
const r = ar[Math.floor(Math.random() * ar.length)];
|
|
|
|
let amt = args[0];
|
|
|
|
if (amt > max) amt = max;
|
|
|
|
if (amt < 100) {
|
|
|
|
interaction.followUp({
|
|
|
|
content: `You need to slot at least 100${client.currency}`,
|
|
|
|
});
|
|
|
|
} else if ((await client.bal(interaction.user.id)) < amt) {
|
|
|
|
interaction.followUp({ content: "You don't have enough balance" });
|
|
|
|
} else if (
|
2021-06-12 12:53:51 +02:00
|
|
|
(slotOne === slotTwo && slotOne === slotThree) ||
|
|
|
|
(slotfour === slotfive && slotfour === slotsix) ||
|
|
|
|
(slotseven === sloteight && slotseven === slotnine)
|
|
|
|
) {
|
2021-11-18 18:56:42 +01:00
|
|
|
const winamt = Math.round(r * amt);
|
|
|
|
const multi = (await client.multi(interaction)) / 10 + 1;
|
2021-09-17 18:28:39 +02:00
|
|
|
await client.add(interaction.user.id, winamt, interaction);
|
|
|
|
await client.ADDSWin(interaction.user.id);
|
2021-06-12 12:53:51 +02:00
|
|
|
const won = new MessageEmbed()
|
|
|
|
.setColor("GREEN")
|
2021-11-18 18:56:42 +01:00
|
|
|
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
|
2021-09-17 18:28:39 +02:00
|
|
|
.setTimestamp()
|
2021-06-12 12:53:51 +02:00
|
|
|
.addField(
|
|
|
|
"|-----|-----|----|",
|
|
|
|
`| ${slotfour} | ${slotfive} | ${slotsix} |`
|
|
|
|
)
|
|
|
|
.addField(
|
|
|
|
"|-----|-----|----|",
|
|
|
|
`| ${slotOne} | ${slotTwo} | ${slotThree} |`
|
|
|
|
)
|
|
|
|
.addField(
|
|
|
|
"|-----|-----|----|",
|
|
|
|
`| ${slotseven} | ${sloteight} | ${slotnine} |`
|
|
|
|
)
|
2021-09-17 18:28:39 +02:00
|
|
|
.setTitle(`${interaction.user.username} wins a slots game`)
|
2021-11-18 18:56:42 +01:00
|
|
|
.addFields(
|
|
|
|
{
|
|
|
|
name: "Won",
|
|
|
|
value: `**${Math.round(winamt * multi)}**${client.currency}`,
|
|
|
|
inline: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "New Balance",
|
|
|
|
value: `**${Math.round(
|
|
|
|
(await client.bal(interaction.user.id)) + winamt * multi
|
|
|
|
)}**${client.currency}`,
|
|
|
|
inline: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "Multiplier",
|
|
|
|
value: `x${r + multi}`,
|
|
|
|
inline: true,
|
|
|
|
}
|
2021-06-12 12:53:51 +02:00
|
|
|
);
|
2021-09-17 18:28:39 +02:00
|
|
|
interaction.followUp({ embeds: [won] });
|
2021-06-12 12:53:51 +02:00
|
|
|
} else {
|
2021-09-17 18:28:39 +02:00
|
|
|
await client.rmv(interaction.user.id, amt);
|
2021-06-12 12:53:51 +02:00
|
|
|
const lost = new MessageEmbed()
|
|
|
|
.setColor("RED")
|
2021-11-18 18:56:42 +01:00
|
|
|
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
|
2021-09-17 18:28:39 +02:00
|
|
|
.setTimestamp()
|
2021-06-12 12:53:51 +02:00
|
|
|
.addField(
|
|
|
|
"|-----|-----|----|",
|
|
|
|
`| ${slotfour} | ${slotfive} | ${slotsix} |`
|
|
|
|
)
|
|
|
|
.addField(
|
|
|
|
"|-----|-----|----|",
|
|
|
|
`| ${slotOne} | ${slotTwo} | ${slotThree} |`
|
|
|
|
)
|
|
|
|
.addField(
|
|
|
|
"|-----|-----|----|",
|
|
|
|
`| ${slotseven} | ${sloteight} | ${slotnine} |`
|
|
|
|
)
|
2021-09-17 18:28:39 +02:00
|
|
|
.setTitle(`${interaction.user.username} loses a slots game`)
|
2021-11-18 18:56:42 +01:00
|
|
|
.addFields(
|
|
|
|
{
|
|
|
|
name: "Lost",
|
|
|
|
value: `**${amt}**${client.currency}`,
|
|
|
|
inline: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "New Balance",
|
|
|
|
value: `**${
|
|
|
|
parseInt(await client.bal(interaction.user.id)) - amt
|
|
|
|
}**${client.currency}`,
|
|
|
|
inline: true,
|
|
|
|
}
|
2021-06-12 12:53:51 +02:00
|
|
|
);
|
2021-09-17 18:28:39 +02:00
|
|
|
interaction.followUp({ embeds: [lost] });
|
2021-06-12 12:53:51 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
};
|