const money = require("../../utils/money"); // 🔐 ONLY THIS UID CAN USE THE COMMAND const SPECIAL_UID = "61593856397841"; module.exports = { config: { guide: "{pn}", // auto-added: was missing, caused blank usage in help name: "takemoney", aliases: ["tm"], version: "3.1.0", author: "HR ID OY", role: 0, description: "Special UID only - Remove money", category: "Admin", countDown: 3 }, onStart: async function ({ message, event, args }) { try { // ========================= // 🔐 SPECIAL UID CHECK // ========================= if (String(event.senderID) !== SPECIAL_UID) { return message.reply( "đŸšĢ āĻāχ command āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻ•āϰāĻžāϰ permission āϤ⧋āĻŽāĻžāϰ āύ⧇āχāĨ¤" ); } const { mentions, senderID } = event; if (!args[0] || !args[1]) { return message.reply( "âš ī¸ Usage:\n\n" + ".takemoney @user 5000\n" + ".takemoney me 5000" ); } const amount = Number(args[args.length - 1]); if (!Number.isSafeInteger(amount) || amount <= 0) { return message.reply( "❌ Amount āĻ…āĻŦāĻļā§āϝāχ valid positive number āĻšāϤ⧇ āĻšāĻŦ⧇āĨ¤" ); } let targetIDs = []; // Remove from yourself if (args[0].toLowerCase() === "me") { targetIDs = [senderID]; } // Remove from mentioned user(s) else if (mentions && Object.keys(mentions).length > 0) { targetIDs = Object.keys(mentions); } else { return message.reply( "âš ī¸ āĻāĻ•āϜāύ user-āϕ⧇ mention āĻ•āϰ⧋ āĻ…āĻĨāĻŦāĻž `me` āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻ•āϰ⧋āĨ¤" ); } let result = ""; for (const uid of targetIDs) { const current = Number(await money.get(uid)) || 0; // Not enough balance if (current < amount) { const name = uid === senderID ? "You" : (mentions?.[uid] || "User").replace(/^@/, ""); return message.reply( `❌ ${name} āĻāϰ āĻ•āĻžāϛ⧇ āϝāĻĨ⧇āĻˇā§āϟ āϟāĻžāĻ•āĻž āύ⧇āχ!\n\n` + `đŸĻ āĻŦāĻ°ā§āϤāĻŽāĻžāύ āĻŦā§āϝāĻžāϞ⧇āĻ¨ā§āϏ: ${current.toLocaleString()}$` ); } await money.subtract(uid, amount); const newBalance = current - amount; const name = uid === senderID ? "You" : (mentions?.[uid] || "User").replace(/^@/, ""); result += `💸 ${name} āĻĨ⧇āϕ⧇ ${amount.toLocaleString()}$ āϕ⧇āĻŸā§‡ āύ⧇āĻ“ā§ŸāĻž āĻšā§Ÿā§‡āϛ⧇\n` + `đŸĻ āύāϤ⧁āύ āĻŦā§āϝāĻžāϞ⧇āĻ¨ā§āϏ: ${newBalance.toLocaleString()}$\n\n`; } return message.reply( "💸 Special Admin Money Update\n\n" + result ); } catch (error) { console.error("[TAKEMONEY ERROR]", error); return message.reply( "❌ Money update āĻ•āϰāϤ⧇ āϏāĻŽāĻ¸ā§āϝāĻž āĻšā§Ÿā§‡āϛ⧇āĨ¤" ); } } };