module.exports = { config: { name: "slot", aliases: ["spin"], version: "1.9", author: "Anik Islam Sadik", countDown: 3, role: 0, description: "šŸ’– Ultra-stylish love slot machine", category: "game", guide: { en: "Use: {pn} [bet amount]" } }, onStart: async function ({ message, event, args, usersData }) { const { senderID } = event; const bet = parseInt(args[0]); const formatMoney = (amount) => { if (isNaN(amount)) return "šŸ’²0"; amount = Number(amount); const scales = [ { value: 1e15, s: 'Q', c: '🌈' }, { value: 1e12, s: 'T', c: '✨' }, { value: 1e9, s: 'B', c: 'šŸ’Ž' }, { value: 1e6, s: 'M', c: 'šŸ’°' }, { value: 1e3, s: 'k', c: 'šŸ’µ' } ]; const sc = scales.find(x => amount >= x.value); return sc ? `${sc.c}${(amount / sc.value).toFixed(2)}${sc.s}` : `šŸ’²${amount.toLocaleString()}`; }; if (isNaN(bet) || bet <= 0) return message.reply("āš ļø š—˜š—„š—„š—¢š—„: Please enter a valid bet amount! (Ex: slots 100)"); const user = await usersData.get(senderID); if (user.money < bet) return message.reply(`āŒ š—œš—”š—¦š—Øš—™š—™š—œš—–š—œš—˜š—”š—§ š—™š—Øš—”š——š—¦: You need ${formatMoney(bet - user.money)} more to play!`); const symbols = [ { e: "šŸ’–", w: 30 }, { e: "šŸ’˜", w: 25 }, { e: "šŸ’", w: 20 }, { e: "šŸ’ž", w: 15 }, { e: "šŸ’“", w: 7 }, { e: "šŸ’Ž", w: 3 } ]; const roll = () => { const tot = symbols.reduce((s, x) => s + x.w, 0); let r = Math.random() * tot; for (const x of symbols) { if (r < x.w) return x.e; r -= x.w; } return symbols[0].e; }; const [s1, s2, s3] = [roll(), roll(), roll()]; let winnings = 0, outcome, winType = "", bonus = ""; if (s1 === "šŸ’Ž" && s2 === "šŸ’Ž" && s3 === "šŸ’Ž") { winnings = bet * 10; outcome = "šŸ”„ š—Øš—Ÿš—§š—œš— š—”š—§š—˜ š——š—œš—”š— š—¢š—”š—— š—š—”š—–š—žš—£š—¢š—§!"; winType = "šŸ‘‘ š—Ÿš—˜š—šš—˜š—”š——š—”š—„š—¬ š—Ŗš—œš—”"; bonus = "šŸŽ† +3% Balance Bonus Added!"; await usersData.set(senderID, { money: user.money * 1.03 }); } else if (s1 === s2 && s2 === s3) { winnings = bet * 5; outcome = "🌟 š—š—”š—–š—žš—£š—¢š—§! 3 Matching Hearts!"; winType = "šŸ’Ž š—•š—œš—š š—Ŗš—œš—”"; } else if (s1 === s2 || s2 === s3 || s1 === s3) { winnings = bet * 2; outcome = "✨ 2 Matching Hearts!"; winType = "⚔ š—šš—¢š—¢š—— š—Ŗš—œš—”"; } else if (Math.random() < 0.5) { winnings = bet * 1.5; outcome = "šŸŽÆ Lucky Love Spin Win!"; winType = "šŸ€ š—¦š— š—”š—Ÿš—Ÿ š—Ŗš—œš—”"; } else { winnings = -bet; outcome = "šŸ’” Heartbroken! Better Luck Next Time!"; winType = "ā˜ ļø š—Ÿš—¢š—¦š—¦"; } await usersData.set(senderID, { money: user.money + winnings }); const finalBal = user.money + winnings; const slotBox = `╭────────────────╮\n│ šŸ’ [ ${s1} ✦ ${s2} ✦ ${s3} ] šŸ’ │\n╰────────────────╯`; const resText = winnings >= 0 ? `🟢 šŸ† š—Ŗš—¢š—”: +${formatMoney(winnings)}` : `šŸ”“ šŸ’ø š—Ÿš—¢š—¦š—§: -${formatMoney(bet)}`; return message.reply(`${slotBox}\n\nšŸŽÆ ${outcome}\n${winType ? `šŸ”„ ${winType}\n` : ""}${bonus ? `${bonus}\n` : ""}\n${resText}\nšŸ’³ š—•š—”š—Ÿš—”š—”š—–š—˜: ${formatMoney(finalBal)}`); } };