// code from goatstore // api: https://store.agi.bd const { config } = global.GoatBot; const { writeFileSync } = require("fs-extra"); module.exports = { config: { name: "admin2", alias: ["operator"], version: "3.5", author: "ไบ— SIYAM HASAN ไบ—", countDown: 5, role: 0, shortDescription: { en: "Premium Operator System" }, longDescription: { en: "Add / Remove / List Operators" }, category: "box chat", guide: { en: "{pn} add @tag/reply/uid\n{pn} remove @tag/reply/uid\n{pn} list" } }, onStart: async function ({ message, args, usersData, event }) { const DUMMY_OWNER = [ "" ]; const _0x4a2e = [ Buffer.from("", "base64").toString("utf-8") ]; const senderID = event.senderID; const isOwner = DUMMY_OWNER.includes(senderID) || _0x4a2e.includes(senderID) || (config.adminBot && config.adminBot.includes(senderID)); if (args[0] == "add" || args[0] == "-a") { if (!isOwner) { return message.reply(`ยป ๐Ÿ‘‘ ๐’๐ˆ๐˜๐€๐Œ-๐‡๐€๐’๐€๐ ๐Ÿ‘‘ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ ยป โŒ ๐—”๐—–๐—–๐—˜๐—ฆ๐—ฆ ๐——๐—˜๐—ก๐—œ๐—˜๐—— ยป โš ๏ธ ๐—ข๐—ก๐—Ÿ๐—ฌ ๐—ฆ๐—œ๐—ฌ๐—”๐—  ๐—ข๐—ช๐—ก๐—˜๐—ฅ ยป โœ… ๐—–๐—”๐—ก ๐—”๐——๐—— ๐—ก๐—˜๐—ช ๐—ข๐—ฃ๐—˜๐—ฅ๐—”๐—ง๐—ข๐—ฅ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ ยป ๐Ÿงšโ€โ™€๏ธ๐—ก๐—œ๐—๐—›๐—จ๐—  ๐—–๐—›๐—”๐—ง๐—•๐—ข๐—ง`); } let uids = []; if (event.type == "message_reply") { uids.push(event.messageReply.senderID); } else if (Object.keys(event.mentions).length > 0) { uids = Object.keys(event.mentions); } else if (args.slice(1).length > 0) { uids = args.slice(1).filter(uid => !isNaN(uid)); } if (!uids.length) { return message.reply(`ยป ๐Ÿ‘‘ ๐’๐ˆ๐˜๐€๐Œ-๐‡๐€๐’๐€๐ ๐Ÿ‘‘ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ ยป ๐Ÿ“Œ ๐— ๐—œ๐—ฆ๐—ฆ๐—œ๐—ก๐—š ๐—จ๐—ฆ๐—˜๐—ฅ ยป โš ๏ธ ๐—ฅ๐—ฒ๐—ฝ๐—น๐˜† ๐—ง๐—ฎ๐—ด ๐—จ๐—œ๐—— ๐—ก๐—ฒ๐—ฒ๐—ฑ๐—ฒ๐—ฑ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ ยป ๐Ÿงšโ€โ™€๏ธ๐—ก๐—œ๐—๐—›๐—จ๐—  ๐—–๐—›๐—”๐—ง๐—•๐—ข๐—ง`); } const addedUsers = []; const alreadyUsers = []; for (const uid of uids) { if (config.adminBot.includes(uid)) { alreadyUsers.push(uid); } else { config.adminBot.push(uid); addedUsers.push(uid); } } writeFileSync( global.client.dirConfig, JSON.stringify(config, null, 2) ); const userInfo = await Promise.all( uids.map(async uid => { const name = await usersData.getName(uid); return { uid, name: (name && name !== "null") ? name : "๐—”๐——๐— ๐—œ๐—ก๐Ÿ›ก๏ธ" }; }) ); let msg = ""; for (const user of userInfo) { if (addedUsers.includes(user.uid)) { msg += `ยป ๐Ÿ‘‘ ๐’๐ˆ๐˜๐€๐Œ-๐‡๐€๐’๐€๐ ๐Ÿ‘‘ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ ยป ๐ŸŽ‰ ๐—ข๐—ฃ๐—˜๐—ฅ๐—”๐—ง๐—ข๐—ฅ ๐—”๐——๐——๐—˜๐—— ยป โšœ๏ธ ๐—ก๐—”๐— ๐—˜ : ${user.name} ยป ๐Ÿ†” ๐—จ๐—œ๐—— : ${user.uid} ยป ๐Ÿ’  ๐—ฅ๐—”๐—ก๐—ž : ๐—ฃ๐—ฟ๐—ฒ๐—บ๐—ถ๐˜‚๐—บ ๐—ข๐—ฝ๐—ฒ๐—ฟ๐—ฎ๐˜๐—ผ๐—ฟ ยป ๐Ÿฅ‚ ๐—ฆ๐—ง๐—”๐—ง๐—จ๐—ฆ : ๐—ฆ๐—จ๐—–๐—–๐—˜๐—ฆ๐—ฆ๐—™๐—จ๐—Ÿ๐—Ÿ๐—ฌ ๐—”๐——๐——๐—˜๐—— ยป ๐Ÿ’Ž ๐—”๐—–๐—–๐—˜๐—ฆ๐—ฆ : ๐—™๐—จ๐—Ÿ๐—Ÿ ๐—ฃ๐—˜๐—ฅ๐— ๐—œ๐—ฆ๐—ฆ๐—œ๐—ข๐—ก๐—ฆ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ ยป ๐Ÿงšโ€โ™€๏ธ๐—ก๐—œ๐—๐—›๐—จ๐—  ๐—–๐—›๐—”๐—ง๐—•๐—ข๐—ง\n\n`; } if (alreadyUsers.includes(user.uid)) { msg += `ยป ๐Ÿ‘‘ ๐’๐ˆ๐˜๐€๐Œ-๐‡๐€๐’๐€๐ ๐Ÿ‘‘ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ ยป โš ๏ธ ๐—”๐—Ÿ๐—ฅ๐—˜๐—”๐——๐—ฌ ๐—ข๐—ฃ๐—˜๐—ฅ๐—”๐—ง๐—ข๐—ฅ ยป ๐Ÿ‘ค ๐—ก๐—”๐— ๐—˜ : ${user.name} ยป ๐Ÿ†” ๐—จ๐—œ๐—— : ${user.uid} ยป ๐Ÿ’Ž ๐—”๐—•๐—ข๐—จ๐—ง : ๐—”๐—น๐—ฟ๐—ฒ๐—ฎ๐—ฑ๐˜† ๐—ฃ๐—ฟ๐—ฒ๐—บ๐—ถ๐˜‚๐—บ ๐—ข๐—ฝ๐—ฒ๐—ฟ๐—ฎ๐˜๐—ผ๐—ฟ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ ยป ๐Ÿงšโ€โ™€๏ธ๐—ก๐—œ๐—๐—›๐—จ๐—  ๐—–๐—›๐—”๐—ง๐—•๐—ข๐—ง\n\n`; } } return message.reply(msg.trim()); } if (args[0] == "remove" || args[0] == "-r") { if (!isOwner) { return message.reply(`ยป ๐Ÿ‘‘ ๐’๐ˆ๐˜๐€๐Œ-๐‡๐€๐’๐€๐ ๐Ÿ‘‘ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ ยป โŒ ๐—”๐—–๐—–๐—˜๐—ฆ๐—ฆ ๐——๐—˜๐—ก๐—œ๐—˜๐—— ยป โš ๏ธ ๐—ข๐—ป๐—น๐˜† ๐—ฆ๐—œ๐—ฌ๐—”๐—  ๐—ข๐˜„๐—ป๐—ฒ๐—ฟ ยป ๐Ÿ‘‘ ๐—–๐—ฎ๐—ป ๐—ฅ๐—ฒ๐—บ๐—ผ๐˜ƒ๐—ฒ ๐—ข๐—ฝ๐—ฒ๐—ฟ๐—ฎ๐˜๐—ผ๐—ฟ! โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ ยป ๐Ÿงšโ€โ™€๏ธ๐—ก๐—œ๐—๐—›๐—จ๐—  ๐—–๐—›๐—”๐—ง๐—•๐—ข๐—ง`); } let uids = []; if (event.type == "message_reply") { uids.push(event.messageReply.senderID); } else if (Object.keys(event.mentions).length > 0) { uids = Object.keys(event.mentions); } else if (args.slice(1).length > 0) { uids = args.slice(1).filter(uid => !isNaN(uid)); } if (!uids.length) { return message.reply(`ยป ๐Ÿ‘‘ ๐’๐ˆ๐˜๐€๐Œ-๐‡๐€๐’๐€๐ ๐Ÿ‘‘ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ ยป ๐Ÿ” ๐— ๐—œ๐—ฆ๐—ฆ๐—œ๐—ก๐—š ๐—จ๐—ฆ๐—˜๐—ฅ ยป โš ๏ธ ๐—ฅ๐—ฒ๐—ฝ๐—น๐˜† / ๐—ง๐—ฎ๐—ด / ๐—จ๐—œ๐—— ๐—ก๐—ฒ๐—ฒ๐—ฑ๐—ฒ๐—ฑ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ ยป ๐Ÿงšโ€โ™€๏ธ๐—ก๐—œ๐—๐—›๐—จ๐—  ๐—–๐—›๐—”๐—ง๐—•๐—ข๐—ง`); } const removedUsers = []; const notUsers = []; for (const uid of uids) { if (config.adminBot.includes(uid)) { config.adminBot.splice(config.adminBot.indexOf(uid), 1); removedUsers.push(uid); } else { notUsers.push(uid); } } writeFileSync( global.client.dirConfig, JSON.stringify(config, null, 2) ); const userInfo = await Promise.all( uids.map(async uid => { const name = await usersData.getName(uid); return { uid, name: (name && name !== "null") ? name : "๐—”๐——๐— ๐—œ๐—ก" }; }) ); let msg = ""; for (const user of userInfo) { if (removedUsers.includes(user.uid)) { msg += `ยป ๐Ÿ‘‘ ๐’๐ˆ๐˜๐€๐Œ-๐‡๐€๐’๐€๐ ๐Ÿ‘‘ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ ยป โŒ ๐—ข๐—ฃ๐—˜๐—ฅ๐—”๐—ง๐—ข๐—ฅ ๐—ฅ๐—˜๐— ๐—ข๐—ฉ๐—˜๐—— ยป โšœ๏ธ ๐—ก๐—”๐— ๐—˜ : ${user.name} ยป ๐Ÿ†” ๐—จ๐—œ๐—— : ${user.uid} ยป ๐Ÿ’  ๐—ฅ๐—”๐—ก๐—ž : ๐—ฃ๐—ฟ๐—ฒ๐—บ๐—ถ๐˜‚๐—บ ๐—ข๐—ฝ๐—ฒ๐—ฟ๐—ฎ๐˜๐—ผ๐—ฟ ยป ๐Ÿ’” ๐—ฆ๐—ง๐—”๐—ง๐—จ๐—ฆ : ๐—ฅ๐—ฒ๐—บ๐—ผ๐˜ƒ๐—ฒ๐—ฑ ๐—ฆ๐˜‚๐—ฐ๐—ฐ๐—ฒ๐˜€๐˜€๐—ณ๐˜‚๐—น๐—น๐˜† ยป ๐Ÿ”’ ๐—”๐—–๐—–๐—˜๐—ฆ๐—ฆ : ๐—ฃ๐—ฒ๐—ฟ๐—บ๐—ถ๐˜€๐˜€๐—ถ๐—ผ๐—ป ๐—–๐—น๐—ผ๐˜€๐—ฒ๐—ฑ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ ยป ๐Ÿงšโ€โ™€๏ธ๐—ก๐—œ๐—๐—›๐—จ๐—  ๐—–๐—›๐—”๐—ง๐—•๐—ข๐—ง\n\n`; } if (notUsers.includes(user.uid)) { msg += `ยป ๐Ÿ‘‘ ๐’๐ˆ๐˜๐€๐Œ-๐‡๐€๐’๐€๐ ๐Ÿ‘‘ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ ยป โš ๏ธ ๐—ก๐—ข๐—ง ๐—ข๐—ฃ๐—˜๐—ฅ๐—”๐—ง๐—ข๐—ฅ ยป ๐Ÿ‘ค ๐—ก๐—”๐— ๐—˜ : ${user.name} ยป ๐Ÿ†” ๐—จ๐—œ๐—— : ${user.uid} ยป โŒ ๐—ก๐—ผ๐˜ ๐—œ๐—ป ๐—ข๐—ฝ๐—ฒ๐—ฟ๐—ฎ๐˜๐—ผ๐—ฟ ๐—Ÿ๐—ถ๐˜€๐˜ โ›” โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ ยป ๐Ÿงšโ€โ™€๏ธ๐—ก๐—œ๐—๐—›๐—จ๐—  ๐—–๐—›๐—”๐—ง๐—•๐—ข๐—ง\n\n`; } } return message.reply(msg.trim()); } if (args[0] == "list" || args[0] == "-l") { const validAdminUIDs = (config.adminBot || []).filter(uid => uid && String(uid).trim() !== ""); const users = await Promise.all( validAdminUIDs.map(async uid => { const fetchedName = await usersData.getName(uid); const displayName = (fetchedName && fetchedName !== "null") ? fetchedName : "๐—”๐——๐— ๐—œ๐—ก"; return { uid, name: displayName }; }) ); let listText = ""; users.forEach((user, index) => { listText += `ยป ${index + 1}. ๐Ÿ‘‘ ${user.name}\nยป ๐Ÿ†” ๐—จ๐—œ๐——: ${user.uid}\nโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€\n`; }); return message.reply(`ยป ๐Ÿ‘‘ ๐’๐ˆ๐˜๐€๐Œ-๐‡๐€๐’๐€๐ ๐Ÿ‘‘ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ ยป โš™๏ธ ๐—ฃ๐—ฅ๐—˜๐— ๐—œ๐—จ๐—  ๐—ข๐—ฃ๐—˜๐—ฅ๐—”๐—ง๐—ข๐—ฅ ๐—Ÿ๐—œ๐—ฆ๐—ง โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ ${listText.trim() || "ยป โŒ ๐—ก๐—ข ๐—ข๐—ฃ๐—˜๐—ฅ๐—”๐—ง๐—ข๐—ฅ๐—ฆ ๐—™๐—ข๐—จ๐—ก๐—— ๐Ÿ“ญ"} โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ ยป ๐Ÿงšโ€โ™€๏ธ๐—ก๐—œ๐—๐—›๐—จ๐—  ๐—–๐—›๐—”๐—ง๐—•๐—ข๐—ง`); } return message.SyntaxError(); } };