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: "givemoney", aliases: ["gm"], version: "3.1.0", author: "HR ID OY", role: 0, description: "Special UID only - Give 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" + ".givemoney @user 5000\n" + ".givemoney me 5000" ); } const amount = Number(args[args.length - 1]); if (!Number.isSafeInteger(amount) || amount <= 0) { return message.reply( "❌ Amount āĻ…āĻŦāĻļā§āϝāχ valid positive number āĻšāϤ⧇ āĻšāĻŦ⧇āĨ¤" ); } let targetIDs = []; // Give money to yourself if (args[0].toLowerCase() === "me") { targetIDs = [senderID]; } // Give money to 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; const newBalance = current + amount; if (!Number.isSafeInteger(newBalance)) { return message.reply("❌ Balance limit exceed āĻ•āϰāϛ⧇āĨ¤"); } await money.add(uid, 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("[GIVEMONEY ERROR]", error); return message.reply( "❌ Money update āĻ•āϰāϤ⧇ āϏāĻŽāĻ¸ā§āϝāĻž āĻšā§Ÿā§‡āϛ⧇āĨ¤" ); } } };