// code from goatstore // api: https://store.agi.bd const axios = require("axios"); const baseApiUrl = async () => { const base = await axios.get( `https://raw.githubusercontent.com/Blankid018/D1PT0/main/baseApiUrl.json`, ); return base.data.api; }; module.exports = { config: { name: "spy", aliases: ["whoishe", "whoisshe", "whoami", "atake"], version: "1.0", role: 0, author: "Dipto", Description: "Get user information and profile photo", category: "information", countDown: 10, }, onStart: async function ({ event, message, usersData, api, args, }) { const uid1 = event.senderID; const uid2 = Object.keys(event.mentions)[0]; let uid; if (args[0]) { if (/^\d+$/.test(args[0])) { uid = args[0]; } else { const match = args[0].match(/profile\.php\?id=(\d+)/); if (match) { uid = match[1]; } } } if (!uid) { uid = event.type === "message_reply" ? event.messageReply.senderID : uid2 || uid1; } const response = await require("axios").get( `${await baseApiUrl()}/baby?list=all` ); const dataa = response.data || { teacher: { teacherList: [] } }; let babyTeach = 0; if (dataa?.teacher?.teacherList?.length) { babyTeach = dataa.teacher.teacherList.find((t) => t[uid])?.[uid] || 0; } const userInfo = await api.getUserInfo(uid); const avatarUrl = await usersData.getAvatarUrl(uid); let genderText; switch (userInfo[uid].gender) { case 1: genderText = "π™Άπš’πš›πš•πŸ™‹πŸ»β€β™€οΈ"; break; case 2: genderText = "BoyπŸ™‹πŸ»β€β™‚οΈ"; break; default: genderText = "π™ΆπšŠπš’πŸ€·πŸ»β€β™‚οΈ"; } const money = (await usersData.get(uid)).money; const allUser = await usersData.getAll(), rank = allUser.slice().sort((a, b) => b.exp - a.exp).findIndex(user => user.userID === uid) + 1, moneyRank = allUser.slice().sort((a, b) => b.money - a.money).findIndex(user => user.userID === uid) + 1; const position = userInfo[uid].type; const userInformation = ` ╭────[ 𝐔𝐒𝐄𝐑 πˆππ…πŽ ] β”œβ€£ π™½πšŠπš–πšŽ: ${userInfo[uid].name} β”œβ€£ π™ΆπšŽπš—πšπšŽπš›: ${genderText} β”œβ€£ πš„π™Έπ™³: ${uid} β”œβ€£ π™²πš•πšŠπšœπšœ: ${position ? position?.toUpperCase() : "π™½πš˜πš›πš–πšŠπš• πš„πšœπšŽπš›πŸ₯Ί"} β”œβ€£ πš„πšœπšŽπš›πš—πšŠπš–πšŽ: ${userInfo[uid].vanity ? userInfo[uid].vanity : "π™½πš˜πš—πšŽ"} β”œβ€£ π™Ώπš›πš˜πšπš’πš•πšŽ πš„πšπ™»: ${userInfo[uid].profileUrl} β”œβ€£ π™±πš’πš›πšπš‘πšπšŠπš’: ${userInfo[uid].isBirthday !== false ? userInfo[uid].isBirthday : "π™Ώπš›πš’πšŸπšŠπšπšŽ"} β”œβ€£ π™½πš’πšŒπš”π™½πšŠπš–πšŽ: ${userInfo[uid].alternateName || "π™½πš˜πš—πšŽ"} β•°β€£ π™΅πš›πš’πšŽπš—πš πš πš’πšπš‘ πš‹πš˜πš: ${userInfo[uid].isFriend ? "πšˆπšŽπšœβœ…" : "π™½πš˜βŽ"} ╭─────[ 𝐔𝐒𝐄𝐑 𝐒𝐓𝐀𝐓𝐒 ] β”œβ€£ π™Όπš˜πš—πšŽπš’: $${formatMoney(money)} β”œβ€£ πšπšŠπš—πš”: #${rank}/${allUser.length} β”œβ€£ π™Όπš˜πš—πšŽπš’ πšπšŠπš—πš”: #${moneyRank}/${allUser.length} β•°β€£ π™±πšŠπš‹πš’ πšπšŽπšŠπšŒπš‘: ${babyTeach || 0}`; message.reply({ body: userInformation, attachment: await global.utils.getStreamFromURL(avatarUrl), }); }, }; function formatMoney(num) { const units = ["", "K", "M", "B", "T", "Q", "Qi", "Sx", "Sp", "Oc", "N", "D"]; let unit = 0; while (num >= 1000 && ++unit < units.length) num /= 1000; return num.toFixed(1).replace(/\.0$/, "") + units[unit]; }