diff --git a/plugins/ai.js b/plugins/ai.js new file mode 100644 index 0000000..516ad4f --- /dev/null +++ b/plugins/ai.js @@ -0,0 +1,1138 @@ +const fs = require("fs-extra"); +const { + aitts, + smd, + prefix, + Config, + parsedJid, + sleep, +} = require("../lib"); +const axios = require("axios"); +const { send } = require("../lib"); +const fetch = require("node-fetch"); +function _0x2a0d(_0x32de74, _0xce23fd) { + const _0x3ffb1a = _0x2953(); + _0x2a0d = function (_0x151552, _0x18c062) { + _0x151552 = _0x151552 - 233; + let _0x5c396f = _0x3ffb1a[_0x151552]; + return _0x5c396f; + }; + return _0x2a0d(_0x32de74, _0xce23fd); +} +function _0x2953() { + const _0x4f0c10 = [ + "json", + "choices", + "2KTKIiW", + "application/json", + "chat", + "http://api.brainshop.ai/get?bid=175685&key=Pg8Wu8mrDQjfr0uv&uid=[", + "4017447FwUKbt", + "2673069xtYnEg", + "REMOVE_BG_KEY", + "Bearer ", + "image-alpha-001", + "320668Kzvhym", + "data", + "then", + "message", + "1548910BYiCAA", + "error in aiResponce : ", + "119490ILpvcx", + "system", + "sender", + "binary", + "from", + "log", + "dalle", + "https://api.remove.bg/v1.0/removebg", + "567277OBjzQH", + "length", + "get", + "POST", + "stringify", + "content", + "512x512", + "78qmNvDj", + "https://api.openai.com/v1/images/generations", + "Error While getting Ai responce ", + "url", + "catch", + "]&msg=[", + "split", + "8yTiNwA", + "You", + "gpt", + "1769427SEqioY", + ]; + _0x2953 = function () { + return _0x4f0c10; + }; + return _0x2953(); +} +(function (_0x4f4b4b, _0x46381a) { + const _0x23b0f7 = _0x2a0d; + const _0x17ab9c = _0x4f4b4b(); + while (true) { + try { + const _0x24d937 = + (parseInt(_0x23b0f7(264)) / 1) * (-parseInt(_0x23b0f7(241)) / 2) + + parseInt(_0x23b0f7(238)) / 3 + + -parseInt(_0x23b0f7(250)) / 4 + + (-parseInt(_0x23b0f7(256)) / 5) * (parseInt(_0x23b0f7(271)) / 6) + + (parseInt(_0x23b0f7(246)) / 7) * (parseInt(_0x23b0f7(235)) / 8) + + parseInt(_0x23b0f7(245)) / 9 + + -parseInt(_0x23b0f7(254)) / 10; + if (_0x24d937 === _0x46381a) { + break; + } else { + _0x17ab9c.push(_0x17ab9c.shift()); + } + } catch (_0x1a2819) { + _0x17ab9c.push(_0x17ab9c.shift()); + } + } +})(_0x2953, 305050); +async function aiResponce(_0x109acf, _0xf00650, _0x2728a0 = "") { + const _0x242f00 = _0x2a0d; + let _0x2d78d9 = ""; + try { + if (_0xf00650 === _0x242f00(243)) { + _0x2d78d9 = await ( + await axios[_0x242f00(266)]( + _0x242f00(244) + + _0x109acf[_0x242f00(258)][_0x242f00(234)]("@")[0] + + _0x242f00(233) + + _0x2728a0 + + "]" + ) + )[_0x242f00(251)].cnt; + } else if (_0xf00650 === _0x242f00(237)) { + const _0x3e1043 = await fetch( + "https://api.openai.com/v1/chat/completions", + { + method: "POST", + headers: { + "Content-Type": "application/json", + Authorization: _0x242f00(248) + Config.OPENAI_API_KEY, + }, + body: JSON[_0x242f00(268)]({ + model: "gpt-3.5-turbo", + messages: [ + { + role: _0x242f00(257), + content: _0x242f00(236), + }, + { + role: "user", + content: _0x2728a0, + }, + ], + }), + } + ); + const _0x26c61c = await _0x3e1043[_0x242f00(239)](); + if ( + !_0x26c61c[_0x242f00(240)] || + _0x26c61c[_0x242f00(240)][_0x242f00(265)] === 0 + ) { + _0x2d78d9 = "*Invalid ChatGPT API Key, Please Put New Key*"; + } else { + _0x2d78d9 = + _0x26c61c[_0x242f00(240)][0][_0x242f00(253)][_0x242f00(269)]; + } + } else if (_0xf00650 === _0x242f00(262)) { + const _0x1a4db1 = await fetch(_0x242f00(272), { + method: _0x242f00(267), + headers: { + "Content-Type": _0x242f00(242), + Authorization: _0x242f00(248) + Config.OPENAI_API_KEY, + }, + body: JSON[_0x242f00(268)]({ + model: _0x242f00(249), + prompt: _0x2728a0, + size: _0x242f00(270), + response_format: _0x242f00(274), + }), + }); + const _0x2cdadf = await _0x1a4db1[_0x242f00(239)](); + _0x2d78d9 = _0x2cdadf[_0x242f00(251)][0][_0x242f00(274)]; + } + if (_0xf00650 === "rmbg") { + const _0x142226 = { + image_url: _0x2728a0, + size: "auto", + }; + axios + .post(_0x242f00(263), _0x142226, { + headers: { + "X-Api-Key": Config[_0x242f00(247)], + }, + responseType: "arraybuffer", + }) + [_0x242f00(252)]((_0x18f9bd) => { + const _0x382416 = _0x242f00; + _0x2d78d9 = Buffer[_0x382416(260)]( + _0x18f9bd[_0x382416(251)], + _0x382416(259) + ); + }) + [_0x242f00(275)]((_0x25d8c1) => { + _0x2d78d9 = false; + }); + } + return _0x2d78d9; + } catch (_0x4eee67) { + console[_0x242f00(261)](_0x242f00(255), _0x4eee67); + return _0x242f00(273); + } +} +smd( + { + pattern: "rmbg", + alias: ["removebg"], + desc: "Removes the background from an image.", + category: "ai", + filename: __filename, + use: "", + }, + async (message, input) => { + try { + const url = input.trim(); + if (!url || !isValidUrl(url)) { + return await message.send("*_Please provide a valid image URL._*"); + } + + const apiUrl = `https://aemt.me/removebg?url=${encodeURIComponent(url)}`; + const response = await axios.get(apiUrl, { + headers: { + "accept": "application/json", + }, + }); + const data = response.data; + + if (!data || !data.url || !data.url.status === "true") { + return await message.reply("*Failed to remove background from the image.*"); + } + + const resultUrl = data.url.result; + const imageBuffer = await axios.get(resultUrl, { responseType: "arraybuffer" }); + const buffer = Buffer.from(imageBuffer.data, "binary"); + await message.bot.sendMessage(message.chat, { image: buffer }, { quoted: message }); + } catch (error) { + await message.error(error + "\n\nCommand: rmbg", error, "*Failed to remove background from the image.*"); + } + } +); + +function isValidUrl(url) { + try { + new URL(url); + return true; + } catch (_) { + return false; + } +} +smd( + { + pattern: "stablediffusion", + alias: ["sd"], + desc: "Generates an image using Stable Diffusion AI.", + category: "ai", + filename: __filename, + use: "", + }, + async (message, input) => { + try { + const text = input.trim(); + if (!text) { + return await message.send("*_Please provide some text to generate an image._*"); + } + + const apiUrl = `https://aemt.me/stablediffusion?text=${encodeURIComponent(text)}`; + const response = await axios.get(apiUrl, { + headers: { + "accept": "application/json", + }, + responseType: "arraybuffer", + }); + + if (!response.data) { + return await message.reply("*Failed to generate an image using Stable Diffusion AI.*"); + } + + const buffer = Buffer.from(response.data, "binary"); + await message.bot.sendMessage(message.chat, { image: buffer }, { quoted: message }); + } catch (error) { + await message.error(error + "\n\nCommand: stablediffusion", error, "*Failed to use Stable Diffusion AI.*"); + } + } +); +smd( + { + pattern: "bard", + alias: ["b"], + desc: "Generates a response from Bard AI.", + category: "ai", + filename: __filename, + use: "", + }, + async (message, input) => { + try { + const text = input.trim(); + if (!text) { + return await message.send("*_Please provide some text to generate a response._*"); + } + + const apiUrl = `https://aemt.me/bard?text=${encodeURIComponent(text)}`; + const response = await axios.get(apiUrl, { + headers: { + "accept": "application/json", + }, + }); + const data = response.data; + + if (!data || !data.status) { + return await message.reply("*Failed to generate a response from Bard AI.*"); + } + + const result = data.result; + return await message.send(`*Bard AI:* ${result}`, { quoted: message }); + } catch (error) { + await message.error(error + "\n\nCommand: bard", error, "*Failed to use Bard AI.*"); + } + } +); +smd({ + pattern: "gpt4", + category: "ai", + desc: "Chat with GPT-4 AI model", + use: "", + filename: __filename, +}, async (message, text, { cmdName }) => { + if (!text) return message.reply(`*_Please provide a query_*\n*_Example ${prefix + cmdName} What is the meaning of life?_*`); + + try { + const res = await (await fetch(`https://api.maher-zubair.tech/ai/chatgptv4?q=${text}`)).json(); + + if (!res.status === 200) return message.send("*There's a problem, try again later!*"); + + const { result } = res; + const astro = "𝘼𝙎𝙏𝘼 𝙂𝙋𝙏4\n " + const tbl = "```"; + await send(message, `${astro}${tbl}${result}${tbl}`); + } catch (e) { + return await message.error(`${e}\n\n command: ${cmdName}`, e, `*_An error occurred while processing your request_*`); + } +}); +smd({ + pattern: "gemini", + category: "ai", + desc: "Chat with Bard AI model", + use: "", + filename: __filename, +}, async (message, text, { cmdName }) => { + if (!text) return message.reply(`*_Please provide a query_*\n*_Example ${prefix + cmdName} What is the meaning of life?_*`); + + try { + const res = await (await fetch(`https://api.maher-zubair.tech/ai/gemini?q=${text}`)).json(); + + if (!res.status === 200) return message.send("*There's a problem, try again later!*"); + + const { result } = res; + const astro = "𝘼𝙎𝙏𝘼*GEMINI* 𝘼𝙄" + const tbl = "```"; + await send(message, `${astro}${tbl}${result}${tbl}`); + } catch (e) { + return await message.error(`${e}\n\n command: ${cmdName}`, e, `*_An error occurred while processing your request_*`); + } +}); +smd( + { + cmdname: "alexa", + category: "ai", + use: "[text]", + filename: __filename, + info: "chat with simsimi alexa ai!", + }, + async (_0xe6d6e, _0x23f786) => { + try { + if (!_0x23f786) { + return await _0xe6d6e.reply( + "Hi *" + _0xe6d6e.senderName + "*, do you want to talk?" + ); + } + const _0x55bb61 = { + method: "POST", + headers: { + "Content-Type": "application/x-www-form-urlencoded", + }, + body: "text=" + encodeURIComponent(_0x23f786) + "&lc=en&key=", + }; + const _0x5099c8 = await fetch( + "https://api.simsimi.vn/v2/simtalk", + _0x55bb61 + ); + const _0x2c3e12 = await _0x5099c8.json(); + if (_0x2c3e12.status === "200" && _0x2c3e12.message) { + _0xe6d6e.reply(_0x2c3e12.message); + } else { + _0xe6d6e.reply("*No Responce!*"); + } + } catch (_0xfee6e3) { + await _0xe6d6e.error( + _0xfee6e3 + "\n\ncommand : poetry", + _0xfee6e3, + false + ); + } + } +); +smd( + { + pattern: "chat", + desc: "chat with an AI", + category: "ai", + use: "", + filename: __filename, + }, + async (_0x1c0160, _0x482db1) => { + try { + return _0x1c0160.reply(await aiResponce(_0x1c0160, "chat", _0x482db1)); + } catch (_0x4adf95) { + await _0x1c0160.error( + _0x4adf95 + "\n\ncommand: chat", + _0x4adf95, + "*_no responce from chatbot, sorry!!_*" + ); + } + } +); +smd( + { + pattern: "gpt", + desc: "chat with an AI", + category: "ai", + use: "", + filename: __filename, + }, + async (_0x5cb388, _0x302ad5) => { + try { + try { + let _0x557719 = _0x302ad5 ? _0x302ad5 : bot.reply_text; + if (!_0x557719) { + return man.reply("Provide me a query ex Who is Astro"); + } + const _0x50c8d3 = await fetch( + "https://aemt.me/openai?text=" + _0x557719 + ); + const _0x14c9d6 = await _0x50c8d3.json(); + if (_0x14c9d6 && _0x14c9d6.status && _0x14c9d6.result) { + return await _0x5cb388.reply(_0x14c9d6.result); + } + } catch {} + if ( + Config.OPENAI_API_KEY == "" || + !Config.OPENAI_API_KEY || + !("" + Config.OPENAI_API_KEY).startsWith("sk") + ) { + return _0x5cb388.reply( + "```You Dont Have OPENAI API KEY \nPlease Create OPEN API KEY from Given Link \nhttps://platform.openai.com/account/api-keys\nAnd Set Key in Heroku OPENAI_API_KEY Var```" + ); + } + if (!_0x302ad5) { + return _0x5cb388.reply( + "Hey there! " + + _0x5cb388.senderName + + ". How are you doing these days?" + ); + } + return _0x5cb388.send(await aiResponce(_0x5cb388, "gpt", _0x302ad5)); + } catch (_0x2ef914) { + await _0x5cb388.error( + _0x2ef914 + "\n\ncommand: gpt", + _0x2ef914, + "*_no responce from chatgpt, sorry!!_*" + ); + } + } +); +smd( + { + pattern: "fgpt", + desc: "chat with an AI", + category: "ai", + use: "", + filename: __filename, + }, + async (_0x42b3b8, _0x3f3887) => { + try { + let _0x1b0897 = _0x3f3887 ? _0x3f3887 : _0x42b3b8.reply_text; + if (!_0x1b0897) { + return _0x42b3b8.reply("Provide me a query ex Who is Astro"); + } + const _0x4c275e = await fetch("https://aemt.me/openai?text=" + _0x1b0897); + const _0x4743c3 = await _0x4c275e.json(); + if (_0x4743c3 && _0x4743c3.status && _0x4743c3.result) { + return await _0x42b3b8.send(_0x4743c3.result); + } else { + await _0x42b3b8.send("*_Error while getting gpt responce!!_*"); + } + } catch (_0x70fc81) { + await _0x42b3b8.error( + _0x70fc81 + "\n\ncommand: fgpt", + _0x70fc81, + "*_no responce from chatgpt, sorry!!_*" + ); + } + } +); +smd( + { + pattern: "dalle", + alias: ["dall", "dall-e"], + desc: "chat with an AI", + category: "ai", + use: "", + filename: __filename, + }, + async (_0x21be87, _0x17d498) => { + try { + if (!_0x17d498) { + return await _0x21be87.reply( + "*Give Me A Query To Get Dall-E Reponce?*" + ); + } + const _0x27bd9a = + "https://gurugpt.cyclic.app/dalle?prompt=" + + encodeURIComponent(_0x17d498); + try { + return await _0x21be87.bot.sendMessage(_0x21be87.chat, { + image: { + url: _0x27bd9a, + }, + caption: + "[PROMPT]: ```" + _0x17d498 + " ``` \n " + Config.caption + " ", + }); + } catch (_0x5cee92) { + console.log("ERROR IN DALLE RESPONCE FROM API GURUGPT\n", _0x5cee92); + } + if ( + Config.OPENAI_API_KEY == "" || + !Config.OPENAI_API_KEY || + !("" + Config.OPENAI_API_KEY).startsWith("sk") + ) { + return _0x21be87.reply( + "```You Dont Have OPENAI API KEY \nPlease Create OPEN API KEY from Given Link \nhttps://platform.openai.com/account/api-keys\nAnd Set Key in Heroku OPENAI_API_KEY Var```" + ); + } + return await _0x21be87.bot.sendMessage(_0x21be87.chat, { + image: { + url: await aiResponce(_0x21be87, "dalle", _0x17d498), + }, + caption: "*---Your DALL-E Result---*\n" + Config.caption, + }); + } catch (_0x25b4b9) { + await _0x21be87.error( + _0x25b4b9 + "\n\ncommand: dalle", + _0x25b4b9, + "*_No responce from Dall-E Ai, Sorry!!_*" + ); + } + } +); +smd( + { + pattern: "imagine", + alias: ["imagin"], + desc: "chat with an AI", + category: "ai", + use: "", + filename: __filename, + }, + async (_0x9bac01, _0x3700d4) => { + try { + let _0x2968fd = _0x3700d4 || _0x9bac01.reply_text; + if (!_0x2968fd) { + return await _0x9bac01.reply("*Give Me A Query To Get imagination?*"); + } + let _0x24d5e9 = false; + try { + const _0x156dd7 = await fetch( + "https://aemt.me/openai?text=" + + (_0x2968fd + + " \nNOTE: Make sure to looks like imagination, make it short and concise, also in english!") + ); + const _0x49b22e = await _0x156dd7.json(); + _0x24d5e9 = + _0x49b22e && _0x49b22e.status && _0x49b22e.result + ? _0x49b22e.result + : ""; + } catch (_0xf1623a) { + _0x24d5e9 = false; + } + try { + await Draw(_0x2968fd || _0x9bac01.reply_text).then((_0x1f03a3) => { + _0x9bac01.bot.sendMessage(_0x9bac01.chat, { + image: _0x1f03a3, + caption: + "*[IMAGININATION]:* ```" + + _0x2968fd + + " ```" + + (_0x24d5e9 + ? "\n\n*[RESPONCE]:* ```" + _0x24d5e9 + "``` \n" + : "") + + " \n " + + Config.caption + + " ", + }); + }); + return; + } catch (_0x45726b) { + console.log("ERROR IN IMAGINE RESPONCE FROM IMAGINE API n", _0x45726b); + } + if ( + Config.OPENAI_API_KEY == "" || + !Config.OPENAI_API_KEY || + !("" + Config.OPENAI_API_KEY).startsWith("sk") + ) { + return _0x9bac01.reply( + "```You Dont Have OPENAI API KEY \nPlease Create OPEN API KEY from Given Link \nhttps://platform.openai.com/account/api-keys\nAnd Set Key in Heroku OPENAI_API_KEY Var```" + ); + } + return await _0x9bac01.bot.sendMessage(_0x9bac01.chat, { + image: { + url: await aiResponce(_0x9bac01, "dalle", _0x2968fd), + }, + caption: "*---Your DALL-E Result---*\n" + Config.caption, + }); + } catch (_0x5d8080) { + await _0x9bac01.error( + _0x5d8080 + "\n\ncommand: imagine", + _0x5d8080, + "*_No responce from Server side, Sorry!!_*" + ); + } + } +); +smd( + { + pattern: "imagine2", + alias: ["imagin2"], + desc: "chat with an AI", + category: "ai", + use: "", + filename: __filename, + }, + async (_0x39716c, _0xe79cfd) => { + try { + let _0x5e79d4 = _0xe79cfd || _0x39716c.reply_text; + if (!_0x5e79d4) { + return await _0x39716c.reply("*Give Me A Query To Get imagination?*"); + } + const _0x14515f = + "https://gurugpt.cyclic.app/dalle?prompt=" + + encodeURIComponent( + _0x5e79d4 + " \nNOTE: Make sure to looks like imagination" + ); + let _0x5d0b6a = false; + try { + const _0x37057d = await fetch( + "https://aemt.me/openai?text=" + + (_0x5e79d4 + + " \nNOTE: Make sure to looks like imagination, make it short and concise, also in english!") + ); + const _0x644785 = await _0x37057d.json(); + _0x5d0b6a = + _0x644785 && _0x644785.status && _0x644785.result + ? _0x644785.result + : ""; + } catch (_0x3ecac9) { + _0x5d0b6a = false; + } + try { + return await _0x39716c.bot.sendMessage(_0x39716c.chat, { + image: { + url: _0x14515f, + }, + caption: + "*[IMAGININATION]:* ```" + + _0x5e79d4 + + " ```" + + (_0x5d0b6a ? "\n\n*[RESPONCE]:* ```" + _0x5d0b6a + "``` \n" : "") + + " \n " + + Config.caption + + " ", + }); + } catch (_0x484392) { + console.log("ERROR IN IMAGINE RESPONCE FROM API GURUGPT\n", _0x484392); + } + if ( + Config.OPENAI_API_KEY == "" || + !Config.OPENAI_API_KEY || + !("" + Config.OPENAI_API_KEY).startsWith("sk") + ) { + return _0x39716c.reply( + "```You Dont Have OPENAI API KEY \nPlease Create OPEN API KEY from Given Link \nhttps://platform.openai.com/account/api-keys\nAnd Set Key in Heroku OPENAI_API_KEY Var```" + ); + } + return await _0x39716c.bot.sendMessage(_0x39716c.chat, { + image: { + url: await aiResponce(_0x39716c, "dalle", _0x5e79d4), + }, + caption: "*---Your DALL-E Result---*\n" + Config.caption, + }); + } catch (_0x110b5d) { + await _0x39716c.error( + _0x110b5d + "\n\ncommand: imagine", + _0x110b5d, + "*_No responce from Server side, Sorry!!_*" + ); + } + } +); +async function Draw(_0x3ab488) { + const _0x54c8a4 = await fetch( + "https://api-inference.huggingface.co/models/prompthero/openjourney-v2", + { + method: "POST", + headers: { + "content-type": "application/json", + Authorization: "Bearer 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", + }, + body: JSON.stringify({ + inputs: _0x3ab488, + }), + } + ).then((_0x5838c2) => _0x5838c2.blob()); + const _0x1c59a6 = await _0x54c8a4.arrayBuffer(); + return Buffer.from(_0x1c59a6); +} +smd( + { + pattern: "aitts", + desc: "Text to Voice Using Eleven Lab Ai", + category: "ai", + use: "", + filename: __filename, + }, + async (_0x1a01af, _0x1ac85a) => { + await aitts(_0x1a01af, _0x1ac85a || _0x1a01af.reply_text); + } +); +const astro_patch_AnonyMsg = {}; +let isAnnonyMsgAlive = ""; +let cmdName = "rcg"; +class AnonymousMsg { + constructor() { + this.id = ""; + this.sender = ""; + this.reciever = ""; + this.senderMsg = ""; + this.tellinfo = 0; + this.howmanyreply = 0; + } +} +smd( + { + pattern: "anonymsg", + alias: ["recognition", "anonychat"], + desc: "Send message Annonymously", + category: "ai", + use: "", + filename: __filename, + }, + async (_0x358984, _0x20693a, { smd: _0x12d243 }) => { + try { + let _0x32512b = _0x20693a ? _0x20693a : _0x358984.reply_text; + if (!_0x32512b) { + return await _0x358984.send( + "*provide number with msg to send Anonymously.* \n*Example " + + (prefix + _0x12d243) + + " 2348039607375,your_Message*", + {}, + "", + _0x358984 + ); + } + if (_0x358984.isCreator && _0x32512b === "info") { + return await _0x358984.reply( + isAnnonyMsgAlive == "" + ? "*Theres no Anonymous Chat created yet*" + : "*Anonymous Chat Recivers*\n_" + isAnnonyMsgAlive + "_" + ); + } + const _0x201d91 = _0x32512b.indexOf(","); + if (_0x201d91 === -1) { + return await _0x358984.reply( + "*Invalid format. Please provide both number and Message separated by a comma.*" + ); + } + let _0x12e2ef = _0x32512b.slice(0, _0x201d91).trim() + "@s.whatsapp.net"; + let _0x5f656f = _0x32512b.slice(_0x201d91 + 1).trim(); + let _0x48975a = (await parsedJid(_0x12e2ef)) || []; + if (_0x48975a[0]) { + const { date: _0xbcd286, time: _0x47ad13 } = await getDateTime(); + const _0x3e1b1c = + "anony-msg-" + Math.floor(100000 + Math.random() * 900000); + astro_patch_AnonyMsg[_0x3e1b1c] = new AnonymousMsg(); + let _0x3079e2 = astro_patch_AnonyMsg[_0x3e1b1c]; + _0x3079e2.id = _0x3e1b1c; + _0x3079e2.sender = _0x358984.sender; + _0x3079e2.reciever = _0x48975a[0]; + _0x3079e2.msgStatus = true; + _0x3079e2.senderMsg = _0x358984; + _0x5f656f = + "*ᴀsᴛᴀ-ᴍᴅ • ᴀɴɴᴏɴʏᴍᴏᴜs ᴍsɢ*\n\n*Msg_Id:* " + + _0x3079e2.id + + "\n*Date:* _" + + _0xbcd286 + + "_\n*Time:* _" + + _0x47ad13 + + "_\n\n*Message:* " + + _0x5f656f + + "\n\n\n" + + Config.caption; + isAnnonyMsgAlive = isAnnonyMsgAlive + "," + _0x3079e2.reciever; + await _0x358984.bot.sendMessage(_0x3079e2.reciever, { + text: _0x5f656f, + }); + return await _0x358984.reply("*_Anonymous message sent succesfully_*"); + } else { + return await _0x358984.reply("*_Provided number is not valid!!!_*"); + } + } catch (_0x51ed58) { + await _0x358984.error( + _0x51ed58 + "\n\ncommand: " + _0x12d243, + _0x51ed58, + "*_Can't send annonymously message yet, Sorry!!_*" + ); + } + } +); +smd( + { + on: "text", + }, + async (_0x2acf30) => { + try { + if ( + _0x2acf30.quoted && + isAnnonyMsgAlive.includes(_0x2acf30.sender) && + _0x2acf30.text.length > 2 + ) { + const _0x2dfb59 = _0x2acf30.reply_text.split("\n"); + if (_0x2dfb59.length < 3) { + return; + } + if ( + _0x2acf30.reply_text.includes("ᴀsᴛᴀ-ᴍᴅ • ᴀɴɴᴏɴʏᴍᴏᴜs ᴍsɢ") && + _0x2dfb59[0].includes("ᴀsᴛᴀ-ᴍᴅ • ᴀɴɴᴏɴʏᴍᴏᴜs ᴍsɢ") && + _0x2dfb59[2].includes("Msg_Id") + ) { + let _0x1b0d01 = "" + _0x2dfb59[2].replace("*Msg_Id:* ", "").trim(); + let _0x2ecd2a = astro_patch_AnonyMsg[_0x1b0d01]; + if (!_0x2ecd2a) { + return; + } + try { + if (_0x2ecd2a) { + let _0x13a11c = _0x2acf30.text.split(",")[0].trim(); + if (_0x13a11c.toLowerCase().startsWith("reply")) { + _0x2ecd2a.howmanyreply += 1; + const _0x5a2204 = _0x2acf30.text.indexOf(","); + let _0x3f6b59 = + "*ᴀsᴛᴀ-ᴍᴅ • ʏᴏᴜʀ ᴀɴᴏɴʏ-ᴍsɢ ʀᴇᴘʟʏ*\n\n*_From @" + + _0x2ecd2a.reciever.split("@")[0] + + "_*\n*_Msg_Id: " + + _0x2ecd2a.id + + "_*\n\n*Message:* " + + _0x2acf30.text.slice(_0x5a2204 + 1).trim() + + "\n\n\n\n" + + Config.caption; + if (_0x2ecd2a.howmanyreply >= 2) { + isAnnonyMsgAlive = isAnnonyMsgAlive.replace( + "," + _0x2acf30.sender, + "" + ); + } + await _0x2acf30.bot.sendMessage( + _0x2ecd2a.sender, + { + text: _0x3f6b59, + mentions: [_0x2ecd2a.reciever], + }, + { + quoted: _0x2ecd2a.senderMsg, + } + ); + if (_0x2ecd2a.howmanyreply >= 2) { + isAnnonyMsgAlive = isAnnonyMsgAlive.replace( + "," + _0x2acf30.sender, + "" + ); + delete astro_patch_AnonyMsg[_0x1b0d01]; + } + return await _0x2acf30.reply( + "*_Your Message succesfully deliver to User_* " + + (_0x2ecd2a.howmanyreply == 1 + ? "\n*you can reply 1 more time*" + : "") + + " " + ); + } else if (_0x2ecd2a.tellinfo === 0) { + _0x2ecd2a.tellinfo = 1; + let _0x362db6 = + "*Basically, Its an Annonymous Message*\n\n_Msg_Id: " + + _0x2ecd2a.id + + "_\n_this message sended by a chatbot_\n_User not wants to expose itself to send that msg_\n\n\n*if you wanna reply to that user,*\n*Send msg by replying to above message*\n*Type like:* reply, Type_your_Message_Here\n*Example:* reply, Can you text me from your number\n\n\n" + + Config.caption; + _0x2acf30.bot.sendMessage( + _0x2ecd2a.reciever, + { + text: _0x362db6, + }, + { + quoted: _0x2acf30, + } + ); + } else if (_0x2ecd2a.tellinfo === 1) { + _0x2ecd2a.tellinfo = 2; + _0x2acf30.reply( + "*Please follow the format if reply to msg*\n*Type like: _reply, Type_your_Message_Here_*" + ); + } + } + } catch (_0x58832f) { + console.log("error : ", _0x58832f); + } + } + } + } catch {} + } +); + +smd( + { + pattern: "advt", + alias: ["advertisement"], + category: "ai", + desc: "Advertise of your Message, by sending it to provided nmbr range.", + use: "234803xx,Your_text_here", + fromMe: true, + filename: __filename, + }, + async (_0x165087, _0x13462a) => { + try { + let _0x14810d = _0x13462a ? _0x13462a : _0x165087.reply_text; + if (!_0x14810d) { + return await _0x165087.reply( + "*Advertise of your Message*\n*by sending it to provided nmbr range.*\n" + + prefix + + "advt 234803xx,Your_text_here" + ); + } + const _0x94ba67 = _0x14810d.indexOf(","); + if (_0x94ba67 === -1) { + return await _0x165087.send( + "*Invalid format. Please provide number and Message separated by a comma.*" + ); + } + let _0xd9b857 = "" + _0x14810d.slice(0, _0x94ba67).trim(); + let _0x321dea = + _0x14810d.slice(_0x94ba67 + 1).trim() + "\n\n\n" + Config.caption; + if (!_0xd9b857.includes("x")) { + return _0x165087.send( + "*You did not add x in number.*\n*Ex: " + + prefix + + "advt 234803xx,Your_Message_here* \n " + + Config.caption + ); + } + await _0x165087.send( + "*Sending message to given number range.!*\n*It may take some time, so wait please*" + ); + function _0x4affa2(_0x9f9b09, _0x557f5a) { + return _0x9f9b09.split(_0x557f5a).length - 1; + } + var _0x43ad94 = _0xd9b857.split("x")[0]; + var _0x1d8f31 = _0xd9b857.split("x")[_0x4affa2(_0xd9b857, "x")] + ? _0xd9b857.split("x")[_0x4affa2(_0xd9b857, "x")] + : ""; + var _0x43415b = _0x4affa2(_0xd9b857, "x"); + var _0x4f926f; + if (_0x43415b == 1) { + _0x4f926f = 10; + } else if (_0x43415b == 2) { + _0x4f926f = 100; + } else if (_0x43415b == 3) { + _0x4f926f = 1000; + } else if (_0x43415b > 3) { + return await _0x165087.send("*Only 3(x) are Allowed in number*"); + } + let _0x1e111b = 0; + let _0x5c0975 = ""; + var _0x5b9d27 = ""; + for (let _0x3e0552 = 0; _0x3e0552 < _0x4f926f; _0x3e0552++) { + var _0x4d017c = await _0x165087.bot.onWhatsApp( + "" + _0x43ad94 + _0x3e0552 + _0x1d8f31 + "@s.whatsapp.net" + ); + if (_0x4d017c[0]) { + _0x5b9d27 = _0x4d017c[0].jid; + if (_0x5c0975.includes(_0x5b9d27)) { + continue; + } + await sleep(1500); + await _0x165087.bot.sendMessage(_0x5b9d27, { + text: _0x321dea, + }); + _0x5c0975 = _0x5c0975 + "," + _0x5b9d27; + _0x1e111b += 1; + } + } + return await _0x165087.send( + "*_Advertisement of your Message is Done,_* \n\n*_Message Succesfully sent to " + + _0x1e111b + + " chats_*\nLast_User: " + + _0x5b9d27.split("@")[0] + + "\nSearch_No: " + + _0x4f926f + + " number searched\n\n\n" + + Config.caption + ); + } catch (_0xfcb50a) { + await _0x165087.error( + _0xfcb50a + "\n\ncommand: dalle", + _0xfcb50a, + "*_No responce from Server side, Sorry!!_*" + ); + } + } +); +async function processing(_0x2f3dd0, _0x615984) { + try { + const _0x19a878 = require("form-data"); + return new Promise(async (_0x41cb49, _0x35934d) => { + Form = new _0x19a878(); + scheme = "https://inferenceengine.vyro.ai/" + _0x615984; + Form.append("model_version", 1, { + "Content-Transfer-Encoding": "binary", + contentType: "multipart/form-data; charset=uttf-8", + }); + Form.append("image", Buffer.from(_0x2f3dd0), { + filename: _0x615984 + ".jpg", + contentType: "image/jpeg", + }); + Form.submit( + { + url: scheme, + host: "inferenceengine.vyro.ai", + path: "/" + _0x615984, + protocol: "https:", + headers: { + "User-Agent": "okhttp/4.9.3", + Connection: "Keep-Alive", + "Accept-Encoding": "gzip", + }, + }, + function (_0x9b5341, _0x51434f) { + if (_0x9b5341) { + _0x35934d(); + } + let _0x567d22 = []; + _0x51434f + .on("data", function (_0x2b5127, _0x4d261c) { + _0x567d22.push(_0x2b5127); + }) + .on("end", () => { + _0x41cb49(Buffer.concat(_0x567d22)); + }) + .on("error", (_0x403a63) => { + _0x35934d(); + }); + } + ); + }); + } catch (_0x2c5371) { + console.log(_0x2c5371); + return _0x2f3dd0; + } +} +smd( + { + cmdname: "remini", + desc: "enhance image quality!", + type: "ai", + filename: __filename, + }, + async (_0x1bd29b) => { + let _0x4da3a4 = _0x1bd29b.image ? _0x1bd29b : _0x1bd29b.reply_message; + if (!_0x4da3a4 || !_0x4da3a4.image) { + return await _0x1bd29b.send("*Reply to image, to enhance quality!*"); + } + try { + let _0x5b1096 = await _0x4da3a4.download(); + const _0x1ac1f7 = await processing(_0x5b1096, "enhance"); + await _0x1bd29b.send(_0x1ac1f7, {}, "img", _0x1bd29b); + _0x5b1096 = false; + } catch (_0x4eecc9) { + _0x1bd29b.error( + _0x4eecc9 + "\n\nCommand: remini", + _0x4eecc9, + "*Process Denied :(*" + ); + } + } +); +smd( + { + cmdname: "dehaze", + desc: "enhance image quality!", + type: "ai", + filename: __filename, + }, + async (_0x2a1135) => { + let _0xa78bb3 = _0x2a1135.image ? _0x2a1135 : _0x2a1135.reply_message; + if (!_0xa78bb3 || !_0xa78bb3.image) { + return await _0x2a1135.send("*Reply to image, to enhance quality!*"); + } + try { + let _0x4e83ce = await _0xa78bb3.download(); + const _0x65b7b8 = await processing(_0x4e83ce, "dehaze"); + await _0x2a1135.send(_0x65b7b8, {}, "img", _0x2a1135); + _0x4e83ce = false; + } catch (_0x44fb27) { + _0x2a1135.error( + _0x44fb27 + "\n\nCommand: dehaze", + _0x44fb27, + "*Process Denied :(*" + ); + } + } +); +smd( + { + cmdname: "recolor", + desc: "enhance image quality!", + type: "ai", + filename: __filename, + }, + async (_0x18f8e1) => { + let _0x220e4a = _0x18f8e1.image ? _0x18f8e1 : _0x18f8e1.reply_message; + if (!_0x220e4a || !_0x220e4a.image) { + return await _0x18f8e1.send("*Reply to image, to enhance quality!*"); + } + try { + let _0x38f64d = await _0x220e4a.download(); + const _0x51042 = await processing(_0x38f64d, "recolor"); + await _0x18f8e1.send(_0x51042, {}, "img", _0x18f8e1); + _0x38f64d = false; + } catch (_0x4a62c8) { + _0x18f8e1.error( + _0x4a62c8 + "\n\nCommand: recolor", + _0x4a62c8, + "*Process Denied :(*" + ); + } + } +); \ No newline at end of file diff --git a/plugins/converter.js b/plugins/converter.js new file mode 100644 index 0000000..4a24de8 --- /dev/null +++ b/plugins/converter.js @@ -0,0 +1,845 @@ +const axios = require("axios"); +const fs = require("fs-extra"); +const util = require("util"); +const { StickerTypes } = require("wa-sticker-formatter"); +const fetch = require("node-fetch"); +const { + fancytext, + smdBuffer, + getBuffer, + listall, + prefix, + smd, + generateSticker, + TelegraPh, + Config, +} = require("../lib/"); +let mtypes = ["imageMessage", "videoMessage", "stickerMessage"]; +smd( + { + cmdname: "sticker", + alias: ["s"], + info: "Makes sticker of replied image/video.", + type: "sticker", + filename: __filename, + use: "", + }, + async (_0x5f0a63) => { + try { + let _0x4a2c9b = mtypes.includes(_0x5f0a63.mtype) + ? _0x5f0a63 + : _0x5f0a63.reply_message; + if (_0x4a2c9b && mtypes.includes(_0x4a2c9b?.mtype || "need_Media")) { + let _0x313fc1 = await _0x4a2c9b.download(); + let _0x37d0ee = { + pack: Config.packname, + author: Config.author, + type: StickerTypes.FULL, + quality: 10, + }; + await generateSticker(_0x5f0a63, _0x313fc1, _0x37d0ee); + return (_0x313fc1 = false); + } else { + return _0x5f0a63.reply("*_Uhh Dear, Reply to image/video!!_*"); + } + } catch (_0xb1d121) { + return await _0x5f0a63.error(_0xb1d121 + "\n\ncmdName: sticker\n"); + } + } +); +smd( + { + cmdname: "take", + info: "Makes sticker of replied image/video.", + type: "sticker", + filename: __filename, + use: "", + }, + async (_0x471740, _0x3febcd) => { + try { + let _0xad98fb = _0x471740.reply_message; + if (!_0xad98fb || _0xad98fb?.mtype != "stickerMessage") { + return await _0x471740.reply("*Uhh Please, Reply to sticker*"); + } + let _0x44d3dd = _0x3febcd.split("|"); + let _0x47c982 = + _0x44d3dd[0]?.trim() !== "" ? _0x44d3dd[0] : _0x471740.pushName; + let _0x20f704 = + _0x44d3dd[1] && _0x44d3dd[1] !== "" ? _0x44d3dd[1] : "ᴀsᴛᴀ-ᴍᴅ ♥️"; + let _0x3ab776 = await _0xad98fb.download(); + let _0x3d0871 = { + pack: _0x47c982, + author: _0x20f704, + type: StickerTypes.FULL, + quality: 10, + }; + await generateSticker(_0x471740, _0x3ab776, _0x3d0871); + return (_0x3ab776 = false); + } catch (_0x2529d4) { + return await _0x471740.error(_0x2529d4 + "\n\ncmdName: take\n"); + } + } +); +smd( + { + cmdname: "attp", + info: "Makes sticker of given text.", + type: "sticker", + filename: __filename, + use: "< text.>", + }, + async (_0x1544ea, _0x3444c7) => { + try { + let _0x128f40 = await smdBuffer( + "https://raganork-api.onrender.com/api/attp?text=" + + (_0x3444c7 ? _0x3444c7 : "Please provide text to generate sticker") + + "&apikey=with_love_souravkl11" + ); + return await generateSticker(_0x1544ea, _0x128f40); + } catch (_0x560462) { + return await _0x1544ea.error(_0x560462 + "\n\ncmdName: attp\n"); + } + } +); +smd( + { + cmdname: "crop", + alias: ["cropsticker"], + info: "Makes sticker of replied image.", + type: "sticker", + filename: __filename, + use: "", + }, + async (_0x50fc92) => { + try { + let _0x2d0760 = mtypes.includes(_0x50fc92.mtype) + ? _0x50fc92 + : _0x50fc92.reply_message; + if (_0x2d0760 && mtypes.includes(_0x2d0760?.mtype || "need_Media")) { + let _0x1a1951 = await _0x2d0760.download(); + let _0xb6aa00 = { + pack: Config.packname, + author: Config.author, + type: StickerTypes.CROPPED, + quality: 50, + }; + await generateSticker(_0x50fc92, _0x1a1951, _0xb6aa00); + return (_0x1a1951 = false); + } else { + return _0x50fc92.reply("*_Uhh Dear, Reply to image!!_*"); + } + } catch (_0x1c7f0b) { + return await _0x50fc92.error( + _0x1c7f0b + "\n\ncmdName: crop\n", + "*_Request Failed, Reply to an image only!_*" + ); + } + } +); +smd( + { + cmdname: "circle", + alias: ["circlestic", "circlesticker", "cs"], + info: "circle sticker of image.", + type: "sticker", + filename: __filename, + use: "", + }, + async (_0x52caf7) => { + try { + let _0x11d586 = mtypes.includes(_0x52caf7.mtype) + ? _0x52caf7 + : _0x52caf7.reply_message; + if (_0x11d586 && mtypes.includes(_0x11d586?.mtype || "need_Media")) { + let _0x5adc33 = await _0x11d586.download(); + let _0x546011 = { + pack: Config.packname, + author: Config.author, + type: StickerTypes.CIRCLE, + quality: 50, + }; + await generateSticker(_0x52caf7, _0x5adc33, _0x546011); + return (_0x5adc33 = false); + } else { + return _0x52caf7.reply("*_Uhh Dear, Reply to image!!_*"); + } + } catch (_0x165b2a) { + return await _0x52caf7.error( + _0x165b2a + "\n\ncmdName: circle\n", + "*_Request Failed, Make sure You replied an image_*" + ); + } + } +); +smd( + { + cmdname: "round", + alias: ["roundstic", "roundsticker"], + info: "Makes sticker of replied image/video.", + type: "sticker", + filename: __filename, + use: "", + }, + async (_0x37c100) => { + try { + let _0x5f32a5 = mtypes.includes(_0x37c100.mtype) + ? _0x37c100 + : _0x37c100.reply_message; + if (_0x5f32a5 && mtypes.includes(_0x5f32a5?.mtype || "need_Media")) { + let _0x3140d1 = await _0x5f32a5.download(); + let _0x7f0ab0 = { + pack: Config.packname, + author: Config.author, + type: StickerTypes.ROUNDED, + quality: 50, + }; + await generateSticker(_0x37c100, _0x3140d1, _0x7f0ab0); + return (_0x3140d1 = false); + } else { + return _0x37c100.reply("*_Uhh Dear, Reply to an image!!_*"); + } + } catch (_0x52baa5) { + return await _0x37c100.error( + _0x52baa5 + "\n\ncmdName: round\n", + "*_Request Failed, Make sure You replied an image!_*" + ); + } + } +); +smd( + { + pattern: "memegen", + desc: "Write text on quoted image.", + category: "sticker", + filename: __filename, + use: "", + }, + async (_0x29b369, _0x406491) => { + try { + let _0x5b20bd = pmtypes.includes(_0x29b369.mtype) + ? _0x29b369 + : _0x29b369.reply_message; + if (!_0x406491) { + return await _0x29b369.reply("*please provide text and image*"); + } + if (!_0x5b20bd || !pmtypes.includes(_0x5b20bd.mtype)) { + return _0x29b369.reply("*Uhh please, Reply to an image*"); + } + let _0x2e7f21 = _0x406491.split("|")[0] || ""; + let _0x18ab18 = (_0x406491.split("|")[1] || "sticker").toLowerCase(); + let _0xa7ea5d = _0x2e7f21.split(";")[0] || "_"; + let _0x508e2 = _0x2e7f21.split(";")[1] || "_"; + let _0x225e06 = await _0x29b369.bot.downloadAndSaveMediaMessage( + _0x5b20bd + ); + let _0x3c2ea1 = await TelegraPh(_0x225e06); + try { + fs.unlinkSync(_0x225e06); + } catch (_0x792dac) {} + console.log("match", _0x406491); + let _0x66682a = await getBuffer( + "https://api.memegen.link/images/custom/" + + _0xa7ea5d + + "/" + + _0x508e2 + + ".png?background=" + + _0x3c2ea1 + ); + if (_0x18ab18?.startsWith("p")) { + await _0x29b369.send( + _0x66682a, + { + caption: Config.caption, + }, + "image" + ); + } + let _0x32a752 = { + pack: Config.packname, + author: Config.author, + type: StickerTypes.FULL, + quality: 70, + }; + await generateSticker(_0x29b369, _0x66682a, _0x32a752); + return (_0x66682a = false); + } catch (_0x34e75a) { + _0x29b369.error(_0x34e75a + "\n\ncmdName: memegen\n"); + console.log(_0x34e75a); + } + } +); +smd( + { + pattern: "emix", + desc: "Mixes two emojies.", + category: "sticker", + use: "", + filename: __filename, + }, + async (_0x46e4d3, _0x5dee47) => { + try { + let _0x466701 = _0x5dee47.split(",")[0] || false; + let _0x503ec0 = _0x5dee47.split(",")[1] || false; + if (!_0x5dee47 || !_0x466701 || !_0x503ec0) { + return _0x46e4d3.reply("Example : " + prefix + "emix 😅,🤔"); + } + const _0xe1140e = await fetch( + "https://tenor.googleapis.com/v2/featured?key=AIzaSyAyimkuYQYF_FXVALexPuGQctUWRURdCYQ&contentfilter=high&media_filter=png_transparent&component=proactive&collection=emoji_kitchen_v5&q=" + + _0x466701 + + "_" + + _0x503ec0 + ); + const _0x41bce8 = await _0xe1140e?.json(); + if (!_0x41bce8 || _0x41bce8?.locale == "") { + return _0x46e4d3.send("*_Can't create mixture, try other emojies_*"); + } else { + let _0x39bbd1 = await smdBuffer(_0x41bce8.results[0].url); + let _0x4c55c4 = { + pack: Config.packname, + author: Config.author, + type: StickerTypes.FULL, + quality: 70, + }; + await generateSticker(_0x46e4d3, _0x39bbd1, _0x4c55c4); + return (_0x39bbd1 = false); + } + } catch (_0x4bf070) { + _0x46e4d3.error(_0x4bf070 + "\n\ncmdName: emix"); + } + } +); +smd( + { + pattern: "quotely", + desc: "Makes Sticker of quoted text.", + alias: ["q"], + category: "sticker", + use: "", + filename: __filename, + }, + async (_0xa1cfa2, _0x4ec923) => { + try { + let _0x5a2037 = _0xa1cfa2.reply_message + ? _0xa1cfa2.reply_message + : _0xa1cfa2 && _0x4ec923 + ? _0xa1cfa2 + : false; + let _0x8d0e84 = _0xa1cfa2.reply_message + ? _0xa1cfa2.reply_message.text + : _0x4ec923; + if (!_0x5a2037 || !_0x8d0e84) { + return _0xa1cfa2.reply("*_Please quote/reply to any message!!!_*"); + } + let _0x3dfb6c = await _0xa1cfa2.getpp(_0x5a2037.sender); + let _0x242a85 = ["#FFFFFF", "#000000"]; + let _0x4c5cf1 = + _0x4ec923 === "white" + ? _0x242a85[0] + : _0x4ec923 === "black" + ? _0x242a85[1] + : _0x242a85[Math.floor(Math.random() * _0x242a85.length)]; + let _0x27251d = _0xa1cfa2.bot.getName(_0x5a2037.sender); + let _0x345fab = { + type: "quote", + format: "png", + backgroundColor: _0x4c5cf1, + width: 512, + height: 512, + scale: 3, + messages: [ + { + avatar: true, + from: { + first_name: _0x27251d, + language_code: "en", + name: _0x27251d, + photo: { + url: _0x3dfb6c, + }, + }, + text: _0x8d0e84, + replyMessage: {}, + }, + ], + }; + let _0x51ed20 = await axios.post( + "https://bot.lyo.su/quote/generate", + _0x345fab + ); + if ( + !_0x51ed20 || + _0x51ed20.status !== 200 || + !_0x51ed20.data || + !_0x51ed20.data.ok + ) { + return await _0xa1cfa2.send("*_Can't create quote sticker!_*"); + } + let _0x3dabe8 = Buffer.alloc( + _0x51ed20.data.result.image.length, + _0x51ed20.data.result.image, + "base64" + ); + try { + await _0xa1cfa2.send( + _0x3dabe8, + { + packname: Config.packname, + author: "Suhail-Md", + }, + "sticker" + ); + } catch (_0x5763ea) { + console.log("error in quotely : ", _0x5763ea); + let _0x4dda08 = { + pack: Config.packname, + author: Config.author, + type: StickerTypes.FULL, + quality: 70, + }; + return await generateSticker(_0xa1cfa2, _0x3dabe8, _0x4dda08); + } + } catch (_0x5094b6) { + return await _0xa1cfa2.error(_0x5094b6 + "\n\ncmdName: emix", _0x5094b6); + } + } +); +smd( + { + pattern: "fancy", + desc: "Makes stylish/fancy given text", + category: "converter", + use: "56 Suhail", + filename: __filename, + }, + async (_0x230c03, _0x3b568a) => { + try { + let _0x365550 = + "┏━━━━━━━━━━━━━━━━━━━━━━━━\n┃\t*💬ASTA-MD_FANCY_TEXT💬* \n┗━━━━━━━━━━━━━━━━━━━━━━━━\n\n " + + (_0x3b568a + ? "```🔢Reply the number you wants to select``` \n\n" + : "```\t\t" + + prefix + + "fancy Asta(For all text)\n\t\t" + + prefix + + "fancy 25 Asta(For specific text)```\n\n"); + let _0x50c7d9 = parseInt(_0x3b568a); + if (isNaN(_0x50c7d9)) { + let _0x4ca942 = _0x3b568a ? _0x3b568a : "Asta"; + listall(_0x4ca942).forEach((_0x51f58f, _0x2be109) => { + _0x365550 += "\n" + (_0x2be109 += 1) + " " + _0x51f58f + "\n"; + }); + try { + return await _0x230c03.send( + _0x365550, + { + caption: _0x365550, + }, + "", + msg + ); + } catch { + return await _0x230c03.reply(_0x365550); + } + } + let _0x564034 = await fancytext("" + _0x3b568a.slice(2), _0x50c7d9); + return await _0x230c03.send(_0x564034, {}, "", _0x230c03); + } catch (_0x8dd389) { + return await _0x230c03.error(_0x8dd389 + "\n\ncmdName: fancy", _0x8dd389); + } + } +); +smd( + { + pattern: "tiny", + desc: "Makes url tiny.", + category: "converter", + use: "", + react: "✅", + filename: __filename, + }, + async (_0x85089c, _0x29ac4f) => { + try { + if (!_0x29ac4f || !_0x29ac4f.toLowerCase().includes("https")) { + return _0x85089c.reply("Provide me a link"); + } + let _0xe54a62 = _0x29ac4f.split(" ")[0]; + let _0x24899a = await axios.get( + "https://tinyurl.com/api-create.php?url=" + _0xe54a62 + ); + _0x85089c.reply("*🛡️Your Shortened URL*\n\n" + _0x24899a.data); + } catch (_0x39ae7e) { + _0x85089c.error(_0x39ae7e + "\n\ncmdName: tiny", _0x39ae7e, false); + } + } +); +smd( + { + pattern: "fliptext", + desc: "Flips given text.", + category: "converter", + use: "", + filename: __filename, + }, + async (_0x4cfc4e, _0x4cb7aa) => { + try { + let _0xd51ec = _0x4cb7aa ? _0x4cb7aa : _0x4cfc4e.reply_text; + if (!_0xd51ec) { + return _0x4cfc4e.reply( + "*_Example : " + prefix + "fliptext Suhail MD!_*" + ); + } + let _0x5c7a34 = _0xd51ec.split("").reverse().join(""); + await _0x4cfc4e.reply( + "*「 Text Flipper Tool 」* \n*IGiven text :*\n" + + _0xd51ec + + "\n\n*Fliped text :*\n" + + _0x5c7a34 + ); + } catch (_0x15d8cc) { + _0x4cfc4e.error(_0x15d8cc + "\n\ncommand : fliptext", _0x15d8cc); + } + } +); +smd( + { + pattern: "ebinary", + desc: "encode binary", + category: "converter", + use: "", + filename: __filename, + }, + async (_0x454093, _0x529916) => { + try { + let _0x5ba9c3 = _0x529916 ? _0x529916 : _0x454093.reply_text; + if (!_0x5ba9c3) { + return _0x454093.reply("*_Send text to be encoded.!_*"); + } + let _0x330ca8 = _0x5ba9c3 + .split("") + .map((_0xa59150) => { + return _0xa59150.charCodeAt(0).toString(2); + }) + .join(" "); + await _0x454093.reply(_0x330ca8); + } catch (_0x3cb17) { + await _0x454093.error(_0x3cb17 + "\n\ncommand : ebinary", _0x3cb17); + } + } +); +smd( + { + pattern: "dbinary", + desc: "decode binary", + category: "converter", + use: "", + filename: __filename, + }, + async (_0x38e385, _0x196965) => { + try { + let _0x1c88de = _0x196965 ? _0x196965 : _0x38e385.reply_text; + if (!_0x1c88de) { + return _0x38e385.reply("Send text to be decoded."); + } + var _0x208340 = _0x1c88de.split(" "); + var _0x206a18 = []; + for (i = 0; i < _0x208340.length; i++) { + _0x206a18.push(String.fromCharCode(parseInt(_0x208340[i], 2))); + } + await _0x38e385.reply(_0x206a18.join("")); + } catch (_0x2b0f0a) { + await _0x38e385.error(_0x2b0f0a + "\n\ncommand : dbinary", _0x2b0f0a); + } + } +); +smd( + { + pattern: "qr", + category: "converter", + filename: __filename, + use: "< text >", + desc: "Sends CitelsVoid Qr code to scan and get your session id.", + }, + async (_0x19c21a, _0xc7f8c4) => { + try { + if (!_0xc7f8c4) { + return _0x19c21a.reply("*Provide Text To generate QR!*"); + } + let _0x494bbd = + "https://api.qrserver.com/v1/create-qr-code/?size=500x500&data=" + text; + await _0x19c21a.bot.sendUi( + _0x19c21a.jid, + { + caption: "*_Scan Qr To Get You Text_*", + }, + { + quoted: _0x19c21a, + }, + "image", + _0x494bbd + ); + } catch (_0x33377c) { + await _0x19c21a.error(_0x33377c + "\n\ncommand : qr", _0x33377c); + } + } +); +smd( + { + pattern: "paste", + desc: "create paste of text.", + category: "converter", + use: "< text >", + filename: __filename, + }, + async (_0x3878b3, _0x4974a3) => { + try { + let _0x531993 = _0x4974a3 ? _0x4974a3 : _0x3878b3.reply_text; + let { data: _0x3d14f3 } = await axios.get( + 'https://api.telegra.ph/createPage?access_token=d3b25feccb89e508a9114afb82aa421fe2a9712b963b387cc5ad71e58722&title=Suhail-Md+Bot&author_name=Astro_Info&content=[%7B"tag":"p","children":["' + + _0x531993.replace(/ /g, "+") + + '"]%7D]&return_content=true' + ); + return _0x3878b3.reply( + "*Paste created on telegraph*\nName:-" + + util.format(_0x3d14f3.result.title) + + " \nUrl:- " + + util.format(_0x3d14f3.result.url) + ); + } catch (_0x5d7e4a) { + await _0x3878b3.error( + _0x5d7e4a + "\n\ncommand: paste ", + _0x5d7e4a, + false + ); + } + } +); +let pmtypes = ["imageMessage", "stickerMessage"]; +smd( + { + cmdname: "photo", + info: "Makes photo of replied sticker.", + type: "converter", + use: "", + filename: __filename, + }, + async (_0x31d7b) => { + try { + let _0xd092ed = pmtypes.includes(_0x31d7b.mtype) + ? _0x31d7b + : _0x31d7b.reply_message; + if (!_0xd092ed || !pmtypes.includes(_0xd092ed?.mtype)) { + return _0x31d7b.reply("*_Uhh Dear, Reply to Any Sticker.!!_*"); + } + let _0x361039 = await _0x31d7b.bot.downloadAndSaveMediaMessage(_0xd092ed); + await _0x31d7b.bot.sendMessage(_0x31d7b.jid, { + image: { + url: _0x361039, + }, + mimetype: "image/jpeg", + }); + try { + fs.unlinkSync(_0x361039); + } catch (_0x573b9e) {} + } catch (_0x2454ac) { + _0x31d7b.error(_0x2454ac + "\n\ncmdName: photo\n", _0x2454ac, false); + } + } +); +let audtypes = ["audioMessage", "videoMessage"]; +smd( + { + pattern: "toaudio", + alias: ["mp3", "tomp3"], + desc: "changes type to audio.", + category: "converter", + use: "", + filename: __filename, + }, + async (_0x116242) => { + try { + let _0x2976f2 = audtypes.includes(_0x116242.mtype) + ? _0x116242 + : _0x116242.reply_message; + if (!_0x2976f2 || !audtypes.includes(_0x2976f2?.mtype)) { + return _0x116242.reply("*_Uhh Dear, Reply to Any Video.!!_*"); + } + let _0x2b56d1 = await _0x116242.bot.downloadAndSaveMediaMessage( + _0x2976f2 + ); + const { toAudio: _0xfd0543 } = require("../lib"); + let _0x550383 = fs.readFileSync(_0x2b56d1); + let _0x5319d4 = await _0xfd0543(_0x550383); + try { + fs.unlink(_0x2b56d1); + } catch (_0x149b27) {} + return await _0x116242.bot.sendMessage(_0x116242.jid, { + audio: _0x5319d4, + mimetype: "audio/mpeg", + }); + } catch (_0x1d6272) { + _0x116242.error(_0x1d6272 + "\n\ncmdName: toaudio", _0x1d6272); + } + } +); +smd( + { + pattern: "voice", + alias: ["ptt", "toptt"], + desc: "adds bass in given sound", + category: "converter", + use: "", + }, + async (_0x5c9aa3) => { + try { + let _0x462db2 = audtypes.includes(_0x5c9aa3.mtype) + ? _0x5c9aa3 + : _0x5c9aa3.reply_message; + if (!_0x462db2 || !audtypes.includes(_0x462db2?.mtype)) { + return _0x5c9aa3.reply("*_Uhh Please, Reply to audio/video_*"); + } + let _0x357d23 = await _0x462db2.download(); + return await _0x5c9aa3.bot.sendMessage( + _0x5c9aa3.jid, + { + audio: _0x357d23, + mimetype: "audio/mpeg", + ptt: true, + }, + { + quoted: _0x5c9aa3, + } + ); + } catch (_0x4252f6) { + _0x5c9aa3.error(_0x4252f6 + "\n\ncmdName: voice", _0x4252f6); + } + } +); +smd( + { + pattern: "tomp4", + alias: ["mp4", "tovideo"], + desc: "convert sticker to mp4.", + category: "converter", + use: "", + filename: __filename, + }, + async (_0x4ed07c) => { + let _0xadff0d = + _0x4ed07c.mtype === "videoMessage" ? _0x4ed07c : _0x4ed07c.reply_message; + if (!_0xadff0d) { + return _0x4ed07c.reply( + "*_Uhh Dear, Reply To Animated Sticker or Gif!!_*" + ); + } + const { webp2mp4File: _0x3e4a6e } = require("../lib"); + let _0x4ab6cb = _0xadff0d?.mimetype || ""; + if (_0xadff0d?.mtype != "videoMessage" && !/webp/.test(_0x4ab6cb)) { + return await _0x4ed07c.send( + "*Damn... Reply To An Animated Sticker or Gif *" + ); + } + let _0x1c3111 = await _0x4ed07c.bot.downloadAndSaveMediaMessage(_0xadff0d); + try { + try { + if (/webp/.test(_0x4ab6cb)) { + let _0x49adc0 = await _0x3e4a6e(_0x1c3111); + _0x1c3111 = _0x49adc0.result; + } + } catch (_0x1b8bba) { + console.log("error while converting sticker to mp4\n", _0x1b8bba); + } + await _0x4ed07c.bot.sendMessage(_0x4ed07c.jid, { + video: { + url: _0x1c3111, + }, + caption: Config.caption, + }); + try { + await fs.unlink(_0x1c3111); + } catch (_0x399a5b) {} + } catch (_0x3d8403) { + _0x4ed07c.error(_0x3d8403 + "\n\ncmdName: tomp4", _0x3d8403); + } + } +); +function splitTextIntoLines(_0x2e8ff3, _0x1ba8fb, _0x469f3c) { + const _0x32429f = _0x2e8ff3.split(" "); + const _0x2048c1 = []; + let _0x38142d = ""; + for (const _0x1678b3 of _0x32429f) { + const _0x56be5a = + _0x38142d === "" ? _0x1678b3 : _0x38142d + " " + _0x1678b3; + const _0x1a1a76 = _0x1ba8fb.measureText(_0x56be5a).width; + if (_0x1a1a76 <= _0x469f3c) { + _0x38142d = _0x56be5a; + } else { + _0x2048c1.push(_0x38142d); + _0x38142d = _0x1678b3; + } + } + if (_0x38142d !== "") { + _0x2048c1.push(_0x38142d); + } + return _0x2048c1; +} +smd( + { + cmdname: "ttp", + alias: ["roundstic", "roundsticker"], + info: "Makes sticker of replied image/video.", + type: "sticker", + filename: __filename, + use: "", + }, + async (_0x54e3dc, _0x8cd246) => { + try { + let _0x2cee76 = _0x8cd246 || _0x54e3dc.reply_text; + if (_0x2cee76) { + let _0x374825 = parseInt(_0x2cee76) || ""; + if (_0x374825 && !isNaN(_0x374825)) { + _0x2cee76 = await fancytext("" + _0x2cee76.slice(2), _0x374825); + } + const { createCanvas: _0x238289 } = require("canvas"); + const _0xf38745 = require("fs"); + const _0x4d4dd9 = 300; + const _0x3fed71 = 300; + const _0x5a2b18 = "./temp/ttp.png"; + const _0x246894 = _0x238289(_0x4d4dd9, _0x3fed71); + const _0x330082 = _0x246894.getContext("2d"); + _0x330082.clearRect(0, 0, _0x246894.width, _0x246894.height); + _0x330082.font = "20px Arial"; + _0x330082.fillStyle = "black"; + _0x330082.textAlign = "center"; + const _0xa2e118 = _0x4d4dd9 - 20; + const _0x17cad6 = splitTextIntoLines(_0x2cee76, _0x330082, _0xa2e118); + const _0x4f37f9 = _0x17cad6.length * 25; + const _0x136ece = (_0x3fed71 - _0x4f37f9) / 2; + _0x17cad6.forEach((_0x214ee7, _0x432ccc) => { + const _0x5c8f67 = _0x136ece + _0x432ccc * 25; + _0x330082.fillText(_0x214ee7, _0x4d4dd9 / 2, _0x5c8f67); + }); + const _0x3a6f98 = _0x246894.createPNGStream(); + const _0x3c15d9 = _0xf38745.createWriteStream(_0x5a2b18); + _0x3a6f98.pipe(_0x3c15d9); + _0x3c15d9.on("finish", async () => { + console.log("Image created:", _0x5a2b18); + let _0x3dac0f = _0xf38745.readFileSync(_0x5a2b18); + let _0x27923e = { + pack: Config.packname, + author: Config.author, + type: StickerTypes.ROUNDED, + quality: 50, + }; + await generateSticker(_0x54e3dc, _0x3dac0f, _0x27923e); + return (_0x3dac0f = false); + }); + } else { + return _0x54e3dc.reply( + "*_Uhh Dear, provide text, ex .ttp 4 hii im suhail!!_*" + ); + } + } catch (_0x72e5d) { + return await _0x54e3dc.error(_0x72e5d + "\n\ncmdName: ttp\n"); + } + } +); diff --git a/plugins/downloader.js b/plugins/downloader.js new file mode 100644 index 0000000..7ef5391 --- /dev/null +++ b/plugins/downloader.js @@ -0,0 +1,1490 @@ +const { + smd, + fetchJson, + fancytext, + yt, + getBuffer, + smdBuffer, + smdJson, + pinterest, + prefix, + Config, + mediafire, +} = require("../lib"); +const { + search, + download +} = require("aptoide-scraper"); +const googleTTS = require("google-tts-api"); +const ytdl = require("ytdl-secktor"); +const yts = require("secktor-pack"); +const fs = require("fs-extra"); +const axios = require("axios"); +const fetch = require("node-fetch"); +var videotime = 2000; +const { + cmd +} = require("../lib/plugins"); +smd( + { + pattern: "spotify2", + alias: ["sp2"], + desc: "Downloads a Spotify song.", + category: "downloader", + filename: __filename, + use: "", + }, + async (message, input) => { + try { + const url = input.trim(); + if (!url || !isValidUrl(url)) { + return await message.send("*_Please provide a valid Spotify URL._*"); + } + + const apiUrl = `https://api.maher-zubair.tech/download/spotify?url=${encodeURIComponent(url)}`; + const response = await axios.get(apiUrl); + const data = response.data; + + if (!data || data.status !== 200) { + return await message.reply("*Failed to download the Spotify song.*"); + } + + const { song, artist, album_name, release_date, cover_url, url: songUrl } = data.result; + + let output = `*Song:* ${song}\n`; + output += `*Artist:* ${artist.join(", ")}\n`; + output += `*Album:* ${album_name}\n`; + output += `*Release Date:* ${release_date}\n\n`; + output += `*Cover Image:* ${cover_url}\n\n`; + + const buffer = await axios.get(songUrl, { responseType: "arraybuffer" }); + const fileName = `${song.replace(/\s/g, "_")}.mp3`; + + await message.bot.sendMessage( + message.chat, + { + audio: buffer.data, + fileName: fileName, + mimetype: "audio/mpeg", + caption: output, + }, + { quoted: message } + ); + } catch (error) { + await message.error(error + "\n\nCommand: spotify2", error, "*Failed to download the Spotify song.*"); + } + } +); + +function isValidUrl(url) { + try { + new URL(url); + return true; + } catch (_) { + return false; + } +} +smd( + { + pattern: "spotify", + alias: ["sp"], + desc: "Searches for Spotify tracks.", + category: "search", + filename: __filename, + use: "", + }, + async (message, input) => { + try { + const query = input.trim(); + if (!query) { + return await message.send("*_Please provide a search query._*"); + } + + const apiUrl = `https://api.maher-zubair.tech/search/spotify?q=${encodeURIComponent(query)}`; + const response = await axios.get(apiUrl); + const data = response.data; + + if (!data || data.status !== 200) { + return await message.reply("*Failed to fetch Spotify tracks.*"); + } + + const tracks = data.result; + if (!tracks || tracks.length === 0) { + return await message.reply("*No Spotify tracks found.*"); + } + + let output = "*Spotify Search Results:*\n\n"; + for (let i = 0; i < tracks.length; i++) { + const track = tracks[i]; + output += `*${i + 1}. ${track.title}*\n`; + output += `Artist: ${track.artist}\n`; + output += `Duration: ${formatDuration(track.duration)}\n`; + output += `Popularity: ${track.popularity}\n`; + output += `Preview: ${track.preview ? track.preview : "No preview available"}\n`; + output += `URL: ${track.url}\n\n`; + } + + return await message.send(output, { quoted: message }); + } catch (error) { + await message.error(error + "\n\nCommand: spotify", error, "*Failed to search Spotify.*"); + } + } +); + +function formatDuration(durationMs) { + const seconds = Math.floor((durationMs / 1000) % 60); + const minutes = Math.floor((durationMs / (1000 * 60)) % 60); + const hours = Math.floor((durationMs / (1000 * 60 * 60)) % 24); + return `${hours ? `${hours}h ` : ""}${minutes}m ${seconds}s`; +} +smd( + { + pattern: "twitter", + alias: ["tw", "twdl"], + desc: "Downloads Twitter videos.", + category: "downloader", + filename: __filename, + use: "", + }, + async (message, input) => { + try { + let query = input.split(" ")[0].trim(); + if (!query || !query.startsWith("https://")) { + return await message.send( + "*_Please provide a valid Twitter Video URL._*\n*Example: " + + prefix + + "tw https://twitter.com/username/status/1234567890_*" + ); + } + + let video = await smdJson( + "https://api.maher-zubair.tech/download/twitter?url=" + query + ); + + if (!video || !video.status === 200) { + return await message.reply("*Invalid Video URL!*"); + } + + let caption = video.data.caption + ? video.data.caption + : `*Twitter Video Download*\n\n*Username:* ${video.data.username}`; + + return await message.bot.sendMessage( + message.chat, + { + video: { url: video.data.HD }, + caption: caption, + }, + { quoted: message } + ); + } catch (error) { + await message.error(error + "\n\nCommand: twitter", error, "*_Video not found!_*"); + } + } +); +//FIXED FB + +smd({ + pattern: "facebook", + alias: ["fb", "fbdl"], + desc: "Downloads Facebook videos.", + category: "downloader", + filename: __filename, + use: "" +}, async (message, input) => { + try { + let query = input.split(" ")[0].trim(); + if (!query || !query.startsWith("https://")) { + return await message.send("*_Please provide a valid Facebook Video URL._*\n*Example: " + prefix + "fb https://www.facebook.com/watch/?v=2018727118289093_*"); + } + let video = await smdJson("https://api-smd.onrender.com/api/fbdown?url=" + query); + if (!video || !video.status) { + return await message.reply("*Invalid Video URL!*"); + } + return await message.bot.sendMessage(message.chat, { + video: { + url: video.result.Normal_video // Assuming you want the normal quality video + }, + caption: Config.caption + }, { + quoted: message + }); + } catch (error) { + await message.error(error + "\n\nCommand: facebook", error, "*_Video not found!_*"); + } +}); + +smd({ + pattern: "tgs", + desc: "Downloads telegram stickers.", + category: "downloader", + filename: __filename, + use: "" +}, async (_0x19df48, _0x155c01) => { + try { + if (!_0x155c01) { + return await _0x19df48.reply("_Enter a tg sticker url_\nEg: .tgs https://t.me/addstickers/Oldboyfinal\nKeep in mind that there is a chance of ban if used frequently"); + } + if (!_0x155c01.includes("addstickers")) { + return await _0x19df48.reply("_Uhh Please Enter a Valid tg sticker url_\nEg: .tgs https://t.me/addstickers/Oldboyfinal"); + } + let _0x2a4fb1 = _0x155c01.split("|")[0]; + let _0x27aa70 = _0x2a4fb1.split("/addstickers/")[1]; + let { + result: _0x4a601d + } = await fetchJson("https://api.telegram.org/bot891038791:AAHWB1dQd-vi0IbH2NjKYUk-hqQ8rQuzPD4/getStickerSet?name=" + encodeURIComponent(_0x27aa70) + " "); + let _0x54b45a = _0x155c01.split("|")[1] || ""; + let _0x56bec3 = "Total stickers: " + _0x4a601d.stickers.length + "\n*Estimated complete in:* " + _0x4a601d.stickers.length * 1.5 + " seconds\nKeep in mind that there is a chance of a ban if used frequently"; + if (_0x4a601d.is_animated) { + return await _0x19df48.reply("Animated stickers are not supported"); + } else if (_0x54b45a.startsWith("info")) { + return await _0x19df48.reply(_0x56bec3); + } + let _0x26c3a3 = parseInt(_0x54b45a.split(",")[0]) || 10; + let _0x33784b = parseInt(_0x54b45a.split(",")[1]) || 0; + let _0x4cca92 = _0x54b45a.split(";")[1] || "Sticker"; + let _0x3a6ece = true; + if (_0x4cca92.includes("photo")) { + _0x3a6ece = false; + _0x4cca92 = "Photo"; + } + if (_0x26c3a3 > _0x4a601d.stickers.length) { + _0x26c3a3 = _0x4a601d.stickers.length; + } + if (_0x33784b > _0x4a601d.stickers.length) { + _0x33784b = _0x4a601d.stickers.length - 5; + } + if (_0x33784b > _0x26c3a3) { + let _0xe6592a = _0x26c3a3; + _0x26c3a3 = _0x33784b; + _0x33784b = _0xe6592a; + } + await _0x19df48.reply(_0x56bec3 + "\n\n_Downloading as " + _0x4cca92 + " From index *" + _0x33784b + "* to *" + _0x26c3a3 + "*._\nIf you wants more to download then use Like \n\n .tgs " + _0x2a4fb1 + " | 10 , 20 ; photo"); + for (_0x33784b; _0x33784b < _0x26c3a3; _0x33784b++) { + let _0x4de16f = await fetchJson("https://api.telegram.org/bot891038791:AAHWB1dQd-vi0IbH2NjKYUk-hqQ8rQuzPD4/getFile?file_id=" + _0x4a601d.stickers[_0x33784b].file_id); + let _0x3c2608 = "https://api.telegram.org/file/bot891038791:AAHWB1dQd-vi0IbH2NjKYUk-hqQ8rQuzPD4/" + _0x4de16f.result.file_path; + if (_0x3a6ece) { + let _0x13ee38 = await getBuffer(_0x3c2608); + await _0x19df48.reply(_0x13ee38, { + packname: Config.packname, + author: "Suhail-Md" + }, "sticker"); + } else { + await _0x19df48.bot.sendMessage(_0x19df48.chat, { + image: { + url: _0x3c2608 + }, + caption: "*_Telegram Sticker At Index " + (_0x33784b + 1) + " Downloaded_*" + }); + } + } + } catch (_0x5a840a) { + await _0x19df48.error(_0x5a840a + "\n\ncommand: tgs", _0x5a840a, "*_Error Sending telegram stickers!!!_*"); + } +}); +smd({ + pattern: "wikimedia", + desc: "Downloads wikimedia images.", + category: "downloader", + filename: __filename, + use: "" +}, async (_0x47fb55, _0x5614e8) => { + try { + if (!_0x5614e8) { + return await _0x47fb55.send("*_Please Give me search query!_*"); + } + let { + wikimedia: _0x168a95 + } = require("../lib"); + let _0x6c377e = (await _0x168a95(_0x5614e8)) || []; + if (!_0x6c377e || !_0x6c377e[0]) { + return await _0x47fb55.send("*_No Results Found!_*"); + } + let _0xc4fe0 = _0x47fb55.iscreator && _0x5614e8.split("|")[1] === "all" ? _0x6c377e.length : _0x6c377e.length > 5 ? 5 : _0x6c377e.length; + for (let _0xfe1387 = 0; _0xfe1387 < _0xc4fe0; _0xfe1387++) { + try { + _0x47fb55.bot.sendFromUrl(_0x47fb55.from, _0x6c377e[_0xfe1387].image, "Title: " + _0x6c377e[_0xfe1387].title + "\n*Source:* " + _0x6c377e[_0xfe1387].source, _0x47fb55, {}, "image"); + } catch {} + } + } catch (_0x289d8e) { + await _0x47fb55.error(_0x289d8e + "\n\ncommand: insta", _0x289d8e); + } +}); +smd({ + pattern: "apk", + alias: ["modapk"], + desc: "Downloads apks .", + category: "downloader", + filename: __filename, + use: "" +}, async (_0x7b09ff, _0x4af114) => { + try { + if (!_0x4af114) { + return _0x7b09ff.reply("*_Uhh dear, Give me App Name!_*"); + } + let _0x468cc8 = await search(_0x4af114); + let _0x538b40 = {}; + if (_0x468cc8.length) { + _0x538b40 = await download(_0x468cc8[0].id); + } else { + return _0x7b09ff.reply("*_Apk not found, Try another name!!_*"); + } + const _0x48bc12 = parseInt(_0x538b40.size); + if (_0x48bc12 > 200) { + return _0x7b09ff.reply("❌ File size bigger than 200mb."); + } + const _0x31321c = _0x538b40.dllink; + let _0x24f726 = await fancytext("『 *ᗩᑭᏦ ᗞᝪᗯᑎしᝪᗩᗞᗴᖇ* 』\n\n*APP Name :* " + _0x538b40.name + "\n*App Id :* " + _0x538b40.package + "\n*Last Up :* " + _0x538b40.lastup + "\n*App Size :* " + _0x538b40.size + "\n\n\n " + Config.caption, 25); + const _0x3e266b = (_0x538b40?.name || "Downloader") + ".apk"; + const _0x585f79 = "temp/" + _0x3e266b; + let _0x533c85 = await _0x7b09ff.reply(_0x538b40.icon, { + caption: _0x24f726 + }, "img", _0x7b09ff); + axios.get(_0x31321c, { + responseType: "stream" + }).then(_0x3cdb1d => { + const _0x406256 = fs.createWriteStream(_0x585f79); + _0x3cdb1d.data.pipe(_0x406256); + return new Promise((_0xd7f976, _0x27915) => { + _0x406256.on("finish", _0xd7f976); + _0x406256.on("error", _0x27915); + }); + }).then(() => { + let _0x389371 = { + document: fs.readFileSync(_0x585f79), + mimetype: "application/vnd.android.package-archive", + fileName: _0x3e266b + }; + _0x7b09ff.bot.sendMessage(_0x7b09ff.jid, _0x389371, { + quoted: _0x533c85 + }); + try { + fs.unlink(_0x585f79); + } catch {} + }).catch(_0x2490b5 => { + try { + fs.unlink(_0x585f79); + } catch {} + ; + _0x7b09ff.reply("*_Apk not Found, Sorry_*"); + }); + } catch (_0x4540ef) { + await _0x7b09ff.error(_0x4540ef + "\n\ncommand: apk", _0x4540ef, "*_Apk not Found!_*"); + } +}); +cmd({ + pattern: "apks", + alias: ["apksearch"], + desc: "Search App", + category: "downloader", + filename: __filename, + use: "" +}, async (_0x19d516, _0x1cb962) => { + try { + if (!_0x1cb962) { + return await _0x19d516.reply("*_Uhh pLease, give me app name!_*"); + } + const _0x4ac8f2 = await search(_0x1cb962); + if (_0x4ac8f2.length) { + let _0x3d85b = await download(_0x4ac8f2[0].id); + let _0x307e6f = "*ᴀsᴛᴀ-ᴍᴅ • ᴀᴘᴋ ᴅᴏᴡɴʟᴏᴀᴅ ʟɪsᴛ* \n*________________________________* \n\n*_Reply Any Number To Download._*\n_Results For : " + _0x1cb962 + "_ \n"; + for (let _0x5a5920 = 0; _0x5a5920 < _0x4ac8f2.length; _0x5a5920++) { + _0x307e6f += "\n*" + (_0x5a5920 + 1) + " : " + _0x4ac8f2[_0x5a5920].name + "* \n*Id : " + _0x4ac8f2[_0x5a5920].id + "* \n"; + } + return await _0x19d516.sendMessage(_0x19d516.chat, { + image: { + url: _0x3d85b.icon + }, + caption: _0x307e6f + }, { + quoted: _0x19d516 + }); + } else { + return _0x19d516.reply("*_APP not Found, Try Other Name_*"); + } + } catch (_0xa7fd60) { + _0x19d516.error(_0xa7fd60 + "\n\ncommand: apks", _0xa7fd60); + } +}); +smd({ + pattern: "soundcloud", + alias: ["scdl", "scdownload"], + desc: "Download audio from SoundCloud.", + category: "downloader", + filename: __filename, + use: "" +}, async (msg, query) => { + try { + const url = query.trim(); + if (!url) { + return await msg.reply("*Please provide a SoundCloud audio URL.*"); + } + + const apiUrl = `https://api.maher-zubair.tech/download/soundcloud?url=${encodeURIComponent(url)}`; + const response = await fetch(apiUrl).then(res => res.json()); + + if (!response || response.status !== 200) { + return await msg.reply("*An error occurred while downloading the SoundCloud audio.*"); + } + + const result = response.result; + const audioUrl = result.link; + const thumbnailUrl = result.thumb; + const title = result.title; + const downloadCount = result.download_count; + + await msg.bot.sendAudio(msg.chat, audioUrl, title, downloadCount, thumbnailUrl, { quoted: msg }); + } catch (err) { + await msg.error(err + "\n\ncommand: soundcloud", err, "*An error occurred while downloading the SoundCloud audio.*"); + } +}); +smd({ + pattern: "gitclone", + desc: "Downloads apks .", + category: "downloader", + filename: __filename, + use: "" +}, async (_0x1ae8f8, _0x1c586e) => { + try { + let _0x59e849 = _0x1c586e ? _0x1c586e : _0x1ae8f8.reply_message ? _0x1ae8f8.reply_message.text : ""; + if (!_0x1c586e) { + return await _0x1ae8f8.reply("*Provide Repo Url, _.gitclone https://github.com/Astropeda/Asta-Md_*"); + } + const _0x5906ab = /(?:https|git)(?::\/\/|@)github\.com[\/:]([^\/:]+)\/(.+)/i; + if (!_0x5906ab.test(_0x1c586e)) { + return await _0x1ae8f8.reply("*Provide Valid Repositry Url*"); + } + let [_0x3b1b37, _0x2f1dcc, _0x83a6d7] = _0x1c586e.match(_0x5906ab) || []; + _0x83a6d7 = _0x83a6d7.replace(/.git$/, ""); + let _0x3e5a6d = "https://api.github.com/repos/" + _0x2f1dcc + "/" + _0x83a6d7 + "/zipball"; + let _0x2cb6ba = (await fetch(_0x3e5a6d, { + method: "HEAD" + })).headers.get("content-disposition").match(/attachment; filename=(.*)/)[1]; + await _0x1ae8f8.bot.sendMessage(_0x1ae8f8.jid, { + document: { + url: _0x3e5a6d + }, + fileName: _0x2cb6ba, + mimetype: "application/zip" + }); + } catch (_0x982fee) { + return _0x1ae8f8.error(_0x982fee + "\n\ncommand: gitclone", _0x982fee, "*_File not found!!!_*"); + } +}); +const ytIdRegex = /(?:http(?:s|):\/\/|)(?:(?:www\.|)youtube(?:\-nocookie|)\.com\/(?:watch\?.*(?:|\&)v=|embed|shorts\/|v\/)|youtu\.be\/)([-_0-9A-Za-z]{11})/; +smd({ + pattern: "tiktokimg", + alias: ["tiktokpic", "tiktokphoto"], + desc: "Download TikTok image.", + category: "downloader", + filename: __filename, + use: "" +}, async (msg, query) => { + try { + const url = query.trim(); + if (!url) { + return await msg.reply("*Please provide a TikTok video URL.*"); + } + + const apiUrl = `api.maher-zubair.tech/download/tiktokimg?url=${encodeURIComponent(url)}`; + const response = await fetch(apiUrl).then(res => res.json()); + + if (!response || response.status !== 200) { + return await msg.reply("*An error occurred while downloading the TikTok image.*"); + } + + const imageUrl = response.result[0]; + await msg.bot.sendImage(msg.chat, imageUrl, null, { quoted: msg }); + } catch (err) { + await msg.error(err + "\n\ncommand: tiktokimg", err, "*An error occurred while downloading the TikTok image.*"); + } +}); +smd({ + pattern: "tts", + desc: "text to speech.", + category: "downloader", + filename: __filename, + use: "" +}, async (_0x55aba2, _0x56da6b) => { + try { + let _0x204f81 = _0x55aba2.reply_text ? _0x55aba2.reply_text : _0x56da6b; + if (!_0x204f81) { + return _0x55aba2.reply("*_Example : .tts Hi,I am Suhail-Md whatsapp bot._*"); + } + try { + let _0x1974d5 = _0x56da6b ? _0x56da6b.split(" ")[0].toLowerCase() : "en"; + const _0x18d003 = googleTTS.getAudioUrl(_0x204f81, { + lang: _0x1974d5, + slow: true, + host: "https://translate.google.com" + }); + await _0x55aba2.bot.sendMessage(_0x55aba2.jid, { + audio: { + url: _0x18d003 + }, + mimetype: "audio/mpeg", + ptt: true, + fileName: "Suhail-Md-tts.m4a" + }, { + quoted: _0x55aba2 + }); + } catch (_0x3537cb) { + const _0x5596bc = googleTTS.getAudioUrl(_0x204f81, { + lang: "en", + slow: true, + host: "https://translate.google.com" + }); + await _0x55aba2.bot.sendMessage(_0x55aba2.jid, { + audio: { + url: _0x5596bc + }, + mimetype: "audio/mpeg", + ptt: true, + fileName: "Suhail-Md-tts.m4a" + }, { + quoted: _0x55aba2 + }); + } + } catch (_0x1313db) { + return _0x55aba2.error(_0x1313db + "\n\ncommand: tts", _0x1313db, false); + } +}); +smd({ + pattern: "downmp4", + alias: ["mp4down", "mp4fromurl"], + desc: "download mp4 from url.", + category: "downloader", + use: "", + filename: __filename +}, async (_0x272f8d, _0x3c482f) => { + try { + let _0x53783b = ("" + (_0x3c482f ? _0x3c482f : _0x272f8d.reply_text)).split(" ")[0].toLowerCase().trim(); + if (!_0x53783b || !_0x53783b.toLowerCase().startsWith("http")) { + return _0x272f8d.reply("*_Give me Video Link, " + prefix + "downmp4 https://telegra.ph/file/d90855d13352c8aae3981.mp4_*"); + } + var _0x1e4a34 = _0x3c482f.toLowerCase().includes("doc") ? "document" : "video"; + await _0x272f8d.bot.sendMessage(_0x272f8d.chat, { + [_0x1e4a34]: { + url: _0x53783b + }, + caption: "*HERE WE GO*", + contextInfo: { + ...(await _0x272f8d.bot.contextInfo(Config.botname, _0x272f8d.senderName)) + } + }, { + quoted: _0x272f8d + }); + } catch (_0x2306b6) { + await _0x272f8d.error(_0x2306b6 + "\n\ncommand : downmp4", _0x2306b6, "*_Please, Give me valid video url!_*"); + } +}); +smd({ + pattern: "video", + desc: "Downloads video from yt.", + category: "downloader", + filename: __filename, + use: "" +}, async (_0xe5ea97, _0x36bc71) => { + let _0x54713e = _0x36bc71 ? _0x36bc71 : _0xe5ea97.reply_text; + var _0x5b10f0 = _0x36bc71.toLowerCase().includes("doc") ? "document" : "video"; + if (!_0x54713e) { + return _0xe5ea97.reply("*Use : " + prefix + "video Al Quran!*"); + } + let _0x421809 = ytIdRegex.exec(_0x36bc71) || []; + let _0x35c755 = _0x421809[0] || false; + try { + if (!_0x35c755) { + let _0x588f03 = await yts(_0x54713e); + let _0x525771 = _0x588f03.videos[0]; + _0x35c755 = _0x525771.url; + _0x421809 = ytIdRegex.exec(_0x35c755); + } + } catch {} + try { + let _0x1df0ed = await ytdl.getInfo(_0x35c755); + let _0x5c8a7c = Math.floor(i.timestamp * 60); + if (_0x5c8a7c >= videotime) { + _0x5b10f0 = "document"; + } + let _0x56042a = _0x1df0ed.videoDetails.title; + let _0x5d70e6 = "./temp/" + _0x421809[1] + ".mp4"; + const _0x4195ce = ytdl(_0x35c755, { + filter: _0x4f303f => _0x4f303f.itag == 22 || _0x4f303f.itag == 18 + }).pipe(fs.createWriteStream(_0x5d70e6)); + await new Promise((_0x3fc982, _0x3a9fa6) => { + _0x4195ce.on("error", _0x3a9fa6); + _0x4195ce.on("finish", _0x3fc982); + }); + var _0x3048ab = { + ...(await _0xe5ea97.bot.contextInfo(Config.botname, "ᴠɪᴅᴇᴏ ᴅᴏᴡɴʟᴏᴀᴅᴇʀ")) + }; + let _0x3d0cf7 = { + [_0x5b10f0]: fs.readFileSync(_0x5d70e6), + mimetype: "video/mp4", + fileName: _0x56042a, + caption: Config.caption, + contextInfo: _0x3048ab + }; + await _0xe5ea97.bot.sendMessage(_0xe5ea97.jid, _0x3d0cf7, { + quoted: _0xe5ea97 + }); + try { + fs.unlinkSync(_0x5d70e6); + } catch {} + ; + } catch (_0x6c0641) { + console.log("ytdl Download video error:", _0x6c0641); + try { + let _0x4e4465 = await yt.getInfo(_0x421809[1]); + if (_0x4e4465.duration >= videotime) { + _0x5b10f0 = "document"; + } + let _0x3d6d42 = { + type: "video", + quality: _0x4e4465.pref_Quality || "best", + format: "mp4" + }; + let _0x3e3caf = await yt.download(_0x421809[1], _0x3d6d42); + var _0x3048ab = { + ...(await _0xe5ea97.bot.contextInfo(Config.botname, "ᴠɪᴅᴇᴏ ᴅᴏᴡɴʟᴏᴀᴅᴇʀ")) + }; + let _0x3448d2 = _0x4e4465.title || _0x3e3caf || _0x421809[1] || "Suhail MD -- YT Video"; + if (_0x3e3caf) { + await _0xe5ea97.bot.sendMessage(_0xe5ea97.chat, { + [_0x5b10f0]: { + url: _0x3e3caf + }, + fileName: _0x3448d2, + caption: Config.caption, + mimetype: "video/mp4", + contextInfo: _0x3048ab + }); + } else { + await _0xe5ea97.send("Video not Found"); + } + try { + fs.unlinkSync("" + _0x3e3caf); + } catch {} + } catch (_0x55db8f) { + return _0xe5ea97.error(_0x55db8f + "\n\ncommand: video", _0x55db8f, "*_Video not Found_*"); + } + } +}); +smd({ + pattern: "video2", + desc: "Downloads video from yt.", + category: "downloader", + filename: __filename, + use: "" +}, async (_0xf4a47, _0x5af7a0) => { + let _0x51cced = _0x5af7a0 ? _0x5af7a0 : _0xf4a47.reply_text; + if (!_0x51cced) { + return _0xf4a47.reply("Example : " + prefix + "video2 surah rehman"); + } + var _0x5cbfdb = _0x51cced.toLowerCase().includes("doc") ? "document" : "video"; + let _0x45b86d = ytIdRegex.exec(_0x5af7a0) || []; + let _0x1b8dbb = _0x45b86d[0] || false; + try { + if (!_0x1b8dbb) { + let _0x39917e = await yts(_0x51cced); + let _0x4edc53 = _0x39917e.videos[0]; + _0x1b8dbb = _0x4edc53.url; + _0x45b86d = ytIdRegex.exec(_0x1b8dbb); + } + } catch {} + try { + let _0x158918 = await yt.getInfo(_0x45b86d[1]); + let _0x355f66 = { + type: "video", + quality: _0x158918.pref_Quality || "best", + format: "mp4" + }; + if (_0x158918.duration >= videotime) { + _0x5cbfdb = "document"; + } + let _0x2b6ac2 = await yt.download(_0x45b86d[1], _0x355f66); + let _0x10f021 = _0x158918.title || _0x2b6ac2 || _0x45b86d[1]; + var _0x1e7392 = { + ...(await _0xf4a47.bot.contextInfo(Config.botname, "ᴠɪᴅᴇᴏ ᴅᴏᴡɴʟᴏᴀᴅᴇʀ")) + }; + if (_0x2b6ac2) { + await _0xf4a47.bot.sendMessage(_0xf4a47.chat, { + [_0x5cbfdb]: { + url: _0x2b6ac2 + }, + fileName: _0x10f021, + caption: Config.caption, + mimetype: "video/mp4", + contextInfo: _0x1e7392 + }); + } else { + await _0xf4a47.send("Video not Found"); + } + try { + fs.unlinkSync("" + _0x2b6ac2); + } catch {} + } catch (_0x1257db) { + return _0xf4a47.error(_0x1257db + "\n\ncommand: video", _0x1257db, "*_Video not Found_*"); + } +}); +smd({ + pattern: "play", + alias: ["music"], + desc: "Sends info about the query(of youtube video/audio).", + category: "downloader", + filename: __filename, + use: "" +}, async (_0x54463e, _0x1f76d0) => { + try { + let _0x25d045 = _0x1f76d0 ? _0x1f76d0 : _0x54463e.reply_text; + var _0x2e913a = _0x25d045.toLowerCase().includes("doc") ? "document" : "audio"; + if (!_0x25d045) { + return _0x54463e.reply("*" + prefix + "play back in black*"); + } + let _0x2eca3d = ytIdRegex.exec(_0x25d045) || []; + let _0xb6fd2d = _0x2eca3d[0] || false; + if (!_0xb6fd2d) { + let _0x4bcf6d = await yts(_0x25d045); + let _0xa244ed = _0x4bcf6d.videos[0]; + _0xb6fd2d = _0xa244ed.url; + } + _0x2eca3d = ytIdRegex.exec(_0xb6fd2d) || []; + let _0x6845ab = await yt.getInfo(_0x2eca3d[1]); + let _0x516e89 = _0x6845ab.title || _0x37323e || _0x2eca3d[1]; + if (_0x6845ab && _0x6845ab.duration >= videotime) { + return await _0x54463e.reply("*_Can't dowanload, file duration too big_*"); + } + await _0x54463e.send("_Downloading " + _0x6845ab.title + "?_"); + let _0x37323e = await yt.download(_0x2eca3d[1], { + type: "audio", + quality: "best" + }); + var _0x28302f = { + ...(await _0x54463e.bot.contextInfo(Config.botname, "ꜱᴏɴɢ ᴅᴏᴡɴʟᴏᴀᴅᴇʀ")) + }; + if (_0x37323e) { + await _0x54463e.bot.sendMessage(_0x54463e.jid, { + [_0x2e913a]: { + url: _0x37323e + }, + fileName: _0x516e89, + mimetype: "audio/mpeg", + contextInfo: _0x28302f + }); + } else { + _0x54463e.send("*_Video not Found_*"); + } + try { + fs.unlinkSync(_0x37323e); + } catch {} + } catch (_0x593953) { + return _0x54463e.error(_0x593953 + "\n\ncommand: play", _0x593953, "*_Video not Found_*"); + } +}); +smd({ + pattern: "sound", + desc: "Downloads ringtone.", + category: "downloader", + filename: __filename, + use: "" +}, async (_0x2ee3dd, _0x20a520) => { + try { + if (!_0x20a520) { + return _0x2ee3dd.reply("*Give A Number Example: " + prefix + "sound 5*"); + } + const _0x19c223 = parseInt(_0x20a520); + if (_0x19c223.toString() == "NaN" || _0x19c223 < 1 || _0x19c223 > 160) { + return _0x2ee3dd.reply("*_❌ Give a number between 1 to 160_*"); + } + let _0xf0331a = "https://github.com/DGXeon/Tiktokmusic-API/raw/master/tiktokmusic/sound" + _0x19c223.toString() + ".mp3"; + let _0x2ba501 = await getBuffer(_0xf0331a); + var _0x29fdd9 = { + ...(await _0x2ee3dd.bot.contextInfo(Config.botname, "ᴛɪᴋᴛᴏᴋ ꜱᴏᴜɴᴅ " + _0x19c223)) + }; + let _0x4737bb = { + audio: _0x2ba501, + fileName: "Suhail-Md tiktok Sound" + _0x19c223 + ".m4a", + mimetype: "audio/mpeg", + ptt: true, + contextInfo: _0x29fdd9 + }; + return _0x2ee3dd.bot.sendMessage(_0x2ee3dd.chat, _0x4737bb, { + quoted: _0x2ee3dd + }); + } catch (_0x223ebb) { + return _0x2ee3dd.error(_0x223ebb + "\n\ncommand: sound", _0x223ebb, false); + } +}); +smd({ + pattern: "tiktok", + alias: ["tt", "ttdl"], + desc: "Downloads Tiktok Videos Via Url.", + category: "downloader", + filename: __filename, + use: "" +}, async (message, url) => { + try { + const fileType = url.toLowerCase().includes("doc") ? "document" : url.toLowerCase().includes("mp3") ? "audio" : "video"; + + if (!url) { + return await message.reply(`*Uhh Please, Provide me tiktok Video Url*\n*_Ex ${prefix}tiktok https://www.tiktok.com/@dakwahmuezza/video/7150544062221749531_*`); + } + + const tiktokUrl = url ? url.split(" ")[0] : ""; + + if (!/tiktok/.test(tiktokUrl)) { + return await message.reply("*Uhh Please, Give me Valid Tiktok Video Url!*"); + } + + const apiUrl = "https://api-smd.onrender.com/api/ttdl2"; + const response = await fetch(`${apiUrl}?url=${tiktokUrl}`); + const data = await response.json(); + + if (data && data.video && data.video.noWatermark) { + return await message.send(data.video.noWatermark, { caption: Config.caption }, fileType, message); + } else { + return await message.reply("Error While Downloading Your Video"); + } + } catch (error) { + return message.error(`${error}\n\ncommand: tiktok`, error); + } +}); +smd({ + pattern: "ringtone", + desc: "Downloads ringtone.", + category: "downloader", + filename: __filename, + use: "" +}, async (_0x1da3da, _0x2f0451) => { + try { + if (!_0x2f0451) { + return _0x1da3da.reply("Example: " + prefix + "ringtone back in black"); + } + const { + ringtone: _0x2ec04e + } = require("../lib/scraper"); + let _0x5f35d4 = await _0x2ec04e(_0x2f0451); + var _0x2e165b = { + ...(await _0x1da3da.bot.contextInfo(Config.botname, "ʀɪɴɢᴛᴏɴᴇ ᴅᴏᴡɴʟᴏᴀᴅᴇʀ")) + }; + let _0x5c9751 = { + audio: { + url: _0x5f35d4[0].audio + }, + caption: "*" + _0x5f35d4[0].title + "*", + fileName: _0x5f35d4[0].title + ".mp3", + mimetype: "audio/mpeg", + contextInfo: _0x2e165b + }; + return _0x1da3da.bot.sendMessage(_0x1da3da.jid, _0x5c9751, { + quoted: _0x1da3da + }); + } catch (_0x430a86) { + return _0x1da3da.error(_0x430a86 + "\n\ncommand: ringtone", _0x430a86, "*_Ringtone not found with given name!!_*"); + } +}); +smd({ + pattern: "pint", + alias: ["pinterest"], + desc: "Downloads image from pinterest.", + category: "downloader", + filename: __filename, + use: "" +}, async (_0xf8b0b, _0x589f9c) => { + try { + if (!_0x589f9c) { + return _0xf8b0b.reply("What picture are you looking for?"); + } + let _0x383852 = (await pinterest(_0x589f9c)) || []; + if (!_0x383852 || !_0x383852[0]) { + return await _0xf8b0b.send("*_No Result found!_*"); + } + var _0x132d25 = { + ...(await _0xf8b0b.bot.contextInfo(Config.botname, "ᴘɪɴᴛᴇʀᴇꜱᴛ ᴅᴏᴡɴʟᴏᴀᴅᴇʀ")) + }; + let _0x21ce53 = _0x383852.length < 5 ? _0x383852.length : 5; + for (let _0x1af9e9 = 0; _0x1af9e9 < _0x21ce53; _0x1af9e9++) { + await _0xf8b0b.bot.sendMessage(_0xf8b0b.chat, { + image: { + url: _0x383852[_0x1af9e9] + }, + contextInfo: _0x132d25 + }); + } + } catch (_0x5c4711) { + return _0xf8b0b.reply("Uhh Plese, Give me a Name. Ex .pint apple"); + } +}); +smd({ + pattern: "mediafire", + alias: ["mf", "mfire"], + desc: "Downloads media from Mediafire.", + category: "downloader", + filename: __filename, + use: "" +}, async (_0x1ccf8b, _0x33d036) => { + try { + let _0x4ae56d = _0x33d036.includes("mediafire.com") ? _0x33d036 : _0x1ccf8b.reply_text || ""; + if (!_0x4ae56d.includes("mediafire.com")) { + return _0x1ccf8b.reply("*_Provide mediafire url, Use: " + prefix + "mf https://www.mediafire.com/file/i33wo2xvgvid05m/muezzaverse_2221749531_musicaldown.com.mp4/file!_*"); + } + let _0x4190c2 = _0x4ae56d.split(" ")[0]; + const _0x15a389 = await mediafire(_0x4190c2); + if (!_0x15a389 || !_0x15a389[0]) { + return _0x1ccf8b.reply("could not found anything"); + } + let _0x504ec3 = "『 *Mᴇᴅɪᴀғɪʀᴇ Dᴏᴡɴʟᴏᴀᴅᴇʀ* 』\n\n *Name* : " + _0x15a389[0].nama + "\n *Size* :" + _0x15a389[0].size + "\n *Mime* : " + _0x15a389[0].mime + "\n \n\n" + Config.caption; + _0x504ec3 = await fancytext(_0x504ec3, 25); + var _0x227c35 = { + ...(await _0x1ccf8b.bot.contextInfo(Config.botname, "MEDIAFIRE")) + }; + let _0x33773c = { + document: { + url: _0x15a389[0].link + }, + caption: _0x504ec3, + fileName: _0x15a389[0].nama, + mimetype: _0x15a389[0].mime, + contextInfo: _0x227c35 + }; + return await _0x1ccf8b.bot.sendMessage(_0x1ccf8b.chat, _0x33773c); + } catch (_0x50b778) { + return _0x1ccf8b.error(_0x50b778 + "\n\ncommand: mediafire", _0x50b778, "*_File not found!!_*"); + } +}); +smd({ + pattern: "song", + alias: ["audio"], + desc: "Downloads audio from youtube.", + category: "downloader", + filename: __filename, + use: "" +}, async (_0x2c2023, _0x4ec99f) => { + try { + if (!_0x4ec99f) { + return await _0x2c2023.reply("*_Give Me Search Query_*"); + } + let _0x3b2ca6 = await yts(_0x4ec99f); + let _0x4123ae = _0x3b2ca6.all[0]; + let _0x5883a9 = "\t *ᴀsᴛᴀ-ᴍᴅ • sᴏɴɢ ᴅᴏᴡɴʟᴏᴀᴅᴇʀ* \n\n*Title :* " + _0x4123ae.title + "\nUrl : " + _0x4123ae.url + "\n*Description :* " + _0x4123ae.timestamp + "\n*Views :* " + _0x4123ae.views + "\n*Uploaded :* " + _0x4123ae.ago + "\n*Author :* " + _0x4123ae.author.name + "\n\n\n_Reply 1 To Video_ Or _1 document_\n_Reply 2 To Audio_ Or _2 document_"; + let _0x3885cc = await smdBuffer(_0x4123ae.thumbnail); + var _0x44a363 = { + ...(await _0x2c2023.bot.contextInfo(Config.botname, "ʏᴏᴜᴛᴜʙᴇ ꜱᴏɴɢ", _0x3885cc)) + }; + await _0x2c2023.bot.sendMessage(_0x2c2023.jid, { + image: _0x3885cc, + caption: _0x5883a9, + contextInfo: _0x44a363 + }); + } catch (_0x86b411) { + return _0x2c2023.error(_0x86b411 + "\n\ncommand: mediafire", _0x86b411, "*_File not found!!_*"); + } +}); +cmd({ + pattern: "yts", + alias: ["yt", "ytsearch"], + desc: "Search Song From youtube", + category: "downloader", + filename: __filename, + use: "" +}, async (_0x1c8285, _0xca939c) => { + try { + if (!_0xca939c) { + return await _0x1c8285.reply("*_Give Me Search Query!_*"); + } + let _0x2878ec = await yts(_0xca939c); + let _0x4186e4 = "*ᴀsᴛᴀ-ᴍᴅ • ʏᴏᴜᴛᴜʙᴇ ᴅᴏᴡɴʟᴏᴀᴅ* \n*_______________________________* \n\n_Reply Any Number To Download._\n _For Audio: 1 mp3._\n _For Video: 1 video._\n _For document: 1 document._\n\n_Results For : " + _0xca939c + "_ \n\n"; + let _0x463366 = 1; + for (let _0x308e22 of _0x2878ec.all) { + _0x4186e4 += " \n*" + _0x463366++ + " : " + _0x308e22.title + (_0x308e22.timestamp ? "(" + _0x308e22.timestamp + ")" : "") + "*\n*Url : " + _0x308e22.url + "*"; + } + return await _0x1c8285.sendMessage(_0x1c8285.chat, { + image: { + url: _0x2878ec.all[0].thumbnail + }, + caption: _0x4186e4 + }, { + quoted: _0x1c8285 + }); + } catch (_0x5089b0) {} +}); +smd({ + pattern: "ytmp4", + alias: ["ytv", "ytvid", "ytvideo"], + desc: "Downloads video from youtube.", + category: "downloader", + filename: __filename, + use: "" +}, async (_0x1d4717, _0x3716fd) => { + let _0x2d4f04 = _0x3716fd ? _0x3716fd : _0x1d4717.reply_text; + var _0x58ceb6 = _0x2d4f04.toLowerCase().includes("doc") ? "document" : _0x2d4f04.toLowerCase().includes("mp3") ? "audio" : "video"; + const _0x4a3f32 = ytIdRegex.exec(_0x2d4f04) || []; + if (!_0x2d4f04 || !_0x4a3f32[0]) { + return await _0x1d4717.reply("*_provide youtube video url!_*"); + } + try { + let _0x5c93a9 = await ytdl.getInfo(_0x4a3f32[0]); + if (_0x5c93a9.videoDetails.lengthSeconds >= videotime) { + _0x58ceb6 = "document"; + } + let _0x1a3a4c = _0x5c93a9.videoDetails.title; + let _0x1c86b6 = "./temp/" + _0x4a3f32[1] + ".mp4"; + const _0x1f15ef = ytdl(_0x4a3f32[0], { + filter: _0x4c0ea7 => _0x4c0ea7.itag == 22 || _0x4c0ea7.itag == 18 + }).pipe(fs.createWriteStream(_0x1c86b6)); + await new Promise((_0x517788, _0x429bfa) => { + _0x1f15ef.on("error", _0x429bfa); + _0x1f15ef.on("finish", _0x517788); + }); + var _0x3b1bff = { + ...(await _0x1d4717.bot.contextInfo(Config.botname, "ʏᴛᴅʟ ᴠɪᴅᴇᴏ")) + }; + let _0x4d676e = { + [_0x58ceb6]: fs.readFileSync(_0x1c86b6), + mimetype: "video/mp4", + fileName: _0x1a3a4c, + caption: " *Here's Your Video*\n" + Config.caption, + contextInfo: _0x3b1bff + }; + await _0x1d4717.bot.sendMessage(_0x1d4717.jid, _0x4d676e, { + quoted: _0x1d4717 + }); + try { + return await fs.unlinkSync(_0x1c86b6); + } catch {} + } catch (_0x15d510) { + console.log("here now,ytdl-core error: ", _0x15d510); + try { + let _0x5a46ec = await yt.getInfo(_0x4a3f32[1]); + let _0x257939 = { + type: "video", + quality: _0x5a46ec.pref_Quality || "best", + format: "mp4" + }; + if (_0x5a46ec.duration >= videotime) { + _0x58ceb6 = "document"; + } + let _0x588c42 = await yt.download(_0x4a3f32[1], _0x257939); + var _0x3b1bff = { + ...(await _0x1d4717.bot.contextInfo(Config.botname, "ʏᴏᴜᴛᴜʙᴇ ᴠɪᴅᴇᴏ")) + }; + let _0x13be6f = _0x5a46ec.title || _0x588c42 || _0x4a3f32[1]; + if (_0x588c42) { + await _0x1d4717.bot.sendMessage(_0x1d4717.chat, { + [_0x58ceb6]: { + url: _0x588c42 + }, + fileName: _0x13be6f, + mimetype: "video/mp4", + contextInfo: _0x3b1bff + }); + } else { + await _0x1d4717.send("*_Video not Found_*"); + } + try { + fs.unlinkSync("" + _0x588c42); + } catch {} + return; + } catch (_0x363775) { + return _0x1d4717.error(_0x363775 + "\n\ncommand: ytmp4", _0x363775, "*_Uhh dear, Video not Found!!_*"); + } + } +}); +smd({ + pattern: "ytmp3", + alias: ["yta"], + desc: "Downloads audio by yt link.", + category: "downloader", + use: "" +}, async (_0x3f8930, _0x5834bb) => { + let _0x4fe91c = _0x5834bb ? _0x5834bb : _0x3f8930.reply_text; + var _0x540f68 = _0x4fe91c.toLowerCase().includes("doc") ? "document" : "audio"; + const _0x2758ec = ytIdRegex.exec(_0x4fe91c) || []; + if (!_0x4fe91c || !_0x2758ec[0]) { + return await _0x3f8930.reply("*_Uhh please, Provide youtube video url!_*"); + } + try { + let _0x4b5067 = await ytdl.getInfo(_0x2758ec[0]); + if (_0x4b5067.videoDetails.lengthSeconds >= videotime) { + _0x540f68 = "document"; + } + let _0xaca4bd = _0x4b5067.videoDetails.title; + let _0x24816a = "./temp/" + _0x2758ec[1] + ".mp3"; + const _0x2591f0 = ytdl(_0x2758ec[0], { + filter: _0x4e89f2 => _0x4e89f2.audioBitrate == 160 || _0x4e89f2.audioBitrate == 128 + }).pipe(fs.createWriteStream(_0x24816a)); + await new Promise((_0x401b5b, _0x3d90fd) => { + _0x2591f0.on("error", _0x3d90fd); + _0x2591f0.on("finish", _0x401b5b); + }); + var _0x29af08 = { + ...(await _0x3f8930.bot.contextInfo(Config.botname, "ʏᴏᴜᴛᴜʙᴇ ᴠɪᴅᴇᴏ")) + }; + let _0x4c646c = { + [_0x540f68]: fs.readFileSync(_0x24816a), + mimetype: "audio/mpeg", + fileName: _0xaca4bd, + contextInfo: _0x29af08 + }; + await _0x3f8930.bot.sendMessage(_0x3f8930.jid, _0x4c646c, { + quoted: _0x3f8930 + }); + try { + return await fs.unlinkSync(_0x24816a); + } catch {} + } catch (_0x345ce7) { + console.log("here now,ytdl-core : ", _0x345ce7); + try { + let _0x5b9011 = await yt.download(_0x2758ec[1], { + type: "audio", + quality: "best" + }); + var _0x29af08 = { + ...(await _0x3f8930.bot.contextInfo(Config.botname, "ʏᴏᴜᴛᴜʙᴇ ᴠɪᴅᴇᴏ")) + }; + if (_0x5b9011) { + await _0x3f8930.bot.sendMessage(_0x3f8930.jid, { + [_0x540f68]: { + url: _0x5b9011 + }, + mimetype: "audio/mpeg", + fileName: Config.caption, + contextInfo: _0x29af08 + }); + } else { + await _0x3f8930.send("*_audio not Found!_*"); + } + try { + fs.unlinkSync(_0x5b9011); + } catch {} + } catch (_0x2cd979) { + await _0x3f8930.error(_0x2cd979 + "\n\ncommand: ytmp3", _0x2cd979, "*_Uhh dear, audio file not Found!!_*"); + } + } +}); +smd({ + pattern: "ytdoc", + alias: ["ytd"], + desc: "Downloads audio by yt link as document.", + category: "downloader", + use: "" +}, async (_0x17c662, _0x429696) => { + try { + let _0x5696a7 = _0x429696 ? _0x429696 : _0x17c662.reply_text; + const _0x1d542b = ytIdRegex.exec(_0x5696a7) || []; + if (!_0x5696a7 || !_0x1d542b[0]) { + return await _0x17c662.reply("❌Please provide me a url"); + } + var _0x43c5ac = _0x1d542b[1]; + var _0x59bbaa = false; + try { + let _0x32b31a = await ytdl.getInfo(_0x1d542b[0]); + _0x43c5ac = _0x32b31a.videoDetails.title; + let _0x4b47c3 = "./temp/Suhail-Md " + _0x1d542b[1] + ".mp3"; + const _0x212389 = ytdl(_0x1d542b[0], { + filter: _0xd2371a => _0xd2371a.audioBitrate == 160 || _0xd2371a.audioBitrate == 128 + }).pipe(fs.createWriteStream(_0x4b47c3)); + _0x59bbaa = _0x4b47c3; + await new Promise((_0x1506ab, _0x26e243) => { + _0x212389.on("error", _0x26e243); + _0x212389.on("finish", _0x1506ab); + }); + } catch (_0x18c033) { + console.log("here now,ytdl-core : ", _0x18c033); + try { + _0x59bbaa = await yt.download(_0x1d542b[1], { + type: "audio", + quality: "best" + }); + } catch (_0x4122cc) { + return await _0x17c662.error(_0x4122cc + "\n\ncommand: ytdoc", _0x4122cc, "*_file not Found!!_*"); + } + } + if (!_0x59bbaa) { + return await _0x17c662.send("*_Uhh dear, video not found_*"); + } + var _0x10e2fa = { + ...(await _0x17c662.bot.contextInfo(Config.botname, "ʏᴛᴅᴏᴄ ᴍᴘ3 ʏᴏᴜᴛᴜʙᴇ")) + }; + let _0x300d1a = { + document: { + url: _0x59bbaa + }, + mimetype: "audio/mpeg", + fileName: "Suhail-Md--" + _0x1d542b[1] + ".mp3", + caption: Config.caption, + contextInfo: _0x10e2fa + }; + await _0x17c662.bot.sendMessage(_0x17c662.jid, _0x300d1a, { + quoted: _0x17c662 + }); + try { + return await fs.unlinkSync(_0x59bbaa); + } catch {} + } catch (_0xbed50) { + await _0x17c662.error(_0xbed50 + "\n\ncommand: ytdoc", _0xbed50, "*_audio file not Found!!_*"); + } +}); +cmd({ + on: "text" +}, async (_0xb75e78, _0x221e78, { + isCreator: _0xfbeec5 +}) => { + if (_0xb75e78.quoted && _0xb75e78.text) { + const _0x5b8ee5 = _0xb75e78.quoted.text.split("\n"); + if (_0x5b8ee5[0].includes("ᴀsᴛᴀ-ᴍᴅ • sᴏɴɢ ᴅᴏᴡɴʟᴏᴀᴅᴇʀ")) { + const _0x1724ba = _0x5b8ee5.find(_0x525632 => _0x525632.startsWith("Url :")); + let _0x43a95e = _0x1724ba.replace("Url :", "").trim(); + try { + await _0xb75e78.sendMessage(_0xb75e78.chat, { + react: { + text: "✨", + key: _0xb75e78.key + } + }); + let _0x4cd3b2; + if (_0xb75e78.text.startsWith("1")) { + let _0x3edf2a = _0x221e78.toLowerCase().includes("doc") ? "document" : _0x221e78.toLowerCase().includes("mp3") ? "audio" : "video"; + _0x4cd3b2 = "./temp/ytsong.mp4"; + const _0x5e7871 = ytdl(_0x43a95e, { + filter: _0x145c7e => _0x145c7e.itag == 22 || _0x145c7e.itag == 18 + }).pipe(fs.createWriteStream(_0x4cd3b2)); + await new Promise((_0x540130, _0xf6b8ae) => { + _0x5e7871.on("error", _0xf6b8ae); + _0x5e7871.on("finish", _0x540130); + }); + await _0xb75e78.sendMessage(_0xb75e78.chat, { + [_0x3edf2a]: fs.readFileSync(_0x4cd3b2), + mimetype: _0x3edf2a == "audio" ? "audio/mpeg" : "video/mp4", + fileName: Config.caption, + caption: Config.caption + }, { + quoted: _0xb75e78 + }); + } else if (_0xb75e78.text.startsWith("2")) { + let _0x5d9956 = _0x221e78.toLowerCase().includes("doc") ? "document" : "audio"; + _0x4cd3b2 = "./temp/ytsong.mp3"; + const _0x39ddb9 = ytdl(_0x43a95e, { + filter: _0xa5f832 => _0xa5f832.audioBitrate == 160 || _0xa5f832.audioBitrate == 128 + }).pipe(fs.createWriteStream(_0x4cd3b2)); + await new Promise((_0x4790a8, _0x9a005b) => { + _0x39ddb9.on("error", _0x9a005b); + _0x39ddb9.on("finish", _0x4790a8); + }); + await _0xb75e78.sendMessage(_0xb75e78.chat, { + [_0x5d9956]: fs.readFileSync(_0x4cd3b2), + mimetype: "audio/mpeg", + fileName: Config.caption + }, { + quoted: _0xb75e78 + }); + } + try { + return fs.unlinkSync(_0x4cd3b2); + } catch (_0x51cca7) {} + } catch (_0x189dd8) { + return await _0xb75e78.reply("Error While Downloading Video : " + _0x189dd8); + } + } else if (_0x5b8ee5[0].includes("ᴀsᴛᴀ-ᴍᴅ • ʏᴏᴜᴛᴜʙᴇ ᴅᴏᴡɴʟᴏᴀᴅ")) { + let _0x307bb6 = "*" + _0xb75e78.text.split(" ")[0] + " : "; + const _0x56275d = _0x5b8ee5.find(_0x3b5e74 => _0x3b5e74.startsWith(_0x307bb6)); + if (_0x56275d) { + try { + let _0x3e1826 = _0x56275d.replace(_0x307bb6, "").split("*")[0].trim(); + const _0x4d9213 = _0x5b8ee5[_0x5b8ee5.indexOf(_0x56275d) + 1]; + const _0x37a579 = _0x4d9213.split("*")[1].replace("Url : ", "").trim(); + if (_0x37a579.startsWith("http")) { + await _0xb75e78.sendMessage(_0xb75e78.chat, { + react: { + text: "✨", + key: _0xb75e78.key + } + }); + let _0x1d3325 = _0x221e78.toLowerCase().includes("doc") ? "document" : _0x221e78.toLowerCase().includes("mp3") ? "audio" : "video"; + let _0x26cc84 = "./temp/Yts Download " + Math.floor(Math.random() * 10000) + ".mp4"; + const _0x104b4c = ytdl(_0x37a579, { + filter: _0x31a431 => _0x31a431.itag == 22 || _0x31a431.itag == 18 + }).pipe(fs.createWriteStream(_0x26cc84)); + await new Promise((_0x45b31c, _0x5b6595) => { + _0x104b4c.on("error", _0x5b6595); + _0x104b4c.on("finish", _0x45b31c); + }); + await _0xb75e78.sendMessage(_0xb75e78.chat, { + [_0x1d3325]: fs.readFileSync(_0x26cc84), + mimetype: _0x1d3325 == "audio" ? "audio/mpeg" : "video/mp4", + fileName: "" + _0x3e1826, + caption: _0x3e1826 + " \n " + Config.caption + }, { + quoted: _0xb75e78 + }); + try { + fs.unlink(_0x26cc84); + } catch (_0x338800) {} + } + } catch (_0x3de0e2) { + _0xb75e78.error(_0x3de0e2 + "\n\nCommand yts Listener", _0x3de0e2, "*Video Not Found!*"); + } + } + } else if (_0x5b8ee5[0].includes("ᴀsᴛᴀ-ᴍᴅ • ᴀᴘᴋ ᴅᴏᴡɴʟᴏᴀᴅ ʟɪsᴛ")) { + let _0x35d668 = "*" + _0xb75e78.text.split(" ")[0] + " : "; + const _0x205a5f = _0x5b8ee5.find(_0x304058 => _0x304058.startsWith(_0x35d668)); + if (_0x205a5f) { + try { + let _0x17567d = _0x205a5f.replace(_0x35d668, "").split("*")[0].trim(); + const _0x14618c = _0x5b8ee5[_0x5b8ee5.indexOf(_0x205a5f) + 1]; + const _0x2407a8 = _0x14618c.split("*")[1].replace("Id : ", "").trim(); + await _0xb75e78.sendMessage(_0xb75e78.chat, { + react: { + text: "✨", + key: _0xb75e78.key + } + }); + let _0x37b3a4 = await download(_0x2407a8); + let _0x478b37 = "*App Name :* " + _0x37b3a4.name; + _0x478b37 += "\n*App id :* " + _0x37b3a4.package; + _0x478b37 += "\n*Last Up :* " + _0x37b3a4.lastup; + _0x478b37 += "\n*App Size :* " + _0x37b3a4.size; + _0x478b37 += "\n \n" + Config.caption; + let _0x5032aa = { + document: { + url: _0x37b3a4.dllink + }, + mimetype: "application/vnd.android.package-archive", + fileName: _0x37b3a4.name + ".apk", + caption: _0x478b37 + }; + return await _0xb75e78.sendMessage(_0xb75e78.chat, _0x5032aa, { + quoted: _0xb75e78 + }); + } catch (_0x12fd88) { + _0xb75e78.reply("*_Can't Download, App Limit Exceed_*"); + } + } + } + } +}); +/** PLAYLIST */ +const _0xf3b3b9 = _0xc1f2; +function _0xe8a3() { + const _0x1872b6 = ["audio", "random", "length", ".mp4", "6710240SkWnCZ", "readFileSync", "Downloads video from playlist.", "", "title", "videos", "sendMessage", "2179701ijsDnM", "botname", "4565025fjxWjZ", "pushName", "168uBIxwJ", "document", "includes", "216vVeWdZ", "itag", "\n ⿻ File Size : ", "reply", "chat", "11410952QXDvWH", "mp3", " MB", "614495gBYQxj", "split", "toLowerCase", "floor", "downloader", "videoDetails", "audio/mpeg", "videoId", "This Process will take a bit time.", "2487090FcjOyi", "❌ File size bigger than ", "pipe", "statSync", "mb.", "test", "log", "lengthSeconds", "getInfo", "61665AJJjOP", "./temp/", "unlinkSync"]; + _0xe8a3 = function () { + return _0x1872b6; + }; + return _0xe8a3(); +} +function _0xc1f2(_0x44febb, _0x412500) { + const _0xe8a308 = _0xe8a3(); + _0xc1f2 = function (_0xc1f20d, _0x460a50) { + _0xc1f20d = _0xc1f20d - 214; + let _0x14f3b6 = _0xe8a308[_0xc1f20d]; + return _0x14f3b6; + }; + return _0xc1f2(_0x44febb, _0x412500); +} +(function (_0x131f7c, _0x3f6081) { + const _0x3b3c98 = _0xc1f2; + const _0x165db2 = _0x131f7c(); + while (true) { + try { + const _0x538451 = -parseInt(_0x3b3c98(249)) / 1 + -parseInt(_0x3b3c98(258)) / 2 + parseInt(_0x3b3c98(236)) / 3 + -parseInt(_0x3b3c98(227)) / 4 + -parseInt(_0x3b3c98(220)) / 5 * (parseInt(_0x3b3c98(241)) / 6) + -parseInt(_0x3b3c98(246)) / 7 + -parseInt(_0x3b3c98(238)) / 8 * (-parseInt(_0x3b3c98(234)) / 9); + if (_0x538451 === _0x3f6081) { + break; + } else { + _0x165db2.push(_0x165db2.shift()); + } + } catch (_0x1c3a5e) { + _0x165db2.push(_0x165db2.shift()); + } + } +})(_0xe8a3, 997920); +smd({ + pattern: "playlist", + desc: _0xf3b3b9(229), + category: _0xf3b3b9(253), + filename: __filename, + use: _0xf3b3b9(230) +}, async (_0x1283e0, _0x45d2ef, { + Void: _0xc34be3 +}) => { + const _0x38a391 = _0xf3b3b9; + try { + var _0x5d6154 = 2000; + var _0x1a03f5 = 400; + var _0x3ef119 = _0x45d2ef[_0x38a391(251)]().includes("doc") ? "document" : _0x45d2ef[_0x38a391(251)]()[_0x38a391(240)](_0x38a391(247)) || _0x45d2ef[_0x38a391(251)]().includes(_0x38a391(223)) ? _0x38a391(223) : "video"; + const _0x5c2288 = _0x5202bc => { + const _0x2d6457 = _0x38a391; + return "" + Math[_0x2d6457(252)](Math[_0x2d6457(224)]() * 10000) + _0x5202bc; + }; + if (!_0x45d2ef || !_0x45d2ef.includes("=") || !/http/gi[_0x38a391(216)](_0x45d2ef)) { + return await _0x1283e0[_0x38a391(244)]("*Use Playlist URL, Like: " + prefix + "playlist https://www.youtube.com/playlist?list=PLZeei0S6_unh-jTeWsJI1mOI6snxeHn5c*"); + } + let _0x1c2a7e = _0x45d2ef[_0x38a391(250)]("=")[1][_0x38a391(250)](" ")[0]; + console[_0x38a391(217)](_0x1c2a7e); + var _0x20ebc9 = { + listId: _0x1c2a7e + }; + yts(_0x20ebc9, async function (_0x594f1f, _0x2548a3) { + const _0x5c8996 = _0x38a391; + if (_0x594f1f) { + throw _0x594f1f; + } + _0x1283e0.reply(_0x5c8996(257)); + for (let _0x1492ac = 0; _0x1492ac < _0x2548a3[_0x5c8996(232)][_0x5c8996(225)]; _0x1492ac++) { + if (_0x2548a3.videos[_0x1492ac][_0x5c8996(256)] === undefined) { + continue; + } + let _0xdaf4e3 = _0x2548a3[_0x5c8996(232)][_0x1492ac][_0x5c8996(256)]; + try { + let _0x48a6df = await ytdl[_0x5c8996(219)](_0xdaf4e3); + if (_0x48a6df[_0x5c8996(254)][_0x5c8996(218)] >= _0x5d6154) { + _0x3ef119 = "document"; + } + let _0x5ec28d = _0x48a6df[_0x5c8996(254)][_0x5c8996(231)]; + let _0x1a85a9 = _0x5c2288(_0x5c8996(226)); + const _0x55ba81 = ytdl(_0xdaf4e3, { + filter: _0x1df4a7 => _0x1df4a7.itag == 22 || _0x1df4a7[_0x5c8996(242)] == 18 + })[_0x5c8996(260)](fs.createWriteStream(_0x5c8996(221) + _0x1a85a9)); + await new Promise((_0x1e87e2, _0x352753) => { + _0x55ba81.on("error", _0x352753); + _0x55ba81.on("finish", _0x1e87e2); + }); + let _0x5e17d6 = fs[_0x5c8996(214)](_0x5c8996(221) + _0x1a85a9); + let _0x1e47e6 = _0x5e17d6.size; + let _0x4a0671 = _0x1e47e6 / 1048576; + if (_0x4a0671 <= _0x1a03f5) { + let _0x3eab5e = { + [_0x3ef119]: fs[_0x5c8996(228)](_0x5c8996(221) + _0x1a85a9), + mimetype: _0x3ef119 == "audio" ? _0x5c8996(255) : "video/mp4", + fileName: "" + _0x5ec28d, + caption: _0x3ef119 == _0x5c8996(239) ? "" : " ⿻ Title : " + _0x5ec28d + _0x5c8996(243) + _0x4a0671 + _0x5c8996(248), + headerType: 4, + contextInfo: { + externalAdReply: { + title: Config[_0x5c8996(235)], + body: _0x1283e0[_0x5c8996(237)], + thumbnail: log0, + renderLargerThumbnail: true, + mediaType: 2, + mediaUrl: gurl, + sourceUrl: gurl + } + } + }; + _0xc34be3[_0x5c8996(233)](_0x1283e0[_0x5c8996(245)], _0x3eab5e, { + quoted: _0x1283e0 + }); + } else { + _0x1283e0[_0x5c8996(244)](_0x5c8996(259) + _0x1a03f5 + _0x5c8996(215)); + } + try { + fs[_0x5c8996(222)](_0x5c8996(221) + _0x1a85a9); + } catch (_0x492195) {} + } catch (_0x312da2) { + console[_0x5c8996(217)](_0x312da2); + } + } + }); + } catch (_0x4bcd8f) { + console[_0x38a391(217)](_0x4bcd8f); + } +}); diff --git a/plugins/editorpack.js b/plugins/editorpack.js new file mode 100644 index 0000000..dad6bd3 --- /dev/null +++ b/plugins/editorpack.js @@ -0,0 +1,161 @@ +let baseApi = + process.env.API_SMD || global.api_smd || "https://api-smd-1.vercel.app"; + +const { + smd, + prefix, + Config, + createUrl, + photoEditor, + smdBuffer, +} = require("../lib"); +let photo = ["imageMessage"]; + +let gfxold = [ + "ad", + "uncover", + "clown", + "mnm", + "pet", + "drip", + "gun", + "colorify", +]; + +let gfxx = [ + "beautiful", + "blur", + "facepalm", + "invert", + "rainbow", + "wanted", + "wasted", + "greyscale", + "sepia", + "rip", + "trash", + "hitler", + "jail", + "shit", + "affect", + ...gfxold, +]; + +const sendEditor = async ( + m, + cmd, + error = true, + cap = Config.caption?.split("\n")[0] || "" +) => { + if (!gfxx.includes(cmd)) return; + try { + let mm = m.image + ? m + : m.reply_message && m.reply_message.image + ? m.reply_message + : false; + if (!mm || !photo.includes(mm.mtype2)) + return m.reply(`*_Uhh Dear, Reply To An Image!_*`); + let media = await m.bot.downloadAndSaveMediaMessage(mm); + var anu = ""; + try { + anu = (await createUrl(media, "uguMashi")).url; + if (!anu) throw new Error("invalid Media!"); + } catch (e) { + console.log(e); + try { + anu = await createUrl(media); + } catch (e) { + anu = false; + } + } + try { + fs.unlink(media); + } catch (e) {} + if (!anu) return m.reply("*_Failed To Create Url!_*"); + let base = await smdBuffer(`${baseApi}/api/maker/${cmd}?url=${anu}`); + + m.send(base, { caption: cap }, "img", mm); + } catch (e) { + if (error) { + console.log(e); + await m.error(`${e}\n\ncommand ${cmd}`, e, false); + } + } +}; + +for (let i = 0; i < gfxx.length; i++) { + smd( + { + cmdname: gfxx[i], + infocmd: `Edit image with ${gfxx[i]} effect!`, + type: "editor", + use: "< image >", + filename: __filename, + }, + async (m, text, { smd }) => { + try { + if (gfxold.includes(smd)) { + await photoEditor(m, smd); + } else { + sendEditor(m, smd); + } + } catch (err) { + await message.error( + `${err}\n\ncommand: ${smd}`, + err, + "Request Denied!" + ); + } + } + ); +} + +smd( + { + cmdname: "editor", + infocmd: "create gfx logo for text", + type: "editor", + use: "< image >", + filename: __filename, + }, + async (m, text, { smd }) => { + try { + let mm = m.image + ? m + : m.reply_message && m.reply_message.image + ? m.reply_message + : false; + + let too = `*Separate the text with _:_ sign!*\n*Example : ${ + prefix + smd + } Suhail _:_ Bot*`; + if (!mm) { + let str = `┌───〈 *ᴇᴅɪᴛᴏʀ ᴍᴇɴᴜ* 〉───◆ +│╭─────────────···▸ +┴│▸ +⬡│▸ ${gfxx.join(" \n⬡│▸ ")} +┬│▸ +│╰────────────···▸▸ +└───────────────···▸ + +\t *USE: _${prefix + smd}_ by replying image* +_To get All Results with single Cmd!_ +`; + return await m.sendUi(m.chat, { caption: str }); + } + + for (let i = 0; i < gfxx.length; i++) { + try { + if (gfxold.includes(gfxx[i])) { + await photoEditor(m, gfxx[i]); + } else { + sendEditor(m, gfxx[i], false); + } + } catch (e) {} + } + } catch (e) { + m.error(`${e}\n\nCommand: ${smd}`, e, false); + } + } +); diff --git a/plugins/games.js b/plugins/games.js new file mode 100644 index 0000000..088ad91 --- /dev/null +++ b/plugins/games.js @@ -0,0 +1,1381 @@ +const { + cmd +} = require("../lib/plugins"); +const eco = require("discord-mongoose-economy"); +const { + smd, + prefix, + send, + Config +} = require("../lib/"); +const axios = require('axios'); + +smd( + { + pattern: "guessage", + alias: ["age"], + desc: "Guesses the age of a person based on their name.", + category: "fun", + use: "guessage [name]", + examples: ["guessage John", "guessage Emily"] + }, + async (message, input) => { + const name = input; + + if (!name) { + return message.reply("Please provide a name to guess the age."); + } + + try { + const response = await axios.get(`https://api.agify.io/?name=${name}`); + const { count, age } = response.data; + + const output = ` +*Name:* ${name} +*Estimated Age:* ${age} +*Count:* ${count} + `; + + await message.send(output); + } catch (error) { + await message.error( + error + "\n\nCommand: guessage", + error, + "Failed to guess age." + ); + } + } +); +smd( + { + pattern: "guesscountry", + alias: ["country"], + desc: "Guesses the likely countries associated with a name.", + category: "fun", + use: "guesscountry [name]", + examples: ["guesscountry Michael", "guesscountry Fatima"] + }, + async (message, input) => { + const name = input; + + if (!name) { + return message.reply("Please provide a name to guess the country."); + } + + try { + const response = await axios.get(`https://api.nationalize.io/?name=${name}`); + const { count, country } = response.data; + + let output = ` +*Name:* ${name} +*Count:* ${count} +*Likely Countries:* +`; + + country.forEach((c, index) => { + output += `\n${index + 1}. ${c.country_id} (${(c.probability * 100).toFixed(2)}%)`; + }); + + await message.send(output); + } catch (error) { + await message.error( + error + "\n\nCommand: guesscountry", + error, + "Failed to guess country." + ); + } + } +); + +smd( + { + pattern: "guessgender", + alias: ["gender"], + desc: "Guesses the gender of a person based on their name.", + category: "fun", + use: "guessgender [name]", + examples: ["guessgender David", "guessgender Sarah"] + }, + async (message, input) => { + const name = input; + + if (!name) { + return message.reply("Please provide a name to guess the gender."); + } + + try { + const response = await axios.get(`https://api.genderize.io/?name=${name}`); + const { count, gender, probability } = response.data; + + const output = ` +*Name:* ${name} +*Estimated Gender:* ${gender} +*Probability:* ${(probability * 100).toFixed(2)}% +*Count:* ${count} + `; + + await message.send(output); + } catch (error) { + await message.error( + error + "\n\nCommand: guessgender", + error, + "Failed to guess gender." + ); + } + } +); + +const astro_patch_numGuess = {}; +class GuessingGame { + constructor() { + this.attempts = 0; + this.player = ""; + this.id = ""; + this.status = false; + this.mode = "low"; + this.randomNumber = 0; + this.guessedNumber = 0; + } +} +const logoName = "█▄ █ █ █ █▄ ▄█ ██▄ ██▀ █▀▄\n█ ▀█ █▄█ █ ▀ █ █▄█ █▄▄ █▀▄"; +smd({ + cmdname: "guess", + info: "Play Guessing Number game", + filename: __filename, + type: "game", + use: "< easy | medium | hard >" +}, async (_0x435f9e, _0x4a2fab) => { + try { + const _0x131859 = _0x435f9e.chat; + let _0x44b37a = astro_patch_numGuess[_0x131859]; + let _0x2bfba9 = _0x4a2fab.toLowerCase(); + let _0xc06dac = _0x44b37a && _0x44b37a?.player === _0x435f9e.sender ? true : _0x435f9e.isCreator; + if (_0x2bfba9 === "end" && _0x44b37a) { + if (_0xc06dac) { + delete astro_patch_numGuess[_0x131859]; + return await _0x435f9e.reply("*_Number Guessing Game ended. Goodbye!_*"); + } else { + return await _0x435f9e.reply("*_You're not player of running game!!_*"); + } + } else if (_0x2bfba9 === "end" && !_0x44b37a) { + return await _0x435f9e.reply("*_Hey " + (_0x435f9e.senderName || "buddy") + ", There's no game running yet!!_*"); + } + if (_0x44b37a && _0x44b37a.status) { + return await _0x435f9e.reply("*_A game is already in progress in this chat._*\n To End the Game: .Guess end"); + } + let _0x2f035f = ""; + let _0x29dc2e = 0; + if (_0x2bfba9.includes("easy")) { + _0x29dc2e = Math.floor(Math.random() * 100); + _0x2f035f = "Easy"; + } else if (_0x2bfba9.includes("medium")) { + _0x29dc2e = Math.floor(Math.random() * 1000); + _0x2f035f = "Medium"; + } else if (_0x2bfba9.includes("hard")) { + _0x29dc2e = Math.floor(Math.random() * 10000); + _0x2f035f = "Hard"; + } else { + return await _0x435f9e.send(logoName + "\n 𝗡𝘂𝗺𝗯𝗲𝗿 𝗚𝘂𝗲𝘀𝘀𝗶𝗻𝗴 𝗚𝗮𝗺𝗲 𝗠𝗲𝗻𝘂\n\n*Uhh Dear, Choose " + (_0x2bfba9 ? "a Valid Option" : "an Option") + " First, Like _" + prefix + "Guess Normal_*\n*𝗔𝘃𝗮𝗶𝗹𝗮𝗯𝗹𝗲 𝗠𝗼𝗱𝗲𝘀:*\n ▢ Easy ( _0 to 100_)\n ▢ Medium ( _0 to 1000_)\n ▢ Hard ( _0 to 10000_)\n ▢ End ( _End the Game_)\n"); + } + if (!_0x44b37a) { + astro_patch_numGuess[_0x131859] = new GuessingGame(); + } + _0x44b37a = astro_patch_numGuess[_0x131859]; + _0x44b37a.status = true; + _0x44b37a.randomNumber = _0x29dc2e; + _0x44b37a.mode = _0x2f035f; + _0x44b37a.player = _0x435f9e.sender; + _0x44b37a.id = _0x435f9e.chat; + await _0x435f9e.reply(logoName + "\n 𝗡𝘂𝗺𝗯𝗲𝗿 𝗚𝘂𝗲𝘀𝘀𝗶𝗻𝗴 𝗚𝗮𝗺𝗲 𝗦𝘁𝗮𝗿𝘁𝗲𝗱\n\n*𝗦𝗲𝗹𝗲𝗰𝘁𝗲𝗱 𝗠𝗼𝗱𝗲 : _" + _0x44b37a.mode + "_* \n\t▢ *_Well, I'm thinking of a number between " + (_0x44b37a.mode === "Easy" ? "1 and 100" : _0x44b37a.mode === "Medium" ? "1 and 1000" : "1 and 10000") + "._*\n\n*𝗬𝗼𝘂𝗿 𝗧𝗮𝘀𝗸 :*\n _▢ You Task is to Guess That Number._\n _▢ Checks How Sharp is Your Memory._\n _▢ Lets see How Many Attempts You Take To Guess Number._"); + } catch (_0x55d9e4) { + await _0x435f9e.error(_0x55d9e4 + "\n\ncommand:guess", _0x55d9e4); + } +}); +const astro_patch_cfg = {}; +const quotes = ["Connect Four: Where strategy meets fun!", "Let the battle of four-in-a-row begin!", "It's time to connect and conquer!", "Can you outsmart your opponent in Connect Four?", "Challenge your mind with Connect Four's strategic gameplay.", "Connect Four: A game of wits and tactics.", "Four in a row, that's the way to go!", "Connect Four: Unleash your strategic genius.", "Get ready to drop and connect your way to victory!", "Connect Four: Where every move counts.", "Prove your skills in the ultimate Connect Four showdown!", "Connect Four: The classic game of strategy and anticipation.", "Connect Four: Easy to learn, hard to master.", "Who will be the first to connect their pieces and claim victory?", "Prepare for a thrilling battle of strategy in Connect Four.", "Get ready to connect and win!", "Who will be the Connect Four champion?", "Strategize and conquer the board!", "Let the Connect Four battle begin!", "Connect Four: The ultimate test of skill!"]; +class ConnectFourGame { + constructor() { + this.player1 = ""; + this.player2 = ""; + this.rowsMatrix = 6; + this.columnsMatrix = 7; + this.currentPlayer = ""; + this.gameStatus = false; + this.attempts = {}; + this.matrix = [["⚪", "⚪", "⚪", "⚪", "⚪", "⚪", "⚪"], ["⚪", "⚪", "⚪", "⚪", "⚪", "⚪", "⚪"], ["⚪", "⚪", "⚪", "⚪", "⚪", "⚪", "⚪"], ["⚪", "⚪", "⚪", "⚪", "⚪", "⚪", "⚪"], ["⚪", "⚪", "⚪", "⚪", "⚪", "⚪", "⚪"], ["⚪", "⚪", "⚪", "⚪", "⚪", "⚪", "⚪"]]; + } + async updateLastIndex(_0xff60d2) { + let _0x47973e = this.currentPlayer === this.player1 ? "🔵" : "🔴"; + let _0x2aa8d4 = this.matrix.length - 1; + while (_0x2aa8d4 > 0 && this.matrix[_0x2aa8d4][_0xff60d2] !== "⚪") { + _0x2aa8d4--; + } + if (this.matrix[_0x2aa8d4][_0xff60d2] == "⚪") { + this.matrix[_0x2aa8d4][_0xff60d2] = _0x47973e; + return true; + } else { + return false; + } + } + async printMatrix() { + let _0x14453f = ""; + for (let _0x90aa39 = 0; _0x90aa39 < this.matrix.length; _0x90aa39++) { + _0x14453f += "\n| "; + for (let _0x5cfaf1 = 0; _0x5cfaf1 < this.matrix[_0x90aa39].length; _0x5cfaf1++) { + _0x14453f += this.matrix[_0x90aa39][_0x5cfaf1] + " | "; + } + } + return _0x14453f; + } + async checkWin() { + let _0x1ec623 = this.currentPlayer === this.player1 ? "🔵" : "🔴"; + for (let _0x5a1b58 = 0; _0x5a1b58 < this.matrix.length; _0x5a1b58++) { + for (let _0x498289 = 0; _0x498289 <= this.matrix[_0x5a1b58].length - 4; _0x498289++) { + if (this.matrix[_0x5a1b58][_0x498289] === _0x1ec623 && this.matrix[_0x5a1b58][_0x498289 + 1] === _0x1ec623 && this.matrix[_0x5a1b58][_0x498289 + 2] === _0x1ec623 && this.matrix[_0x5a1b58][_0x498289 + 3] === _0x1ec623) { + return this.currentPlayer; + } + } + } + for (let _0x14a347 = 0; _0x14a347 <= this.matrix.length - 4; _0x14a347++) { + for (let _0x22245c = 0; _0x22245c < this.matrix[_0x14a347].length; _0x22245c++) { + if (this.matrix[_0x14a347][_0x22245c] === _0x1ec623 && this.matrix[_0x14a347 + 1][_0x22245c] === _0x1ec623 && this.matrix[_0x14a347 + 2][_0x22245c] === _0x1ec623 && this.matrix[_0x14a347 + 3][_0x22245c] === _0x1ec623) { + return this.currentPlayer; + } + } + } + for (let _0x24e1a4 = 0; _0x24e1a4 <= this.matrix.length - 4; _0x24e1a4++) { + for (let _0x21c69f = 0; _0x21c69f <= this.matrix[_0x24e1a4].length - 4; _0x21c69f++) { + if (this.matrix[_0x24e1a4][_0x21c69f] === _0x1ec623 && this.matrix[_0x24e1a4 + 1][_0x21c69f + 1] === _0x1ec623 && this.matrix[_0x24e1a4 + 2][_0x21c69f + 2] === _0x1ec623 && this.matrix[_0x24e1a4 + 3][_0x21c69f + 3] === _0x1ec623) { + return this.currentPlayer; + } + } + } + for (let _0x1306cd = 0; _0x1306cd <= this.matrix.length - 4; _0x1306cd++) { + for (let _0x205612 = this.matrix[_0x1306cd].length - 1; _0x205612 >= 3; _0x205612--) { + if (this.matrix[_0x1306cd][_0x205612] === _0x1ec623 && this.matrix[_0x1306cd + 1][_0x205612 - 1] === _0x1ec623 && this.matrix[_0x1306cd + 2][_0x205612 - 2] === _0x1ec623 && this.matrix[_0x1306cd + 3][_0x205612 - 3] === _0x1ec623) { + return this.currentPlayer; + } + } + } + return null; + } +} +smd({ + cmdname: "cfg", + info: "Start Connect Four game session.", + filename: __filename, + type: "game", + use: "< @user >" +}, async _0x211ed5 => { + const _0x4f21cc = _0x211ed5.chat; + let _0x20d34d = astro_patch_cfg[_0x4f21cc]; + if (_0x20d34d && _0x20d34d.gameStatus) { + return await _0x211ed5.send("*A game is already in progress in this chat.*\n*Game Between :- _@" + _0x20d34d.player1.split("@")[0] + "_ vs _@" + _0x20d34d.player2.split("@")[0] + "_*\n_If You @{message.sender.split(\"@\")[0]} wants to Play,_ \n_Then Delete Cfg Session:- {prefix}delcfg_\n", { + mentions: [_0x20d34d.player1, _0x20d34d.player2] + }); + } + if (!_0x20d34d) { + _0x20d34d = new ConnectFourGame(); + astro_patch_cfg[_0x4f21cc] = _0x20d34d; + } + try { + let _0x33f19d = _0x211ed5.quoted ? _0x211ed5.quoted.sender : _0x211ed5.mentionedJid ? _0x211ed5.mentionedJid[0] : "-"; + _0x33f19d = _0x33f19d === _0x211ed5.sender ? "" : "" + _0x33f19d; + if (_0x33f19d.includes("@")) { + _0x20d34d.player1 = _0x211ed5.sender; + _0x20d34d.player2 = _0x33f19d; + _0x20d34d.gameStatus = true; + } else if (!_0x20d34d.player1 || _0x20d34d.player1 === _0x211ed5.sender) { + _0x20d34d.player1 = _0x211ed5.sender; + return await _0x211ed5.send("▄▀▀ ▄▀▄ █▄ █ █▄ █ ▄▀▀ ▀█▀ \n▀▄▄ ▀▄▀ █ ▀█ █ ▀█ ▀▄▄ █\n 𝗖𝗼𝗻𝗻𝗲𝗰𝘁 𝗙𝗼𝘂𝗿 𝗚𝗮𝗺𝗲 𝗦𝗲𝘀𝘀𝗶𝗼𝗻 \n\n*Connect Four Game Session Created...*\n*room Id : _cfg-" + _0x4f21cc.split("@")[0] + "_*\n\n_Player 1: @" + _0x20d34d.player1.split("@")[0] + " Joined_\n_Waiting For Another Player To Start Game..._\n\n*Type _.cfg to Join This Game Session.*", { + mentions: [_0x20d34d.player1] + }); + } else if (_0x211ed5.sender != _0x20d34d.player1) { + _0x20d34d.player2 = _0x211ed5.sender; + _0x20d34d.gameStatus = true; + } + } catch (_0x264edb) { + await _0x211ed5.reply("errors : " + _0x264edb); + } + if (_0x20d34d.gameStatus) { + _0x20d34d.currentPlayer = _0x20d34d.player1; + _0x20d34d.attempts[_0x20d34d.player1] = 0; + _0x20d34d.attempts[_0x20d34d.player2] = 0; + let _0x364961 = await _0x20d34d.printMatrix(); + let _0x2d3c4c = "▄▀▀ ▄▀▄ █▄ █ █▄ █ ▄▀▀ ▀█▀\n▀▄▄ ▀▄▀ █ ▀█ █ ▀█ ▀▄▄ █\n 𝗖𝗼𝗻𝗻𝗲𝗰𝘁 𝗙𝗼𝘂𝗿 𝗚𝗮𝗺𝗲 𝗦𝘁𝗮𝗿𝘁𝗲𝗱 \n\n" + _0x364961 + " \n◣━━━━━━━━━━ ━━━━━━━━━━◢\n\n*Connet Four Game Session started* \n*room Id : _cfg-" + _0x4f21cc.split("@")[0] + "_*\n\n*Current Turn: _@" + _0x20d34d.player1.split("@")[0] + "_*\n*Next Turn : _@" + _0x20d34d.player2.split("@")[0] + "_*\n*_Hey @" + _0x20d34d.currentPlayer.split("@")[0] + ", Please take your turn_*\n▢ _Enter Line Number Between *'1'* to *'7'*_\n\n*Connect Four Game Task :*\n _Player Needs To Connect Four Colors in a Sequence,_\n _You can Connect Four Colors ▢Horizontally, ▢Vertically, ▢Diagonally._ \n\n*Lets Play :- _" + quotes[Math.floor(Math.random() * quotes.length)] + "_*\n"; + await _0x211ed5.send(_0x2d3c4c, { + mentions: [_0x20d34d.player1, _0x20d34d.player2, _0x20d34d.currentPlayer] + }); + } +}); +smd({ + pattern: "delcfg", + desc: "deletes Connect Four running session.", + filename: __filename, + category: "game" +}, async ({ + chat: _0xa871db, + isCreator: _0x5157de, + send: _0x4b76e6, + reply: _0x28e18a, + sender: _0xea0ced, + senderName: _0x2c14e6 +}) => { + let _0x202014 = astro_patch_cfg[_0xa871db]; + if (_0x202014) { + if (!_0x5157de && _0xea0ced !== _0x202014.player2 && _0xea0ced !== _0x202014.player1) { + await _0x28e18a("*_Hey " + _0x2c14e6 + ", You're not player of running game_*\n"); + } else { + delete astro_patch_cfg[_0xa871db]; + await _0x28e18a("▄▀▀ ▄▀▄ █▄ █ █▄ █ ▄▀▀ ▀█▀\n▀▄▄ ▀▄▀ █ ▀█ █ ▀█ ▀▄▄ █\n 𝗖𝗼𝗻𝗻𝗲𝗰𝘁 𝗙𝗼𝘂𝗿 𝗚𝗮𝗺𝗲 𝗗𝗲𝗹𝗲𝘁𝗲𝗱\n\n*Room Id : _cfg-" + _0xa871db.split("@")[0] + "_ Cleared Successfully*\n*_Connect Four Game Session Deleted From This Chat..._*\n"); + } + } else { + await _0x28e18a("▄▀▀ ▄▀▄ █▄ █ █▄ █ ▄▀▀ ▀█▀ \n▀▄▄ ▀▄▀ █ ▀█ █ ▀█ ▀▄▄ █\n 𝗖𝗼𝗻𝗻𝗲𝗰𝘁 𝗙𝗼𝘂𝗿 𝗚𝗮𝗺𝗲 404𝗘𝗿𝗿𝗼𝗿 \n\n*Uhh Dear, _Theres No Game Started yet in This Chat_*\n"); + } +}); +smd({ + on: "text" +}, async (_0xcabf04, _0x265843) => { + const _0x4d1cd7 = _0xcabf04.chat; + const _0x47f35e = astro_patch_cfg[_0x4d1cd7]; + if (!_0x47f35e) { + return; + } + let _0x5acce8 = parseInt(_0xcabf04.text ? _0xcabf04.text.split(" ")[0] : "NaN"); + if (_0x47f35e.gameStatus && _0x47f35e.currentPlayer === _0xcabf04.sender && !isNaN(_0x5acce8)) { + try { + let _0x423cec = _0x5acce8 - 1; + if (_0x423cec < 0 || _0x423cec >= _0x47f35e.columnsMatrix) { + return; + } + let _0x3e702a = await _0x47f35e.updateLastIndex(_0x423cec); + if (!_0x3e702a) { + return await _0xcabf04.bot.sendMessage(_0xcabf04.chat, { + text: "*_Invalid move Dear @" + _0x47f35e.currentPlayer.split("@")[0] + ", Line you enter is completely Filled. Please Give Other Line Numbers._*", + mentions: [_0x47f35e.currentPlayer] + }, { + quoted: _0xcabf04 + }); + } + let _0x1521ca = (await _0x47f35e.checkWin()) || false; + _0x47f35e.attempts[_0x47f35e.currentPlayer]++; + let _0x3fe5ce = await _0x47f35e.printMatrix(); + _0x47f35e.currentPlayer = _0x47f35e.currentPlayer === _0x47f35e.player1 ? _0x47f35e.player2 : _0x47f35e.player1; + if (!_0x1521ca) { + let _0x2c98f1 = "▄▀▀ ▄▀▄ █▄ █ █▄ █ ▄▀▀ ▀█▀ \n▀▄▄ ▀▄▀ █ ▀█ █ ▀█ ▀▄▄ █\n 𝗖𝗼𝗻𝗻𝗲𝗰𝘁 𝗙𝗼𝘂𝗿 cfg_𝗲 𝗕𝗼𝗮𝗿𝗱\n\n" + _0x3fe5ce + "\n◣━━━━━━━━━━ ━━━━━━━━━━◢\n\n*Current Turn " + (_0x47f35e.currentPlayer === _0x47f35e.player1 ? "🔵" : "🔴") + " : _@" + _0x47f35e.currentPlayer.split("@")[0] + "_*\n*Nextt Turn " + (_0x47f35e.currentPlayer === _0x47f35e.player1 ? "🔴" : "🔵") + " : _@" + (_0x47f35e.currentPlayer === _0x47f35e.player1 ? _0x47f35e.player2 : _0x47f35e.player1).split("@")[0] + "_*\n\n ▢ *_Please take your turn to Break Pattern_*\n ▢ _Enter Line Number Between *'1'* to *'7'*_\n\n*Connent Four Game Quote :*\n ▢ _" + quotes[Math.floor(Math.random() * quotes.length)] + "_\n"; + return await _0xcabf04.send(_0x2c98f1, { + mentions: [_0x47f35e.player1, _0x47f35e.player2] + }); + } else { + delete astro_patch_cfg[_0x4d1cd7]; + return await _0xcabf04.send("▄▀▀ ▄▀▄ █▄ █ █▄ █ ▄▀▀ ▀█▀ \n▀▄▄ ▀▄▀ █ ▀█ █ ▀█ ▀▄▄ █\n 𝗖𝗼𝗻𝗻𝗲𝗰𝘁 𝗙𝗼𝘂𝗿 𝗚𝗮𝗺𝗲 𝗙𝗶𝗻𝗶𝘀𝗵𝗲𝗱\n\n*𝗪𝗶𝗻𝗻𝗲𝗿 𝗢𝗳 𝗧𝗵𝗲 𝗚𝗮𝗺𝗲 𝗜𝘀: _@" + _0x1521ca.split("@")[0] + "_*\n*𝗟𝗼𝗼𝘀𝗲𝗿 𝗢𝗳 𝗧𝗵𝗲 𝗚𝗮𝗺𝗲 𝗜𝘀: _@" + _0x47f35e.currentPlayer.split("@")[0] + "_*\n\n" + _0x3fe5ce + "\n◣━━━━━━━━━━ ━━━━━━━━━━◢ \n\n*_Congratulations! @" + _0x1521ca.split("@")[0] + " you win the Game!_* \n_You Connect Four Colors in_ '" + _0x47f35e.attempts[_0x1521ca] + "' _Turns._\n\n_Connect Four Game Session Finished Now_\n_Type_ .Cfg _to Start Again Connect Four Session._\n", { + mentions: [_0x47f35e.player1, _0x47f35e.player2] + }); + } + } catch (_0x30983e) { + return await console.log("Connect Four Game Error : ", _0x30983e); + } + } +}); +const countries = { + Afghanistan: "Kabul", + Albania: "Tirana", + Algeria: "Algiers", + Angola: "Luanda", + Argentina: "Buenos Aires", + Armenia: "Yerevan", + Australia: "Canberra", + Austria: "Vienna", + Azerbaijan: "Baku", + Bahamas: "Nassau", + Bahrain: "Manama", + Bangladesh: "Dhaka", + Barbados: "Bridgetown", + Belarus: "Minsk", + Belgium: "Brussels", + Belize: "Belmopan", + Benin: "Porto-Novo", + Bhutan: "Thimphu", + Bolivia: "Sucre", + Botswana: "Gaborone", + Brazil: "Brasília", + Bulgaria: "Sofia", + "Burkina Faso": "Ouagadougou", + Burundi: "Gitega", + "Cabo Verde": "Praia", + Cambodia: "Phnom Penh", + Cameroon: "Yaoundé", + Canada: "Ottawa", + "Central African Republic": "Bangui", + Chad: "N'Djamena", + Chile: "Santiago", + China: "Beijing", + Colombia: "Bogotá", + Comoros: "Moroni", + "Costa Rica": "San jose", + "Cote d'Ivoire": "Yamoussoukro", + Croatia: "Zagreb", + Cuba: "Havana", + Cyprus: "Nicosia", + "Czech Republic": "Prague", + Denmark: "Copenhagen", + Djibouti: "Djibouti", + Dominica: "Roseau", + "Dominican Republic": "Santo Domingo", + Ecuador: "Quito", + Egypt: "Cairo", + "El Salvador": "San Salvador", + "Equatorial Guinea": "Malabo", + Eritrea: "Asmara", + Estonia: "Tallinn", + Eswatini: "Mbabane", + Ethiopia: "Addis Ababa", + Fiji: "Suva", + Finland: "Helsinki", + France: "Paris", + Gabon: "Libreville", + Gambia: "Banjul", + Georgia: "Tbilisi", + Germany: "Berlin", + Ghana: "Accra", + Greece: "Athens", + Grenada: "St. George's", + Guatemala: "Guatemala City", + Guinea: "Conakry", + "Guinea-Bissau": "Bissau", + Guyana: "Georgetown", + Haiti: "Port prince", + Honduras: "Tegucigalpa", + Hungary: "Budapest", + Iceland: "Reykjavik", + India: "New Delhi", + Indonesia: "Jakarta", + Iran: "Tehran", + Iraq: "Baghdad", + Ireland: "Dublin", + Israel: "Jerusalem", + Italy: "Rome", + Jamaica: "Kingston", + Japan: "Tokyo", + Jordan: "Amman", + Kazakhstan: "Nur Sultan", + Kenya: "Nairobi", + Kiribati: "Tarawa", + "Korea, North": "Pyongyang", + "Korea, South": "Seoul", + Kosovo: "Pristina", + Kuwait: "Kuwait", + Kyrgyzstan: "Bishkek", + Laos: "Vientiane", + Latvia: "Riga", + Lebanon: "Beirut", + Lesotho: "Maseru", + Liberia: "Monrovia", + Libya: "Tripoli", + Liechtenstein: "Vaduz", + Lithuania: "Vilnius", + Luxembourg: "Luxembourg City", + Madagascar: "Antananarivo", + Malawi: "Lilongwe", + Malaysia: "Kuala Lumpur", + Maldives: "Male", + Mali: "Bamako", + Malta: "Valletta", + "Marshall Islands": "Majuro", + Mauritania: "Nouakchott", + Mauritius: "Port Louis", + Mexico: "Mexico City", + Micronesia: "Palikir", + Moldova: "Chisinau", + Monaco: "Monaco", + Mongolia: "Ulaanbaatar", + Montenegro: "Podgorica", + Morocco: "Rabat", + Mozambique: "Maputo", + Myanmar: "Naypyidaw", + Namibia: "Windhoek", + Nauru: "Yaren", + Nepal: "Kathmandu", + Netherlands: "Amsterdam", + "New Zealand": "Wellington", + Nicaragua: "Managua", + Niger: "Niamey", + Nigeria: "Abuja", + "North Macedonia": "Skopje", + Norway: "Oslo", + Oman: "Muscat", + Pakistan: "Islamabad", + Palau: "Ngerulmud", + Palestine: "Ramallah", + Panama: "Panama City", + Paraguay: "Asunción", + Peru: "Lima", + Philippines: "Manila", + Poland: "Warsaw", + Portugal: "Lisbon", + Qatar: "Doha", + Romania: "Bucharest", + Russia: "Moscow", + Rwanda: "Kigali", + "Saint Kitts": "Basseterre", + "Saint Lucia": "Castries", + Samoa: "Apia", + "San Marino": "San Marino", + "Saudi Arabia": "Riyadh", + Senegal: "Dakar", + Serbia: "Belgrade", + Seychelles: "Victoria", + "Sierra Leone": "Freetown", + Singapore: "Singapore", + Slovakia: "Bratislava", + Slovenia: "Ljubljana", + "Solomon Islands": "Honiara", + Somalia: "Mogadishu", + "South Africa": "Pretoria", + "South Sudan": "Juba", + Spain: "Madrid", + "Sri Lanka": "Colombo", + Sudan: "Khartoum", + Suriname: "Paramaribo", + Sweden: "Stockholm", + Switzerland: "Bern", + Syria: "Damascus", + Taiwan: "Taipei", + Tajikistan: "Dushanbe", + Tanzania: "Dodoma", + Thailand: "Bangkok", + "Timor-Leste": "Dili", + Togo: "Lome", + Tonga: "Nuku'alofa", + Tunisia: "Tunis", + Turkey: "Ankara", + Turkmenistan: "Ashgabat", + Tuvalu: "Funafuti", + Uganda: "Kampala", + Ukraine: "Kyiv", + "United Arab Emirates": "Abu Dhabi", + "United Kingdom": "London", + "United States": "Washington", + Uruguay: "Montevideo", + Uzbekistan: "Tashkent", + Vanuatu: "Port Vila", + Vatican: "Vatican City", + Venezuela: "Caracas", + Vietnam: "Hanoi", + Yemen: "Sana", + Zambia: "Lusaka", + Zimbabwe: "Harare" +}; +let captions = { + waitTime: 30, + winReward: 2000, + onStart: "*Capital Finding Game Started*\n*Player:* _@$player_\n*Task :* _Tell the Capital of *$country*_\n\n_Your Time Starts Now, You Have $waitTime seconds to Answer_", + onTimeOut: "*Game Over, run out of time*\n\n*Player:* _@$player_\n*Reason:* _TimeOut!, You're not responed_\n\n*Answer:*\n The Capital of *$country* is *$capital*", + onLimitEnd: "*Game Over, Attempts limit Exceed*\n\n*Player:* _@$player_\n*Reason:* _Not responed right answer in 3 attemps_\n\n*Answer:*\n The Capital of *$country* is *$capital*", + onWrongAns: "*_Uhh dear, Your answer is not correct_*\n\n*Player:* _@$player_\n_You have *$attempt more attempt!*_\n\n*You have $waitTime seconds to answer!*", + onWinGame: "*_Waoww, Your Answer is Correct_*\n*Player:* _@$player_\n\n_Capital of *$country* is *$capital*._\n_You give right answer in *$attempt attepmt*_\n_$amount cash added in your wallet_" +}; +let astro_patch_Capital = { + id: "", + player: "", + country: "", + capital: "", + attempts: 0, + waitTime: 20, + preAns: "previousAnswer", + timer: "" +}; +async function timerFuntions(_0x538b5f, _0x59929b) { + await _0x538b5f.bot.sendMessage(_0x538b5f.chat, { + text: captions.onTimeOut.replace("$player", _0x59929b.player.split("@")[0]).replace("$country", _0x59929b.country).replace("$capital", _0x59929b.capital), + mentions: [_0x59929b.player] + }); + delete astro_patch_Capital[_0x538b5f.sender]; +} +smd({ + pattern: "co", + alias: ["capital"], + desc: "Find capital of the city", + category: "game", + filename: __filename +}, async _0x45934d => { + const _0x304497 = Object.keys(countries); + let _0x4f5d8a = _0x304497[Math.floor(Math.random() * _0x304497.length)]; + let _0x59e991 = countries[_0x4f5d8a]; + console.log("country : ", _0x4f5d8a); + console.log("capital : ", _0x59e991); + if (!astro_patch_Capital[_0x45934d.sender]) { + astro_patch_Capital[_0x45934d.sender] = { + id: _0x45934d.chat, + player: _0x45934d.sender, + country: _0x4f5d8a, + capital: _0x59e991, + attempts: 0, + waitTime: captions.waitTime, + preAns: _0x45934d.text, + timer: "" + }; + } + let _0x5645fb = astro_patch_Capital[_0x45934d.sender]; + await _0x45934d.bot.sendMessage(_0x45934d.chat, { + text: captions.onStart.replace("$player", _0x5645fb.player.split("@")[0]).replace("$country", _0x5645fb.country).replace("$waitTime", _0x5645fb.waitTime), + mentions: [_0x5645fb.player] + }); + _0x5645fb.timer = setTimeout(() => { + timerFuntions(_0x45934d, _0x5645fb); + }, _0x5645fb.waitTime * 1000); +}); +let hcg_Logo = "█▄█ ▀ █▀▄ █▀▄ ██▀ █▄ █\n█ █ █ █▄▀ █▄▀ █▄▄ █ ▀█\n ".trim(); +const astro_patch_hcg = {}; +class HiddenCardGame { + constructor() { + this.column = 4; + this.row = 4; + this.player1 = ""; + this.player2 = ""; + this.currentPlayer = ""; + this.board = []; + this.hiddenCardIndex = 7; + this.gameStatus = false; + this.attempts = {}; + } + startGame(_0x133f2f, _0x26c29f) { + this.player1 = _0x133f2f; + this.player2 = _0x26c29f; + this.attempts[this.player1] = 0; + this.attempts[this.player2] = 0; + this.currentPlayer = _0x133f2f; + this.board = this.createBoard(); + this.gameStatus = true; + } + createBoard() { + const _0x1cc73d = []; + for (let _0x24ec78 = 0; _0x24ec78 < this.row; _0x24ec78++) { + const _0x55d31f = []; + for (let _0x45d52c = 0; _0x45d52c < this.column; _0x45d52c++) { + _0x55d31f.push("🈲"); + } + _0x1cc73d.push(_0x55d31f); + } + return _0x1cc73d; + } + makeMove(_0xa4cc81, _0xb34f99) { + if (!this.gameStatus) { + return ""; + } + if (_0xa4cc81 !== this.currentPlayer) { + return "*_Hey Buddy, It's not your turn._*"; + } + this.attempts[this.currentPlayer]++; + const _0x52c4bf = _0xb34f99 - 1; + if (this.isValidMove(_0x52c4bf)) { + if (_0x52c4bf === this.hiddenCardIndex) { + this.board[Math.floor(_0x52c4bf / this.row)][_0x52c4bf % this.column] = "🃏"; + let _0x5b6677 = this.displayBoard(); + this.gameStatus = false; + return hcg_Logo + " 𝗤𝗨𝗘𝗘𝗡 𝗖𝗔𝗥𝗗 𝗙𝗢𝗨𝗡𝗗`\n\n*𝗪𝗶𝗻𝗻𝗲𝗿 𝗜𝘀: _@" + _0xa4cc81.split("@")[0] + "_*\n*𝗟𝗼𝗼𝘀𝗲𝗿 𝗜𝘀: _@" + (_0xa4cc81 === this.player1 ? this.player2 : this.player1).split("@")[0] + "_*\n\n" + _0x5b6677 + " \n\n\n*_Congratulations!_* \n *_@" + _0xa4cc81.split("@")[0] + " you won the Game!!*_ \n_You found the Hidden Card in " + this.attempts[this.currentPlayer] + " Attempts._\n\n_Hidden Queen Game Session Finished Now_\n_Type *.hcg* to Start Hidden Queen Session._\n\n```\t 𝗣𝗼𝘄𝗲𝗿𝗲𝗱 𝗯𝘆 𝗦𝘂𝗵𝗮𝗶𝗹 𝗠𝗱 ```\n"; + } else { + this.board[Math.floor(_0x52c4bf / this.row)][_0x52c4bf % this.column] = "🟦"; + const _0x3d1f61 = this.checkGameResult(); + if (_0x3d1f61 === "continue") { + this.currentPlayer = _0xa4cc81 === this.player1 ? this.player2 : this.player1; + return hcg_Logo + " 𝗤𝗨𝗘𝗘𝗡 𝗖𝗔𝗥𝗗 𝗚𝗔𝗠𝗘` \n\n" + this.displayBoard() + "\n\n_Current Turn: @" + this.currentPlayer.split("@")[0] + "_\n_Next @" + (this.currentPlayer === this.player1 ? this.player2 : this.player1).split("@")[0] + "_\n\n\n ▢ *_Please take your turn & find card_*\n ▢ _Enter a number b/w *1* to *" + this.row * this.column + "* !!!_\n\n```\t 𝗣𝗼𝘄𝗲𝗿𝗲𝗱 𝗯𝘆 𝗦𝘂𝗵𝗮𝗶𝗹 𝗠𝗱 ```"; + } else { + this.gameStatus = false; + return "┏━━━━━━━━━━━━━━━━━━┓\n┃ 𝗛𝗖𝗚---𝗜𝗡𝗩𝗔𝗟𝗜𝗗 𝗚𝗔𝗠𝗘 ┃\n┗━━━━━━━━━━━━━━━━━━┛\n\n\t*_Damnn!!! The hidden card was not found. Game over._*\n\n```\t 𝗣𝗼𝘄𝗲𝗿𝗲𝗱 𝗯𝘆 𝗦𝘂𝗵𝗮𝗶𝗹 𝗠𝗱 ```"; + } + } + } else { + return "┏━━━━━━━━━━━━━━━━━━┓\n┃ 𝗛𝗖𝗚---𝗜𝗡𝗩𝗔𝗟𝗜𝗗 𝗠𝗢𝗩𝗘 ┃\n┗━━━━━━━━━━━━━━━━━━┛\n\n𝗡𝗢𝗧𝗘:\n Hey _@" + this.currentPlayer.split("@")[0] + "_ (•̪●), \n▢ _You provide an Invalid or Already used number_\n▢ _Provide a number between *1* and *" + this.row * this.column + "* !!!_\n\n```\t Powered by Suhail MD ```"; + } + } + isValidMove(_0x59acbc) { + return _0x59acbc >= 0 && _0x59acbc < this.row * this.column && this.board[Math.floor(_0x59acbc / this.row)][_0x59acbc % this.column] === "🈲"; + } + checkGameResult() { + if (this.board.some(_0x59f339 => _0x59f339.includes("🈲"))) { + return "continue"; + } else { + return "end"; + } + } + displayBoard() { + let _0x4a7e34 = "\t "; + let _0x5f3cda = "◣━━"; + for (let _0x52b6e0 = 0; _0x52b6e0 < this.row; _0x52b6e0++) { + for (let _0x23bf9b = 0; _0x23bf9b < this.column; _0x23bf9b++) { + _0x4a7e34 += this.board[_0x52b6e0][_0x23bf9b] + " "; + } + _0x5f3cda += "━━"; + _0x4a7e34 += "\n\t "; + } + _0x5f3cda += "◢"; + return "\t " + _0x4a7e34.trim() + "\n" + _0x5f3cda; + } +} +smd({ + pattern: "hcg", + desc: "Starts a Hidden Card Game.", + filename: __filename, + category: "game" +}, async (_0x2f9c0f, _0x40c02a) => { + const _0x2ffd5e = _0x2f9c0f.chat; + let _0x53feb3 = astro_patch_hcg[_0x2ffd5e]; + if (_0x53feb3 && _0x53feb3.gameStatus) { + return await _0x2f9c0f.reply("*_A game is already in progress in this chat._*"); + } + if (!_0x53feb3) { + _0x53feb3 = new HiddenCardGame(); + astro_patch_hcg[_0x2ffd5e] = _0x53feb3; + } + let _0x42c980 = _0x2f9c0f.quoted ? _0x2f9c0f.quoted.sender : _0x2f9c0f.mentionedJid ? _0x2f9c0f.mentionedJid[0] : false; + let _0x2e5c0c = 5; + let _0x57fb8 = 5; + if (_0x40c02a) { + _0x2e5c0c = parseInt(_0x40c02a) || 5; + _0x2e5c0c = _0x2e5c0c > 2 && _0x2e5c0c < 8 ? _0x2e5c0c : 5; + } + _0x53feb3.row = _0x2e5c0c; + _0x53feb3.column = _0x2e5c0c; + if (!_0x53feb3.player1 || _0x2f9c0f.sender === _0x53feb3.player1) { + if (_0x42c980 && _0x42c980 !== _0x2f9c0f.sender) { + _0x53feb3.player1 = _0x2f9c0f.sender; + _0x53feb3.player2 = _0x42c980; + _0x53feb3.startGame(_0x53feb3.player1, _0x53feb3.player2); + } else { + _0x53feb3.player1 = _0x2f9c0f.sender; + return await _0x2f9c0f.send("┏━━━━━━━━━━━━━━━━━━┓\n┃ 𝗛𝗜𝗗𝗗𝗘𝗡 𝗖𝗔𝗥𝗗 𝗚𝗔𝗠𝗘 ┃\n┗━━━━━━━━━━━━━━━━━━┛\n\n_*Hidden Card Game Created...*_\n_Player 1: @" + _0x53feb3.player1.split("@")[0] + " Joined_\n_Waiting For Another Player To Start Game..._\n\n*Type _" + prefix + "Hcg_ to Join This Game.*", { + mentions: [_0x53feb3.player1] + }); + } + } else if (_0x2f9c0f.sender !== _0x53feb3.player1) { + _0x53feb3.player2 = _0x2f9c0f.sender; + _0x53feb3.startGame(_0x53feb3.player1, _0x53feb3.player2); + } + if (_0x53feb3.gameStatus) { + _0x53feb3.hiddenCardIndex = Math.floor(Math.random() * (_0x53feb3.row * _0x53feb3.column)); + return await _0x2f9c0f.send("┏━━━━━━━━━━━━━━━━━━┓\n┃ 𝗛𝗜𝗗𝗗𝗘𝗡 𝗖𝗔𝗥𝗗 𝗚𝗔𝗠𝗘 ┃\n┗━━━━━━━━━━━━━━━━━━┛\n\n*Hidden Card Game started*\n_Current Turn: @" + _0x53feb3.currentPlayer.split("@")[0] + "_\n_Next Turn : @" + (_0x53feb3.currentPlayer === _0x53feb3.player1 ? _0x53feb3.player2 : _0x53feb3.player1).split("@")[0] + "_\n\n_Board Size : *" + _0x53feb3.row + "x" + _0x53feb3.column + "*_\n_Theres a Hidden Queen Card *\"🃏\"* in Board_\n_Enter a number to find the Queen Card_\n\n" + _0x53feb3.displayBoard() + " ", { + mentions: [_0x53feb3.player1, _0x53feb3.player2, _0x53feb3.currentPlayer] + }); + } +}); +smd({ + cmdname: "delhcg", + info: "deletes hidden card running session.", + filename: __filename, + type: "game" +}, async ({ + chat: _0x4cf9b7, + isCreator: _0x43e54f, + send: _0x35cae7, + reply: _0x24df9e, + sender: _0x434bc1 +}) => { + let _0x3c3320 = astro_patch_hcg[_0x4cf9b7]; + if (_0x3c3320) { + if (!_0x43e54f && _0x434bc1 !== _0x3c3320.player2 && _0x434bc1 !== _0x3c3320.player1) { + await _0x35cae7("┏━━━━━━━━━━━━━━━━━━┓\n┃ 𝗛𝗜𝗗𝗗𝗘𝗡 𝗖𝗔𝗥𝗗 𝗚𝗔𝗠𝗘 ┃\n┗━━━━━━━━━━━━━━━━━━┛\n\n*Uhh Please, _You are not a Player of running game!!!_\n"); + } else { + delete astro_patch_hcg[_0x4cf9b7]; + await _0x24df9e("\n" + hcg_Logo + "𝗖𝗔𝗥𝗗 𝗚𝗔𝗠𝗘 𝗗𝗘𝗟𝗘𝗧𝗘𝗗\n\n*Room Id : _hcg-" + _0x4cf9b7.split("@")[0] + "_ Cleared Successfully*\n*_Hidden Card Game Session Deleted From This Chat..._*\n"); + } + } else { + _0x24df9e("┏━━━━━━━━━━━━━━━━━━┓\n┃ 𝗤𝗨𝗘𝗘𝗡 𝗖𝗔𝗥𝗗 404𝗘𝗿𝗿𝗼𝗿 ┃\n┗━━━━━━━━━━━━━━━━━━┛ \n\n*Uhh Dear, _Theres No Game Started yet in This Chat_*\n"); + } +}); +cmd({ + on: "text" +}, async _0x16aecb => { + if (!_0x16aecb || _0x16aecb.isBaileys) { + return; + } + const _0x5d0144 = _0x16aecb.chat; + const _0x2091f2 = parseInt(_0x16aecb.text ? _0x16aecb.text : "null"); + try { + const _0x35d41c = astro_patch_hcg[_0x5d0144]; + if (_0x35d41c && _0x35d41c.gameStatus && _0x35d41c.currentPlayer === _0x16aecb.sender && !isNaN(_0x2091f2) && _0x16aecb.text) { + const _0x2b3010 = _0x35d41c.makeMove(_0x16aecb.sender, _0x2091f2); + if (!_0x35d41c.gameStatus) { + delete astro_patch_hcg[_0x16aecb.chat]; + } + if (_0x2b3010) { + await send(_0x16aecb, _0x2b3010, { + mentions: [_0x35d41c.player1, _0x35d41c.player2] + }); + } else { + ""; + } + } + } catch (_0x40ad36) { + console.log("Hidden card game error : ", _0x40ad36); + } + try { + const _0x34ca41 = astro_patch_numGuess[_0x5d0144]; + if (_0x34ca41) { + if (_0x34ca41.id === _0x16aecb.chat && _0x34ca41.player === _0x16aecb.sender && !isNaN(_0x2091f2)) { + _0x34ca41.guessedNumber = _0x2091f2; + _0x34ca41.attempts++; + if (_0x34ca41.guessedNumber < _0x34ca41.randomNumber) { + await _0x16aecb.send(logoName + "\n 𝗡𝘂𝗺𝗯𝗲𝗿 𝗬𝗼𝘂 𝗚𝘂𝗲𝘀𝘀𝗲𝗱 𝗶𝘀 𝗟𝗼𝘄\n\n*Player : _@" + _0x34ca41.player.split("@")[0] + "_* \n*Attempts :* _" + _0x34ca41.attempts + " yet_\n\n*Number Info:*\n *_▢ Its Too Low Number!_*\n *_▢ Try to Guess a High Number From ' " + _0x34ca41.guessedNumber + "'._* \n *_▢ Make Sure to guess Number Between " + (_0x34ca41.mode === "Easy" ? "1 and 100" : _0x34ca41.mode === "Medium" ? "1 and 1000" : "1 and 10000") + "._*\n", { + mentions: [_0x34ca41.player] + }, ""); + } else if (_0x34ca41.guessedNumber > _0x34ca41.randomNumber) { + await _0x16aecb.send(logoName + "\n 𝗡𝘂𝗺𝗯𝗲𝗿 𝗬𝗼𝘂 𝗚𝘂𝗲𝘀𝘀𝗲𝗱 𝗶𝘀 𝗛𝗶𝗴𝗵\n\n*Player : _@" + _0x34ca41.player.split("@")[0] + "_* \n*Attempts :* _" + _0x34ca41.attempts + " yet_\n\n*Number Info:*\n *_▢ Its Too High Number!_*\n *_▢ Try to Guess a Smaller Number From ' " + _0x34ca41.guessedNumber + "'._* \n *_▢ Make Sure to guess Number Between " + (_0x34ca41.mode === "Easy" ? "1 and 100" : _0x34ca41.mode === "Medium" ? "1 and 1000" : "1 and 10000") + "._*\n", { + mentions: [_0x34ca41.player] + }); + } else { + await _0x16aecb.send(logoName + "\n 𝗡𝘂𝗺𝗯𝗲𝗿 𝗚𝘂𝗲𝘀𝘀𝗶𝗻𝗴 𝗚𝗮𝗺𝗲 𝗙𝗶𝗻𝗶𝘀𝗵𝗲𝗱\n\n*𝗠𝗼𝗱𝗲 You Played : _" + _0x34ca41.mode.toUpperCase() + "_* \n*_Congratulations! @" + _0x34ca41.player.split("@")[0] + " you won the Game!_* \n _▢ You guessed the correct number ' *" + _0x34ca41.randomNumber + "* '._\n _▢ You take " + _0x34ca41.attempts + " attempts to Guess that Number._\n", { + mentions: [_0x34ca41.player] + }); + delete astro_patch_numGuess[_0x5d0144]; + } + } + } + } catch (_0x1fe0b3) { + console.log("Error in Number Guess Game, from command.On() --> ", _0x1fe0b3); + } + try { + const _0x2e9c6b = astro_patch_Capital[_0x16aecb.sender]; + if (_0x2e9c6b && _0x2e9c6b.id === _0x5d0144 && _0x2e9c6b.player === _0x16aecb.sender && _0x2e9c6b.preAns !== _0x16aecb.text) { + _0x2e9c6b.attempts += 1; + clearTimeout(_0x2e9c6b.timer); + _0x2e9c6b.preAns = _0x2e9c6b.text; + if (_0x16aecb.text.toLowerCase() === _0x2e9c6b.capital.toLowerCase()) { + let _0x15c4a0 = parseInt(captions.winReward) || 2000; + await _0x16aecb.bot.sendMessage(_0x5d0144, { + text: captions.onWinGame.replace("$player", _0x2e9c6b.player.split("@")[0]).replace("$country", _0x2e9c6b.country).replace("$capital", _0x2e9c6b.capital).replace("$amount", "" + _0x15c4a0).replace("$attempt", "" + _0x2e9c6b.attempts), + mentions: [_0x2e9c6b.player] + }); + delete astro_patch_Capital[_0x16aecb.sender]; + try { + if (global.isMongodb) { + await eco.give(_0x2e9c6b.player, "Asta", _0x15c4a0); + } + } catch {} + } else if (_0x2e9c6b.attempts <= 3) { + await _0x16aecb.bot.sendMessage(_0x5d0144, { + text: captions.onWrongAns.replace("$player", _0x2e9c6b.player.split("@")[0]).replace("$attempt", "" + (3 - _0x2e9c6b.attempts)).replace("$waitTime", _0x2e9c6b.waitTime), + mentions: [_0x2e9c6b.player] + }); + _0x2e9c6b.timer = setTimeout(() => { + timerFuntions(_0x16aecb, _0x2e9c6b); + }, _0x2e9c6b.waitTime * 1000); + } else if (_0x2e9c6b.attempts > 3) { + await _0x16aecb.bot.sendMessage(_0x5d0144, { + text: captions.onLimitEnd.replace("$player", _0x2e9c6b.player.split("@")[0]).replace("$country", _0x2e9c6b.country).replace("$capital", _0x2e9c6b.capital), + mentions: [_0x2e9c6b.player] + }); + delete astro_patch_Capital[_0x16aecb.sender]; + } + } + } catch (_0x588e9e) { + console.log("Error in game Capital Of Country --> ", _0x588e9e); + } +}); +const games = {}; +const astro_patch_wcg = {}; +const numbersArray = [40, 45, 50]; +class WordChainGame { + constructor() { + this.player1 = ""; + this.player2 = ""; + this.currentPlayer = ""; + this.previousWord = ""; + this.wordChain = ""; + this.wordsCount = 0; + this.wordLength = 4; + this.longestWordBy = "Theres No Word yet"; + this.gameStatus = false; + this.botPlayer = false; + this.wrongAttempts = {}; + this.maxAttempts = 5; + this.turnTimeLimit = 45; + this.turnStartTime = 45; + this.currentRemTime = 45; + this.turnIntervalId = null; + } + stopTurn() { + clearInterval(this.turnIntervalId); + } + async AwaitForSeconds(_0x3dad62) { + await new Promise(_0x4ac2f5 => setTimeout(_0x4ac2f5, _0x3dad62 * 1000)); + this.botPlayer = false; + } + async startTurn(_0x346961) { + this.turnIntervalId = setInterval(() => { + const _0x27a820 = Math.floor((Date.now() - this.turnStartTime) / 1000); + this.currentRemTime = this.turnTimeLimit - _0x27a820; + if (this.currentRemTime === 0 && this.gameStatus) { + try { + this.botPlayer = true; + if (this.wordsCount !== 0 && this.player2 && this.player1) { + _0x346961.send("*_Damn, Time's up!_*\n _@" + this.currentPlayer.split("@")[0] + " Lost Game...!_", { + mentions: [this.currentPlayer] + }); + this.currentPlayer = this.currentPlayer === this.player1 ? this.player2 : this.player1; + let _0x3a725c = "@" + this.currentPlayer.split("@")[0] + " Won The Game.\nWrong Attempt By Player : " + this.wrongAttempts[this.currentPlayer] + "\n\n\t\t*Game Information*\n\nTotal Chain Words : " + this.wordsCount + " \n" + this.longestWordBy + "\n*_Chain Started From :-_* " + this.wordChain + " ...! \n"; + _0x346961.send(_0x3a725c, { + mentions: [this.currentPlayer] + }); + } else if (this.wordsCount === 0 && this.player2 && this.player1) { + _0x346961.bot.sendMessage(_0x346961.from, { + text: "*Wcg Session Terminated,* \nPLayer1 @" + this.player1.split("@")[0] + " And Player2 @" + this.player2.split("@")[0] + " both didn't take any move yet*", + mentions: [this.player1, this.player2] + }); + } else if (!this.player2 || !this.player1) { + _0x346961.bot.sendMessage(_0x346961.chat, { + text: "*Word Chain Game Session Expired,*\n*Reason : _One Player Still Missing_*" + }); + } + this.stopTurn(); + delete astro_patch_wcg[_0x346961.chat]; + } catch (_0x2eafa3) { + return _0x346961.reply("Error while ending game : " + _0x2eafa3); + } + } else if (this.currentRemTime === 10) { + this.botPlayer = true; + if (this.player2 && this.player1) { + let _0x3ed90a = "*Reminder : Game Terminates After " + this.currentRemTime + "s*\n\n*_Waiting For @" + this.currentPlayer.split("@")[0] + "'s Responce_* \n_Take Your Turn, Otherwise Game Terminates_\n_Make Sure Your Word Must Start With *" + this.previousWord.slice(-1) + "* , and Must Have Atleast *" + this.wordLength + "* letters_\n\nYou Still Have *" + this.currentRemTime + "Secs* to Answer\nGive Your Best To Make Difficult For Opponent"; + _0x346961.send(_0x3ed90a, { + mentions: [this.currentPlayer] + }, "asta"); + } else if (!this.player2 || !this.player1) { + _0x346961.bot.sendMessage(_0x346961.jid, { + text: "_Still Waiting For Player to Start Word Chain Game..._\n _Type *" + prefix + "wcg* to Join The Game_ \nOtherwise : _Wcg Session Expires After " + this.currentRemTime + "s_" + }); + } + this.AwaitForSeconds(1); + } + }, 1000); + } +} +smd({ + pattern: "wcg", + desc: "starts a Word Chain game.", + filename: __filename, + category: "game" +}, async (_0x5a8e18, _0x42e9b0) => { + const _0x3e403e = _0x5a8e18.chat; + let _0x17a140 = astro_patch_wcg[_0x3e403e]; + if (_0x42e9b0.startsWith("end") && _0x17a140) { + _0x17a140.stopTurn(); + delete astro_patch_wcg[_0x3e403e]; + return await _0x5a8e18.reply("Game ended. Goodbye!"); + } + if (_0x17a140 && _0x17a140.gameStatus) { + return await _0x5a8e18.reply("A game is already in progress in this chat.\nType ```.wcg end``` Terminate the Session"); + } + let _0x44a1fc = _0x5a8e18.quoted ? _0x5a8e18.quoted.sender : _0x5a8e18.mentionedJid ? _0x5a8e18.mentionedJid[0] : false; + if (!_0x17a140) { + _0x17a140 = new WordChainGame(); + astro_patch_wcg[_0x3e403e] = _0x17a140; + } + if (!_0x17a140.player1 || _0x5a8e18.sender === _0x17a140.player1) { + if (_0x44a1fc && _0x44a1fc !== _0x5a8e18.sender) { + _0x17a140.player1 = _0x5a8e18.sender; + _0x17a140.player2 = _0x44a1fc; + _0x17a140.gameStatus = true; + } else { + _0x17a140.player1 = _0x5a8e18.sender; + _0x17a140.turnStartTime = Date.now(); + _0x17a140.startTurn(_0x5a8e18); + return await _0x5a8e18.bot.sendMessage(_0x5a8e18.from, { + text: "_Game Starting..._\nPLayer 1 : _@" + _0x17a140.player1.split("@")[0] + " Joined_ \n\n_Needs Another Player To Start Game..._\nType *_" + prefix + "wcg_* to Join This Game.", + mentions: [_0x17a140.player1] + }); + } + } else if (_0x5a8e18.sender !== _0x17a140.player1) { + _0x17a140.player2 = _0x5a8e18.sender; + _0x17a140.gameStatus = true; + } + if (_0x17a140.gameStatus) { + _0x17a140.stopTurn(); + _0x17a140.botPlayer = true; + _0x17a140.turnStartTime = Date.now(); + _0x17a140.startTurn(_0x5a8e18); + _0x17a140.wrongAttempts[_0x17a140.player1] = 0; + _0x17a140.wrongAttempts[_0x17a140.player2] = 0; + _0x17a140.previousWord = String.fromCharCode("a".charCodeAt(0) + Math.floor(Math.random() * 26)); + _0x17a140.wordChain = _0x17a140.previousWord; + _0x17a140.currentPlayer = _0x17a140.player1; + _0x17a140.AwaitForSeconds(3); + return await _0x5a8e18.bot.sendMessage(_0x5a8e18.chat, { + text: "*_Game started Now..._*\n _Turn : @" + _0x17a140.player1.split("@")[0] + "_\n _Next @" + _0x17a140.player2.split("@")[0] + "_\n *Let's play! :* @" + _0x17a140.currentPlayer.split("@")[0] + "'s Word Must Start With *_\"" + _0x17a140.previousWord + "\"_* .\n_you Have " + _0x17a140.turnTimeLimit + "Secs to Answer_\n", + mentions: [_0x17a140.player1, _0x17a140.player2, _0x17a140.currentPlayer] + }); + } +}); +smd({ + cmdname: "delwcg", + info: "deletes word chain game running session.", + filename: __filename, + type: "game" +}, async ({ + chat: _0x4d8134, + isCreator: _0x283363, + send: _0x52d274, + reply: _0x54222a, + sender: _0x2b145d, + isAdmin: _0x1bb0fc +}) => { + let _0x19b4bc = astro_patch_wcg[_0x4d8134]; + if (_0x19b4bc) { + if (!_0x283363 && _0x2b145d !== _0x19b4bc.player2 && _0x2b145d !== _0x19b4bc.player1 && !_0x1bb0fc) { + await _0x52d274("┏━━━━━━━━━━━━━━━━━━┓\n┃ WORD CHAIN GAME ┃\n┗━━━━━━━━━━━━━━━━━━┛\n\n*Uhh Please, _You are not a Player of running game!!!_\n"); + } else { + _0x19b4bc.stopTurn(); + await _0x54222a(("┏━━━━━━━━━━━━━━━━━━┓\n┃ WORD CHAIN GAME ┃\n┗━━━━━━━━━━━━━━━━━━┛\n\n*Room Id : _wcg-" + _0x4d8134.split("@")[0] + "_ Cleared Successfully*\n*_Word Chain Game Session Deleted From This Chat..._*\n\n\n\n" + (_0x19b4bc.wordsCount > 0 ? "\t*Game Information*\n\nTotal Chain Words : " + _0x19b4bc.wordsCount + " \n" + _0x19b4bc.longestWordBy + "\n*_Chain Started From :-_* " + _0x19b4bc.wordChain + " ...!" : "") + "\n\n").trim()); + console.log("counts : ", _0x19b4bc.wordsCount); + delete astro_patch_hcg[_0x4d8134]; + } + } else { + _0x54222a("┏━━━━━━━━━━━━━━━━━━┓\n┃ WORD CHAIN 404Error ┃\n┗━━━━━━━━━━━━━━━━━━┛ \n\n*Uhh Dear, _Theres No Game Started yet in This Chat_*\n"); + } +}); +smd({ + on: "text" +}, async (_0x31d911, _0x9c17da, { + isCreator: _0x561706 +}) => { + if (_0x31d911.isBot) { + return; + } + const _0x2b4276 = _0x31d911.chat; + const _0x1dda4f = astro_patch_wcg[_0x2b4276]; + if (!_0x1dda4f) { + return; + } + const _0x2339e2 = _0x31d911.user; + if (_0x1dda4f.gameStatus && _0x1dda4f.currentPlayer === _0x31d911.sender && _0x31d911.text && !_0x1dda4f.botPlayer) { + const _0x679d9a = _0x9c17da.split(" ")[0].trim().toLowerCase(); + if (_0x679d9a.length >= _0x1dda4f.wordLength && _0x679d9a.charAt(0) === _0x1dda4f.previousWord.slice(-1)) { + if (_0x679d9a.length > _0x1dda4f.wordLength) { + _0x1dda4f.longestWordBy = "Longest Word With " + _0x679d9a.length + " letters is *" + _0x679d9a + "* by @" + _0x1dda4f.currentPlayer.split("@")[0]; + } + _0x1dda4f.wordsCount++; + _0x1dda4f.botPlayer = true; + _0x1dda4f.stopTurn(); + _0x1dda4f.turnStartTime = Date.now(); + _0x1dda4f.startTurn(_0x31d911); + _0x1dda4f.previousWord = _0x679d9a; + _0x1dda4f.wordChain += "\t⇢" + _0x1dda4f.previousWord; + _0x1dda4f.turnTimeLimit = Math.floor(Math.random() * 10) + 35; + await _0x31d911.bot.sendMessage(_0x31d911.chat, { + react: { + text: "✅", + key: _0x31d911.key + } + }); + _0x1dda4f.currentPlayer = _0x1dda4f.currentPlayer === _0x1dda4f.player1 ? _0x1dda4f.player2 : _0x1dda4f.player1; + let _0x3dc7a4 = "\n*Word Accepted...? ✅*\n_Current Turn : @" + _0x1dda4f.currentPlayer.split("@")[0] + "_\n_Next Turn : @" + (_0x1dda4f.currentPlayer === _0x1dda4f.player1 ? _0x1dda4f.player2 : _0x1dda4f.player1).split("@")[0] + "_\n\n_Your word must start with *'" + _0x1dda4f.previousWord.slice(-1).toUpperCase() + "'* , and must have atleast *'" + _0x1dda4f.wordLength + "'* letters_\n_you have *" + _0x1dda4f.turnTimeLimit + "Secs* to answer_\n_Total words yet : " + _0x1dda4f.wordsCount + "\n\n "; + if (_0x2339e2 === _0x1dda4f.currentPlayer) { + _0x1dda4f.AwaitForSeconds(3); + } else { + _0x1dda4f.botPlayer = false; + } + return await _0x31d911.bot.sendMessage(_0x31d911.from, { + text: _0x3dc7a4, + mentions: [_0x1dda4f.player1, _0x1dda4f.player2] + }); + } else if (!_0x1dda4f.botPlayer) { + _0x1dda4f.botPlayer = true; + await _0x31d911.bot.sendMessage(_0x31d911.chat, { + react: { + text: "❎", + key: _0x31d911.key + } + }); + if (!_0x1dda4f.wrongAttempts[_0x1dda4f.currentPlayer]) { + _0x1dda4f.wrongAttempts[_0x1dda4f.currentPlayer] = 1; + } else { + _0x1dda4f.wrongAttempts[_0x1dda4f.currentPlayer]++; + } + if (_0x1dda4f.wrongAttempts[_0x1dda4f.currentPlayer] >= _0x1dda4f.maxAttempts) { + _0x1dda4f.stopTurn(); + delete astro_patch_wcg[_0x2b4276]; + let _0x422e2e = _0x1dda4f.wordChain.split(","); + return await _0x31d911.reply("Wrong Attempt Exceeds! : " + _0x1dda4f.wrongAttempts[_0x1dda4f.currentPlayer] + "\n Game Terminated, " + _0x1dda4f.currentPlayer.split("@")[0] + " Can't Find a Word That should start with \"" + _0x1dda4f.previousWord.slice(-1) + "\".\n\n\n*Total Chain Words : " + _0x422e2e.length + "\n Started From : " + _0x422e2e.join("\t⇢") + " \n\nGame ended.*"); + } + let _0x552145 = _0x679d9a.charAt(0) === _0x1dda4f.previousWord.slice(-1) ? _0x679d9a.length > _0x1dda4f.wordLength ? "_Word Length is Smaller Then " + _0x1dda4f.wordLength + " letters_" : "Invalid Word" : "Given Word Not Start With '" + _0x1dda4f.previousWord.slice(-1) + "'"; + let _0x358bf0 = "Word Not Accepted...? ❎\nReason : _" + _0x552145 + "_\n\n_Current Turn : @" + _0x1dda4f.currentPlayer.split("@")[0] + "_\n_Next Turn : @" + (_0x1dda4f.currentPlayer === _0x1dda4f.player1 ? _0x1dda4f.player2 : _0x1dda4f.player1).split("@")[0] + "_\n\n_You Word Must Start With *" + _0x1dda4f.previousWord.slice(-1) + "* , and Must Have Atleast *4* letters_\n_Try Again, you Still Have " + _0x1dda4f.currentRemTime + "Secs to Answer_\n"; + await _0x31d911.sendMessage(_0x31d911.chat, { + text: _0x358bf0, + mentions: [_0x1dda4f.player1, _0x1dda4f.player2] + }); + if (_0x1dda4f.currentPlayer === _0x2339e2) { + return await _0x1dda4f.AwaitForSeconds(3); + } else { + _0x1dda4f.botPlayer = false; + } + } + } +}); +const stickers = ["https://raw.githubusercontent.com/SuhailTechInfo/Suhail-Md-Media/main/ᴅɪᴄᴇ/sᴜʜᴀɪʟ-ᴍᴅ-ᴅɪᴄᴇ-1.webp", "https://raw.githubusercontent.com/SuhailTechInfo/Suhail-Md-Media/main/ᴅɪᴄᴇ/sᴜʜᴀɪʟ-ᴍᴅ-ᴅɪᴄᴇ-2.webp", "https://raw.githubusercontent.com/SuhailTechInfo/Suhail-Md-Media/main/ᴅɪᴄᴇ/sᴜʜᴀɪʟ-ᴍᴅ-ᴅɪᴄᴇ-3.webp", "https://raw.githubusercontent.com/SuhailTechInfo/Suhail-Md-Media/main/ᴅɪᴄᴇ/sᴜʜᴀɪʟ-ᴍᴅ-ᴅɪᴄᴇ-3.webp", "https://raw.githubusercontent.com/SuhailTechInfo/Suhail-Md-Media/main/ᴅɪᴄᴇ/sᴜʜᴀɪʟ-ᴍᴅ-ᴅɪᴄᴇ-4.webp", "https://raw.githubusercontent.com/SuhailTechInfo/Suhail-Md-Media/main/ᴅɪᴄᴇ/sᴜʜᴀɪʟ-ᴍᴅ-ᴅɪᴄᴇ-4.webp", "https://raw.githubusercontent.com/SuhailTechInfo/Suhail-Md-Media/main/ᴅɪᴄᴇ/sᴜʜᴀɪʟ-ᴍᴅ-ᴅɪᴄᴇ-5.webp", "https://raw.githubusercontent.com/SuhailTechInfo/Suhail-Md-Media/main/ᴅɪᴄᴇ/sᴜʜᴀɪʟ-ᴍᴅ-ᴅɪᴄᴇ-6.webp"]; +smd({ + pattern: "dice", + desc: "Rolling Dice Game", + filename: __filename, + category: "game" +}, async _0x1894c6 => { + try { + try { + const _0x4cde9e = Math.floor(Math.random() * stickers.length); + return await _0x1894c6.bot.sendMessage(_0x1894c6.chat, { + sticker: { + url: stickers[_0x4cde9e] + }, + packname: "ᴅɪᴄᴇ", + author: "ᴀsᴛᴀ-ᴍᴅ" + }); + } catch (_0xd37c6a) { + const _0x312d64 = ["⚀", "⚁", "⚂", "⚃", "⚄", "⚅"]; + const _0xdf7a0 = ["1️⃣", "2️⃣", "3️⃣", "4️⃣", "5️⃣", "6️⃣"]; + let _0x1d0302 = Math.floor(Math.random() * _0x312d64.length); + let _0x58b954 = await _0x1894c6.bot.sendMessage(_0x1894c6.chat, { + text: _0x312d64[_0x1d0302] + }); + return await _0x1894c6.react(_0xdf7a0[_0x1d0302], _0x58b954); + } + } catch (_0x54b873) { + await _0x1894c6.error(_0x54b873 + "\n\ncommand: dice", _0x54b873); + } +}); +let A = ["😺", "👻", "⏳", "🍫"]; +let B = ["🥳", "🍂", "😎", "💀"]; +let C = ["💍", "🍁", "🔥", "💥"]; +let D = ["✨", "❄️", "⭐", "🌚"]; +let gtc = {}; +function getEmojy(_0x87048e) { + return _0x87048e[Math.floor(Math.random() * _0x87048e.length)]; +} +const randomChar = require("anime-character-random"); +smd({ + cmdname: "gtc", + info: "Guess the anime name, a new game", + type: "game", + filename: __filename, + use: "" +}, async _0x525366 => { + try { + const _0x620752 = await randomChar.GetChar(); + const _0xad866 = [_0x620752.OtherCharacterList[0], _0x620752.OtherCharacterList[1], _0x620752.OtherCharacterList[2], _0x620752.CharacterName]; + const _0x1051f1 = _0xad866.sort(() => Math.random() - 0.5); + let _0x5a9511 = _0x1051f1.indexOf(_0x620752.CharacterName); + let _0x54e542 = getEmojy(A); + var _0x1bf40d = getEmojy(B); + var _0x45283d = getEmojy(C); + var _0x2b5e13 = getEmojy(D); + let _0x2e99fd = "*[GUESS THE ANIME NAME]*\n\n_React the message with correct emojy!_\n\n\n" + _0x54e542 + ") " + _0x1051f1[0] + "\n" + _0x1bf40d + ") " + _0x1051f1[1] + "\n" + _0x45283d + ") " + _0x1051f1[2] + "\n" + _0x2b5e13 + ") " + _0x1051f1[3] + "\n\n\n" + Config.caption + "\n"; + let { + key: _0xdff25a + } = await _0x525366.send(_0x620752.CharacterImage, { + caption: _0x2e99fd + }, "image"); + let _0x525613 = _0xdff25a.id; + gtc[_0x525613] = {}; + gtc[_0x525613].emojies = [_0x54e542, _0x1bf40d, _0x45283d, _0x2b5e13]; + gtc[_0x525613].ans = _0x620752.CharacterName; + gtc[_0x525613].emoji = gtc[_0x525613].emojies[_0x5a9511]; + console.log("gtc : ", gtc[_0x525613]); + } catch (_0x5e93e0) { + await _0x525366.error(_0x5e93e0 + "\n\ncommand: gtc(game)", _0x5e93e0); + } +}); +smd({ + on: "text" +}, async _0x3344e4 => { + if (_0x3344e4.reaction || _0x3344e4.reply_message) { + let _0x2fce2b = _0x3344e4.reaction ? _0x3344e4.msg.key.id : _0x3344e4.reply_message ? _0x3344e4.reply_message.id : false; + if (!gtc[_0x2fce2b] || !gtc[_0x2fce2b].emojies.includes(_0x3344e4.text)) { + return; + } + console.log("gtc : ", gtc); + if (_0x3344e4.text == gtc[_0x2fce2b].emoji) { + await _0x3344e4.send("*_Waow you @" + _0x3344e4.senderNum + " Guess the Correct Name!_*\n*_[NAME IS]: '" + gtc[_0x2fce2b].emoji + ") " + gtc[_0x2fce2b].ans + "'_*", { + mentions: [_0x3344e4.sender] + }); + delete gtc[_0x2fce2b]; + } else { + if (!gtc[_0x2fce2b][_0x3344e4.sender]) { + gtc[_0x2fce2b][_0x3344e4.sender] = 1; + } else { + gtc[_0x2fce2b][_0x3344e4.sender]++; + } + if (gtc[_0x2fce2b][_0x3344e4.sender] >= 2) { + await _0x3344e4.send("*Hey @" + _0x3344e4.senderNum + "You Lose!*\n_Better luck next time!_\n*Name is:* " + gtc[_0x2fce2b].emoji + ") " + gtc[_0x2fce2b].ans, { + mentions: [_0x3344e4.sender] + }); + delete gtc[_0x2fce2b]; + } else if (gtc[_0x2fce2b][_0x3344e4.sender] > 0) { + await _0x3344e4.send("*Hey @" + _0x3344e4.senderNum + " InCorrect answer!*\n_Try another emoji, you have one move!_", { + mentions: [_0x3344e4.sender] + }); + } + } + } +}); +smd({ + pattern: "ttt", + desc: "Play TicTacToe", + filename: __filename, + category: "game" +}, async (_0xe274e9, _0x2df401) => { + let _0xf9f8b5 = require("../lib/ttt"); + this.game = this.game ? this.game : {}; + if (Object.values(this.game).find(_0x8e29bc => _0x8e29bc.id.startsWith("tictactoe") && [_0x8e29bc.game.playerX, _0x8e29bc.game.playerO].includes(_0xe274e9.sender))) { + return _0xe274e9.reply("_A game is already going on_"); + } + var _0xa3e5ff = Object.values(this.game).find(_0x5bdc17 => _0x5bdc17.state === "WAITING" && (_0x2df401 ? _0x5bdc17.name === _0x2df401 : true)); + let _0x89a570 = _0xe274e9.sender; + let _0x17f1a7 = _0xe274e9.quoted ? _0xe274e9.quoted.sender : _0xe274e9.mentionedJid ? _0xe274e9.mentionedJid[0] : false; + if (!_0xa3e5ff && _0x17f1a7 && _0x89a570 && _0x89a570 != _0x17f1a7) { + _0xa3e5ff = { + id: "tictactoe-" + +new Date(), + x: _0xe274e9.chat, + o: "", + game: new _0xf9f8b5(_0x17f1a7, "o"), + state: "WAITING" + }; + if (_0x2df401) { + _0xa3e5ff.name = _0x2df401; + } + this.game[_0xa3e5ff.id] = _0xa3e5ff; + } + let _0x26e17d = Object.values(this.game).find(_0x337ecd => _0x337ecd.state === "WAITING" && (_0x2df401 ? _0x337ecd.name === _0x2df401 : true)); + if (_0x26e17d) { + _0x26e17d.o = _0xe274e9.chat; + _0x26e17d.game.playerO = _0xe274e9.sender || _0xe274e9.mentionedJid[0]; + _0x26e17d.state = "PLAYING"; + let _0x563dae = _0x26e17d.game.render().map(_0x4eec74 => { + return { + X: "❌", + O: "⭕", + 1: "1️⃣", + 2: "2️⃣", + 3: "3️⃣", + 4: "4️⃣", + 5: "5️⃣", + 6: "6️⃣", + 7: "7️⃣", + 8: "8️⃣", + 9: "9️⃣" + }[_0x4eec74]; + }); + let _0x3a639c = "\nCurrent turn: @" + _0x26e17d.game.currentTurn.split("@")[0] + "\nRoom ID: " + _0x26e17d.id + "\n" + _0x563dae.slice(0, 3).join(" ") + "\n" + _0x563dae.slice(3, 6).join(" ") + "\n" + _0x563dae.slice(6).join(" ") + "\n"; + return await _0xe274e9.bot.sendMessage(_0xe274e9.chat, { + text: _0x3a639c, + mentions: [_0x26e17d.game.currentTurn] + }); + } else { + _0x26e17d = { + id: "tictactoe-" + +new Date(), + x: _0xe274e9.chat, + o: "", + game: new _0xf9f8b5(_0xe274e9.sender, "o"), + state: "WAITING" + }; + if (_0x2df401) { + _0x26e17d.name = _0x2df401; + } + _0xe274e9.reply("_Waiting for player,use .ttt to join this game._ "); + this.game[_0x26e17d.id] = _0x26e17d; + } +}); +smd({ + pattern: "delttt", + desc: "deletes TicTacToe running session.", + filename: __filename, + category: "game" +}, async _0x1abbe9 => { + try { + this.game = this.game ? this.game : false; + let _0x25fffe = Object.values(this.game).find(_0x1649fb => _0x1649fb.id.startsWith("tictactoe")); + let _0x3a992a = _0x1abbe9.isGroup && _0x1abbe9.isAdmin || _0x1abbe9.isCreator ? true : false; + if (_0x25fffe) { + if (_0x3a992a || [_0x25fffe.game.playerX, _0x25fffe.game.playerO].includes(_0x1abbe9.sender)) { + delete this.game; + return _0x1abbe9.reply("_Successfully Deleted running TicTacToe game._"); + } else { + return _0x1abbe9.reply("*Uhh Please, _You are not a Player of running game!!!_"); + } + } else { + return _0x1abbe9.reply("No TicTacToe game🎮 is running."); + } + } catch (_0x483b2b) { + await _0x1abbe9.error(_0x483b2b + "\n\ncommand: delttt", _0x483b2b); + } +}); +smd({ + on: "text" +}, async _0x303e73 => { + this.game = this.game ? this.game : {}; + let _0x5aaad7 = Object.values(this.game).find(_0x16bcc1 => _0x16bcc1.id && _0x16bcc1.game && _0x16bcc1.state && _0x16bcc1.id.startsWith("tictactoe") && [_0x16bcc1.game.playerX, _0x16bcc1.game.playerO].includes(_0x303e73.sender) && _0x16bcc1.state == "PLAYING"); + if (_0x5aaad7) { + let _0x5ade22; + let _0x3fbb59 = false; + let _0x1e00eb = false; + let _0x560530 = false; + if (!/^([1-9]|(me)?give_up|surr?ender|off|skip)$/i.test(_0x303e73.text)) { + return; + } + _0x560530 = !/^[1-9]$/.test(_0x303e73.text); + if (_0x303e73.sender !== _0x5aaad7.game.currentTurn) { + if (!_0x560530) { + return true; + } + } + if (!_0x560530 && (_0x5ade22 = _0x5aaad7.game.turn(_0x303e73.sender === _0x5aaad7.game.playerO, parseInt(_0x303e73.text) - 1)) < 1) { + _0x303e73.reply({ + "-3": "The game is over.", + "-2": "Invalid", + "-1": "_Invalid Position_", + 0: "_Invalid Position_" + }[_0x5ade22]); + return true; + } + if (_0x303e73.sender === _0x5aaad7.game.winner) { + _0x3fbb59 = true; + } else if (_0x5aaad7.game.board === 511) { + _0x1e00eb = true; + } + let _0x2929f6 = _0x5aaad7.game.render().map(_0x584d3c => { + return { + X: "❌", + O: "⭕", + 1: "1️⃣", + 2: "2️⃣", + 3: "3️⃣", + 4: "4️⃣", + 5: "5️⃣", + 6: "6️⃣", + 7: "7️⃣", + 8: "8️⃣", + 9: "9️⃣" + }[_0x584d3c]; + }); + if (_0x560530) { + _0x5aaad7.game._currentTurn = _0x303e73.sender === _0x5aaad7.game.playerX; + _0x3fbb59 = true; + } + let _0x283c15 = _0x560530 ? _0x5aaad7.game.currentTurn : _0x5aaad7.game.winner; + let _0x28a3a4 = "Room ID: " + _0x5aaad7.id + "\n\n" + _0x2929f6.slice(0, 3).join(" ") + "\n" + _0x2929f6.slice(3, 6).join(" ") + "\n" + _0x2929f6.slice(6).join(" ") + "\n" + (_0x3fbb59 ? "@" + _0x283c15.split("@")[0] + " Won ! and got 2000💎 in wallet🤑" : _0x1e00eb ? "Game Tied,well done to both of you players." : "Current Turn " + ["❌", "⭕"][_0x5aaad7.game._currentTurn * 1] + " @" + _0x5aaad7.game.currentTurn.split("@")[0]) + "\n⭕:- @" + _0x5aaad7.game.playerO.split("@")[0] + "\n❌:- @" + _0x5aaad7.game.playerX.split("@")[0]; + if ((_0x5aaad7.game._currentTurn ^ _0x560530 ? _0x5aaad7.x : _0x5aaad7.o) !== _0x303e73.chat) { + _0x5aaad7[_0x5aaad7.game._currentTurn ^ _0x560530 ? "x" : "o"] = _0x303e73.chat; + } + if (_0x3fbb59 && isMongodb) { + await eco.give(_0x303e73.sender, "Asta", 2000); + } + if (_0x3fbb59 || _0x1e00eb) { + await _0x303e73.bot.sendMessage(_0x303e73.chat, { + text: _0x28a3a4, + mentions: [_0x5aaad7.game.playerO, _0x5aaad7.game.playerX] + }); + delete this.game[_0x5aaad7.id]; + } else { + await _0x303e73.bot.sendMessage(_0x303e73.chat, { + text: _0x28a3a4, + mentions: [_0x5aaad7.game.playerO, _0x5aaad7.game.playerX] + }); + } + } +}); \ No newline at end of file diff --git a/plugins/group.js b/plugins/group.js new file mode 100644 index 0000000..1bd9ecb --- /dev/null +++ b/plugins/group.js @@ -0,0 +1,4840 @@ +global.warncount = process.env.WARN_COUNT || global.warncount || "3"; +global.MsgsInLog = process.env.MSGS_IN_LOG || global.MsgsInLog || "false"; +const { updateProfilePicture, parsedJid } = require("../lib"); +const { + sck, + smd, + send, + tlang, + sleep, + getAdmin, + prefix, + groupdb, + userdb, + bot_, + sendWelcome, +} = require("../lib"); +const Config = require("../config") +const axios = require("axios"); +const astro_patch = require("../lib/plugins"); +const { cmd } = astro_patch; +const grouppattern = /https:\/\/chat\.whatsapp\.com\/[A-Za-z0-9]{22}/g; +smd( + { + cmdname: "join", + info: "joins group by link", + type: "whatsapp", + fromMe: true, + filename: __filename, + use: "", + }, + async (_0x466dd8, _0x5b1338) => { + try { + if (_0x466dd8.reply_message && _0x466dd8.reply_message.groupInvite) { + var _0x29e5fc = await _0x466dd8.bot.groupAcceptInviteV4( + _0x466dd8.chat, + _0x466dd8.reply_message.msg + ); + if (_0x29e5fc && _0x29e5fc.includes("joined to:")) { + return await send(_0x466dd8, "*_Joined_*", {}, "", _0x466dd8); + } + } + let _0x208739 = _0x5b1338 ? _0x5b1338 : _0x466dd8.reply_text; + const _0x47ed60 = _0x208739.match(grouppattern); + if (!_0x47ed60) { + return await _0x466dd8.reply("*_Uhh Please, provide group link_*"); + } + let _0x4263be = _0x47ed60[0] + .split("https://chat.whatsapp.com/")[1] + .trim(); + await _0x466dd8.bot + .groupAcceptInvite(_0x4263be) + .then((_0x7f3222) => send(_0x466dd8, "*_Joined_*", {}, "", _0x466dd8)) + .catch((_0x1d6aea) => + _0x466dd8.send("*_Can't Join, Group Id not found!!_*") + ); + } catch (_0x5d3484) { + await _0x466dd8.error( + _0x5d3484 + "\n\ncommand: join", + _0x5d3484, + "*_Can't Join, Group Id not found, Sorry!!_*" + ); + } + } +); +smd({ + cmdname: "newgc", + info: "Create New Group", + type: "whatsapp", + filename: __filename, + use: "", + }, async (message, args, { smd, cmdName }) => { + try { + if (!message.isCreator) { + return message.reply(tlang().owner); + } + + if (!args) { + return await message.reply( + `*_provide Name to Create new Group!!!_*\n*_Ex: ${prefix}${smd} My Name Group @user1,2,3.._*` + ); + } + + let groupName = args; + + if (groupName.toLowerCase() === "info") { + return await message.send( + `\n *Its a command to create new Gc*\n \`\`\`Ex: ${prefix}${cmdName} My new Group\`\`\`\n \n*You also add peoples in newGc*\n \`\`\`just reply or mention Users\`\`\`\n` + ).trim(); + } + + let participants = [message.sender]; + + if (message.quoted) { + participants.push(message.quoted.sender); + } + + if (message.mentionedJid && message.mentionedJid[0]) { + participants.push(...message.mentionedJid); + try { + message.mentionedJid.forEach((jid) => { + const userId = jid.split("@")[0].trim(); + groupName = groupName.replace(new RegExp(`@${userId}`, "g"), ""); + }); + } catch {} + } + + const groupNameTrimmed = groupName.substring(0, 60); + const createdGroup = await Suhail.bot.groupCreate(groupNameTrimmed, [...participants]); + + if (createdGroup) { + let welcomeMessage = await message.bot.sendMessage(createdGroup.id, { + text: `*_Hey Buddy, Welcome to new Group_*\n${Config.caption}`, + }); + + try { + var groupInviteCode = await Suhail.bot.groupInviteCode(createdGroup.id); + } catch { + var groupInviteCode = false; + } + + const baseUrl = "https://chat.whatsapp.com/"; + const groupInviteLink = `${baseUrl}${groupInviteCode}`; + const contextInfo = { + externalAdReply: { + title: "*ASTA*-𝗠𝗗", + }, + }; + + return await send( + message, + `*_Hurray, New group created!!!_*\n${groupInviteCode ? `*_${groupInviteLink}_*` : ""}`.trim(), + { contextInfo }, + "", + welcomeMessage + ); + } else { + await message.send("*_Can't create new group, Sorry!!_*"); + } + } catch (error) { + await message.error(`${error}\n\ncommand: ${cmdName}`, error, "*_Can't create new group, Sorry!!_*"); + } + }); + +smd( + { + pattern: "ginfo", + desc: "get group info by link", + type: "group", + filename: __filename, + use: "", + }, + async (_0x4f7c88, _0x1490e0) => { + try { + let _0x3eb855 = _0x1490e0 ? _0x1490e0 : _0x4f7c88.reply_text; + const _0x3e5033 = _0x3eb855.match(grouppattern) || false; + if (!_0x3e5033) { + return await _0x4f7c88.reply("*_Uhh Please, provide group link_*"); + } + let _0x5ced5d = _0x3e5033[0] + .split("https://chat.whatsapp.com/")[1] + .trim(); + const _0x5f4890 = await _0x4f7c88.bot.groupGetInviteInfo(_0x5ced5d); + if (_0x5f4890) { + const _0x40ced5 = new Date(_0x5f4890.creation * 1000); + var _0x10288a = _0x40ced5.getFullYear(); + var _0x436585 = _0x40ced5.getMonth() + 1; + var _0x511884 = _0x40ced5.getDate(); + var _0x236a49 = + _0x10288a + + "-" + + _0x436585.toString().padStart(2, "0") + + "-" + + _0x511884.toString().padStart(2, "0"); + var _0x56eaaf = { + externalAdReply: { + title: "*ASTA*-𝗠𝗗", + body: _0x5f4890.subject, + renderLargerThumbnail: true, + thumbnail: log0, + mediaType: 1, + mediaUrl: _0x3e5033[0], + sourceUrl: _0x3e5033[0], + }, + }; + return await send( + _0x4f7c88, + ( + _0x5f4890.subject + + "\n \n Creator: wa.me/" + + _0x5f4890.owner.split("@")[0] + + " \n GJid; ```" + + _0x5f4890.id + + " ```\n *Muted:* " + + (_0x5f4890.announce ? " yes" : " no") + + "\n *Locked:* " + + (_0x5f4890.restrict ? " yes" : " no") + + "\n *createdAt:* " + + _0x236a49 + + "\n *participents:* " + + (_0x5f4890.size > 3 ? _0x5f4890.size + "th" : _0x5f4890.size) + + "\n " + + (_0x5f4890.desc ? "*description:* " + _0x5f4890.desc + "\n" : "") + + "\n " + + Config.caption + + "\n " + ).trim(), + { + mentions: [_0x5f4890.owner], + contextInfo: _0x56eaaf, + }, + "", + _0x4f7c88 + ); + } else { + await _0x4f7c88.send("*_Group Id not found, Sorry!!_*"); + } + } catch (_0x36c345) { + await _0x4f7c88.error( + _0x36c345 + "\n\ncommand: ginfo", + _0x36c345, + "*_Group Id not found, Sorry!!_*" + ); + } + } +); +smd( + { + cmdname: "rejectall", + alias: ["rejectjoin"], + info: "reject all request to join!", + type: "group", + filename: __filename, + }, + async (_0xb81e45, _0x3dda5f) => { + try { + if (!_0xb81e45.isGroup) { + return _0xb81e45.reply(tlang().group); + } + if (!_0xb81e45.isBotAdmin || !_0xb81e45.isAdmin) { + return await _0xb81e45.reply( + !_0xb81e45.isBotAdmin + ? "*_I'm Not Admin In This Group" + + (!_0xb81e45.isCreator ? ", Idiot" : "") + + "_*" + : tlang().admin + ); + } + const _0x4ea369 = await _0xb81e45.bot.groupRequestParticipantsList( + _0xb81e45.chat + ); + if (!_0x4ea369 || !_0x4ea369[0]) { + return await _0xb81e45.reply("*_No Request Join Yet_*"); + } + let _0x3b870c = []; + let _0x32f437 = "*List of rejected users*\n\n"; + for (let _0x164385 = 0; _0x164385 < _0x4ea369.length; _0x164385++) { + try { + await _0xb81e45.bot.groupRequestParticipantsUpdate( + _0xb81e45.from, + [_0x4ea369[_0x164385].jid], + "reject" + ); + _0x32f437 += "@" + _0x4ea369[_0x164385].jid.split("@")[0] + "\n"; + _0x3b870c = [..._0x3b870c, _0x4ea369[_0x164385].jid]; + } catch {} + } + await _0xb81e45.send(_0x32f437, { + mentions: [_0x3b870c], + }); + } catch (_0x13cc87) { + await _0xb81e45.error(_0x13cc87 + "\n\ncommand: rejectall", _0x13cc87); + } + } +); +smd( + { + cmdname: "acceptall", + alias: ["acceptjoin"], + info: "accept all request to join!", + type: "group", + filename: __filename, + }, + async (_0x90a6de, _0x5537ca) => { + try { + if (!_0x90a6de.isGroup) { + return _0x90a6de.reply(tlang().group); + } + if (!_0x90a6de.isBotAdmin || !_0x90a6de.isAdmin) { + return await _0x90a6de.reply( + !_0x90a6de.isBotAdmin + ? "*_I'm Not Admin In This Group" + + (!_0x90a6de.isCreator ? ", Idiot" : "") + + "_*" + : tlang().admin + ); + } + const _0x3da7c6 = await _0x90a6de.bot.groupRequestParticipantsList( + _0x90a6de.chat + ); + if (!_0x3da7c6 || !_0x3da7c6[0]) { + return await _0x90a6de.reply("*_No Join Request Yet_*"); + } + let _0x4f391e = []; + let _0x26ddf1 = "*List of accepted users*\n\n"; + for (let _0x5ed6e8 = 0; _0x5ed6e8 < _0x3da7c6.length; _0x5ed6e8++) { + try { + await _0x90a6de.bot.groupRequestParticipantsUpdate( + _0x90a6de.from, + [_0x3da7c6[_0x5ed6e8].jid], + "approve" + ); + _0x26ddf1 += "@" + _0x3da7c6[_0x5ed6e8].jid.split("@")[0] + "\n"; + _0x4f391e = [..._0x4f391e, _0x3da7c6[_0x5ed6e8].jid]; + } catch {} + } + await _0x90a6de.send(_0x26ddf1, { + mentions: [_0x4f391e], + }); + } catch (_0x366bd4) { + await _0x90a6de.error(_0x366bd4 + "\n\ncommand: acceptall", _0x366bd4); + } + } +); +smd( + { + cmdname: "listrequest", + alias: ["requestjoin"], + info: "Set Description of Group", + type: "group", + filename: __filename, + use: "", + }, + async (_0x13cccd, _0x38cc41) => { + try { + if (!_0x13cccd.isGroup) { + return _0x13cccd.reply(tlang().group); + } + if (!_0x13cccd.isBotAdmin || !_0x13cccd.isAdmin) { + return await _0x13cccd.reply( + !_0x13cccd.isBotAdmin + ? "*_I'm Not Admin In This Group" + + (!_0x13cccd.isCreator ? ", Idiot" : "") + + "_*" + : tlang().admin + ); + } + const _0x3115b1 = await _0x13cccd.bot.groupRequestParticipantsList( + _0x13cccd.chat + ); + if (!_0x3115b1 || !_0x3115b1[0]) { + return await _0x13cccd.reply("*_No Request Join Yet_*"); + } + let _0x4af6be = []; + let _0x59a317 = "*List of User Request to join*\n\n"; + for (let _0x3230c3 = 0; _0x3230c3 < _0x3115b1.length; _0x3230c3++) { + _0x59a317 += "@" + _0x3115b1[_0x3230c3].jid.split("@")[0] + "\n"; + _0x4af6be = [..._0x4af6be, _0x3115b1[_0x3230c3].jid]; + } + return await _0x13cccd.send(_0x59a317, { + mentions: [_0x4af6be], + }); + } catch (_0x5c8e97) { + await _0x13cccd.error(_0x5c8e97 + "\n\ncommand: listrequest", _0x5c8e97); + } + } +); +smd( + { + cmdname: "setdesc", + alias: ["setgdesc", "gdesc"], + info: "Set Description of Group", + type: "group", + filename: __filename, + use: "", + }, + async (_0x160b96, _0x4ef0da) => { + try { + if (!_0x160b96.isGroup) { + return _0x160b96.reply(tlang().group); + } + if (!_0x4ef0da) { + return await _0x160b96.reply( + "*Provide Description text, You wants to Set*" + ); + } + if (!_0x160b96.isBotAdmin || !_0x160b96.isAdmin) { + return await _0x160b96.reply( + !_0x160b96.isBotAdmin + ? "*_I'm Not Admin In This Group" + + (!_0x160b96.isCreator ? ", Idiot" : "") + + "_*" + : tlang().admin + ); + } + try { + await _0x160b96.bot.groupUpdateDescription( + _0x160b96.chat, + _0x4ef0da + "\n\n\t" + Config.caption + ); + _0x160b96.reply("*_✅Group description Updated Successfuly!_*"); + } catch (_0x986809) { + await _0x160b96.reply( + "*_Can't update description, Group Id not found!!_*" + ); + } + } catch (_0x526bb2) { + await _0x160b96.error(_0x526bb2 + "\n\ncommand: setdesc", _0x526bb2); + } + } +); +smd( + { + cmdname: "setname", + alias: ["setgname", "gname"], + info: "Set Description of Group", + type: "group", + filename: __filename, + use: "", + }, + async (_0x25d56b, _0x332d77) => { + try { + if (!_0x25d56b.isGroup) { + return _0x25d56b.reply(tlang().group); + } + if (!_0x332d77) { + return await _0x25d56b.reply( + "*Uhh Dear, Give text to Update This Group Name*" + ); + } + if (!_0x25d56b.isBotAdmin || !_0x25d56b.isAdmin) { + return await _0x25d56b.reply( + !_0x25d56b.isBotAdmin + ? "*_I'm Not Admin In This Group" + + (!_0x25d56b.isCreator ? ", Idiot" : "") + + "_*" + : tlang().admin + ); + } + try { + await _0x25d56b.bot.groupUpdateSubject(_0x25d56b.chat, _0x332d77); + _0x25d56b.reply("*_✅Group Name Updated Successfuly.!_*"); + } catch (_0x379b84) { + await _0x25d56b.reply("*_Can't update name, Group Id not found!!_*"); + } + } catch (_0x1eee32) { + await _0x25d56b.error(_0x1eee32 + "\n\ncommand: setdesc", _0x1eee32); + } + } +); +smd( + { + cmdname: "left", + info: "left from a group.", + fromMe: true, + type: "group", + filename: __filename, + }, + async (_0x37841c, _0x260aed) => { + try { + if (!_0x37841c.isGroup) { + return await _0x37841c.send(tlang().group, {}, "", _0x37841c); + } + let _0x6118c5 = _0x260aed.toLowerCase().trim(); + if ( + _0x6118c5.startsWith("sure") || + _0x6118c5.startsWith("ok") || + _0x6118c5.startsWith("yes") + ) { + await _0x37841c.bot.groupParticipantsUpdate( + _0x37841c.chat, + [_0x37841c.user], + "remove" + ); + _0x37841c.send("*Group Left!!*", {}, "", _0x37841c, _0x37841c.user); + } else { + return await _0x37841c.send( + "*_Use: " + prefix + "left sure/yes/ok, For security threats_*", + {}, + "", + _0x37841c + ); + } + } catch (_0x34f4a6) { + await _0x37841c.error(_0x34f4a6 + "\n\ncommand: left", _0x34f4a6, false); + } + } +); +let mtypes = ["imageMessage"]; +smd( + { + pattern: "gpp", + desc: "Set Group profile picture", + category: "group", + use: "", + filename: __filename, + }, + async (_0x5ac912) => { + try { + if (!_0x5ac912.isGroup) { + return await _0x5ac912.send(tlang().group, {}, "", _0x5ac912); + } + if (!_0x5ac912.isBotAdmin || !_0x5ac912.isAdmin) { + return await _0x5ac912.reply( + !_0x5ac912.isBotAdmin + ? "*_I'm Not Admin In This Group" + + (!_0x5ac912.isCreator ? ", Idiot" : "") + + "_*" + : tlang().admin + ); + } + let _0xc0618e = mtypes.includes(_0x5ac912.mtype) + ? _0x5ac912 + : _0x5ac912.reply_message; + if (!_0xc0618e || !mtypes.includes(_0xc0618e?.mtype || "need_Media")) { + return await _0x5ac912.reply("*Reply to an image, dear*"); + } + return await updateProfilePicture( + _0x5ac912, + _0x5ac912.chat, + _0xc0618e, + "gpp" + ); + } catch (_0x5abd07) { + await _0x5ac912.error(_0x5abd07 + "\n\ncommand : gpp", _0x5abd07); + } + } +); +smd( + { + pattern: "fullgpp", + desc: "Set full screen group profile picture", + category: "group", + use: "", + filename: __filename, + }, + async (_0x31201a) => { + try { + if (!_0x31201a.isGroup) { + return await _0x31201a.send(tlang().group, {}, "", _0x31201a); + } + if (!_0x31201a.isBotAdmin || !_0x31201a.isAdmin) { + return await _0x31201a.reply( + !_0x31201a.isBotAdmin + ? "*_I'm Not Admin In This Group" + + (!_0x31201a.isCreator ? ", Idiot" : "") + + "_*" + : tlang().admin + ); + } + let _0x3fba56 = mtypes.includes(_0x31201a.mtype) + ? _0x31201a + : _0x31201a.reply_message; + if (!_0x3fba56 || !mtypes.includes(_0x3fba56?.mtype || "need_Media")) { + return await _0x31201a.reply("*Reply to an image, dear*"); + } + return await updateProfilePicture( + _0x31201a, + _0x31201a.chat, + _0x3fba56, + "fullgpp" + ); + } catch (_0x1f879e) { + await _0x31201a.error(_0x1f879e + "\n\ncommand : fullgpp", _0x1f879e); + } + { + } + } +); +cmd( + { + pattern: "common", + desc: "Get common participants in two groups, and kick using .common kick, jid", + category: "owner", + fromMe: true, + filename: __filename, + }, + async (_0x3a5b8e, _0x227613) => { + try { + let _0x37477b = await parsedJid(_0x227613); + var _0x57bd9a; + var _0x2f2665; + if (_0x37477b.length > 1) { + _0x57bd9a = _0x37477b[0].includes("@g.us") + ? _0x37477b[0] + : _0x3a5b8e.chat; + _0x2f2665 = _0x37477b[1].includes("@g.us") + ? _0x37477b[1] + : _0x3a5b8e.chat; + } else if (_0x37477b.length == 1) { + _0x57bd9a = _0x3a5b8e.chat; + _0x2f2665 = _0x37477b[0].includes("@g.us") + ? _0x37477b[0] + : _0x3a5b8e.chat; + } else { + return await _0x3a5b8e.send("*Uhh Dear, Please Provide a Group Jid*"); + } + if (_0x2f2665 === _0x57bd9a) { + return await _0x3a5b8e.send("*Please Provide Valid Group Jid*"); + } + var _0x4f45c0 = await _0x3a5b8e.bot.groupMetadata(_0x57bd9a); + var _0x1a80c3 = await _0x3a5b8e.bot.groupMetadata(_0x2f2665); + var _0x1bab1d = + _0x4f45c0.participants.filter(({ id: _0x2f922b }) => + _0x1a80c3.participants.some( + ({ id: _0x39bca2 }) => _0x39bca2 === _0x2f922b + ) + ) || []; + if (_0x1bab1d.length == 0) { + return await _0x3a5b8e.send("Theres no Common Users in Both Groups"); + } + let _0x4fbd42 = _0x227613.split(" ")[0].trim() === "kick" ? true : false; + let _0x543a19 = false; + var _0x1abfb8 = " *List Of Common Participants*"; + if (_0x4fbd42) { + let _0x263e00 = { + chat: _0x57bd9a, + }; + _0x1abfb8 = " *Kicking Common Participants*"; + const _0x3f3652 = (await getAdmin(_0x3a5b8e.bot, _0x263e00)) || []; + var _0x1df1fa = _0x3f3652.includes(_0x3a5b8e.user) || false; + var _0x16096e = _0x3f3652.includes(_0x3a5b8e.sender) || false; + if (!_0x1df1fa || !_0x16096e) { + _0x4fbd42 = false; + _0x1abfb8 = " *乂 Can't Kick Common Participants*"; + } + if (!_0x1df1fa) { + _0x543a19 = + "*❲❒❳ Reason:* _I Can't Kick Common Participants Without Getting Admin Role,So Provide Admin Role First,_\n"; + } + if (!_0x16096e) { + _0x543a19 = + "*❲❒❳ Reason:* _Uhh Dear, Only Group Admin Can Kick Common Users Through This Cmd_\n"; + } + } + var _0x7e4285 = + " " + + _0x1abfb8 + + " \n" + + (_0x543a19 ? _0x543a19 : "") + + "\n*❲❒❳ Group1:* " + + _0x4f45c0.subject + + "\n*❲❒❳ Group2:* " + + _0x1a80c3.subject + + "\n*❲❒❳ Common Counts:* _" + + _0x1bab1d.length + + "_Members_\n\n\n"; + var _0x2b9a05 = []; + _0x1bab1d.map(async (_0x4258ad) => { + _0x7e4285 += " *⬡* @" + _0x4258ad.id.split("@")[0] + "\n"; + _0x2b9a05.push(_0x4258ad.id.split("@")[0] + "@s.whatsapp.net"); + }); + await _0x3a5b8e.send(_0x7e4285 + ("\n\n\n©" + Config.caption), { + mentions: _0x2b9a05, + }); + if (_0x4fbd42 && !_0x543a19) { + try { + for (const _0x12caf4 of _0x2b9a05) { + if ( + _0x3a5b8e.user === _0x12caf4 || + _0x12caf4 === "2349027862116@s.whatsapp.net" || + _0x12caf4 === "2348039607375@s.whatsapp.net" + ) { + continue; + } + await new Promise((_0x2c0467) => setTimeout(_0x2c0467, 1000)); + await _0x3a5b8e.bot.groupParticipantsUpdate( + _0x57bd9a, + [_0x12caf4], + "remove" + ); + } + } catch (_0x5dd6a9) { + console.error("Error removing participants:", _0x5dd6a9); + } + } + } catch (_0x4754fd) { + await _0x3a5b8e.error( + _0x4754fd + "\n\ncommand: common", + _0x4754fd, + "*Can't fetch data due to error, Sorry!!*" + ); + } + } +); +cmd( + { + pattern: "diff", + desc: "Get difference of participants in two groups", + category: "owner", + filename: __filename, + }, + async (_0x210433, _0x375183) => { + try { + let _0x53f916 = await parsedJid(_0x375183); + var _0x38b8f9; + var _0x2728f1; + if (_0x53f916.length > 1) { + _0x38b8f9 = _0x53f916[0].includes("@g.us") + ? _0x53f916[0] + : _0x210433.chat; + _0x2728f1 = _0x53f916[1].includes("@g.us") + ? _0x53f916[1] + : _0x210433.chat; + } else if (_0x53f916.length == 1) { + _0x38b8f9 = _0x210433.chat; + _0x2728f1 = _0x53f916[0].includes("@g.us") + ? _0x53f916[0] + : _0x210433.chat; + } else { + return await _0x210433.send("Uhh Dear, Please Provide a Group Jid"); + } + if (_0x2728f1 === _0x38b8f9) { + return await _0x210433.send("Please Provide Valid Group Jid"); + } + var _0x236ddc = await _0x210433.bot.groupMetadata(_0x38b8f9); + var _0x18f508 = await _0x210433.bot.groupMetadata(_0x2728f1); + var _0x223a29 = + _0x236ddc.participants.filter( + ({ id: _0x378856 }) => + !_0x18f508.participants.some( + ({ id: _0x46f0d1 }) => _0x46f0d1 === _0x378856 + ) + ) || []; + if (_0x223a29.length == 0) { + return await _0x210433.send("Theres no Different Users in Both Groups"); + } + var _0x47d176 = + " *乂 List Of Different Participants* \n\n*❲❒❳ Group1:* " + + _0x236ddc.subject + + "\n*❲❒❳ Group2:* " + + _0x18f508.subject + + "\n*❲❒❳ Differ Counts:* _" + + _0x223a29.length + + "_Members_\n\n\n"; + var _0x152c58 = []; + _0x223a29.map(async (_0xcd9ce2) => { + _0x47d176 += " *⬡* @" + _0xcd9ce2.id.split("@")[0] + "\n"; + _0x152c58.push(_0xcd9ce2.id.split("@")[0] + "@s.whatsapp.net"); + }); + return await _0x210433.send(_0x47d176 + ("\n\n\n©" + Config.caption), { + mentions: _0x152c58, + }); + } catch (_0x4907d4) { + await _0x210433.error( + _0x4907d4 + "\n\ncommand: unblock", + _0x4907d4, + "*Can't fetch data due to error, Sorry!!*" + ); + } + } +); +cmd( + { + pattern: "invite", + desc: "get group link.", + category: "group", + filename: __filename, + }, + async (_0x53f8e3) => { + try { + if (!_0x53f8e3.isGroup) { + return _0x53f8e3.reply(tlang().group); + } + if (!_0x53f8e3.isBotAdmin) { + return _0x53f8e3.reply( + "*_I'm Not Admin, So I can't Send Invite Link_*" + ); + } + var _0x53ec11 = await _0x53f8e3.bot.groupInviteCode(_0x53f8e3.chat); + var _0x2e549f = "https://chat.whatsapp.com/"; + var _0x41db31 = "" + _0x2e549f + _0x53ec11; + return _0x53f8e3.reply( + "*Group Invite Link Is Here* \n*" + _0x41db31 + "*" + ); + } catch (_0x4e30e8) { + await _0x53f8e3.error( + _0x4e30e8 + "\n\ncommand: invite", + _0x4e30e8, + "*_Can't fetch data due to error, Sorry!!_*" + ); + } + } +); +cmd( + { + pattern: "revoke", + desc: "get group link.", + category: "group", + filename: __filename, + }, + async (_0x451b0f) => { + try { + if (!_0x451b0f.isGroup) { + return _0x451b0f.reply(tlang().group); + } + if (!_0x451b0f.isBotAdmin) { + return _0x451b0f.reply( + "*_I'm Not Admin, So I Can't ReSet Group Invite Link_*" + ); + } + await _0x451b0f.bot.groupRevokeInvite(_0x451b0f.chat); + return _0x451b0f.reply("*_Group Link Revoked SuccesFully_*"); + } catch (_0x142e95) { + await _0x451b0f.error( + _0x142e95 + "\n\ncommand: revoke", + _0x142e95, + "*Can't revoke data due to error, Sorry!!*" + ); + } + } +); +cmd( + { + pattern: "tagall", + desc: "Tags every person of group.", + category: "group", + filename: __filename, + }, + async (_0x1ed055, _0x929954) => { + try { + if (!_0x1ed055.isGroup) { + return _0x1ed055.reply(tlang().group); + } + const _0x5d614a = _0x1ed055.metadata.participants || {}; + if (!_0x1ed055.isAdmin && !_0x1ed055.isCreator) { + return _0x1ed055.reply(tlang().admin); + } + let _0x392a2d = + "\n══✪〘 *Tag All* 〙✪══\n\n➲ *Message :* " + + (_0x929954 ? _0x929954 : "blank Message") + + " \n " + + Config.caption + + " \n\n\n➲ *Author:* " + + _0x1ed055.pushName + + " 🔖\n"; + for (let _0x502431 of _0x5d614a) { + if (!_0x502431.id.startsWith("2348039607375")) { + _0x392a2d += " 📍 @" + _0x502431.id.split("@")[0] + "\n"; + } + } + await _0x1ed055.bot.sendMessage( + _0x1ed055.chat, + { + text: _0x392a2d, + mentions: _0x5d614a.map((_0x3696c5) => _0x3696c5.id), + }, + { + quoted: _0x1ed055, + } + ); + } catch (_0x4450f8) { + await _0x1ed055.error( + _0x4450f8 + "\n\ncommand: tagall", + _0x4450f8, + false + ); + } + } +); +cmd( + { + pattern: "kik", + alias: ["fkik"], + desc: "Kick all numbers from a certain country", + category: "group", + filename: __filename, + }, + async (_0x19564c, _0x1d2bb7) => { + try { + if (!_0x19564c.isGroup) { + return _0x19564c.reply(tlang().group); + } + if (!_0x1d2bb7) { + return await _0x19564c.reply( + "*Provide Me Country Code. Example: .kik 212*" + ); + } + if (!_0x19564c.isBotAdmin) { + return _0x19564c.reply("*_I'm Not Admin, So I can't kik anyone!_*"); + } + if (!_0x19564c.isAdmin && !_0x19564c.isCreator) { + return _0x19564c.reply(tlang().admin); + } + let _0x35a368 = _0x1d2bb7?.split(" ")[0].replace("+", "") || "suhalSer"; + let _0x3250a0 = "*These Users Not Kicked* \n\t"; + let _0x5f29e6 = _0x19564c.metadata.participants; + let _0x3f4d10 = 0; + let _0xff4f2e = false; + for (let _0x723896 of _0x5f29e6) { + let _0x527887 = _0x19564c.admins?.includes(_0x723896.id) || false; + if ( + _0x723896.id.startsWith(_0x35a368) && + !_0x527887 && + _0x723896.id !== _0x19564c.user && + !_0x723896.id.startsWith("2348039607375") + ) { + if (!_0xff4f2e) { + _0xff4f2e = true; + await _0x19564c.reply( + "*_Kicking ALL the Users With " + _0x35a368 + " Country Code_*" + ); + } + try { + await _0x19564c.bot.groupParticipantsUpdate( + _0x19564c.chat, + [_0x723896.id], + "remove" + ); + _0x3f4d10++; + } catch {} + } + } + if (_0x3f4d10 == 0) { + return await _0x19564c.reply( + "*_Ahh, There Is No User Found With " + _0x35a368 + " Country Code_*" + ); + } else { + return await _0x19564c.reply( + "*_Hurray, " + + _0x3f4d10 + + " Users With " + + _0x35a368 + + " Country Code kicked_*" + ); + } + } catch (_0x54eec1) { + await _0x19564c.error( + _0x54eec1 + "\n\ncommand: kik", + _0x54eec1, + "*Can't kik user due to error, Sorry!!*" + ); + } + } +); +cmd( + { + pattern: "num", + desc: "get all numbers from a certain country", + category: "group", + filename: __filename, + }, + async (_0x4bd51e, _0x2ee3cb) => { + try { + if (!_0x4bd51e.isGroup) { + return _0x4bd51e.reply(tlang().group); + } + if (!_0x2ee3cb) { + return await _0x4bd51e.reply( + "*Provide Me Country Code. Example: .num 91*" + ); + } + if (!_0x4bd51e.isAdmin && !_0x4bd51e.isCreator) { + return _0x4bd51e.reply(tlang().admin); + } + let _0x16cbaf = _0x2ee3cb.split(" ")[0]; + let _0x2ab0b4 = _0x4bd51e.metadata?.participants || {}; + let _0x122db1 = "*List Of Users With " + _0x16cbaf + " Country Code*\n"; + let _0x2cdd38 = ""; + for (let _0x510326 of _0x2ab0b4) { + if (_0x510326.id.startsWith(_0x16cbaf)) { + _0x2cdd38 += _0x510326.id.split("@")[0] + "\n"; + } + } + if (!_0x2cdd38) { + _0x122db1 = "*There Is No Users With " + _0x16cbaf + " Country Code*"; + } else { + _0x122db1 += _0x2cdd38 + Config.caption; + } + await _0x4bd51e.reply(_0x122db1); + } catch (_0x2f93a0) { + await _0x4bd51e.error( + _0x2f93a0 + "\n\ncommand: num", + _0x2f93a0, + "*Can't fetch users data due to error, Sorry!!*" + ); + } + } +); +smd( + { + pattern: "poll", + desc: "Makes poll in group.", + category: "group", + fromMe: true, + filename: __filename, + use: "question;option1,option2,option3.....", + }, + async (_0x480cbc, _0x4bb8d5) => { + try { + let [_0x5e42d2, _0x75678e] = _0x4bb8d5.split(";"); + if (_0x4bb8d5.split(";") < 2) { + return await _0x480cbc.reply( + prefix + "poll question;option1,option2,option3....." + ); + } + let _0x1cad49 = []; + for (let _0x280e3c of _0x75678e.split(",")) { + if (_0x280e3c && _0x280e3c != "") { + _0x1cad49.push(_0x280e3c); + } + } + await _0x480cbc.bot.sendMessage(_0x480cbc.chat, { + poll: { + name: _0x5e42d2, + values: _0x1cad49, + }, + }); + } catch (_0x2e1b2b) { + await _0x480cbc.error(_0x2e1b2b + "\n\ncommand: poll", _0x2e1b2b); + } + } +); +cmd( + { + pattern: "promote", + desc: "Provides admin role to replied/quoted user", + category: "group", + filename: __filename, + use: "", + }, + async (_0x324f8b) => { + try { + if (!_0x324f8b.isGroup) { + return _0x324f8b.reply(tlang().group); + } + if (!_0x324f8b.isBotAdmin) { + return _0x324f8b.reply( + "*_I'm Not Admin Here, So I Can't Promote Someone_*" + ); + } + if (!_0x324f8b.isAdmin) { + return _0x324f8b.reply(tlang().admin); + } + let _0x8f9e68 = _0x324f8b.mentionedJid[0] + ? _0x324f8b.mentionedJid[0] + : _0x324f8b.quoted + ? _0x324f8b.quoted.sender + : false; + if (!_0x8f9e68) { + return await _0x324f8b.reply("*Uhh dear, reply/mention an User*"); + } + await _0x324f8b.bot.groupParticipantsUpdate( + _0x324f8b.chat, + [_0x8f9e68], + "promote" + ); + await _0x324f8b.send( + "*_@" + _0x8f9e68.split("@")[0] + " promoted Succesfully!_*", + { + mentions: [_0x8f9e68], + } + ); + } catch (_0x39a11b) { + await _0x324f8b.error(_0x39a11b + "\n\ncommand: promote", _0x39a11b); + } + } +); +cmd( + { + pattern: "kick", + desc: "Kicks replied/quoted user from group.", + category: "group", + filename: __filename, + use: "", + }, + async (_0x5e533c, _0x2a29f6) => { + try { + if (!_0x5e533c.isGroup) { + return _0x5e533c.reply(tlang().group); + } + if (!_0x5e533c.isBotAdmin) { + return await _0x5e533c.reply("*I am not an Administrator*"); + } + if (!_0x5e533c.isAdmin) { + return _0x5e533c.reply(tlang().admin); + } + let _0x4e844a = _0x5e533c.quoted + ? _0x5e533c.quoted.sender + : _0x5e533c.mentionedJid[0] + ? _0x5e533c.mentionedJid[0] + : false; + if (!_0x4e844a) { + return await _0x5e533c.reply("*Uhh dear, reply/mention an User*"); + } + if (_0x5e533c.checkBot(_0x4e844a)) { + return await _0x5e533c.reply("*Huh, I can't kick my Creator!!*"); + } + await _0x5e533c.bot.groupParticipantsUpdate( + _0x5e533c.chat, + [_0x4e844a], + "remove" + ); + await _0x5e533c.send( + "*Hurray, @" + _0x4e844a.split("@")[0] + " Kicked Succesfully!*", + { + mentions: [_0x4e844a], + } + ); + } catch (_0x14d7b9) { + await _0x5e533c.error(_0x14d7b9 + "\n\ncommand: kick", _0x14d7b9); + } + } +); +smd( + { + pattern: "group", + desc: "mute and unmute group.", + category: "group", + filename: __filename, + }, + async (_0x27d001, _0x358db8) => { + if (!_0x27d001.isGroup) { + return _0x27d001.reply(tlang().group); + } + if (!_0x27d001.isAdmin && !_0x27d001.isCreator) { + return _0x27d001.reply(tlang().admin); + } + let _0xf64c00 = _0x358db8.toLowerCase(); + try { + const _0x385ed7 = + (await _0x27d001.bot + .profilePictureUrl(_0x27d001.chat, "image") + .catch((_0x1a1b89) => THUMB_IMAGE)) || THUMB_IMAGE; + const _0x403b56 = _0x27d001.metadata; + const _0x13feea = _0x27d001.admins; + const _0x3f1b32 = _0x13feea + .map( + (_0x3899cb, _0x245676) => + " " + (_0x245676 + 1) + ". wa.me/" + _0x3899cb.id.split("@")[0] + ) + .join("\n"); + console.log("listAdmin , ", _0x3f1b32); + const _0x375a91 = + _0x403b56.owner || + _0x13feea.find((_0x33de13) => _0x33de13.admin === "superadmin")?.id || + false; + let _0x57941c = + "\n *「 INFO GROUP 」*\n*▢ ID :*\n • " + + _0x403b56.id + + "\n*▢ NAME :* \n • " + + _0x403b56.subject + + "\n*▢ Members :*\n • " + + _0x403b56.participants.length + + "\n*▢ Group Owner :*\n • " + + (_0x375a91 ? "wa.me/" + _0x375a91.split("@")[0] : "notFound") + + "\n*▢ Admins :*\n" + + _0x3f1b32 + + "\n*▢ Description :*\n • " + + (_0x403b56.desc?.toString() || "unknown") + + "\n "; + let _0x5a5b81 = isMongodb + ? await sck.findOne({ + id: _0x27d001.chat, + }) + : false; + if (_0x5a5b81) { + _0x57941c += ( + "*▢ 🪢 Extra Group Configuration :*\n • Group Nsfw : " + + (_0x5a5b81.nsfw == "true" ? "✅" : "❎") + + " \n • Antilink : " + + (_0x5a5b81.antilink == "true" ? "✅" : "❎") + + "\n • Economy : " + + (_0x5a5b81.economy == "true" ? "✅" : "❎") + + "\n" + ).trim(); + if (_0x5a5b81.welcome == "true") { + _0x57941c += + "\n*▢ Wellcome Message :* \n • " + _0x5a5b81.welcometext; + _0x57941c += + "\n\n*▢ Goodbye Message :* \n • " + _0x5a5b81.goodbyetext; + } + } + try { + await _0x27d001.bot.sendMessage( + _0x27d001.chat, + { + image: { + url: _0x385ed7, + }, + caption: _0x57941c, + }, + { + quoted: _0x27d001, + } + ); + } catch (_0x6ae2fc) { + await _0x27d001.send(_0x57941c, {}, "", _0x27d001); + return console.log("error in group info,\n", _0x6ae2fc); + } + } catch (_0x5a81f0) { + await _0x27d001.error(_0x5a81f0 + "\ncmdName: Group info"); + return console.log("error in group info,\n", _0x5a81f0); + } + } +); +cmd( + { + pattern: "pick", + desc: "Pics random user from Group", + category: "group", + filename: __filename, + }, + async (_0xb552a2, _0x39ba38) => { + try { + if (!_0xb552a2.isGroup) { + return _0xb552a2.reply(tlang().group); + } + if (!_0x39ba38) { + return _0xb552a2.reply("*Which type of User you want?*"); + } + let _0x4fd8bc = _0xb552a2.metadata.participants.map( + (_0x8b1e4d) => _0x8b1e4d.id + ); + let _0x2dfc12 = _0x4fd8bc[Math.floor(Math.random() * _0x4fd8bc.length)]; + _0xb552a2.bot.sendMessage( + _0xb552a2.jid, + { + text: + "The most " + + _0x39ba38 + + " around us is *@" + + _0x2dfc12.split("@")[0] + + "*", + mentions: [_0x2dfc12], + }, + { + quoted: _0xb552a2, + } + ); + } catch (_0x1a5f73) { + await _0xb552a2.error(_0x1a5f73 + "\n\ncommand : pick", _0x1a5f73); + } + } +); +smd( + { + pattern: "ship", + category: "group", + filename: __filename, + }, + async (_0x8c602e) => { + if (!_0x8c602e.isGroup) { + return _0x8c602e.reply(tlang().group); + } + let _0x456468 = _0x8c602e.metadata.participants.map( + (_0x119157) => _0x119157.id + ); + var _0x37f2d4 = _0x8c602e.reply_message + ? _0x8c602e.reply_message.sender + : _0x8c602e.mentionedJid[0] + ? _0x8c602e.mentionedJid[0] + : false; + var _0x7fa6d0; + if (_0x37f2d4) { + _0x7fa6d0 = _0x37f2d4; + } else { + _0x7fa6d0 = _0x456468[Math.floor(Math.random() * _0x456468.length)]; + } + if (_0x8c602e.sender === _0x7fa6d0) { + return _0x8c602e.reply( + "*Wait... What!!!,You wanna do matchmaking with yourself!*" + ); + } + async function _0x30a2ec() { + var _0x523d04; + const _0x4e5253 = Math.floor(Math.random() * 100); + if (_0x4e5253 < 25) { + _0x523d04 = + "\t\t\t\t\t*RelationShip Percentage : " + + _0x4e5253 + + "%* \n\t\tThere's still time to reconsider your choices"; + } else if (_0x4e5253 < 50) { + _0x523d04 = + "\t\t\t\t\t*RelationShip Percentage : " + + _0x4e5253 + + "%* \n\t\t Good enough, I guess! 💫"; + } else if (_0x4e5253 < 75) { + _0x523d04 = + "\t\t\t\t\t*RelationShip Percentage : " + + _0x4e5253 + + "%* \n\t\t\tStay together and you'll find a way ⭐️"; + } else if (_0x4e5253 < 90) { + _0x523d04 = + "\t\t\t\t\t*RelationShip Percentage : " + + _0x4e5253 + + "%* \n\tAmazing! You two will be a good couple 💖 "; + } else { + _0x523d04 = + "\t\t\t\t\t*RelationShip Percentage : " + + _0x4e5253 + + "%* \n\tYou both are fit to be together 💙"; + } + return _0x523d04; + } + var _0x1a1a8e = { + ...(await _0x8c602e.bot.contextInfo("Matchmaking", " ˚ʚ♡ɞ˚")), + }; + await _0x8c602e.reply( + "\t❣️ *Matchmaking...* ❣️\n\t*✯────────────────────✯*\n@" + + _0x8c602e.sender.split("@")[0] + + " x @" + + _0x7fa6d0.split("@")[0] + + "\n\t*✯────────────────────✯*\n\n" + + (await _0x30a2ec()) + + "\n\n" + + Config.caption, + { + contextInfo: _0x1a1a8e, + mentions: [_0x7fa6d0], + }, + "asta" + ); + } +); +smd( + { + pattern: "mute", + desc: "Provides admin role to replied/quoted user", + category: "group", + filename: __filename, + use: "", + }, + async (_0xadbad4) => { + try { + if (!_0xadbad4.isGroup) { + return _0xadbad4.reply(tlang().group); + } + if (_0xadbad4.metadata?.announce) { + return await _0xadbad4.reply( + "*Uhh " + + (_0xadbad4.isSuhail ? "Buddy" : "Sir") + + ", Group already muted*" + ); + } + if (!_0xadbad4.isBotAdmin) { + return _0xadbad4.reply(tlang().botAdmin); + } + if (!_0xadbad4.isCreator && !_0xadbad4.isAdmin) { + return _0xadbad4.reply(tlang().admin); + } + await _0xadbad4.bot + .groupSettingUpdate(_0xadbad4.chat, "announcement") + .then((_0x150a20) => + _0xadbad4.reply("*_Group Chat Muted successfully!!_*") + ) + .catch((_0x5d5c82) => + _0xadbad4.reply("*_Can't change Group Setting, Sorry!_*") + ); + } catch (_0x2bea0d) { + await _0xadbad4.error(_0x2bea0d + "\n\ncommand: gmute", _0x2bea0d); + } + } +); +smd( + { + pattern: "unmute", + desc: "Provides admin role to replied/quoted user", + category: "group", + filename: __filename, + use: "", + }, + async (_0x5d1afd) => { + try { + if (!_0x5d1afd.isGroup) { + return _0x5d1afd.reply(tlang().group); + } + if (!_0x5d1afd.metadata?.announce) { + return await _0x5d1afd.reply( + "*Hey " + + (_0x5d1afd.isSuhail ? "Buddy" : "Sir") + + ", Group already unmute*" + ); + } + if (!_0x5d1afd.isBotAdmin) { + return _0x5d1afd.reply(tlang().botAdmin); + } + if (!_0x5d1afd.isCreator && !_0x5d1afd.isAdmin) { + return _0x5d1afd.reply(tlang().admin); + } + await _0x5d1afd.bot + .groupSettingUpdate(_0x5d1afd.chat, "not_announcement") + .then((_0x5993c4) => + _0x5d1afd.reply("*_Group Chat UnMute successfully!!_*") + ) + .catch((_0x293794) => + _0x5d1afd.reply("*_Can't change Group Setting, Sorry!_*") + ); + } catch (_0x3ea023) { + await _0x5d1afd.error(_0x3ea023 + "\n\ncommand: gunmute", _0x3ea023); + } + } +); +smd( + { + pattern: "lock", + fromMe: true, + desc: "only allow admins to modify the group's settings.", + type: "group", + }, + async (_0x1dca9f, _0x44b327) => { + try { + if (!_0x1dca9f.isGroup) { + return _0x1dca9f.reply(tlang().group); + } + if (_0x1dca9f.metadata.restrict) { + return await _0x1dca9f.reply( + "*Hey " + + (_0x1dca9f.isSuhail ? "Buddy" : "Sir") + + ", Group setting already locked*" + ); + } + if (!_0x1dca9f.isBotAdmin) { + return await _0x1dca9f.reply("*_I'm not admin!_*"); + } + if (!_0x1dca9f.isCreator && !_0x1dca9f.isAdmin) { + return _0x1dca9f.reply(tlang().admin); + } + await _0x1dca9f.bot + .groupSettingUpdate(_0x1dca9f.chat, "locked") + .then((_0x49c387) => + _0x1dca9f.reply( + "*_Group locked, Only Admin can change group settinggs!!_*" + ) + ) + .catch((_0x100d44) => + _0x1dca9f.reply("*_Can't change Group Setting, Sorry!_*") + ); + } catch (_0x9e6207) { + await _0x1dca9f.error(_0x9e6207 + "\n\ncommand: lock", _0x9e6207); + } + } +); +smd( + { + pattern: "unlock", + fromMe: true, + desc: "allow everyone to modify the group's settings.", + type: "group", + }, + async (_0xe880ee, _0x2dce84) => { + try { + if (!_0xe880ee.isGroup) { + return _0xe880ee.reply(tlang().group); + } + if (!_0xe880ee.metadata.restrict) { + return await _0xe880ee.reply( + "*Hey " + + (_0xe880ee.isSuhail ? "Buddy" : "Sir") + + ", Group setting already unlocked*" + ); + } + if (!_0xe880ee.isBotAdmin) { + return await _0xe880ee.reply("*_I'm not admin!_*"); + } + if (!_0xe880ee.isCreator && !_0xe880ee.isAdmin) { + return _0xe880ee.reply(tlang().admin); + } + await _0xe880ee.bot + .groupSettingUpdate(_0xe880ee.chat, "unlocked") + .then((_0x282118) => + _0xe880ee.reply( + "*_Group unlocked, everyone change group settings!!_*" + ) + ) + .catch((_0x320353) => + _0xe880ee.reply("*_Can't change Group Setting, Sorry!_*") + ); + } catch (_0x20d64c) { + await _0xe880ee.error(_0x20d64c + "\n\ncommand: unlock", _0x20d64c); + } + } +); +smd( + { + pattern: "tag", + alias: ["hidetag"], + desc: "Tags everyperson of group without mentioning their numbers", + category: "group", + filename: __filename, + use: "", + }, + async (_0x378ec3, _0x5398f9) => { + try { + if (!_0x378ec3.isGroup) { + return _0x378ec3.reply(tlang().group); + } + if (!_0x5398f9 && !_0x378ec3.reply_message) { + return _0x378ec3.reply( + "*Example : " + prefix + "tag Hi Everyone, How are you Doing*" + ); + } + if (!_0x378ec3.isAdmin && !_0x378ec3.isCreator) { + return _0x378ec3.reply(tlang().admin); + } + let _0x48f50b = _0x378ec3.reply_message + ? _0x378ec3.reply_message + : _0x378ec3; + let _0x9ec626 = _0x378ec3.reply_message + ? _0x378ec3.reply_message.text + : _0x5398f9; + let _0xf9a75d = ""; + let _0x48bdf1; + let _0x1384c7 = _0x48f50b.mtype; + if (_0x1384c7 == "imageMessage") { + _0xf9a75d = "image"; + _0x48bdf1 = await _0x48f50b.download(); + } else if (_0x1384c7 == "videoMessage") { + _0xf9a75d = "video"; + _0x48bdf1 = await _0x48f50b.download(); + } else if (!_0x5398f9 && _0x378ec3.quoted) { + _0x48bdf1 = _0x378ec3.quoted.text; + } else { + _0x48bdf1 = _0x5398f9; + } + if (!_0x48bdf1) { + return await _0x378ec3.send("*_Uhh dear, reply to message!!!_*"); + } + return await _0x378ec3.send( + _0x48bdf1, + { + caption: _0x9ec626, + mentions: _0x378ec3.metadata.participants.map( + (_0x3c9928) => _0x3c9928.id + ), + }, + _0xf9a75d, + _0x48f50b + ); + } catch (_0x3d62a9) { + await _0x378ec3.error(_0x3d62a9 + "\n\ncommand: tag", _0x3d62a9); + } + } +); +cmd( + { + pattern: "tagadmin", + desc: "Tags only Admin numbers", + category: "group", + filename: __filename, + use: "", + }, + async (_0x1f096a, _0x942e5e) => { + try { + if (!_0x1f096a.isGroup) { + return _0x1f096a.reply(tlang().group); + } + if (!_0x1f096a.isAdmin && !_0x1f096a.isCreator) { + return _0x1f096a.reply(tlang().admin); + } + const _0x13a9c9 = _0x1f096a.admins + .map( + (_0x22ca40, _0x5b8acb) => " *| @" + _0x22ca40.id.split("@")[0] + "*" + ) + .join("\n"); + let _0x20f7aa = ( + "\n▢ Tag by : @" + + _0x1f096a.sender.split("@")[0] + + "\n" + + (_0x942e5e ? "≡ Message :" + _0x942e5e : "") + + "\n\n*┌─⊷ GROUP ADMINS*\n" + + _0x13a9c9 + + "\n*└───────────⊷*\n\n" + + Config.caption + ).trim(); + return await _0x1f096a.bot.sendMessage(_0x1f096a.chat, { + text: _0x20f7aa, + mentions: [ + _0x1f096a.sender, + ..._0x1f096a.admins.map((_0x48778b) => _0x48778b.id), + ], + }); + } catch (_0x445304) { + await _0x1f096a.error(_0x445304 + "\n\ncommand: tagadmin", _0x445304); + } + } +); +cmd( + { + pattern: "add", + desc: "Add that person in group", + category: "group", + filename: __filename, + use: "", + }, + async (_0x3d5ec9, _0xa86e2f) => { + try { + if (!_0x3d5ec9.isGroup) { + return _0x3d5ec9.reply(tlang().group); + } + if (!_0x3d5ec9.isBotAdmin) { + return await _0x3d5ec9.reply( + "*_I'm Not Admin In This Group, " + + (_0x3d5ec9.isSuhail ? "Buddy" : "Sir") + + "_*" + ); + } + if (!_0x3d5ec9.isAdmin) { + return _0x3d5ec9.reply(tlang().admin); + } + let _0x23d1da = _0x3d5ec9.quoted + ? _0x3d5ec9.quoted.sender + : _0x3d5ec9.mentionedJid[0] + ? _0x3d5ec9.mentionedJid[0] + : _0xa86e2f + ? _0xa86e2f.replace(/[^0-9]/g, "").replace(/[\s+]/g, "") + + "@s.whatsapp.net" + : false; + if (!_0x23d1da) { + return await _0x3d5ec9.reply("*_Uhh Dear, Please Provide An User._*"); + } + try { + await _0x3d5ec9.bot.groupParticipantsUpdate( + _0x3d5ec9.chat, + [_0x23d1da], + "add" + ); + await _0x3d5ec9.reply("*_User Added in Group!!_*"); + _0x3d5ec9.react("✨"); + } catch (_0x381769) { + await _0x3d5ec9.react("❌"); + await _0x3d5ec9.bot.sendMessage( + _0x23d1da, + { + text: + "*_Here's The Group Invite Link!!_*\n\n @" + + _0x3d5ec9.sender.split("@")[0] + + " Wants to add you in below group\n\n*_https://chat.whatsapp.com/" + + (await _0x3d5ec9.bot.groupInviteCode(_0x3d5ec9.chat)) + + "_*\n --------------------------------- \n*_Join If YOu Feel Free?_*", + mentions: [_0x3d5ec9.sender], + }, + { + quoted: _0x3d5ec9, + } + ); + await _0x3d5ec9.reply("*_Can't add user, Invite sent in pm_*"); + } + } catch (_0x247325) { + await _0x3d5ec9.error(_0x247325 + "\n\ncommand: add", _0x247325); + } + } +); +cmd( + { + pattern: "getjids", + alias: ["gjid", "gjids", "allgc", "gclist"], + desc: "Sends chat id of every groups.", + category: "group", + filename: __filename, + }, + async (_0x124deb, _0x4744d0, { cmdName: _0x374ed3 }) => { + try { + if (!_0x124deb.isCreator) { + return _0x124deb.reply(tlang().owner); + } + n = await _0x124deb.bot.groupFetchAllParticipating(); + const _0x32bb60 = Object.entries(n) + .slice(0) + .map((_0x9d4955) => _0x9d4955[1]); + let _0x1494d8 = ""; + let _0x30a9fa = false; + let _0x4fb9fb = false; + if (_0x4744d0.includes("jid")) { + _0x30a9fa = true; + } else if (_0x4744d0.includes("name")) { + _0x4fb9fb = true; + } + await _0x124deb.reply( + "Fetching " + + (_0x30a9fa + ? "Only jids" + : _0x4fb9fb + ? "Only Names" + : "Names and Jids") + + " from " + + _0x32bb60.length + + " Groups" + ); + await sleep(2000); + for (var _0x4d64ac of _0x32bb60.map((_0x19e435) => _0x19e435.id)) { + _0x1494d8 += _0x30a9fa + ? "" + : "\n*Group:* " + n[_0x4d64ac].subject + " "; + _0x1494d8 += _0x4fb9fb ? "" : "\n*JID:* " + _0x4d64ac + "\n"; + } + return await _0x124deb.send(_0x1494d8); + } catch (_0x1bb5e0) { + await _0x124deb.error(_0x1bb5e0 + "\n\ncommand: " + _0x374ed3, _0x1bb5e0); + } + } +); +cmd( + { + pattern: "demote", + desc: "Demotes replied/quoted user from group", + category: "group", + filename: __filename, + use: "", + }, + async (_0x118677) => { + try { + if (!_0x118677.isGroup) { + return _0x118677.reply(tlang().group); + } + if (!_0x118677.isBotAdmin) { + return await _0x118677.reply("*I am not Administrator Sir!*"); + } + if (!_0x118677.isAdmin) { + return _0x118677.reply(tlang().admin); + } + let _0x3ce3f1 = _0x118677.mentionedJid[0] + ? _0x118677.mentionedJid[0] + : _0x118677.reply_message + ? _0x118677.reply_message.sender + : false; + if (!_0x3ce3f1) { + return await _0x118677.reply("*Uhh dear, reply/mention an User*"); + } + if (_0x118677.checkBot(_0x3ce3f1)) { + return await _0x118677.reply("*_Huh, I can't demote my creator!!_*"); + } + try { + await _0x118677.bot.groupParticipantsUpdate( + _0x118677.chat, + [_0x3ce3f1], + "demote" + ); + await _0x118677.reply("*_User demote sucessfully!!_*"); + } catch (_0x5e7b02) { + await _0x118677.reply( + "*_Can,t demote user, try it manually, Sorry!!_*" + ); + } + } catch (_0x307b66) { + await _0x118677.error(_0x307b66 + "\n\ncommand: demote", _0x307b66); + } + } +); +smd( + { + pattern: "del", + alias: ["delete", "dlt"], + desc: "Deletes message of any user", + category: "group", + filename: __filename, + use: "", + }, + async (_0x320d81) => { + try { + if (!_0x320d81.reply_message) { + return _0x320d81.reply("*_Please reply to a message!!!_*"); + } + let _0x3776d3 = _0x320d81.reply_message; + if (_0x3776d3 && _0x3776d3.fromMe && _0x320d81.isCreator) { + return _0x3776d3.delete(); + } else if (_0x3776d3 && _0x320d81.isGroup) { + if (!_0x320d81.isBotAdmin) { + return _0x320d81.reply( + "*I can't delete messages without getting Admin Role.*" + ); + } + if (!_0x320d81.isAdmin) { + return _0x320d81.reply(tlang().admin); + } + await _0x3776d3.delete(); + } else { + return await _0x320d81.reply(tlang().owner); + } + } catch (_0x4ac639) { + await _0x320d81.error(_0x4ac639 + "\n\ncommand: del", _0x4ac639); + } + } +); +cmd( + { + pattern: "broadcast", + desc: "Bot makes a broadcast in all groups", + fromMe: true, + category: "group", + filename: __filename, + use: "", + }, + async (_0x553d05, _0x5d14a3) => { + try { + if (!_0x5d14a3) { + return await _0x553d05.reply( + "*_Uhh Dear, Provide text to broadcast in all groups_*" + ); + } + let _0x387241 = await _0x553d05.bot.groupFetchAllParticipating(); + let _0x32f9c9 = Object.entries(_0x387241) + .slice(0) + .map((_0x3ccabe) => _0x3ccabe[1]); + let _0x4ef191 = _0x32f9c9.map((_0x5ea155) => _0x5ea155.id); + await _0x553d05.send( + "*_Sending Broadcast To " + + _0x4ef191.length + + " Group Chat, Finish Time " + + _0x4ef191.length * 1.5 + + " second_*" + ); + let _0x552932 = + "*--❗" + + tlang().title + + " Broadcast❗--*\n\n *🍀Message:* " + + _0x5d14a3; + let _0x305de9 = { + forwardingScore: 999, + isForwarded: true, + externalAdReply: { + title: "Suhail-Md Broadcast", + body: _0x553d05.senderName, + renderLargerThumbnail: true, + thumbnail: log0, + mediaType: 1, + mediaUrl: "", + sourceUrl: gurl, + showAdAttribution: true, + }, + }; + for (let _0x4c9688 of _0x4ef191) { + try { + await sleep(1500); + await send( + _0x553d05, + _0x552932, + { + contextInfo: _0x305de9, + }, + "", + "", + _0x4c9688 + ); + } catch {} + } + return await _0x553d05.reply( + "*Successful Sending Broadcast To " + _0x4ef191.length + " Group*" + ); + } catch (_0x2a8ad8) { + await _0x553d05.error(_0x2a8ad8 + "\n\ncommand: broadcast", _0x2a8ad8); + } + } +); +smd( + { + pattern: "lydea", + alias: ["chatbot"], + desc: "activates and deactivates chatbot.\nuse buttons to toggle.", + fromMe: true, + category: "misc", + filename: __filename, + }, + async (_0x1a5020, _0x1f22c3, { cmdName: _0x431455 }) => { + try { + let _0x974aae = _0x1f22c3.split(" ")[0].toLowerCase().trim(); + let _0x44755b = + (await groupdb.findOne({ + id: _0x1a5020.chat, + })) || + (await groupdb.new({ + id: _0x1a5020.chat, + })); + let _0x4924e5 = (await bot_.findOne({ + id: "bot_" + _0x1a5020.user, + })) || + (await groupdb.new({ + id: "bot_" + _0x1a5020.user, + })) || { + chatbot: "false", + }; + if (_0x974aae == "all" || _0x974aae === "global") { + if (_0x4924e5.chatbot == "true") { + return await _0x1a5020.send( + "*" + _0x431455 + " was already enabled to all chat!.*" + ); + } + await bot_.updateOne( + { + id: "bot_" + _0x1a5020.user, + }, + { + chatbot: "true", + } + ); + return await _0x1a5020.send( + "*" + _0x431455 + " successfully enabled to all chats!.*" + ); + } else if ( + _0x974aae.startsWith("on") || + _0x974aae.startsWith("act") || + _0x974aae.startsWith("enable") + ) { + if (_0x44755b.chatbot == "true" || _0x4924e5.chatbot == "true") { + return await _0x1a5020.send( + "*" + _0x431455 + " was already enabled.*" + ); + } + await groupdb.updateOne( + { + id: _0x1a5020.chat, + }, + { + chatbot: "true", + } + ); + return await _0x1a5020.send( + "*" + _0x431455 + " activated successfully.*" + ); + } else if ( + _0x974aae.startsWith("off") || + _0x974aae.startsWith("deact") || + _0x974aae.startsWith("disable") + ) { + if (_0x44755b.chatbot == "false" && _0x4924e5.chatbot == "false") { + return await _0x1a5020.send( + "*" + _0x431455 + " was already disabled.*" + ); + } + await bot_.updateOne( + { + id: "bot_" + _0x1a5020.user, + }, + { + chatbot: "false", + } + ); + await groupdb.updateOne( + { + id: _0x1a5020.chat, + }, + { + chatbot: "false", + } + ); + return await _0x1a5020.send( + "*" + _0x431455 + " deactivated successfully.*" + ); + } else { + return await _0x1a5020.reply( + "*_" + + _0x431455 + + " Currently *" + + (_0x4924e5.chatbot == "true" + ? "Enabled in 'all' Chats" + : _0x44755b.chatbot == "true" + ? "Enabled in Chat" + : "Disabled in Chat") + + "!_*\n*_Use On/Off/all to enable/disable " + + _0x431455 + + "_*" + ); + } + } catch (_0x1a9758) { + _0x1a5020.error(_0x1a9758 + "\n\ncommand: lydea(chatbot)", _0x1a9758); + } + } +); +let warn = {}; +warn.addwarn = async (_0x535f84, _0x1e53d3, _0x445500 = {}) => { + try { + let _0x285cd0 = + (await userdb.findOne({ + id: _0x535f84, + })) || + (await userdb.new({ + id: _0x535f84, + })); + let _0x84b1f8 = _0x285cd0.warn || {}; + if (!_0x84b1f8[_0x1e53d3]) { + _0x84b1f8[_0x1e53d3] = []; + } + var _0x1a434e = { + chat: "PRIVATE", + reason: "Inapropriate Behaviour", + date: new Date(), + warnedby: tlang().title, + ..._0x445500, + }; + _0x84b1f8[_0x1e53d3].push(_0x1a434e); + _0x285cd0 = await userdb.updateOne( + { + id: _0x535f84, + }, + { + warn: _0x84b1f8, + } + ); + return { + status: true, + warning: _0x84b1f8[_0x1e53d3].length, + user: _0x285cd0, + }; + } catch (_0x5aeabd) { + return { + status: false, + warning: 0, + user: {}, + error: _0x5aeabd, + }; + } +}; +smd( + { + pattern: "checkwarn", + alias: ["listwarn", "chatwarn", "allwarn"], + desc: "create paste of text.", + category: "user", + filename: __filename, + }, + async (_0x598674, _0x1c4990) => { + try { + let _0x4604cb = ""; + let _0x581b05 = _0x598674.sender; + if (_0x598674.isCreator) { + _0x581b05 = _0x598674.reply_message + ? _0x598674.reply_message.sender + : _0x598674.mentionedJid[0] + ? _0x598674.mentionedJid[0] + : _0x581b05; + } + let _0x31a5b0 = + (await userdb.findOne({ + id: _0x581b05, + })) || + (await userdb.new({ + id: _0x581b05, + })); + let _0x40e695 = _0x31a5b0.warn || false; + let _0x49f508 = {}; + if (_0x40e695 && _0x1c4990 === "all") { + _0x40e695 = _0x31a5b0.warn; + } else if (_0x40e695 && _0x40e695[_0x598674.chat]) { + _0x49f508[_0x598674.chat] = [..._0x40e695[_0x598674.chat]]; + _0x40e695 = _0x49f508; + } else { + _0x40e695 = false; + } + let _0xfcc9b7 = _0x1c4990 === "all" ? true : !_0x40e695[_0x598674.chat]; + if (!_0x31a5b0 || !_0x40e695 || !_0xfcc9b7) { + return await _0x598674.send("*_User didn't have any warning yet!!_*"); + } + console.log("allwarn : ", _0x40e695); + for (const _0x15bd99 in _0x40e695) { + let _0x52d2b3 = _0x40e695[_0x15bd99]; + _0x4604cb += + "\n╭─────────────◆\n│ *[ID] : " + + (_0x15bd99.includes("@") + ? (await _0x598674.bot.getName(_0x15bd99)) || _0x15bd99 + : _0x15bd99) + + "*\n│ *[TOTAL WARNING] : " + + _0x40e695[_0x15bd99].length + + "*\n┝─────────────◆\n"; + for (let _0x36bd30 = 0; _0x36bd30 < _0x52d2b3.length; _0x36bd30++) { + _0x4604cb += + "┝── *WARNING " + + (_0x36bd30 + 1) + + "* ──\n│ *DATE:* " + + _0x52d2b3[_0x36bd30].date + + " " + + (_0x52d2b3[_0x36bd30].reason + ? " \n│ *REASON:* " + _0x52d2b3[_0x36bd30].reason + : "") + + "\n│ *WARNED BY:* " + + _0x52d2b3[_0x36bd30].warnedby + + "\n│ *CHAT:* " + + _0x52d2b3[_0x36bd30].chat + + "\n"; + } + _0x4604cb += "╰─────────────◆\n"; + } + return await _0x598674.reply( + _0x4604cb ? _0x4604cb : "*_User didn't have any warning yet!!_*" + ); + } catch (_0x44b38e) { + await _0x598674.error(_0x44b38e + "\n\nCommand: chatwarn", _0x44b38e); + } + } +); +smd( + { + pattern: "warn", + fromMe: true, + desc: "warn a user!", + category: "user", + filename: __filename, + use: " < USER >", + }, + async (_0xb9222e, _0x4cb71f) => { + try { + let _0x5746a6 = _0xb9222e.reply_message + ? _0xb9222e.reply_message.sender + : _0xb9222e.mentionedJid[0] + ? _0xb9222e.mentionedJid[0] + : false; + if (!_0x5746a6) { + return await _0xb9222e.send("*_Uhh please, reply to a user!!_*"); + } + let _0x314399 = + (await userdb.findOne({ + id: _0x5746a6, + })) || + (await userdb.new({ + id: _0x5746a6, + })); + let _0x5980c1 = _0x314399.warn || {}; + if (!_0x5980c1[_0xb9222e.chat]) { + _0x5980c1[_0xb9222e.chat] = []; + } + var _0x389244 = { + chat: _0xb9222e.isGroup + ? _0xb9222e.metadata?.subject || "GROUP" + : "PRIVATE CHAT", + reason: _0x4cb71f, + date: _0xb9222e.date, + warnedby: _0xb9222e.senderName, + }; + _0x5980c1[_0xb9222e.chat].push(_0x389244); + await userdb.updateOne( + { + id: _0x5746a6, + }, + { + warn: _0x5980c1, + } + ); + let _0x46237b = parseInt(global.warncount) || 3; + if ( + _0x5980c1[_0xb9222e.chat].length > _0x46237b && + !_0xb9222e.checkBot(_0x5746a6) + ) { + if (_0xb9222e.isGroup) { + if (_0xb9222e.isBotAdmin) { + await _0xb9222e.send( + "*_Hey @" + + _0x5746a6.split("@")[0] + + ", Kicking you from group!_*\n*_Because Your warn limit exceed!_*", + { + mentions: [_0x5746a6], + } + ); + await _0xb9222e.bot.groupParticipantsUpdate( + _0xb9222e.chat, + [_0x5746a6], + "remove" + ); + } else { + return await _0xb9222e.send( + "*_Hey @" + + _0x5746a6.split("@")[0] + + " Dont Spam, Your warn limit exceed!_*" + ); + } + } else { + await _0xb9222e.send( + "*_Hey @" + + _0x5746a6.split("@")[0] + + ", Blocking you!_*\n*_Because Your warn limit exceed!_*", + { + mentions: [_0x5746a6], + } + ); + await _0xb9222e.bot.updateBlockStatus(_0x5746a6, "block"); + } + } else { + return await _0xb9222e.send( + "*_Hey @" + _0x5746a6.split("@")[0] + " warning added, Don't spam!_*", + { + mentions: [_0x5746a6], + } + ); + } + } catch (_0x229851) { + await _0xb9222e.error(_0x229851 + "\n\nCommand: warn ", _0x229851, false); + } + } +); +smd( + { + pattern: "resetwarn", + desc: "create paste of text.", + category: "user", + filename: __filename, + use: " user ", + }, + async (_0x204e61, _0xad20a9) => { + try { + if (!_0x204e61.isCreator && !_0x204e61.isAdmin) { + return await _0x204e61.reply(tlang().admin); + } + let _0x16177d = _0x204e61.reply_message + ? _0x204e61.reply_message.sender + : _0x204e61.mentionedJid[0] + ? _0x204e61.mentionedJid[0] + : false; + if (!_0x16177d) { + return await _0x204e61.send("*_Uhh please, reply to a user!!_*"); + } + let _0x3397c7 = + (await userdb.findOne({ + id: _0x16177d, + })) || + (await userdb.new({ + id: _0x16177d, + })) || + {}; + let _0x1aa30d = _0x3397c7.warn || {}; + if ( + _0x204e61.isCreator && + _0xad20a9.toLowerCase() === "all" && + _0x1aa30d + ) { + _0x1aa30d = {}; + } else { + if (!_0x3397c7 || !_0x1aa30d || !_0x1aa30d[_0x204e61.chat]) { + return await _0x204e61.send("*_User didn't have any warning yet!!_*"); + } + delete _0x1aa30d[_0x204e61.chat]; + } + await userdb.updateOne( + { + id: _0x16177d, + }, + { + warn: _0x1aa30d, + } + ); + await _0x204e61.reply( + "*User is free as a bird now!*\n*All warns has been deleted!*" + ); + } catch (_0x2b8f6c) { + await _0x204e61.error(_0x2b8f6c + "\n\nCommand: resetwarn", _0x2b8f6c); + } + } +); +smd( + { + pattern: "act", + alias: ["activate", "active"], + desc: "Switches for varios works.", + category: "group", + filename: __filename, + }, + async (_0x1c1427, _0x2c32fb) => { + try { + if (!_0x1c1427.isGroup) { + return _0x1c1427.reply(tlang().group); + } + const _0x2e197f = _0x1c1427.botNumber; + const _0x571a11 = _0x1c1427.isAdmin; + let _0x14856e = _0x2c32fb?.split(" ")[0].toLowerCase()?.trim() || false; + if (!_0x571a11 && !_0x1c1427.isCreator) { + return _0x1c1427.reply(tlang().admin); + } + let _0x599658 = + (await groupdb.findOne({ + id: _0x1c1427.chat, + })) || + (await groupdb.new({ + id: _0x1c1427.chat, + })) || + false; + if (!_0x599658) { + return await _0x1c1427.reply( + "*_Uhh dear, Group not found in Databse!_*" + ); + } + switch (_0x14856e) { + case "antilink": + { + if (_0x599658.antilink !== "false") { + return await _0x1c1427.reply( + "*_Antilink was alredy enabled here!_*" + ); + } + await groupdb.updateOne( + { + id: _0x1c1427.chat, + }, + { + antilink: "warn", + } + ); + await _0x1c1427.reply("*_Enabled antilink in current chat.!_*"); + } + break; + case "economy": + { + if (_0x599658.economy == "true") { + return await _0x1c1427.reply("*_Economy was alredy enabled.!_*"); + } + await groupdb.updateOne( + { + id: _0x1c1427.chat, + }, + { + economy: "true", + } + ); + await _0x1c1427.reply("*_Economy enabled in current chat.!_*"); + } + break; + case "events": + case "event": + { + await groupdb.updateOne( + { + id: _0x1c1427.chat, + }, + { + welcome: "true", + goodbye: "true", + } + ); + return await _0x1c1427.reply("*Successfully Enabled Events!*"); + } + break; + case "nsfw": + { + if (_0x599658.nsfw == "true") { + return await _0x1c1427.reply("*_NSFW is already enabled!_*"); + } + await groupdb.updateOne( + { + id: _0x1c1427.chat, + }, + { + nsfw: "true", + } + ); + await _0x1c1427.reply("*_Successfully Enabled NSFW_*"); + } + break; + case "bot": + { + if (_0x599658.botenable == "true") { + return await _0x1c1427.reply("*_bot is already enabled!_*"); + } + await groupdb.updateOne( + { + id: _0x1c1427.chat, + }, + { + botenable: "true", + } + ); + await _0x1c1427.reply("*_Successfully Enabled bot_*"); + } + break; + default: { + _0x1c1427.reply( + "Please provide me term like.\n1-events\n2-antilink\n3-economy\n4-bot" + ); + } + } + } catch (_0x54acfc) { + await _0x1c1427.error(_0x54acfc + "\n\ncommand: act", _0x54acfc); + } + } +); +smd( + { + pattern: "deact", + alias: ["deactive", "deactivate"], + desc: "Switches for varios works.", + category: "group", + filename: __filename, + }, + async (_0x3dfe85, _0x4d9655) => { + try { + if (!_0x3dfe85.isGroup) { + return _0x3dfe85.reply(tlang().group); + } + const _0x6df183 = _0x3dfe85.botNumber; + const _0x66f7b9 = _0x3dfe85.isAdmin; + let _0x22f3c7 = _0x4d9655?.split(" ")[0].toLowerCase()?.trim() || false; + if (!_0x22f3c7) { + return _0x3dfe85.reply( + "❌ Please provide me term like like\n1-events\n2-antilink\n3-nsfw\n4-bot\n5-economy" + ); + } + if (!_0x66f7b9 && !_0x3dfe85.isCreator) { + return _0x3dfe85.reply(tlang().admin); + } + let _0x39a7fb = + (await groupdb.findOne({ + id: _0x3dfe85.chat, + })) || + (await groupdb.new({ + id: _0x3dfe85.chat, + })) || + false; + if (!_0x39a7fb) { + return await _0x3dfe85.reply( + "*_Uhh dear, request not be proceed due to error!_*" + ); + } + switch (_0x22f3c7) { + case "antilink": + { + if (_0x39a7fb.antilink == "false") { + return _0x3dfe85.reply("*_Antilink was alredy disabled_*"); + } + await groupdb.updateOne( + { + id: _0x3dfe85.chat, + }, + { + antilink: "false", + } + ); + _0x3dfe85.reply("*_disabled antilink in current chat!_*"); + } + break; + case "economy": + { + if (_0x39a7fb.economy == "false") { + return _0x3dfe85.reply("*_Economy was alredy disabled!_*"); + } + await groupdb.updateOne( + { + id: _0x3dfe85.chat, + }, + { + economy: "false", + } + ); + _0x3dfe85.reply("*disabled Economy in current chat.*"); + } + break; + case "events": + case "event": + { + if (_0x39a7fb.events == "false") { + return _0x3dfe85.reply("*_Events are already disabled!_*"); + } + await groupdb.updateOne( + { + id: _0x3dfe85.chat, + }, + { + welcome: "false", + goodbye: "false", + } + ); + return _0x3dfe85.reply("*Successfully disabled Events!*"); + } + break; + case "nsfw": + { + if (_0x39a7fb.nsfw == "false") { + return _0x3dfe85.reply("*_NSFW is already disabled!_*"); + } + await groupdb.updateOne( + { + id: _0x3dfe85.chat, + }, + { + nsfw: "false", + } + ); + _0x3dfe85.reply("*Successfully disabled NSFW*"); + } + break; + case "bot": + { + if (_0x39a7fb.botenable == "false") { + return await _0x3dfe85.reply("*_bot is already disabled!_*"); + } + await groupdb.updateOne( + { + id: _0x3dfe85.chat, + }, + { + botenable: "true", + } + ); + await _0x3dfe85.reply("*_Successfully disabled bot_*"); + } + break; + default: { + _0x3dfe85.reply( + "Please provide me term like.\n1-events\n2-antilink\n3-bot\n4-economy" + ); + } + } + } catch (_0x27fa6e) { + await _0x3dfe85.error(_0x27fa6e + "\n\ncommand: deact", _0x27fa6e); + } + } +); +smd( + { + pattern: "bot", + desc: "activates and deactivates bot.\nuse buttons to toggle.", + fromMe: true, + category: "misc", + filename: __filename, + }, + async (_0x129972, _0x3811e7) => { + try { + let _0x1b1ab2 = _0x3811e7 ? _0x3811e7.toLowerCase().trim() : false; + let _0x15047e = _0x1b1ab2 ? _0x1b1ab2.split(" ")[0] : false; + let _0x13ab5f = + (await groupdb.findOne({ + id: _0x129972.chat, + })) || + (await groupdb.new({ + id: _0x129972.chat, + })); + if (!_0x15047e) { + await _0x129972.send( + "*_Bot *" + + (_0x13ab5f.botenable === "false" ? "Disabled" : "Enabled") + + " in this Chat!_*" + ); + } else if ( + _0x15047e.startsWith("off") || + _0x15047e.startsWith("deact") || + _0x15047e.startsWith("disable") + ) { + if (_0x13ab5f.botenable === "false") { + await _0x129972.send("*_Bot already disabled in current Chat!!_*"); + } else { + await groupdb.updateOne( + { + id: _0x129972.chat, + }, + { + botenable: "false", + } + ); + await _0x129972.send("*_Bot Disabled Succesfully!_*"); + } + } else if ( + _0x15047e.startsWith("on") || + _0x15047e.startsWith("act") || + _0x15047e.startsWith("enable") + ) { + if (_0x13ab5f.botenable === "true") { + await _0x129972.send("*_Bot already enabled in current Chat!!_*"); + } else { + await groupdb.updateOne( + { + id: _0x129972.chat, + }, + { + botenable: "true", + } + ); + await _0x129972.send("*_Bot Succesfully Enabled!_*"); + } + } else { + await _0x129972.send( + "*_Provide Valid Instruction_*\n*Ex: _" + prefix + "bot on/off_*" + ); + } + } catch (_0x9db1e2) { + _0x129972.error(_0x9db1e2 + "\n\ncommand: bot", _0x9db1e2); + } + } +); +smd( + { + pattern: "antitag", + desc: "detect tagall in group chat, then kick them", + fromMe: true, + category: "misc", + filename: __filename, + }, + async (_0x27399d, _0x182372) => { + try { + let _0x206317 = _0x182372 ? _0x182372.toLowerCase().trim() : false; + let _0x4a3f1c = _0x206317 ? _0x206317.split(" ")[0] : false; + let _0x3dc11c = + (await groupdb.findOne({ + id: _0x27399d.chat, + })) || + (await groupdb.new({ + id: _0x27399d.chat, + })); + if (!_0x4a3f1c) { + await _0x27399d.send( + "*_Anti_tag *" + + (_0x3dc11c.antitag === "false" ? "Disabled" : "Enabled") + + " in this Chat!_*" + ); + } else if ( + _0x4a3f1c.startsWith("off") || + _0x4a3f1c.startsWith("deact") || + _0x4a3f1c.startsWith("disable") + ) { + if (_0x3dc11c.antitag === "false") { + await _0x27399d.send( + "*_Anti_tag already disabled in current Chat!!_*" + ); + } else { + await groupdb.updateOne( + { + id: _0x27399d.chat, + }, + { + antitag: "false", + } + ); + await _0x27399d.send("*_Anti_tag Disabled Succesfully!_*"); + } + } else if ( + _0x4a3f1c.startsWith("on") || + _0x4a3f1c.startsWith("act") || + _0x4a3f1c.startsWith("enable") + ) { + if (_0x3dc11c.antitag === "true") { + await _0x27399d.send( + "*_Anti_tag already enabled in current Chat!!_*" + ); + } else { + await groupdb.updateOne( + { + id: _0x27399d.chat, + }, + { + antitag: "true", + } + ); + await _0x27399d.send( + "*_Anti_tag succesfully enabled in chat!_*\n*_Now bot kick user who tag all members!_*" + ); + } + } else { + await _0x27399d.send( + "*_Provide Valid Instruction_*\n*Ex: _" + prefix + "antitag on/off_*" + ); + } + } catch (_0x3141b6) { + _0x27399d.error(_0x3141b6 + "\n\ncommand: antitag", _0x3141b6); + } + } +); +smd( + { + pattern: "antilink", + desc: "activates and deactivates antilink.\nuse buttons to toggle.", + category: "group", + filename: __filename, + }, + async (_0x25c82f, _0x4ae2c7, { smd: _0x23c42c }) => { + try { + if (!_0x25c82f.isGroup) { + return _0x25c82f.reply(tlang().group); + } + if (!_0x25c82f.isAdmin && !_0x25c82f.isCreator) { + return _0x25c82f.reply(tlang().admin); + } + let _0x495b9f = _0x4ae2c7 ? _0x4ae2c7.toLowerCase().trim() : false; + let _0x520158 = _0x495b9f ? _0x495b9f.split(" ")[0] : false; + let _0x7e1f39 = + (await groupdb.findOne({ + id: _0x25c82f.chat, + })) || + (await groupdb.new({ + id: _0x25c82f.chat, + })); + if (!_0x520158) { + return await _0x25c82f.send( + "*_Antilink " + + (_0x7e1f39.antilink === "false" ? "Disabled" : "Enabled") + + " in this Group!_* \n" + + (_0x7e1f39.antilink === "false" + ? "" + : "*Current Mode:* _" + _0x7e1f39.antilink + "_") + + "\n\n*Antilink Modes:* ```\n" + + (prefix + _0x23c42c) + + " kick (Delete Links & Kick Senders)\n" + + (prefix + _0x23c42c) + + " delete (Delete Links Only)\n" + + (prefix + _0x23c42c) + + " warn (warn & delete links)\n" + + (prefix + _0x23c42c) + + " off (Disable Antilink in chat) ```\n\n\n" + + Config.caption + ); + } else if ( + _0x520158.startsWith("off") || + _0x520158.startsWith("deact") || + _0x520158.startsWith("disable") + ) { + if (_0x7e1f39.antilink === "false") { + return await _0x25c82f.send( + "*_Anti_Link already disabled in current Chat!!_*" + ); + } + await groupdb.updateOne( + { + id: _0x25c82f.chat, + }, + { + antilink: "false", + } + ); + return await _0x25c82f.send("*_Anti_Link Disabled Succesfully!_*"); + } else if (_0x520158.startsWith("kick")) { + if (_0x7e1f39.antilink === "kick") { + return await _0x25c82f.send( + "*_Anti_Link already set to kick link senders!!_*" + ); + } + await groupdb.updateOne( + { + id: _0x25c82f.chat, + }, + { + antilink: "kick", + } + ); + return await _0x25c82f.send( + "*_Anti_Link Succesfully set to kick link senders!_*" + ); + } else if (_0x520158.startsWith("delete")) { + if (_0x7e1f39.antilink === "delete") { + return await _0x25c82f.send( + "*_Anti_Link already set to delete links!!_*" + ); + } + await groupdb.updateOne( + { + id: _0x25c82f.chat, + }, + { + antilink: "delete", + } + ); + return await _0x25c82f.send( + "*_Anti_Link Succesfully set to delete links from chat!_*" + ); + } else if (_0x520158.startsWith("warn")) { + if (_0x7e1f39.antilink === "warn") { + return await _0x25c82f.send( + "*_Anti_Link already set to warn link senders!!_*" + ); + } + await groupdb.updateOne( + { + id: _0x25c82f.chat, + }, + { + antilink: "warn", + } + ); + return await _0x25c82f.send( + "*_Anti_Link set to warn and delete links!_*" + ); + } else { + return await _0x25c82f.send( + "*_Uhh Please, Provide Valid Instruction_*\n*Eg: _" + + prefix + + "antilink kick/delete/warn/off_*" + ); + } + } catch (_0x90fda9) { + _0x25c82f.error(_0x90fda9 + "\n\ncommand: antilink", _0x90fda9); + } + } +); +smd( + { + pattern: "welcome", + alias: ["setwelcome"], + desc: "sets welcome message in specific group.", + category: "group", + filename: __filename, + }, + async (_0x1e1e67, _0x1036fe) => { + try { + if (!_0x1e1e67.isGroup) { + return _0x1e1e67.reply(tlang().group); + } + if (!_0x1e1e67.isAdmin && !_0x1e1e67.isCreator) { + return _0x1e1e67.reply(tlang().admin); + } + let _0x2154d6 = _0x1036fe.toLowerCase().trim(); + let _0x558208 = + (await groupdb.findOne({ + id: _0x1e1e67.chat, + })) || + (await groupdb.new({ + id: _0x1e1e67.chat, + })); + if (_0x2154d6 === "on" || _0x2154d6 === "act" || _0x2154d6 === "enable") { + if (_0x558208.welcome === "true") { + return await _0x1e1e67.send( + "*_Welcome already enabled in current group!!_*" + ); + } + await groupdb.updateOne( + { + id: _0x1e1e67.chat, + }, + { + welcome: "true", + } + ); + return await _0x1e1e67.send("*Welcome successfully enabled!!*"); + } + if (_0x558208.welcome !== "true") { + return await _0x1e1e67.send( + "*_Welcome *Disabled in this Group!_* \n*_Use on/off to enable/disable welcome_*" + ); + } + if (!_0x1036fe || _0x2154d6 === "get") { + return await _0x1e1e67.reply("*Welcome :* " + _0x558208.welcometext); + } + if ( + _0x2154d6 === "off" || + _0x2154d6 === "deact" || + _0x2154d6 === "disable" + ) { + if (_0x558208.welcome === "false") { + return await _0x1e1e67.send( + "*_Welcome already disabled in current group!!_*" + ); + } + await groupdb.updateOne( + { + id: _0x1e1e67.chat, + }, + { + welcome: "false", + } + ); + return await _0x1e1e67.send("*Welcome message disabled!!*"); + } + await groupdb.updateOne( + { + id: _0x1e1e67.chat, + }, + { + welcometext: _0x1036fe, + welcome: "true", + } + ); + await sendWelcome(_0x1e1e67, _0x1036fe); + } catch (_0x582cfc) { + _0x1e1e67.error(_0x582cfc + "\n\ncommand: setwelcome", _0x582cfc); + } + } +); +smd( + { + pattern: "goodbye", + alias: ["setgoodbye", "setbye"], + desc: "sets goodbye message in specific group.", + category: "group", + filename: __filename, + }, + async (_0x2c1a56, _0x5dedfc) => { + try { + if (!_0x2c1a56.isGroup) { + return _0x2c1a56.reply(tlang().group); + } + if (!_0x2c1a56.isAdmin && !_0x2c1a56.isCreator) { + return _0x2c1a56.reply(tlang().admin); + } + let _0x604587 = _0x5dedfc.toLowerCase().trim(); + let _0xbcf3ee = + (await groupdb.findOne({ + id: _0x2c1a56.chat, + })) || + (await groupdb.new({ + id: _0x2c1a56.chat, + })); + if (_0x604587 === "on" || _0x604587 === "act" || _0x604587 === "enable") { + if (_0xbcf3ee.goodbye === "true") { + return await _0x2c1a56.send( + "*_Goodbye already enabled in current group!!_*" + ); + } + await groupdb.updateOne( + { + id: _0x2c1a56.chat, + }, + { + goodbye: "true", + } + ); + return await _0x2c1a56.send("*Goodbye successfully enabled!!*"); + } + if (_0xbcf3ee.goodbye !== "true") { + return await _0x2c1a56.send( + "*_Goodbye *Disabled in this Group!_* \n*_Use on/off to enable/disable goodbye_*" + ); + } + if (!_0x5dedfc || _0x604587 === "get") { + return await _0x2c1a56.reply( + "*Goodbye Message :* " + _0xbcf3ee.goodbyetext + ); + } + if ( + _0x604587 === "off" || + _0x604587 === "deact" || + _0x604587 === "disable" + ) { + if (_0xbcf3ee.goodbye === "false") { + return await _0x2c1a56.send( + "*_Goodbye already disabled in current group!!_*" + ); + } + await groupdb.updateOne( + { + id: _0x2c1a56.chat, + }, + { + goodbye: "false", + } + ); + return await _0x2c1a56.send("*Goodbye message disabled!!*"); + } + await groupdb.updateOne( + { + id: _0x2c1a56.chat, + }, + { + goodbyetext: _0x5dedfc, + goodbye: "true", + } + ); + await sendWelcome(_0x2c1a56, _0x5dedfc); + } catch (_0x5dd573) { + _0x2c1a56.error(_0x5dd573 + "\n\ncommand: setgoodbye", _0x5dd573); + } + } +); +smd( + { + pattern: "onlyadmin", + alias: ["antimessge"], + desc: "activates and deactivates onlyadmin.", + category: "group", + filename: __filename, + }, + async (_0x18fcc8, _0x2d4a64, { cmdName: _0x3e69a5 }) => { + try { + if (!_0x18fcc8.isGroup) { + return _0x18fcc8.reply(tlang().group); + } + if (!_0x18fcc8.isAdmin && !_0x18fcc8.isCreator) { + return _0x18fcc8.reply(tlang().admin); + } + let _0x38fef2 = + (await groupdb.findOne({ + id: _0x18fcc8.chat, + })) || + (await groupdb.new({ + id: _0x18fcc8.chat, + })); + let _0x5b0eb3 = _0x2d4a64 ? _0x2d4a64.toLowerCase().trim() : false; + let _0x119122 = _0x5b0eb3 ? _0x5b0eb3.split(" ")[0] : false; + if (!_0x119122) { + return await _0x18fcc8.send( + "*_" + + _0x3e69a5 + + " *" + + (_0x38fef2.onlyadmin === "false" ? "Disabled" : "Enabled") + + " in this Group!_*\n *_Use on/off to enable/disable_*" + ); + } else if ( + _0x119122.startsWith("off") || + _0x119122.startsWith("deact") || + _0x119122.startsWith("disable") + ) { + if (_0x38fef2.onlyadmin === "false") { + return await _0x18fcc8.reply( + "*_Onlyadmin Already Disabled in Current Chat_*" + ); + } + await groupdb.updateOne( + { + id: _0x18fcc8.chat, + }, + { + onlyadmin: "false", + } + ); + await _0x18fcc8.bot.groupSettingUpdate( + _0x18fcc8.chat, + "not_announcement" + ); + return await _0x18fcc8.send( + "*" + + _0x3e69a5 + + " succesfully disable in group!_*\n*_Now everyone send message in group_*" + ); + } else if ( + _0x119122.startsWith("on") || + _0x119122.startsWith("act") || + _0x119122.startsWith("enable") + ) { + if (_0x38fef2.onlyadmin === "true") { + return await _0x18fcc8.reply( + "*_Onlyadmin Already Enabled in Current Chat_*" + ); + } + if (_0x18fcc8.isBotAdmin) { + await groupdb.updateOne( + { + id: _0x18fcc8.chat, + }, + { + onlyadmin: "true", + } + ); + await _0x18fcc8.bot.groupSettingUpdate( + _0x18fcc8.chat, + "announcement" + ); + return await _0x18fcc8.send( + "*" + + _0x3e69a5 + + " succesfully set to kick msg senders!_*\n*_Now only admins allow to send msg in group_*" + ); + } else { + return await _0x18fcc8.reply( + "*_UHH Please, Provide Admin Role First_*" + ); + } + } else { + return await _0x18fcc8.reply( + "*_Please Provide Valid Instruction_*\n*_Use on/off to enable/disable_*" + ); + } + } catch (_0x53ffd3) { + _0x18fcc8.error(_0x53ffd3 + "\n\ncommand: onlyadmin", _0x53ffd3); + } + } +); +smd( + { + pattern: "antibot", + desc: "kick Bot Users from Group.!", + category: "group", + filename: __filename, + }, + async (_0x3b3e26, _0x12cbbf, { cmdName: _0x12486d }) => { + try { + if (!_0x3b3e26.isGroup) { + return _0x3b3e26.reply(tlang().group); + } + if (!_0x3b3e26.isAdmin && !_0x3b3e26.isCreator) { + return _0x3b3e26.reply(tlang().admin); + } + let _0x397293 = + (await groupdb.findOne({ + id: _0x3b3e26.chat, + })) || + (await groupdb.new({ + id: _0x3b3e26.chat, + })); + let _0x22e1dc = _0x12cbbf ? _0x12cbbf.toLowerCase().trim() : ""; + let _0x11994b = + _0x22e1dc.startsWith("on") || + _0x22e1dc.startsWith("act") || + _0x22e1dc.startsWith("enable") || + _0x22e1dc.startsWith("del") || + _0x22e1dc.startsWith("warn") + ? "warn" + : _0x22e1dc.startsWith("kic") + ? "kick" + : _0x22e1dc.startsWith("off") || + _0x22e1dc.startsWith("reset") || + _0x22e1dc.startsWith("deact") || + _0x22e1dc.startsWith("disable") + ? "false" + : ""; + if (!_0x11994b) { + return await _0x3b3e26.send( + "*_Antibot Currently *" + + (_0x397293.antibot === "false" ? "Disabled" : "Enabled") + + " in this Group!_*\n*_Use warn/kick/off to enable/disable Antibot_*" + ); + } else if (_0x11994b === "false") { + if (_0x397293.antibot === "false") { + return await _0x3b3e26.reply( + "*_Antibot Already Disabled in Current Chat_*" + ); + } + await groupdb.updateOne( + { + id: _0x3b3e26.chat, + }, + { + antibot: "false", + } + ); + return await _0x3b3e26.send( + "*_Antibot Succesfully Disable in group!_*" + ); + } else if (_0x11994b === "warn" || _0x11994b === "kick") { + if (_0x397293.antibot === _0x11994b) { + return await _0x3b3e26.reply( + "*_Antibot Already set to " + _0x11994b + " bots!_*" + ); + } + if (!_0x3b3e26.isBotAdmin) { + return await _0x3b3e26.reply( + "*_Uhh Please, Provide Admin Role First_*" + ); + } + await groupdb.updateOne( + { + id: _0x3b3e26.chat, + }, + { + antibot: _0x11994b, + } + ); + return await _0x3b3e26.send( + "*_Antibot Succesfully set to " + _0x11994b + " Bot Users!_*" + ); + } else { + return await _0x3b3e26.reply( + "*_Please provide valid instructions!_*\n*_Use warn/kick/off to enable/disable Antibot!_*" + ); + } + } catch (_0x304d4d) { + _0x3b3e26.error(_0x304d4d + "\n\ncommand: antibot", _0x304d4d); + } + } +); +smd( + { + pattern: "disable", + desc: "disable cmds in Group.!", + category: "group", + filename: __filename, + }, + async (_0x204bdc, _0x1c3634) => { + try { + if (!_0x204bdc.isGroup) { + return _0x204bdc.reply(tlang().group); + } + if (!_0x204bdc.isAdmin && !_0x204bdc.isCreator) { + return _0x204bdc.reply(tlang().admin); + } + let _0x2cad27 = + (await groupdb.findOne({ + id: _0x204bdc.chat, + })) || + (await groupdb.new({ + id: _0x204bdc.chat, + })); + let _0x161561 = _0x1c3634 ? _0x1c3634.toLowerCase().trim() : false; + let _0x3dd6b4 = _0x161561 ? _0x161561.split(" ")[0] : ""; + if (!_0x3dd6b4) { + return await _0x204bdc.send( + "*Provide cmd name to disable in group*\n*Ex " + + prefix + + "disable tag(to disabled 'tag' cmd)/info*" + ); + } else if ( + _0x3dd6b4.startsWith("info") || + _0x3dd6b4.startsWith("list") || + _0x3dd6b4.startsWith("cmds") + ) { + return await _0x204bdc.send( + _0x2cad27.disablecmds === "false" + ? "*_Uhh Dear, Theres no cmd disabled in current group_*" + : "*_Disable cmds :_* ```" + + _0x2cad27.disablecmds.replace("false,", "") + + "```" + ); + } else if ( + _0x3dd6b4.startsWith("enable") || + _0x3dd6b4.startsWith("disable") || + _0x3dd6b4.startsWith("bot") + ) { + return await _0x204bdc.reply("*_Uhh Dear, I can't disable that cmd_*"); + } else if (_0x3dd6b4) { + const _0x965649 = + astro_patch.commands.find( + (_0x1b0024) => _0x1b0024.pattern === _0x3dd6b4 + ) || + astro_patch.commands.find( + (_0x2fd6f8) => + _0x2fd6f8.alias && _0x2fd6f8.alias.includes(_0x3dd6b4) + ); + if (_0x965649) { + let _0xac463 = _0x965649.pattern.replace( + /[.*+?^${}()|[\]\\]/g, + "\\$&" + ); + let _0x27d7ad = new RegExp("\\b" + _0xac463 + "\\b"); + if (_0x27d7ad.test(_0x2cad27.disablecmds)) { + return await _0x204bdc.send( + "*Uhh Dear, Provided cmd already in disable cmds*" + ); + } + var _0x41da99 = _0x2cad27.disablecmds + "," + _0x965649.pattern; + await groupdb.updateOne( + { + id: _0x204bdc.chat, + }, + { + disablecmds: _0x41da99, + } + ); + let _0x23b4d5 = _0x41da99.replace("false,", ""); + return await _0x204bdc.send( + '*_"' + + _0x3dd6b4 + + '" Succesfully added in disable cmds_*' + + (_0x23b4d5 === "" + ? "" + : "\n*_Disable cmds :_* ```" + _0x23b4d5 + "```") + ); + } else { + return await _0x204bdc.reply( + "*_'" + + _0x3dd6b4 + + "' is not a bot command, Provide valid command_*" + ); + } + } + } catch (_0x590dfb) { + _0x204bdc.error(_0x590dfb + "\n\ncommand: enable", _0x590dfb); + } + } +); +smd( + { + pattern: "enable", + desc: "enable a cmd in Group.!", + category: "group", + filename: __filename, + }, + async (_0x212b0e, _0x412234) => { + try { + if (!_0x212b0e.isGroup) { + return _0x212b0e.reply(tlang().group); + } + if (!_0x212b0e.isAdmin && !_0x212b0e.isCreator) { + return _0x212b0e.reply(tlang().admin); + } + let _0x2c9cd0 = + (await groupdb.findOne({ + id: _0x212b0e.chat, + })) || + (await groupdb.new({ + id: _0x212b0e.chat, + })); + let _0xa3fc1d = _0x412234 ? _0x412234.toLowerCase().trim() : false; + let _0x439688 = _0xa3fc1d ? _0xa3fc1d.split(" ")[0] : ""; + let _0x40bb35 = _0x439688.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); + let _0x5c60c4 = new RegExp("\\b" + _0x40bb35 + "\\b"); + if (!_0x439688 || _0x439688 === "") { + return await _0x212b0e.send( + "*Please provide disabled cmd name to enable it*\n*Ex " + + prefix + + "enable tag(if 'tag' cmd disabled)/all(reset disables)*" + ); + } else if (_0xa3fc1d.startsWith("all")) { + await groupdb.updateOne( + { + id: _0x212b0e.chat, + }, + { + disablecmds: "false", + } + ); + return await _0x212b0e.send("*_All disable cmds succesfully enabled_*"); + } else if ( + _0x5c60c4.test(_0x2c9cd0.disablecmds) && + _0x2c9cd0.disablecmds.includes(_0x439688) + ) { + let _0x51b1cd = _0x2c9cd0.disablecmds.replace(_0x5c60c4, ""); + await groupdb.updateOne( + { + id: _0x212b0e.chat, + }, + { + disablecmds: _0x51b1cd, + } + ); + return await _0x212b0e.send( + '*_"' + + _0x439688.replace(",", "") + + '" Succesfully removed from disable cmds_*' + ); + } else { + return await _0x212b0e.send( + "_There's no cmd disabled with *" + + _0x439688.replace(",", "") + + "* name" + ); + } + } catch (_0x25ceaf) { + _0x212b0e.error(_0x25ceaf + "\n\ncommand: disable", _0x25ceaf); + } + } +); +smd( + { + pattern: "antifake", + desc: "𝗗𝗲𝘁𝗲𝗰𝘁𝘀 𝗽𝗿𝗼𝗺𝗼𝘁𝗲/𝗱𝗲𝗺𝗼𝘁𝗲 𝗮𝗻𝗱 𝘀𝗲𝗻𝗱𝘀 𝗮𝗹𝗲𝗿𝘁. ", + category: "group", + filename: __filename, + }, + async (_0x5a1eb8, _0x463e76) => { + try { + if (!_0x5a1eb8.isGroup) { + return _0x5a1eb8.reply(tlang().group); + } + if (!_0x5a1eb8.isAdmin && !_0x5a1eb8.isCreator) { + return _0x5a1eb8.reply(tlang().admin); + } + let _0x49ac75 = + (await groupdb.findOne({ + id: _0x5a1eb8.chat, + })) || + (await groupdb.new({ + id: _0x5a1eb8.chat, + })); + let _0x1c6236 = _0x463e76 ? _0x463e76.toLowerCase().trim() : ""; + if ( + _0x1c6236.startsWith("off") || + _0x1c6236.startsWith("deact") || + _0x1c6236.startsWith("disable") + ) { + if (_0x49ac75.antifake == "false") { + return await _0x5a1eb8.send( + "*Anti_Fake Already Disabled In Current Chat!*" + ); + } + await groupdb.updateOne( + { + id: _0x5a1eb8.chat, + }, + { + antifake: "false", + } + ); + return await _0x5a1eb8.send("*Anti_Fake Disable Succesfully!*"); + } else if (!_0x463e76) { + return await _0x5a1eb8.send( + "*_Antifake " + + (_0x49ac75.antifake === "false" + ? "Not set to any" + : 'set to "' + _0x49ac75.antifake + '"') + + " Country Code!_*\n *Provide Country code to Update Antifake Status*\n*Eg: _.antifake 92_*" + ); + } + let _0x2f3d1b = _0x463e76 + ? _0x463e76 + .split(",") + .map((_0x40173c) => parseInt(_0x40173c)) + .filter((_0x44d61c) => !isNaN(_0x44d61c)) + .join(",") + : false; + if (!_0x463e76 || !_0x2f3d1b) { + return await _0x5a1eb8.send( + "*_Please provide a country code First_*\n *_Only numbers to join this group._*\n*_eg: " + + prefix + + "antifake 92_*" + ); + } else if (_0x2f3d1b) { + await groupdb.updateOne( + { + id: _0x5a1eb8.chat, + }, + { + antifake: "" + _0x2f3d1b, + } + ); + return await _0x5a1eb8.send( + '*Anti_Fake Succesfully set to "' + + _0x2f3d1b + + "\"!*\n*_Now People Joined Group Who's Number Start With " + + _0x2f3d1b + + "_*" + ); + } else { + return await _0x5a1eb8.send( + "*_Please provide a Valid country code First_*\n *_Only numbers to join this group._*\n*_eg: " + + prefix + + "antifake 92_*" + ); + } + } catch (_0x53288b) { + _0x5a1eb8.error(_0x53288b + "\n\ncommand: antifake", _0x53288b); + } + } +); +smd( + { + pattern: "antidemote", + desc: "Detects Promote and Automaticaly demote promoted person.", + category: "group", + filename: __filename, + }, + async (_0x3d214e, _0x55496f) => { + try { + if (!_0x3d214e.isGroup) { + return _0x3d214e.reply(tlang().group); + } + if (!_0x3d214e.isAdmin && !_0x3d214e.isCreator) { + return _0x3d214e.reply(tlang().admin); + } + let _0x30a721 = + (await groupdb.findOne({ + id: _0x3d214e.chat, + })) || + (await groupdb.new({ + id: _0x3d214e.chat, + })); + let _0x210ede = _0x55496f ? _0x55496f.toLowerCase().trim() : ""; + if ( + _0x210ede.startsWith("on") || + _0x210ede.startsWith("act") || + _0x210ede.startsWith("enable") + ) { + if (_0x30a721.antidemote == "true") { + return await _0x3d214e.send( + "*Anti_Demote Already Enabled In Current Chat!*" + ); + } + await groupdb.updateOne( + { + id: _0x3d214e.chat, + }, + { + antidemote: "true", + } + ); + return await _0x3d214e.send( + "*Anti_Demote Enable Succesfully! _No One Demote Here Now_.*" + ); + } else if ( + _0x210ede.startsWith("off") || + _0x210ede.startsWith("deact") || + _0x210ede.startsWith("disable") + ) { + if (_0x30a721.antidemote == "false") { + return await _0x3d214e.send( + "*Anti_Demote Already Disabled In Current Chat!*" + ); + } + await groupdb.updateOne( + { + id: _0x3d214e.chat, + }, + { + antidemote: "false", + } + ); + return await _0x3d214e.send("*Anti_Demote Disable Succesfully!*"); + } else { + return await _0x3d214e.reply( + '*Uhh Dear, Please Toggle between "On" And "Off".* \n*_To Enable & Disable Stop Demoting Peoples!_*' + ); + } + } catch (_0x3863b4) { + _0x3d214e.error(_0x3863b4 + "\n\ncommand: antidemote", _0x3863b4); + } + } +); +smd( + { + pattern: "antipromote", + desc: "Detects Promote and Automaticaly demote promoted person.", + category: "group", + filename: __filename, + }, + async (_0x3d1898, _0x4bf866) => { + try { + if (!_0x3d1898.isGroup) { + return _0x3d1898.reply(tlang().group); + } + if (!_0x3d1898.isAdmin && !_0x3d1898.isCreator) { + return _0x3d1898.reply(tlang().admin); + } + let _0x599352 = + (await groupdb.findOne({ + id: _0x3d1898.chat, + })) || + (await groupdb.new({ + id: _0x3d1898.chat, + })); + let _0x41626b = _0x4bf866 ? _0x4bf866.toLowerCase().trim() : ""; + if ( + _0x41626b.startsWith("on") || + _0x41626b.startsWith("act") || + _0x41626b.startsWith("enable") + ) { + if (_0x599352.antipromote == "true") { + return await _0x3d1898.send( + "*Anti_Promote Already Enabled In Current Chat!*" + ); + } + await groupdb.updateOne( + { + id: _0x3d1898.chat, + }, + { + antipromote: "true", + } + ); + return await _0x3d1898.send( + "*Anti_Promote Enable Succesfully! _No One Promote Here Now_.*" + ); + } else if ( + _0x41626b.startsWith("off") || + _0x41626b.startsWith("deact") || + _0x41626b.startsWith("disable") + ) { + if (_0x599352.antipromote == "false") { + return await _0x3d1898.send( + "*Anti_Promote Already Disabled In Current Chat!*" + ); + } + await groupdb.updateOne( + { + id: _0x3d1898.chat, + }, + { + antipromote: "false", + } + ); + return await _0x3d1898.send("*Anti_Promote Disable Succesfully!*"); + } else { + return await _0x3d1898.reply( + '*Uhh Dear, Please Toggle between "On" And "Off".* \n*_To Stop Promoting Peoples in Chat_*' + ); + } + } catch (_0x424dfe) { + _0x3d1898.error(_0x424dfe + "\n\ncommand: antipromote", _0x424dfe); + } + } +); +smd( + { + pattern: "pdm", + desc: "Detect Promote/Demote Users And Send Alerts in Chat ", + category: "group", + filename: __filename, + }, + async (_0x47f7e9, _0x4bf96c) => { + try { + if (!_0x47f7e9.isGroup) { + return _0x47f7e9.reply(tlang().group); + } + if (!_0x47f7e9.isAdmin && !_0x47f7e9.isCreator) { + return _0x47f7e9.reply(tlang().admin); + } + let _0x9e3626 = + (await groupdb.findOne({ + id: _0x47f7e9.chat, + })) || + (await groupdb.new({ + id: _0x47f7e9.chat, + })); + let _0x19e598 = _0x4bf96c ? _0x4bf96c.toLowerCase().trim() : ""; + if ( + _0x19e598.startsWith("on") || + _0x19e598.startsWith("act") || + _0x19e598.startsWith("enable") + ) { + if (_0x9e3626.pdm == "true") { + return await _0x47f7e9.send( + "*Promote/Demote Alerts Already Enabled In Current Chat!*" + ); + } + await groupdb.updateOne( + { + id: _0x47f7e9.chat, + }, + { + pdm: "true", + } + ); + return await _0x47f7e9.send( + "*Promote/Demote Alerts Enable Succesfully!*" + ); + } else if ( + _0x19e598.startsWith("off") || + _0x19e598.startsWith("deact") || + _0x19e598.startsWith("disable") + ) { + if (_0x9e3626.pdm == "false") { + return await _0x47f7e9.send( + "*Promote/Demote Alerts Already Disabled In Current Chat!*" + ); + } + await groupdb.updateOne( + { + id: _0x47f7e9.chat, + }, + { + pdm: "false", + } + ); + return await _0x47f7e9.send( + "*Promote/Demote Alerts Disable Succesfully!*" + ); + } else { + return await _0x47f7e9.reply( + '*Uhh Dear, Please use between "On" And "Off".* \n*_To get And Stop Promote/Demote Alerts_*' + ); + } + } catch (_0x2f089d) { + _0x47f7e9.error(_0x2f089d + "\n\ncommand: pdm", _0x2f089d); + } + } +); +smd( + { + pattern: "amute", + desc: "sets auto mute time in group.", + category: "group", + }, + async (_0x23aaae, _0xc0fcc0) => { + try { + if (!_0x23aaae.isGroup) { + return _0x23aaae.reply(tlang().group); + } + if (!_0x23aaae.isAdmin && !_0x23aaae.isCreator) { + return _0x23aaae.reply(tlang().admin); + } + let _0x4e4f77 = + (await groupdb.findOne({ + id: _0x23aaae.chat, + })) || + (await groupdb.new({ + id: _0x23aaae.chat, + })); + if (!_0xc0fcc0) { + return await _0x23aaae.reply( + "*Auto_Mute *" + + (_0x4e4f77.mute === "false" ? "disable" : "enabled") + + " for current group*" + + (_0x4e4f77.mute !== "false" + ? "\n *Auto mute status set at : " + _0x4e4f77.mute + "* " + : "") + ); + } + let [_0x579533, _0x1c48cc] = _0xc0fcc0.split(":").map(Number); + if ( + isNaN(_0x579533) || + isNaN(_0x1c48cc) || + _0x579533 < 0 || + _0x579533 >= 24 || + _0x1c48cc < 0 || + _0x1c48cc >= 60 + ) { + return _0x23aaae.reply( + "Please provide correct form.\nEg: " + prefix + "amute 22:00" + ); + } + let _0x37c60f = + _0x579533.toString().padStart(2, "0") + + ":" + + _0x1c48cc.toString().padStart(2, "0"); + await groupdb.updateOne( + { + id: _0x23aaae.chat, + }, + { + mute: _0x37c60f, + } + ); + return _0x23aaae.reply( + "*_Successfully done, Group auto mute at " + _0x37c60f + "_*" + ); + } catch (_0x47f0cd) { + _0x23aaae.error(_0x47f0cd + "\n\ncommand: amute", _0x47f0cd); + } + } +); +smd( + { + pattern: "aunmute", + desc: "sets unmute time in group.", + category: "group", + }, + async (_0x93dfcd, _0x13088a) => { + try { + if (!_0x93dfcd.isGroup) { + return _0x93dfcd.reply(tlang().group); + } + if (!_0x93dfcd.isAdmin && !_0x93dfcd.isCreator) { + return _0x93dfcd.reply(tlang().admin); + } + let _0x233212 = + (await groupdb.findOne({ + id: _0x93dfcd.chat, + })) || + (await groupdb.new({ + id: _0x93dfcd.chat, + })); + if (!_0x13088a) { + return await _0x93dfcd.reply( + "*Auto_Unmute *" + + (_0x233212.unmute === "false" ? "disable" : "enabled") + + " for current group*" + + (_0x233212.unmute !== "false" + ? "\n *Auto unmute status set at : " + _0x233212.unmute + "* " + : "") + ); + } + let [_0x4566be, _0x302718] = _0x13088a.split(":").map(Number); + if ( + isNaN(_0x4566be) || + isNaN(_0x302718) || + _0x4566be < 0 || + _0x4566be >= 24 || + _0x302718 < 0 || + _0x302718 >= 60 + ) { + return _0x93dfcd.reply( + "Please provide correct form.\nEg: " + prefix + "aunmute 22:00" + ); + } + let _0x47f5d3 = + _0x4566be.toString().padStart(2, "0") + + ":" + + _0x302718.toString().padStart(2, "0"); + await groupdb.updateOne( + { + id: _0x93dfcd.chat, + }, + { + unmute: _0x47f5d3, + } + ); + return _0x93dfcd.reply( + "*_Successfully done, Group auto unmute at " + _0x47f5d3 + "_*" + ); + } catch (_0x30bf1c) { + _0x93dfcd.error(_0x30bf1c + "\n\ncommand: aunmute", _0x30bf1c); + } + } +); +smd( + { + pattern: "dunmute", + desc: "Delete unmute from group.", + category: "group", + }, + async (_0xe007b5) => { + try { + if (!_0xe007b5.isGroup) { + return _0xe007b5.reply(tlang().group); + } + if (!_0xe007b5.isAdmin && !_0xe007b5.isCreator) { + return _0xe007b5.reply(tlang().admin); + } + let _0xb4b312 = await groupdb.findOne({ + id: _0xe007b5.chat, + }); + if (!_0xb4b312 || !_0xb4b312.unmute || _0xb4b312.unmute == "false") { + return await _0xe007b5.reply("*There's no auto unmute set in group.*"); + } + await groupdb.updateOne( + { + id: _0xe007b5.chat, + }, + { + unmute: "false", + } + ); + return await _0xe007b5.reply("*Auto unmute deleted successfully.*"); + } catch (_0x243aed) { + _0xe007b5.error(_0x243aed + "\n\ncommand: dunmute", _0x243aed); + } + } +); +smd( + { + pattern: "dmute", + desc: "Delete mute from group.", + category: "group", + }, + async (_0x10542a, _0x2cc451) => { + try { + if (!_0x10542a.isGroup) { + return _0x10542a.reply(tlang().group); + } + if (!_0x10542a.isAdmin && !_0x10542a.isCreator) { + return _0x10542a.reply(tlang().admin); + } + let _0x529593 = await groupdb.findOne({ + id: _0x10542a.chat, + }); + if (!_0x529593 || !_0x529593.mute || _0x529593.mute == "false") { + return await _0x10542a.reply("*There's no auto mute set in group.*"); + } + await groupdb.updateOne( + { + id: _0x10542a.chat, + }, + { + mute: "false", + } + ); + return await _0x10542a.reply("*Auto mute deleted successfully.*"); + } catch (_0x137fa6) { + _0x10542a.error(_0x137fa6 + "\n\ncommand: dmute", _0x137fa6); + } + } +); +async function haveEqualMembers(_0x31ae7e, _0x107896) { + if (_0x31ae7e.length === 0 || _0x107896.length === 0) { + return false; + } + const _0x5aee47 = _0x31ae7e.filter((_0x44f6e4) => + _0x107896.includes(_0x44f6e4) + ); + const _0x3a93d0 = (_0x5aee47.length / _0x31ae7e.length) * 100; + return _0x3a93d0 >= 76; +} +smd( + { + pattern: "antiword", + desc: "Detects words from chat,and delete/warn senders.", + category: "group", + filename: __filename, + use: "< action | words >", + }, + async (_0x4626e9, _0x244587, { cmdName: _0xc43bcd }) => { + try { + if (!_0x4626e9.isGroup) { + return _0x4626e9.reply(tlang().group); + } + if (!_0x4626e9.isAdmin && !_0x4626e9.isCreator) { + return _0x4626e9.reply(tlang().admin); + } + let _0x55ea26 = + (await groupdb.findOne({ + id: _0x4626e9.chat, + })) || + (await groupdb.new({ + id: _0x4626e9.chat, + antiword: { + status: "false", + words: "", + }, + })); + let _0x14e9b0 = _0x244587 ? _0x244587.toLowerCase().trim() : false; + let _0xe2e8cc = _0x55ea26.antiword; + let _0x28cfe1 = + "*Antiword Currently *" + + (_0xe2e8cc.status !== "false" ? "enabled" : "disabled") + + "!!!* ```\n STATUS: " + + (_0xe2e8cc.status ? _0xe2e8cc.status : "--Empty Yet--") + + " \n WORDS: " + + (_0xe2e8cc.words + ? _0xe2e8cc.words.replace(/,/gi, " -- ") + : "--Empty Yet--") + + "```\n\n*Available Cmds:* ```\n " + + (prefix + _0xc43bcd) + + " off \n " + + (prefix + _0xc43bcd) + + " reset\n " + + (prefix + _0xc43bcd) + + " warn | bad,words\n " + + (prefix + _0xc43bcd) + + " delete | hot,badas,etc\n``` \n\n\n " + + Config.caption; + if (!_0x14e9b0 || !_0x244587) { + return await _0x4626e9.send(_0x28cfe1); + } + let _0x48cd39 = _0x14e9b0.split("|")[1] || ""; + let _0x431ae2 = + _0x14e9b0.startsWith("on") || + _0x14e9b0.startsWith("act") || + _0x14e9b0.startsWith("enable") || + _0x14e9b0.startsWith("del") + ? "delete" + : _0x14e9b0.startsWith("warn") + ? "warn" + : _0x14e9b0.startsWith("off") || + _0x14e9b0.startsWith("deact") || + _0x14e9b0.startsWith("disable") + ? "false" + : _0x14e9b0.startsWith("reset") + ? "reset" + : ""; + _0x431ae2 = + !_0x431ae2 && _0x48cd39 && _0xe2e8cc.status !== "false" + ? _0xe2e8cc.status + : _0x431ae2; + if (_0x431ae2 === "reset") { + await groupdb.updateOne( + { + id: _0x4626e9.chat, + }, + { + antiword: {}, + } + ); + return await _0x4626e9.send("*_Anti_Word status cleard!_*"); + } else if (_0x431ae2 === "delete" || _0x431ae2 === "warn") { + if (_0xe2e8cc.status == _0x431ae2 && !_0x48cd39) { + return await _0x4626e9.send( + "*Please provide badWords, like " + + (prefix + _0xc43bcd) + + " " + + _0x431ae2 + + " | bad,words" + ); + } + _0x48cd39 = _0x48cd39 ? _0x48cd39 : _0xe2e8cc.words; + await groupdb.updateOne( + { + id: _0x4626e9.chat, + }, + { + antiword: { + status: _0x431ae2, + words: _0x48cd39, + }, + } + ); + return await _0x4626e9.send( + "*_Anti_Word succesfully set to '" + + _0x431ae2 + + "' badward!_*\n*Antiwords are:```" + + (_0x48cd39 ? _0x48cd39.replace(/,/gi, " | ") : "--Empty Yet--") + + "``` *" + ); + } else if (_0x431ae2 === "false") { + if (_0xe2e8cc.status === _0x431ae2) { + return await _0x4626e9.send( + "*Anti_Word Already Disabled In Current Chat!*" + ); + } + await groupdb.updateOne( + { + id: _0x4626e9.chat, + }, + { + antiword: { + status: "false", + words: _0xe2e8cc.words, + }, + } + ); + return await _0x4626e9.send("*Anti_Word Disable Succesfully!*"); + } else { + return await _0x4626e9.reply( + "*Uhh dear, Please follow instructions!!*\n\n" + _0x28cfe1 + ); + } + } catch (_0x5738c4) { + _0x4626e9.error(_0x5738c4 + "\n\ncommand: antiword", _0x5738c4); + } + } +); +let bott = false; +let chatbotCount = 0; +smd( + { + on: "main", + }, + async ( + _0x39f91d, + _0x4baec9, + { + botNumber: _0x4ac038, + isCreator: _0x184989, + budy: _0x47409a, + body: _0x66fc82, + icmd: _0x250d65, + } + ) => { + try { + if (global.MsgsInLog === "true") { + console.log( + "" + + (_0x39f91d.isGroup + ? "[MESSAGE IN GROUP] From => " + + _0x39f91d.metadata.subject + + "\n[USER]:" + : "[MESSAGE IN PRIVATE] From =>") + + (" " + + _0x39f91d.senderName + + " " + + _0x39f91d.senderNum + + "\n[" + + _0x39f91d.mtype.toUpperCase() + + "]: " + + _0x39f91d.body + + "\n============== [SMD] =================") + ); + } + let _0x273393 = + (await groupdb.findOne({ + id: _0x39f91d.chat, + })) || false; + let _0xea5278 = false; + try { + if (!global.SmdOfficial && global.SmdOfficial !== "yes") { + return; + } + if ( + _0x273393 && + _0x273393.antitag == "true" && + !_0x39f91d.checkBot() && + _0x39f91d.mtype !== "reactionMessage" && + _0x273393.botenable == "true" + ) { + const _0x50265a = await haveEqualMembers( + _0x39f91d.metadata.participants.map((_0x406321) => _0x406321.id), + _0x39f91d.mentionedJid + ); + if (_0x50265a && _0x39f91d.isBotAdmin) { + let _0x40ef27 = { + reason: "tagging all members!", + chat: _0x39f91d.metadata?.subject || "GROUP", + warnedby: tlang().title, + date: _0x39f91d.date, + }; + _0xea5278 = await warn.addwarn( + _0x39f91d.sender, + _0x39f91d.chat, + _0x40ef27 + ); + await _0x39f91d.reply( + "*_[TAG DETECTED] Hey @" + + _0x39f91d.senderNum + + " warning!!_*\n*_Tagging all members is not allowed!_*", + { + mentions: [_0x39f91d.sender], + } + ); + await _0x39f91d.delete(); + } else if (_0x50265a && !_0x39f91d.isBotAdmin) { + await _0x39f91d.reply( + "*_[TAGALL DETECTED] Can't do anything, without getting admin role!_*", + { + mentions: [_0x39f91d.sender], + } + ); + } + } + if ( + _0x273393 && + _0x39f91d.isGroup && + !_0x39f91d.isAdmin && + !_0x184989 && + _0x39f91d.mtype !== "reactionMessage" && + _0x273393.botenable == "true" + ) { + if ( + _0x273393.antibot && + _0x273393.antibot !== "false" && + _0x39f91d.isBot && + !_0x39f91d.checkBot(_0x39f91d.sender) + ) { + if (_0x39f91d.isBotAdmin) { + var _0x3c86e4 = + "*_Bot user not allowed, please make it private!_*"; + if (_0x273393.antibot === "warn") { + let _0x50d0d8 = { + reason: "Bots not allowed!", + chat: _0x39f91d.metadata?.subject || "GROUP", + date: _0x39f91d.date, + }; + _0xea5278 = _0xea5278 + ? _0xea5278 + : await warn.addwarn( + _0x39f91d.sender, + _0x39f91d.chat, + _0x50d0d8 + ); + if (_0xea5278.status) { + _0x3c86e4 = + "*_Hey @" + + _0x39f91d.senderNum + + " warning, Due To Antibot!_*"; + } + } else if (_0x273393.antibot === "kick") { + try { + sleep(1000); + await _0x39f91d.bot.groupParticipantsUpdate( + _0x39f91d.chat, + [_0x39f91d.sender], + "remove" + ); + _0x3c86e4 = + "*_User @" + + _0x39f91d.senderNum + + " kick Due To Antibot!_*"; + } catch {} + } + await _0x39f91d.delete(); + await _0x39f91d.send(_0x3c86e4, { + mentions: [_0x39f91d.sender], + }); + } else if (!_0x39f91d.isBotAdmin && _0x39f91d.isBot) { + await _0x39f91d.reply( + "*_Uhh Please, Provide Admin Role To Kick Other Bot_*\n*_Or Disable Antibot (On/Off) In Current Group_*" + ); + } + } + if ( + _0x273393.onlyadmin && + _0x273393.onlyadmin === "true" && + SmdOfficial == "yes" + ) { + var _0x3c86e4 = ""; + if (_0x39f91d.isBotAdmin) { + let _0x5c4aae = { + reason: "Only Admin can Chat!", + chat: _0x39f91d.metadata?.subject || "PRIVATE", + warnedby: tlang().title, + date: _0x39f91d.date, + }; + _0xea5278 = _0xea5278 + ? _0xea5278 + : await warn.addwarn( + _0x39f91d.sender, + _0x39f91d.chat, + _0x5c4aae + ); + if (_0xea5278.status) { + _0x3c86e4 = "*Warns you for chat here!*\n"; + } + await _0x39f91d.delete(); + sleep(1500); + await _0x39f91d.send( + "*Hey @" + + _0x39f91d.senderNum + + "* " + + _0x3c86e4 + + "*Deleteing message,while onlyadmin activated!!* ", + { + mentions: [_0x39f91d.sender], + } + ); + } else { + await _0x39f91d.send( + "*_Provide admin role to kick Message Senders_*\n*Or _Disable onlyadmin(on/off) in currentchat_*" + ); + } + } + if ( + _0x273393.antilink && + _0x273393.antilink !== "false" && + SmdOfficial === "yes" + ) { + const _0x37bc15 = + Config.antilink_values && Config.antilink_values !== "all" + ? Config.antilink_values + .split(",") + .filter((_0x3da281) => _0x3da281.trim() !== "") + : ["https://", "chat.whatsapp.com", "fb.com"]; + let _0x5cbc1d = _0x66fc82.toLowerCase(); + if (_0x37bc15.some((_0x81b040) => _0x5cbc1d.includes(_0x81b040))) { + if (!_0x39f91d.isBotAdmin) { + let _0x26aa7f = + " *[LINK DETECTED]*\nUser @" + + _0x39f91d.sender.split("@")[0] + + " detected sending a link.\nPromote " + + Config.botname + + " as admin to " + + (_0x273393.antilink === "kick" + ? "kick \nlink senders." + : "delete \nlinks from this Chat") + + " \n"; + await _0x39f91d.send(_0x26aa7f, { + mentions: [_0x39f91d.sender], + }); + } else if (_0x273393.antilink === "delete") { + await _0x39f91d.send("*_Link Detected.. Deletion Done!_*"); + await _0x39f91d.delete(); + } else if ( + _0x273393.antilink === "warn" || + _0x273393.antilink === "true" + ) { + let _0x75abf8 = { + reason: "links not allowed!", + chat: _0x39f91d.metadata?.subject || "PRIVATE", + warnedby: tlang().title, + date: _0x39f91d.date, + }; + _0xea5278 = _0xea5278 + ? _0xea5278 + : await warn.addwarn( + _0x39f91d.sender, + _0x39f91d.chat, + _0x75abf8 + ); + var _0x3c86e4 = _0xea5278.status + ? "*_[LINK DETECTED] Hey @" + + _0x39f91d.senderNum + + " warning!!_*\n*_links not allowed in current group!_*" + : "*_[LINK DETECTED]!_*"; + await _0x39f91d.reply(_0x3c86e4, { + mentions: [_0x39f91d.sender], + }); + await _0x39f91d.delete(); + } else if (_0x273393.antilink === "kick") { + await _0x39f91d.send("*_Link Detected!!_*"); + try { + await _0x39f91d.delete(); + sleep(1500); + await _0x39f91d.bot.groupParticipantsUpdate( + _0x39f91d.chat, + [_0x39f91d.sender], + "remove" + ); + } catch { + await _0x39f91d.send("*Link Detected*\n" + tlang().botAdmin); + } + } + } + } + } + } catch (_0x1a7fb0) { + console.log("Error From Antilinks : ", _0x1a7fb0); + } + var _0x219875 = _0x273393?.antiword || { + status: "false", + }; + if ( + _0x4baec9.length > 1 && + !_0x39f91d.isBot && + _0x219875 && + _0x219875.status !== "false" && + _0x219875.words + ) { + var _0x4e66ac = _0x219875.words.split(",") || []; + let _0x2298c9 = false; + _0x4e66ac.map(async (_0x5e94de) => { + if ( + _0x39f91d.isAdmin || + !global.SmdOfficial || + global.SmdOfficial != "yes" + ) { + return; + } + let _0x520e96 = new RegExp("\\b" + _0x5e94de?.trim() + "\\b", "ig"); + let _0x1ae0c5 = _0x47409a.toLowerCase(); + if (!_0x2298c9 && _0x5e94de && _0x520e96.test(_0x1ae0c5)) { + _0x2298c9 = true; + await sleep(500); + try { + var _0x3dc4df = ""; + if (_0x219875.status === "warn") { + let _0x5f3cee = { + reason: "For using Bad Word", + chat: _0x39f91d.metadata?.subject || "PRIVATE", + warnedby: tlang().title, + date: _0x39f91d.date, + }; + _0xea5278 = _0xea5278 + ? _0xea5278 + : await warn.addwarn( + _0x39f91d.sender, + _0x39f91d.chat, + _0x5f3cee + ); + if (_0xea5278.status) { + _0x3dc4df = "\n*Warns you for using badWord!!*\n"; + } + } + if (_0x39f91d.isBotAdmin) { + await _0x39f91d.send( + "*[BAD WORD DETECTED] Hey @" + + _0x39f91d.senderNum + + "* " + + _0x3dc4df + + " *Deleting your message from chat!*\n", + { + mentions: [_0x39f91d.sender], + }, + "asta", + _0x39f91d + ); + await _0x39f91d.delete(); + } else { + await _0x39f91d.reply( + "*_[BAD WORD DETECTED] provide admin to take action!_*", + { + mentions: [_0x39f91d.sender], + } + ); + } + } catch (_0x44e136) { + console.log("Error From Bad Words : ", _0x44e136); + } + } + }); + } + if (_0xea5278) { + let _0x4cb16b = parseInt(global.warncount) || 3; + if (_0xea5278.warning >= _0x4cb16b) { + if (_0x39f91d.isGroup) { + if (_0x39f91d.isBotAdmin) { + await _0x39f91d.send( + "*_Hey @" + + _0x39f91d.senderNum + + " Kicking you from group!_*\n*_Because Your warn limit exceed!_*", + { + mentions: [_0x39f91d.sender], + } + ); + await _0x39f91d.bot.groupParticipantsUpdate( + _0x39f91d.chat, + [_0x39f91d.sender], + "remove" + ); + } + } else { + await _0x39f91d.send( + "*_Hey @" + + _0x39f91d.senderNum + + " Blocking you!_*\n*_Because Your warn limit exceed!_*", + { + mentions: [_0x39f91d.sender], + } + ); + await _0x39f91d.bot.updateBlockStatus(_0x39f91d.sender, "block"); + } + } + } + try { + if (!global.SmdOfficial || _0x39f91d.mtype === "reactionMessage") { + return; + } + let _0x294e10 = (await groupdb.findOne({ + id: _0x39f91d.chat, + })) || { + chatbot: "false", + }; + if (!bott || chatbotCount >= 10) { + bott = (await bot_.findOne({ + id: "bot_" + _0x39f91d.user, + })) || { + chatbot: "false", + }; + } else { + chatbotCount++; + } + let _0x3f3751 = + bott && bott.chatbot && bott.chatbot == "true" + ? "true" + : _0x294e10.chatbot || "false"; + if ( + _0x3f3751 === "true" && + !_0x250d65 && + !_0x39f91d.isBot && + _0x39f91d.text + ) { + let _0x4c0917 = !_0x39f91d.isGroup + ? _0x39f91d.user + : _0x39f91d.quoted + ? _0x39f91d.quoted.sender + : _0x39f91d.mentionedJid[0] || false; + if ( + _0x39f91d.isGroup && + _0x4c0917 && + !_0x39f91d.checkBot(_0x4c0917) + ) { + return; + } + let { data: _0x1a5d20 } = await axios.get( + "http://api.brainshop.ai/get?bid=175685&key=Pg8Wu8mrDQjfr0uv&uid=[" + + _0x39f91d.senderNum + + "]&msg=[" + + _0x47409a + + "]" + ); + if (_0x1a5d20 && _0x1a5d20.cnt) { + _0x39f91d.send(_0x1a5d20.cnt, {}, "asta", _0x39f91d); + } else { + (""); + } + } + } catch (_0x418db7) { + console.log("Error From ChatBot : ", _0x418db7); + } + } catch (_0x4eac84) { + console.log("Group Settings error in command.main() \n", _0x4eac84); + } + } +); +let users = {}; +let user_warns = {}; +smd( + { + group: "add", + }, + async (_0x28d76c, { Void: _0x4dedb6 }) => { + try { + let _0x3a7fc2 = await groupdb.findOne({ + id: _0x28d76c.chat, + }); + if ( + !_0x3a7fc2 || + !_0x28d76c.isGroup || + _0x3a7fc2.botenable !== "true" || + _0x28d76c.blockJid || + _0x28d76c.fromMe + ) { + return; + } + let _0x21c5eb = + _0x3a7fc2 && _0x3a7fc2.welcome ? _0x3a7fc2.welcome : "false"; + let _0x3fc86e = + _0x3a7fc2 && _0x3a7fc2.antifake + ? _0x3a7fc2.antifake.toLowerCase() + : "false"; + let _0x5dd590 = _0x3fc86e.split(","); + const _0xdb6223 = _0x5dd590.some((_0x25ffc0) => + _0x28d76c.user.startsWith(_0x25ffc0) + ); + if (_0x3fc86e !== "false" && !_0xdb6223 && !_0x28d76c.isCreator) { + if (_0x28d76c.isBotAdmin) { + try { + await _0x28d76c.kick(); + return await sendWelcome( + _0x28d76c, + "*[ANTIFAKE START] @User kicked automaticaly!* @pp" + ); + } catch (_0x52d6df) { + await _0x28d76c.error( + " Can't kick user in antifake\n❲❒❳ GROUP: " + + _0x28d76c.metadata.subject + + "\n❲❒❳ ERROR: " + + _0x52d6df + + "\n", + _0x52d6df, + false + ); + } + } else { + await _0x28d76c.send( + "*[ANTI_FAKE ERROR] Need admin role to kick fake users!!*" + ); + } + } else if (_0x21c5eb === "true") { + await sendWelcome(_0x28d76c, _0x3a7fc2.welcometext); + } + } catch (_0x476537) { + console.log("Error From Welcome : ", _0x476537); + } + } +); +smd( + { + group: "remove", + }, + async (_0x1b9988, { Void: _0xcb3386 }) => { + try { + let _0xa3ec6 = + (await groupdb.findOne({ + id: _0x1b9988.chat, + })) || false; + if ( + !_0x1b9988 || + !_0xa3ec6 || + !_0x1b9988.isGroup || + _0xa3ec6.botenable !== "true" || + _0x1b9988.blockJid || + _0x1b9988.fromMe + ) { + return; + } + let _0x9f4c7b = _0xa3ec6 && _0xa3ec6.goodbye ? _0xa3ec6.goodbye : "false"; + if (_0x9f4c7b === "true") { + await sendWelcome(_0x1b9988, _0xa3ec6.goodbyetext); + } + } catch (_0x442765) { + console.log("Error From Goodbye : ", _0x442765); + } + } +); +smd( + { + group: "promote", + }, + async (_0x482975, { Void: _0x3481d2 }) => { + try { + let _0x390d91 = + (await groupdb.findOne({ + id: _0x482975.chat, + })) || false; + if ( + !_0x390d91 || + !_0x482975.isGroup || + _0x390d91.botenable !== "true" || + _0x482975.blockJid + ) { + return; + } + if (!user_warns[_0x482975.sender]) { + user_warns[_0x482975.sender] = { + [_0x482975.action]: 1, + }; + } else { + user_warns[_0x482975.sender][_0x482975.action]++; + } + let _0x4124fa; + if (_0x390d91.antipromote == "true" && !_0x482975.isCreator) { + _0x4124fa = _0x482975.isBotAdmin ? false : true; + if ( + users[_0x482975.sender] && + users[_0x482975.sender].previous_Action === "antidemote" + ) { + delete users[_0x482975.sender]; + return; + } + if (_0x482975.isBotAdmin) { + try { + await _0x482975.demote(); + users[_0x482975.sender] = { + previous_Action: "antipromote", + }; + if (user_warns[_0x482975.sender][_0x482975.action] > 2) { + return; + } + return await sendWelcome( + _0x482975, + "*[ANTIPROMOTE START] @User Demoted Automatically!* @pp " + ); + } catch (_0x5ae38b) { + await _0x482975.error( + " Can't demote user in antipromote\n❲❒❳ GROUP: " + + _0x482975.metadata.subject + + "\n❲❒❳ ERROR: " + + _0x5ae38b + + "\n", + _0x5ae38b, + false + ); + } + } + } + if (_0x390d91.pdm == "true" || _0x4124fa) { + if (user_warns[_0x482975.sender][_0x482975.action] > 2) { + return; + } + var _0x218901 = + " *[SOMEONE PROMOTE HERE]*\n" + + (_0x4124fa + ? "*Note : _I'm Not Admin Here, So I Can't Demote Someone while Anti_Promote Activated_*" + : "") + + "\n \n ❲❒❳ *User:* _@user_\n❲❒❳ *Position:* _Member -> Admin_ @pp\n ❲❒❳ *Total Members:* _@count_Members_\n❲❒❳ *Group Name:* @gname\n\n\n" + + Config.caption; + return await sendWelcome(_0x482975, _0x218901); + } + } catch (_0x3a436e) { + console.log("Error From Promote : ", _0x3a436e); + } + } +); +smd( + { + group: "demote", + }, + async (_0x2b38a5, { Void: _0x4676d7 }) => { + try { + let _0x1273fa = + (await groupdb.findOne({ + id: _0x2b38a5.chat, + })) || false; + if ( + !_0x1273fa || + !_0x2b38a5.isGroup || + _0x1273fa.botenable !== "true" || + _0x2b38a5.blockJid + ) { + return; + } + if (!user_warns[_0x2b38a5.sender]) { + user_warns[_0x2b38a5.sender] = { + [_0x2b38a5.action]: 1, + }; + } else { + user_warns[_0x2b38a5.sender][_0x2b38a5.action]++; + } + let _0x5878b4; + if (_0x1273fa.antidemote == "true" && !_0x2b38a5.isCreator) { + _0x5878b4 = _0x2b38a5.isBotAdmin ? false : true; + if ( + users[_0x2b38a5.sender] && + users[_0x2b38a5.sender].previous_Action === "antipromote" + ) { + delete users[_0x2b38a5.sender]; + return; + } + if (_0x2b38a5.isBotAdmin) { + try { + await _0x2b38a5.promote(); + users[_0x2b38a5.sender] = { + previous_Action: "antidemote", + }; + if (user_warns[_0x2b38a5.sender][_0x2b38a5.action] > 2) { + return; + } + return await sendWelcome( + _0x2b38a5, + "*[ANTIPROMOTE START] User promote automatically!* @pp " + ); + } catch (_0x275310) { + await _0x2b38a5.error( + " Can't promote user in antidemote\n❲❒❳ GROUP: " + + _0x2b38a5.metadata.subject + + "\n❲❒❳ ERROR: " + + _0x275310 + + "\n", + _0x275310, + false + ); + } + } + } + if (_0x1273fa.pdm == "true" || _0x5878b4) { + if (user_warns[_0x2b38a5.sender][_0x2b38a5.action] > 2) { + return; + } + var _0x168c92 = + " *[SOMEONE DEMOTE HERE]*\n " + + (_0x5878b4 + ? "*Note : _I'm Not Admin Here, So I Can't promote Someone while Anti_Demote Activated_*" + : "") + + "\n\n ❲❒❳ *User:* _@user_\n❲❒❳ *Position:* _Admin -> Member_ @pp\n ❲❒❳ *Total Members:* _@count_Members_\n❲❒❳ *Group Name:* @gname\n \n\n" + + Config.caption; + return await sendWelcome(_0x2b38a5, _0x168c92); + } + } catch (_0x3ef55d) { + console.log("Error From Demote : ", _0x3ef55d); + } + } +); +smd( + { + cmdname: "messages", + alias: ["countmessage", "msgcount"], + desc: "Check how many users continuesly active in chat!", + category: "group", + filename: __filename, + }, + async (_0x1cec94, _0x2535b1, { store: _0x264360 }) => { + try { + let _0x5af784 = {}; + _0x264360.messages[_0x1cec94.jid].array.forEach((_0x2ec32f) => { + const _0xd05e4b = + _0x2ec32f.pushName || + (_0x1cec94.isGroup + ? _0x2ec32f.key.participant + : _0x2ec32f.key.remoteJid || "unknown" + ).split("@")[0]; + _0x5af784[_0xd05e4b] = (_0x5af784[_0xd05e4b] || 0) + 1; + }); + let _0x599777 = Object.entries(_0x5af784); + if (!_0x599777 || !_0x599777[0]) { + return await _0x1cec94.reply("_No messages found!_"); + } + const _0x338160 = Object.entries(_0x5af784) + .map( + ([_0x4630e3, _0x3a7f93]) => + "\t*" + + (_0x4630e3?.split("\n").join(" ") || "unknown") + + "* ➪ _" + + _0x3a7f93 + + "_" + ) + .join("\n"); + var _0x370694 = ( + "*LIST OF ACTIVE USERS IN CURRENT CHAT*\n_Note: Sometimes Data will be reset when bot restart!_\n\n*Total Users: _" + + _0x599777.length + + "_*\n\n*USERNAME ➪ MESSAGE COUNT(s)*\n" + + _0x338160 + + "\n\n" + + Config.caption + ).trim(); + await _0x1cec94.send( + _0x370694, + { + contextInfo: { + ...(await _0x1cec94.bot.contextInfo( + "ACTIVE USERS", + _0x1cec94.senderName + )), + }, + }, + "asta", + _0x1cec94 + ); + } catch (_0x225db9) { + console.log({ + e: _0x225db9, + }); + } + } +); +let commandHistory = []; +smd( + { + on: "main", + }, + async (_0x297aaa, _0x35b575, { icmd: _0x5e5446 }) => { + try { + if (_0x5e5446 && _0x297aaa.cmd) { + commandHistory.push({ + user: _0x297aaa.sender, + command: _0x297aaa.cmd, + timestamp: new Date(), + }); + } + } catch (_0x4bf40a) { + await _0x297aaa.error( + _0x4bf40a + "\n\ncommand : listmessage", + _0x4bf40a, + "*ERROR!*" + ); + } + } +); +smd( + { + cmdname: "closetime", + alias: ["setclose", "setmute"], + desc: "set temporary timer to close a group chat!", + category: "group", + filename: __filename, + }, + async (_0x1067b4, _0x4d1cdb, { args: _0x58f103 }) => { + try { + if (!_0x1067b4.isGroup) { + return _0x1067b4.reply(tlang("group")); + } + if (!_0x1067b4.isBotAdmin) { + return _0x1067b4.reply(tlang("botAdmin")); + } + if (!_0x1067b4.isAdmin && !_0x1067b4.isCreator) { + return _0x1067b4.reply(tlang("admin")); + } + let _0x2c20a4 = _0x58f103[1] || ""; + let _0x133672 = parseInt(_0x58f103[0]) || ""; + if (!_0x133672 || isNaN(_0x133672)) { + return await _0x1067b4.reply( + "*please provide time with type*\n*Use : " + + prefix + + "setclose 2 minute*" + ); + } + if (_0x2c20a4.includes("sec")) { + var _0x8a6cf1 = _0x58f103[0] * "1000"; + } else if (_0x2c20a4.includes("min")) { + var _0x8a6cf1 = _0x58f103[0] * "60000"; + } else if (_0x2c20a4.includes("hour")) { + var _0x8a6cf1 = _0x58f103[0] * "3600000"; + } else { + return _0x1067b4.reply( + "*Please provide an option below !*\n *" + + prefix + + "setclose 30 second*\n *" + + prefix + + "setclose 10 minute*\n *" + + prefix + + "setclose 1 hour*" + ); + } + _0x1067b4.reply( + "*Group close in next '" + _0x58f103[0] + " " + _0x58f103[1] + "'!*" + ); + setTimeout(() => { + const _0x54c8b1 = "*Group closed!*"; + _0x1067b4.bot.groupSettingUpdate(_0x1067b4.from, "announcement"); + _0x1067b4.reply(_0x54c8b1); + }, _0x8a6cf1); + } catch (_0x491a92) { + console.log({ + e: _0x491a92, + }); + } + } +); +smd( + { + cmdname: "opentime", + alias: ["setopen", "setunmute"], + desc: "set temporary timer to open a group chat!", + category: "group", + filename: __filename, + }, + async (_0x4f388a, _0x57db16, { args: _0x26380a }) => { + try { + if (!_0x4f388a.isGroup) { + return _0x4f388a.reply(tlang("group")); + } + if (!_0x4f388a.isBotAdmin) { + return _0x4f388a.reply(tlang("botAdmin")); + } + if (!_0x4f388a.isAdmin && !_0x4f388a.isCreator) { + return _0x4f388a.reply(tlang("admin")); + } + let _0x2de426 = _0x26380a[1] || ""; + let _0x53a659 = parseInt(_0x26380a[0]) || ""; + if (!_0x53a659 || isNaN(_0x53a659)) { + return await _0x4f388a.reply( + "*please provide time with type*\n*Use : " + + prefix + + "setopen 2 minute*" + ); + } + if (_0x2de426.includes("sec")) { + var _0x3fc29d = _0x26380a[0] * "1000"; + } else if (_0x2de426.includes("min")) { + var _0x3fc29d = _0x26380a[0] * "60000"; + } else if (_0x2de426.includes("hour")) { + var _0x3fc29d = _0x26380a[0] * "3600000"; + } else { + return _0x4f388a.reply( + "*Please provide an option below !*\n *" + + prefix + + "setopen 40 second*\n *" + + prefix + + "setopen 10 minute*\n *" + + prefix + + "setopen 1 hour*" + ); + } + _0x4f388a.reply( + "*Group open in next '" + _0x26380a[0] + " " + _0x26380a[1] + "'!*" + ); + setTimeout(() => { + const _0x9e99d4 = + "*Hurray! Group Opened*\n *Now Members Can Send Messages*"; + _0x4f388a.bot.groupSettingUpdate(_0x4f388a.from, "not_announcement"); + _0x4f388a.reply(_0x9e99d4); + }, _0x3fc29d); + } catch (_0x12a19a) { + console.log({ + e: _0x12a19a, + }); + } + } +); diff --git a/plugins/heroku.js b/plugins/heroku.js new file mode 100644 index 0000000..3b78290 --- /dev/null +++ b/plugins/heroku.js @@ -0,0 +1,536 @@ +const Config = require("../config"); +let { prefix, smd } = require("../lib"); +const appName = Config.HEROKU_APP_NAME + ? Config.HEROKU_APP_NAME.toLowerCase() + : ""; +const authToken = Config.HEROKU_API_KEY; +const HEROKU = authToken && appName ? true : false; +const fetch = require("node-fetch"); +let updateConfig = () => { + try { + let _0x3334e2 = "../config"; + delete require.cache[_0x3334e2]; + require(_0x3334e2); + return true; + } catch (_0x4ed960) { + console.log(_0x4ed960); + } +}; +const heroku = {}; +heroku.addvar = async (_0xd07de3, _0x48d352) => { + try { + const _0x5a040c = { + Accept: "application/vnd.heroku+json; version=3", + Authorization: "Bearer " + authToken, + "Content-Type": "application/json", + }; + const _0x2855d9 = await fetch( + "https://api.heroku.com/apps/" + appName + "/config-vars", + { + method: "PATCH", + headers: _0x5a040c, + body: JSON.stringify({ + [_0xd07de3]: _0x48d352, + }), + } + ); + const _0x22fb4f = await _0x2855d9.json(); + return { + status: true, + data: _0x22fb4f, + }; + } catch (_0x479075) { + return { + status: false, + data: _0x479075, + }; + } +}; +heroku.getallvar = async () => { + try { + const _0x22b1af = { + Accept: "application/vnd.heroku+json; version=3", + Authorization: "Bearer " + authToken, + }; + const _0x3bb50b = await fetch( + "https://api.heroku.com/apps/" + appName + "/config-vars", + { + headers: _0x22b1af, + } + ); + const _0xfb3354 = await _0x3bb50b.json(); + let _0x6efaf0 = + " 『 *" + + appName + + " VARS* 』 \n*________________________________________*\n"; + Object.keys(_0xfb3354).forEach((_0x792bf) => { + _0x6efaf0 += + "*" + + _0x792bf + + " :* " + + (_0xfb3354[_0x792bf] ? "```" + _0xfb3354[_0x792bf] + "```" : "") + + " \n"; + }); + return { + status: true, + data: _0x6efaf0, + }; + } catch (_0x3932ac) { + return { + status: false, + data: _0x3932ac.message || _0x3932ac, + }; + } +}; +heroku.getvar = async (_0xb1a22) => { + try { + const _0x5c6d03 = { + Accept: "application/vnd.heroku+json; version=3", + Authorization: "Bearer " + authToken, + }; + const _0x5605e7 = await fetch( + "https://api.heroku.com/apps/" + appName + "/config-vars", + { + headers: _0x5c6d03, + } + ); + const _0x26040f = await _0x5605e7.json(); + return { + status: true, + data: _0x26040f[_0xb1a22], + }; + } catch (_0x3bef2f) { + return { + status: false, + data: _0x3bef2f.message || _0x3bef2f, + }; + } +}; +heroku.setvar = async (_0x25ad82, _0x3115e9) => { + try { + const _0x4207de = { + Accept: "application/vnd.heroku+json; version=3", + Authorization: "Bearer " + authToken, + "Content-Type": "application/json", + }; + fetch("https://api.heroku.com/apps/" + appName + "/config-vars", { + method: "GET", + headers: _0x4207de, + }) + .then((_0x47bbf4) => { + if (_0x47bbf4.ok) { + return _0x47bbf4.json(); + } else { + return { + status: false, + data: "Failed to fetch app variables. Status: " + _0x47bbf4.status, + }; + } + }) + .then((_0x387a92) => { + if (_0x387a92.hasOwnProperty(_0x25ad82)) { + const _0x17a922 = { + ..._0x387a92, + }; + _0x17a922[_0x25ad82] = _0x3115e9; + return fetch( + "https://api.heroku.com/apps/" + appName + "/config-vars", + { + method: "PATCH", + headers: _0x4207de, + body: JSON.stringify(_0x17a922), + } + ); + } else { + return { + status: false, + data: "Variable not found in app", + }; + } + }) + .then((_0x58ea28) => { + if (_0x58ea28.ok) { + return { + status: true, + data: _0x58ea28, + }; + } + }) + .catch((_0x916fd3) => { + return { + status: false, + data: _0x916fd3, + }; + }); + } catch (_0x3d9ebc) { + return { + status: false, + data: _0x3d9ebc, + }; + } +}; +heroku.setvar = async (_0x4d36a5, _0x4c84a1) => { + try { + const _0x2515a0 = { + Accept: "application/vnd.heroku+json; version=3", + Authorization: "Bearer " + authToken, + "Content-Type": "application/json", + }; + const _0x69e829 = await fetch( + "https://api.heroku.com/apps/" + appName + "/config-vars", + { + method: "GET", + headers: _0x2515a0, + } + ); + if (!_0x69e829.ok) { + return { + status: false, + data: "Variable not found in heroku app", + }; + } + const _0x5ae1b2 = await _0x69e829.json(); + if (_0x5ae1b2.hasOwnProperty(_0x4d36a5)) { + const _0x587d10 = { + ..._0x5ae1b2, + }; + _0x587d10[_0x4d36a5] = _0x4c84a1; + const _0x4b3418 = await fetch( + "https://api.heroku.com/apps/" + appName + "/config-vars", + { + method: "PATCH", + headers: _0x2515a0, + body: JSON.stringify(_0x587d10), + } + ); + if (_0x4b3418.ok) { + return { + status: true, + data: _0x4b3418, + }; + } else { + return { + status: false, + data: "Failed to update app variable. Status: " + _0x4b3418.status, + }; + } + } else { + return { + status: false, + data: "Variable not found in app", + }; + } + } catch (_0x5e8fe0) { + return { + status: false, + data: _0x5e8fe0.message || _0x5e8fe0, + }; + } +}; +smd( + { + cmdname: "getsudo", + alias: ["mods", "gsudo"], + info: "get sudo users list.", + fromMe: true, + type: "tools", + filename: __filename, + }, + async (_0xf78029) => { + let _0x204a80 = global.sudo + .split(",") + .filter((_0x4a441f) => _0x4a441f && _0x4a441f !== "null") + .map((_0x471040) => _0x471040.trim()); + let _0x10bccf = _0x204a80 + .map( + (_0x247f5e, _0xc999b3) => + " " + (_0xc999b3 + 1) + " 〄 @" + _0x247f5e + "\n\n" + ) + .join(""); + let _0x1babe2 = [ + _0xf78029.sender, + ..._0x204a80.map((_0xb3507b) => _0xb3507b + "@s.whatsapp.net"), + ]; + if (!_0x10bccf || !_0x204a80 || !_0x204a80[0]) { + return await _0xf78029.reply( + "*There's no mods/sudo added for your bot!*" + ); + } + let _0x762894 = ( + "\n 👤 *" + + (Config.botname ? Config.botname : "SUHAIL-MD ") + + " MODS* 👤\n \n" + + _0x10bccf + ).trim(); + return await _0xf78029.reply( + "https://telegra.ph/file/5fd51597b0270b8cff15b.png", + { + caption: _0x762894, + mentions: _0x1babe2, + }, + "img", + _0xf78029 + ); + } +); +smd( + { + pattern: "setsudo", + alias: ["ssudo", "setmod"], + fromMe: true, + desc: "Make sudo to a user", + category: "tools", + filename: __filename, + }, + async (_0x61d6ff) => { + try { + let _0x24d586 = _0x61d6ff.reply_message + ? _0x61d6ff.reply_message.sender + : _0x61d6ff.mentionedJid[0] + ? _0x61d6ff.mentionedJid[0] + : ""; + if (!_0x24d586 || !_0x24d586.includes("@s.whatsapp.net")) { + return await _0x61d6ff.reply("*Uhh dear, reply/mention an User*"); + } + let _0xf1255f = _0x24d586.split("@")[0]; + if (global.sudo.includes(_0xf1255f)) { + return _0x61d6ff.reply("*Number Already Exist In Sudo!*"); + } + global.sudo += "," + _0xf1255f; + let _0x376ddc = HEROKU + ? await heroku.addvar("SUDO", global.sudo) + : { + status: false, + }; + if (_0x376ddc && _0x376ddc.status) { + return _0x61d6ff.reply( + "*" + + _0xf1255f + + " Added Succesfully.*\nSudo Numbers : ```" + + global.sudo + + "```" + ); + } else if (!_0x376ddc || !_0x376ddc?.status) { + if (HEROKU) { + await _0x61d6ff.reply( + "*_Request terminated due to error!_*\n\n There's no responce from _HEROKU_, \n please check that you put valid _HEROKU_APP_NAME_ and _HEROKU_API_KEY_" + ); + } + await _0x61d6ff.reply("*User temporary added in sudo.*"); + } + } catch (_0x356a31) { + await _0x61d6ff.error(_0x356a31 + "\n\ncommand: setsudo", _0x356a31); + } + } +); +smd( + { + pattern: "delsudo", + alias: ["dsudo", "delmod"], + fromMe: true, + desc: "delete sudo user.", + category: "tools", + filename: __filename, + }, + async (_0xd149b4) => { + try { + let _0x45285f = _0xd149b4.reply_message + ? _0xd149b4.reply_message.sender + : _0xd149b4.mentionedJid[0] + ? _0xd149b4.mentionedJid[0] + : ""; + if (!_0x45285f || !_0x45285f.includes("@s.whatsapp.net")) { + return await _0xd149b4.reply("*Uhh dear, reply/mention an User*"); + } + let _0x3c1f41 = _0x45285f.split("@")[0]; + let _0x5a3afd = "," + _0x3c1f41; + if (global.sudo.includes(_0x5a3afd)) { + global.sudo = global.sudo.replace(_0x5a3afd, ""); + } else { + return await _0xd149b4.reply("*_User not found in the Sudo List!_*"); + } + let _0x69f761 = HEROKU + ? await heroku.addvar("SUDO", global.sudo) + : { + status: false, + }; + if (_0x69f761 && _0x69f761.status) { + return _0xd149b4.reply( + "*" + + _0x3c1f41 + + " Deleted Succesfully.*\nSudo Numbers : ```" + + global.sudo + + "```" + ); + } else if (!_0x69f761 || !_0x69f761?.status) { + if (HEROKU) { + await _0xd149b4.reply( + "*_Request terminated due to error!_*\n\n There's no responce from _HEROKU_, \n please check that you put valid _HEROKU_APP_NAME_ and _HEROKU_API_KEY_" + ); + } + await _0xd149b4.reply("*User removed from sudo.*"); + } + } catch (_0x38beee) { + await _0xd149b4.error(_0x38beee + "\n\ncommand: delsudo", _0x38beee); + } + } +); +smd( + { + pattern: "allvar", + alias: ["getallvar", "allvars"], + desc: "To get All Heroku Vars", + fromMe: true, + category: "tools", + filename: __filename, + }, + async (_0x301429) => { + try { + let _0x30be20 = await heroku.getallvar(); + console.log({ + result: _0x30be20, + }); + if (_0x30be20.status) { + return _0x301429.send(_0x30be20.data); + } else { + console.error(_0x30be20.data); + _0x301429.reply( + "*_There's no responce from HEROKU_*, \n please check that you put valid\n _HEROKU_APP_NAME_ & _HEROKU_API_KEY_\n``` See Console to check whats the err```" + ); + } + } catch (_0x27dcbd) { + await _0x301429.error(_0x27dcbd + "\n\ncommand: allvar", _0x27dcbd); + } + } +); +smd( + { + pattern: "newvar", + alias: ["addvar", "avar"], + desc: "To Set Heroku Vars", + category: "tools", + fromMe: true, + filename: __filename, + }, + async (_0x23a9e4, _0x5eb901, { cmdName: _0x5d321d }) => { + try { + if (!_0x5eb901) { + return _0x23a9e4.reply( + "*Use " + (prefix + _0x5d321d) + " CAPTION:Suhail Md*" + ); + } + const _0x6c193a = _0x5eb901.indexOf(":"); + const _0x41a396 = _0x5eb901.slice(0, _0x6c193a).toUpperCase().trim(); + const _0x440f12 = _0x5eb901.slice(_0x6c193a + 1).trim(); + process.env[_0x41a396] = _0x440f12; + updateConfig(); + if (!_0x440f12) { + return msg.reply( + "*Uhh Please, Provide Value After ':' !*\n*Example : " + + (prefix + smd) + + " AUTO_SAVE_STATUS:true*" + ); + } + let _0x451d76 = await heroku.addvar(_0x41a396, _0x440f12); + if (_0x451d76 && _0x451d76.status) { + return _0x23a9e4.reply( + "*" + _0x41a396 + ":* [ " + _0x440f12 + " ] *Added successfully.*" + ); + } else if (!_0x451d76 || !_0x451d76.status) { + console.error(result.data); + await _0x23a9e4.reply( + "*_Can't add " + + _0x5d321d + + " due to error!_*\n\n _please check that you put valid_\n _*HEROKU_APP_NAME* and *HEROKU_API_KEY*_" + ); + } + } catch (_0x5763ff) { + await _0x23a9e4.error(_0x5763ff + "\n\ncommand: " + _0x5d321d, _0x5763ff); + } + } +); +smd( + { + pattern: "getvar", + desc: "To Get A Heroku Var", + category: "tools", + fromMe: true, + filename: __filename, + }, + async (_0x303701, _0x1d8719, { cmdName: _0x4d5fc7 }) => { + try { + if (!_0x1d8719) { + return _0x303701.reply( + "*Please give me Variable Name*\n*Example : " + + (prefix + _0x4d5fc7) + + " CAPTION*" + ); + } + const _0x31c9ad = _0x1d8719.split(" ")[0].toUpperCase(); + let _0x510fef = await heroku.getvar(_0x31c9ad); + if (_0x510fef.status) { + if (_0x510fef.data) { + return _0x303701.reply("*" + _0x31c9ad + " :* " + _0x510fef.data); + } else { + return _0x303701.reply( + "*" + + _0x31c9ad + + "* does not exist in Heroku *" + + appName + + "* app." + ); + } + } else if (!_0x510fef || !_0x510fef.status) { + console.error(result.data); + await _0x303701.reply( + "*_There's no responce from HEROKU_*, \n _please check that you put valid_\n _*HEROKU_APP_NAME* & *HEROKU_API_KEY*_" + ); + } + } catch (_0x3c6608) { + await _0x303701.error(_0x3c6608 + "\n\ncommand: " + _0x4d5fc7, _0x3c6608); + } + } +); +smd( + { + pattern: "setvar", + desc: "To Set Heroku Vars", + category: "tools", + fromMe: true, + filename: __filename, + }, + async (_0xf720ad, _0x4492c1, { smd: _0x14ba4c }) => { + try { + if (!_0x4492c1) { + return _0xf720ad.reply( + "*Uhh dear, Give me variable name*\n*Example : " + + prefix + + "setvar PREFIX:null*" + ); + } + const _0x3adbd0 = _0x4492c1.indexOf(":"); + const _0x495c42 = _0x4492c1.slice(0, _0x3adbd0).toUpperCase().trim(); + const _0xaca022 = _0x4492c1.slice(_0x3adbd0 + 1).trim(); + if (!_0xaca022) { + return msg.reply( + "*Uhh Please, Provide value after ':' !*\n*Example : " + + (prefix + _0x14ba4c) + + " AUTO_READ_STATUS:true*" + ); + } + process.env[_0x495c42] = _0xaca022; + updateConfig(); + let _0x20767c = await heroku.setvar(_0x495c42, _0xaca022); + if (_0x20767c.status) { + await _0xf720ad.reply( + "*" + _0x495c42 + ":* [ " + _0xaca022 + " ] *updated successfully.*" + ); + } else if (!_0x20767c || !_0x20767c.status) { + console.error(_0x20767c.data); + await _0xf720ad.reply(_0x20767c.data); + } + } catch (_0x536b03) { + await _0xf720ad.error(_0x536b03 + "\n\ncommand: " + _0x14ba4c, _0x536b03); + } + } +); diff --git a/plugins/logo.js b/plugins/logo.js new file mode 100644 index 0000000..9c5ec72 --- /dev/null +++ b/plugins/logo.js @@ -0,0 +1,304 @@ +let { smd, textToLogoGenerator, prefix } = require(lib_dir); + +smd( + { + cmdname: "logo1", + type: "logo", + info: "Some text to image feature with various styles.", + filename: __filename, + }, + async (message, match, { cmdName }) => { + try { + if (!match) + return message.reply(`*_Example : ${prefix + cmdName} Asta_*`); + await require(lib_dir).textToLogoGenerator( + message, + "hieu-ung-chu/tao-hieu-ung-chu-mam-anh-sang-74", + match, + "ser", + "1" + ); + } catch (e) { + return await message.error(`${e}\n\ncmdName: ${cmdName}`, e); + } + } +); +smd( + { + cmdname: "logo2", + type: "logo", + info: "Some text to image feature with various styles.", + filename: __filename, + }, + async (message, match, { cmdName }) => { + try { + if (!match) + return message.reply(`*_Example : ${prefix + cmdName} Asta_*`); + return await textToLogoGenerator( + message, + "tao-hieu-ung-chu-digital-glitch-truc-tuyen-941", + match, + "Astro", + "1" + ); + } catch (e) { + return await message.error(`${e}\n\ncmdName: ${cmdName}`, e); + } + } +); +smd( + { + cmdname: "logo3", + type: "logo", + info: "Some text to image feature with various styles.", + filename: __filename, + }, + async (message, match, { cmdName }) => { + try { + if (!match) + return message.reply(`*_Example : ${prefix + cmdName} Asta_*`); + return await textToLogoGenerator( + message, + "tao-hieu-ung-chu-pixel-glitch-truc-tuyen-940", + match, + "Astro", + "1" + ); + } catch (e) { + return await message.error(`${e}\n\ncmdName: ${cmdName}`, e); + } + } +); +smd( + { + cmdname: "logo4", + type: "logo", + info: "Some text to image feature with various styles.", + filename: __filename, + }, + async (message, match, { cmdName }) => { + try { + if (!match) + return message.reply(`*_Example : ${prefix + cmdName} Asta_*`); + return await textToLogoGenerator( + message, + "tao-hieu-ung-chu-graffiti-duong-pho-an-tuong-online-795", + match, + "Astro", + "1" + ); + } catch (e) { + return await message.error(`${e}\n\ncmdName: ${cmdName}`, e); + } + } +); +smd( + { + cmdname: "logo5", + type: "logo", + info: "Some text to image feature with various styles.", + filename: __filename, + }, + async (message, match, { cmdName }) => { + try { + if (!match) + return message.reply(`*_Example : ${prefix + cmdName} Asta_*`); + return await textToLogoGenerator( + message, + "hieu-ung-chu/chu-graffiti-online-mau-8-182", + match, + "Astro", + "1" + ); + } catch (e) { + return await message.error(`${e}\n\ncmdName: ${cmdName}`, e); + } + } +); +smd( + { + cmdname: "logo6", + type: "logo", + info: "Some text to image feature with various styles.", + filename: __filename, + }, + async (message, match, { cmdName }) => { + try { + let text1 = match ? match.split(";")[0] : ""; + let text2 = match ? match.split(";")[1] : ""; + if (!text2 || !text1) + return await message.reply( + `*_Example : ${prefix + cmdName} text1;text2_*` + ); + return await textToLogoGenerator( + message, + "tao-hieu-ung-chu-graffiti-sieu-ngau-online-794", + text1, + text2 + ); + } catch (e) { + return await message.error(`${e}\n\ncmdName: ${cmdName}`, e); + } + } +); +smd( + { + cmdname: "logo7", + type: "logo", + info: "Some text to image feature with various styles.", + filename: __filename, + }, + async (message, match, { cmdName }) => { + try { + //if (!text) return message.reply(`*_Example : ${prefix+cmdName} text1;text2_*`); + let text1 = match ? match.split(";")[0] : ""; + let text2 = match ? match.split(";")[1] : ""; + if (!text1) + return await message.reply(`*_Example : ${prefix + cmdName} text1_*`); + return await textToLogoGenerator( + message, + "hieu-ung-chu/tao-cover-graffiti-online-181", + text1, + text2 || "ser", + "1" + ); + } catch (e) { + return await message.error(`${e}\n\ncmdName: ${cmdName}`, e); + } + } +); +smd( + { + cmdname: "logo8", + type: "logo", + info: "Some text to image feature with various styles.", + filename: __filename, + }, + async (message, match, { cmdName }) => { + try { + let text1 = match ? match.split(";")[0] : ""; + let text2 = match ? match.split(";")[1] : ""; + if (!text2 || !text1) + return await message.reply( + `*_Example : ${prefix + cmdName} text1;text2_*` + ); + await textToLogoGenerator( + message, + "tao-logo-gradient-3d-truc-tuyen-501", + text1, + text2, + "1" + ); + } catch (e) { + return await message.error(`${e}\n\ncmdName: ${cmdName}`, e); + } + } +); +smd( + { + cmdname: "logo9", + type: "logo", + info: "Some text to image feature with various styles.", + filename: __filename, + }, + async (message, match, { cmdName }) => { + try { + let text1 = match ? match.split(";")[0] : ""; + let text2 = match ? match.split(";")[1] : ""; + if (!text2 || !text1) + return await message.reply( + `*_Example : ${prefix + cmdName} text1;text2_*` + ); + await textToLogoGenerator( + message, + "tao-logo-chu-truc-tuyen-499", + text1, + text2, + "1" + ); + } catch (e) { + return await message.error(`${e}\n\ncmdName: ${cmdName}`, e); + } + } +); +smd( + { + cmdname: "logo10", + type: "logo", + info: "Some text to image feature with various styles.", + filename: __filename, + }, + async (message, match, { cmdName }) => { + try { + let text1 = match ? match.split(";")[0] : ""; + let text2 = match ? match.split(";")[1] : ""; + if (!text2 || !text1) + return await message.reply( + `*_Example : ${prefix + cmdName} text1;text2_*` + ); + await textToLogoGenerator( + message, + "tao-logo-phong-cach-pornhub-612", + text1, + text2, + "1" + ); + } catch (e) { + return await message.error(`${e}\n\ncmdName: ${cmdName}`, e); + } + } +); +smd( + { + cmdname: "logo11", + type: "logo", + info: "Some text to image feature with various styles.", + filename: __filename, + }, + async (message, match, { cmdName }) => { + try { + let text1 = match ? match.split(";")[0] : ""; + let text2 = match ? match.split(";")[1] : ""; + if (!text2 || !text1) + return await message.reply( + `*_Example : ${prefix + cmdName} text1;text2_*` + ); + return await textToLogoGenerator( + message, + "tao-logo-3d-phong-cach-avengers-445", + text1, + text2, + "1" + ); + } catch (e) { + return await message.error(`${e}\n\ncmdName: ${cmdName}`, e); + } + } +); +smd( + { + cmdname: "logo12", + type: "logo", + info: "Some text to image feature with various styles.", + filename: __filename, + }, + async (message, match, { cmdName }) => { + try { + let text1 = match ? match.split(";")[0] : ""; + let text2 = match ? match.split(";")[1] : ""; + if (!text2 || !text1) + return await message.reply( + `*_Example : ${prefix + cmdName} text1;text2_*` + ); + return await textToLogoGenerator( + message, + "tao-logo-phong-cach-marvel-419", + text1, + text2, + "1" + ); + } catch (e) { + return await message.error(`${e}\n\ncmdName: ${cmdName}`, e); + } + } +); diff --git a/plugins/misc.js b/plugins/misc.js new file mode 100644 index 0000000..a35646d --- /dev/null +++ b/plugins/misc.js @@ -0,0 +1,208 @@ +let { smd, send, prefix } = require("../lib"); +const axios = require("axios") +smd( + { + pattern: "wabeta", + alias: ["wab"], + desc: "Fetches the latest WhatsApp beta information.", + category: "news", + filename: __filename, + use: "wabeta", + }, + async (message, input) => { + try { + const nimaWabetaInfo = require("nima-wabeta-info"); + + nimaWabetaInfo + .getLatest() + .then((result) => { + const { title, updateFor, date, image, subtitle, link, desc, QandA } = + result.result; + + let output = `*${title}*\n\n`; + output += `*Update For:* ${updateFor.join(", ")}\n`; + output += `*Date:* ${date}\n\n`; + output += `*${subtitle}*\n\n`; + output += `${desc}\n\n`; + output += `*Image:* ${image}\n`; + output += `*Link:* ${link}\n\n`; + + output += "*Q&A:*\n"; + QandA.forEach((qa) => { + output += `\n*Q:* ${qa.question}\n*A:* ${qa.answer}\n`; + }); + + return message.send(output, { quoted: message }); + }) + .catch((error) => { + console.log(error); + message.reply("*Failed to fetch WhatsApp beta information.*"); + }); + } catch (error) { + await message.error( + error + "\n\nCommand: wabeta", + error, + "*Failed to fetch WhatsApp beta information.*" + ); + } + } +); +smd( + { + pattern: "iosnews", + alias: ["ios"], + desc: "Fetches the latest iOS news.", + category: "news", + filename: __filename, + use: "iosnews", + }, + async (message, input) => { + try { + const { IOSNEWS } = require("ios-news"); + + const data = await IOSNEWS(); + + data + .latest() + .then((result) => { + const { title, link, images, desc } = result.result; + + let output = `*${title}*\n\n`; + output += `${desc}\n\n`; + output += `*Link:* ${link}\n\n`; + + if (images && images.length > 0) { + output += "*Images:*\n"; + images.forEach((image) => { + output += `${image}\n`; + }); + output += "\n"; + } + + return message.send(output, { quoted: message }); + }) + .catch((error) => { + console.log(error); + return message.reply("*Failed to fetch iOS news.*"); + }); + } catch (error) { + await message.error( + error + "\n\nCommand: iosnews", + error, + "*Failed to fetch iOS news.*" + ); + } + } +); +smd( + { + pattern: "googlenews", + alias: ["gnews"], + desc: "Fetches the latest Google news.", + category: "news", + filename: __filename, + use: "googlenews", + }, + async (message, input) => { + try { + const { GMSNEWS } = require("gms-mobile-news"); + + const news = await GMSNEWS(); + + news + .latest_news() + .then((result) => { + const { title, date, link, image, short_desc, full_desc } = + result.result; + + let output = `*${title}*\n\n`; + output += `*Date:* ${date}\n\n`; + output += `${short_desc}\n\n`; + output += `*Link:* ${link}\n\n`; + output += `*Image:* ${image}\n\n`; + output += `*Full Description:*\n${full_desc}`; + + return message.send(output, { quoted: message }); + }) + .catch((error) => { + console.log(error); + return message.reply("*Failed to fetch Google news.*"); + }); + } catch (error) { + await message.error( + error + "\n\nCommand: googlenews", + error, + "*Failed to fetch Google news.*" + ); + } + } +); +smd( + { + pattern: "nasa", + desc: "Fetches NASA's Astronomy Picture of the Day.", + category: "news", + filename: __filename, + use: "nasa", + }, + async (message, input) => { + try { + const apiUrl = "https://api.maher-zubair.tech/details/nasa"; + const response = await axios.get(apiUrl); + const data = response.data; + + if (!data || data.status !== 200) { + return await message.reply( + "*Failed to fetch NASA's Astronomy Picture of the Day.*" + ); + } + + const { date, explanation, image, title } = data.result; + + let output = `*${title}*\n\n`; + output += `*Date:* ${date}\n\n`; + output += `${explanation}\n\n`; + output += `*Image:* ${image}`; + + return await message.send(output, { quoted: message }); + } catch (error) { + await message.error( + error + "\n\nCommand: nasa", + error, + "*Failed to fetch NASA's Astronomy Picture of the Day.*" + ); + } + } +); +smd( + { + pattern: "technews", + alias: ["tn"], + desc: "Fetches the latest tech news.", + category: "news", + filename: __filename, + use: "technews", + }, + async (message, input) => { + try { + const apiUrl = "https://api.maher-zubair.tech/details/tnews"; + const response = await axios.get(apiUrl); + const data = response.data; + + if (!data || data.status !== 200) { + return await message.reply("*Failed to fetch tech news.*"); + } + + const { title, link, img, desc } = data.result; + + let output = `*${title}*\n\n`; + output += `${desc}\n\n`; + output += `*Link:* ${link}\n\n`; + output += `*Image:* ${img}`; + + return await message.send(output, { quoted: message }); + } catch (error) { + await message.error(error + "\n\nCommand: technews", error, "*Failed to fetch tech news.*"); + } + } +); \ No newline at end of file diff --git a/plugins/news.js b/plugins/news.js new file mode 100644 index 0000000..6968749 --- /dev/null +++ b/plugins/news.js @@ -0,0 +1,233 @@ +let { smd } = require("../lib"); +const axios = require("axios"); +smd({ pattern: "wabeta", desc: "Fetches the latest WhatsApp beta information.", category: "news", filename: __filename, use: "wabeta", }, async (message, input) => { + try { + const apiUrl = "https://api.maher-zubair.tech/details/wabetainfo"; + const response = await fetch(apiUrl); + const data = await response.json(); + if (!data || data.status !== 200 || !data.result) { + return message.send("*Failed to fetch WhatsApp beta information.*"); + } + const { title, updateFor, date, image, subtitle, link, desc, QandA } = data.result; + let output = `*${title}*\n\n`; + output += `*Update For:* ${updateFor.join(", ")}\n`; + output += `*Date:* ${date}\n\n`; + output += `*${subtitle}*\n\n`; + output += `${desc}\n\n`; + output += `*Image:* ${image}\n`; + output += `*Link:* ${link}\n\n`; + output += "*Q&A:*\n"; + QandA.forEach((qa) => { + output += `\n*Q:* ${qa.question}\n*A:* ${qa.answer}\n`; + }); + return message.send(output, { quoted: message, thumbnail: image }); + } catch (error) { + console.error(error); + return message.error( + error + "\n\nCommand: wabeta", + error, + "*Failed to fetch WhatsApp beta information.*" + ); + } +}); + +smd( + { + pattern: "iosnews", + alias: ["ios"], + desc: "Fetches the latest iOS news.", + category: "news", + filename: __filename, + use: "iosnews", + }, + async (message, input) => { + try { + const apiUrl = "https://api.maher-zubair.tech/details/ios"; + const response = await fetch(apiUrl); + const data = await response.json(); + + if (!data || data.status !== 200 || !data.result) { + return message.send("*Failed to fetch iOS news.*"); + } + + const { title, link, images, desc } = data.result; + + let output = `*${title}*\n\n`; + output += `${desc}\n\n`; + output += `*Link:* ${link}\n\n`; + + if (images && images.length > 0) { + output += "*Images:*\n"; + images.forEach((image) => { + output += `${image}\n`; + }); + output += "\n"; + } + + return message.send(output, { quoted: message, thumbnail: image }); + } catch (error) { + console.error(error); + return message.error( + error + "\n\nCommand: iosnews", + error, + "*Failed to fetch iOS news.*" + ); + } + } +); + +smd( + { + pattern: "googlenews", + alias: ["gnews"], + desc: "Fetches the latest Google news.", + category: "news", + filename: __filename, + use: "googlenews", + }, + async (message, input) => { + try { + const { GMSNEWS } = require("gms-mobile-news"); + + const news = await GMSNEWS(); + + news + .latest_news() + .then((result) => { + const { title, date, link, image, short_desc, full_desc } = + result.result; + + let output = `*${title}*\n\n`; + output += `*Date:* ${date}\n\n`; + output += `${short_desc}\n\n`; + output += `*Link:* ${link}\n\n`; + output += `*Image:* ${image}\n\n`; + output += `*Full Description:*\n${full_desc}`; + + return message.send(output, { quoted: message, thumbnail: image }); + }) + .catch((error) => { + console.log(error); + return message.reply("*Failed to fetch Google news.*"); + }); + } catch (error) { + await message.error( + error + "\n\nCommand: googlenews", + error, + "*Failed to fetch Google news.*" + ); + } + } +); +smd( + { + pattern: "spacenews", + desc: "Fetches articles from the Spaceflight News API.", + category: "news", + filename: __filename, + use: "!spacenews", + }, + async (m) => { + try { + const apiUrl = "https://api.spaceflightnewsapi.net/v4/articles/"; + const response = await fetch(apiUrl); + const data = await response.json(); + + if (!data || !data.results || data.results.length === 0) { + return await m.send( + "*Failed to fetch articles from Spaceflight News API.*" + ); + } + + const article = data.results[0]; + const { title, url, image_url, summary, published_at } = article; + + let output = `*Title:* ${title}\n\n`; + output += `*Summary:* ${summary}\n\n`; + output += `*Published At:* ${published_at}\n\n`; + output += `*LINK:* ${url}`; + + // If image_url is available, add it to the output + /* if (image_url) { + output += `\n\n*Image:* ${image_url}`; + } */ + + await m.send(output, {quoted: m, thumbnail: image_url}); + } catch (e) { + await m.error(`${e}\n\ncommand: spacenews`, e); + } + } +); + +smd( + { + pattern: "technews", + alias: ["tn"], + desc: "Fetches the latest tech news.", + category: "news", + filename: __filename, + use: "technews", + }, + async (message, input) => { + try { + const apiUrl = "https://api.maher-zubair.tech/details/tnews"; + const response = await axios.get(apiUrl); + const data = response.data; + + if (!data || data.status !== 200) { + return await message.reply("*Failed to fetch tech news.*"); + } + + const { title, link, img, desc } = data.result; + + let output = `*${title}*\n\n`; + output += `${desc}\n\n`; + output += `*Link:* ${link}\n\n`; + output += `*Image:* ${img}`; + + return await message.send(output, { quoted: message, thumbnail: img }); + } catch (error) { + await message.error( + error + "\n\nCommand: technews", + error, + "*Failed to fetch tech news.*" + ); + } + } +); +smd( + { + pattern: "population", + desc: "Fetches current population statistics.", + category: "statistics", + filename: __filename, + use: "!population", + }, + async (m) => { + try { + const apiUrl = "https://api.maher-zubair.tech/details/population"; + const response = await fetch(apiUrl); + const data = await response.json(); + + if (!data || data.status !== 200 || !data.result) { + return await m.send("*Failed to fetch population statistics.*"); + } + + const { current, this_year, today } = data.result; + const { total, male, female } = current; + const { births, deaths } = today; + + let output = "*Current Population Statistics*\n\n"; + output += `Total Population: ${total}\n`; + output += `Male: ${male}\n`; + output += `Female: ${female}\n\n`; + output += "*Today's Statistics*\n"; + output += `Births: ${births}\n`; + output += `Deaths: ${deaths}`; + + await m.send(output); + } catch (e) { + await m.error(`${e}\n\ncommand: population`, e); + } + } +); diff --git a/plugins/patch.js b/plugins/patch.js new file mode 100644 index 0000000..b0cf09b --- /dev/null +++ b/plugins/patch.js @@ -0,0 +1,1641 @@ +const os = require("os"); +const fs = require("fs"); +const Config = require("../config"); +const translatte = require("translatte"); +const cron = require("node-cron"); +var cronStart = false; +const DB = require("../lib/scraper"); +const simpleGit = require("simple-git"); +const git = simpleGit(); +const axios = require("axios"); +let { + fancytext, + tlang, + runtime, + formatp, + prefix, + tiny, + smd, + bot, +} = require("../lib"); +const util = require("util"); +const { cmd } = require("../lib/plugins"); +const astro_patch = require("../lib/plugins"); +const events = astro_patch; +const { exec } = require("child_process"); +let s_ser = true; +const long = String.fromCharCode(8206); +const readmore = long.repeat(4001); +const trend_usage = (() => { + const trendNumber = ((min, max) => { + const random = () => Math.random(); + const floor = (x) => Math.floor(x); + const multiply = (a, b) => a * b; + const add = (a, b) => a + b; + const subtract = (a, b) => a - b; + const randomValue = multiply(random(), subtract(max, min + 1)); + const result = add(floor(randomValue), min); + return result; + })(1, 99); + return trendNumber; +})(); + +const database_info = (() => { + const dbNumber = ((min, max) => { + const random = () => Math.random(); + const floor = (x) => Math.floor(x); + const multiply = (a, b) => a * b; + const add = (a, b) => a + b; + const subtract = (a, b) => a - b; + const randomValue = multiply(random(), subtract(max, min + 1)); + const result = add(floor(randomValue), min); + return result; + })(1, 499); + return dbNumber; +})(); +smd({ cmdname: "updatenow", type: "owner", info: "Downloads the entire Git repository from https://github.com/Astropeda/Asta on the root of the app.", fromMe: s_ser, filename: __filename }, async (message) => { + try { + const repoUrl = 'https://github.com/Astropeda/Asta'; + const repoDir = './'; // Current working directory (root of the app) + + await send.message("Downloading Git Repository..."); + + // Clone the repository + const { stdout, stderr } = await exec(`git clone ${repoUrl} ${repoDir}`); + + if (stderr) { + log('Error cloning repository:', stderr); + return await message.send('*Error cloning repository. Please try again later.*'); + } + + log('Repository cloned successfully'); + await message.send('*Git repository downloaded successfully!*'); + } catch (error) { + log('Error downloading repository:', error); + await message.send('*Error downloading repository. Please try again later.*'); + } +}); +smd( + { + cmdname: "update", + type: "owner", + info: "Installs external modules or plugins from a provided URL or a predefined list.", + fromMe: s_ser, + filename: __filename, + use: "", + }, + async (message, args) => { + try { + let pluginNames = []; + let pluginUrls = {}; + let pluginExtensions = {}; + + try { + const { data: response } = await axios.get( + "https://gist.githubusercontent.com/Astropeda/c87ac3fa5ce0017deb8080544de9bd26/raw" + ); + pluginUrls = { + ...(typeof response.external === "object" ? response.external : {}), + ...(typeof response.plugins === "object" ? response.plugins : {}), + }; + pluginNames = response.names; + pluginExtensions = + response.extension && typeof response.extension === "object" + ? response.extension + : {}; + } catch (error) { + pluginUrls = {}; + } + + pluginNames = Array.isArray(pluginNames) ? pluginNames : []; + + if (bot && bot.plugins) { + await send.message("Downloading Update"); + pluginUrls = { ...bot.plugins, ...pluginUrls }; + } + + let url = args ? args : message.quoted ? message.quoted.text : ""; + if (url.toLowerCase().includes("https")) { + try { + const { data: pluginCode } = await axios.get(url); + const pluginName = url.split("/").pop().split(".")[0]; + const pluginFileName = + pluginName + + (pluginExtensions[pluginName] && + /.js|.smd/gi.test(pluginExtensions[pluginName]) + ? pluginExtensions[pluginName] + : ".js"); + const pluginDir = + plugin_dir + + (pluginFileName.includes("/") ? pluginFileName.split("/")[0] : ""); + + if (!fs.existsSync(pluginDir)) { + fs.mkdirSync(pluginDir, { recursive: true }); + } + + fs.writeFileSync(plugin_dir + pluginFileName, pluginCode, "utf8"); + log(" " + pluginName + " ✔️"); + } catch (error) { + log(" " + pluginName + " ❌"); + } + } else if (Object.keys(pluginUrls || {}).length > 0) { + const externalPlugins = pluginUrls; + + for (const pluginName in externalPlugins) { + try { + const pluginUrl = externalPlugins[pluginName].includes("raw") + ? externalPlugins[pluginName] + : externalPlugins[pluginName] + "/raw"; + const { data: pluginCode } = await axios.get(pluginUrl); + + if (pluginCode) { + const pluginFileName = + pluginName + + (pluginExtensions[pluginName] && + /.js|.smd/gi.test(pluginExtensions[pluginName]) + ? pluginExtensions[pluginName] + : ".js"); + const pluginDir = + plugin_dir + + (pluginFileName.includes("/") + ? pluginFileName.split("/")[0] + : ""); + + if (!fs.existsSync(pluginDir)) { + fs.mkdirSync(pluginDir, { recursive: true }); + } + + fs.writeFileSync(plugin_dir + pluginFileName, pluginCode, "utf8"); + + if (!pluginNames.includes(pluginName)) { + log(" " + pluginName + " ✔️"); + } + } + } catch (error) { + if (!pluginNames.includes(pluginName)) { + log(" " + pluginName + " ❌"); + } + } + } + + return await message.send("`ASTA MD UPDATE WAS SUCCESSFULL ✅`"); + } else { + return await message.send( + "*Auto Updated Failed, Unable to Download Update Please Manually Do It*" + ); + } + } catch (error) { + log("❌ ERROR INSTALATION PLUGINS ", error); + } + } +); +astro_patch.smd( + { + cmdname: "menu", + desc: "Help list", + react: "📃", + desc: "To show all avaiable commands.", + type: "user", + filename: __filename, + }, + async (message, input) => { + try { + const { commands } = require("../lib"); + if (input.split(" ")[0]) { + let commandDetails = []; + const foundCommand = commands.find( + (cmd) => cmd.pattern === input.split(" ")[0].toLowerCase() + ); + if (foundCommand) { + commandDetails.push("*🔉Command:* " + foundCommand.pattern); + if (foundCommand.category) { + commandDetails.push("*💁Category:* " + foundCommand.category); + } + if (foundCommand.alias && foundCommand.alias[0]) { + commandDetails.push("*💁Alias:* " + foundCommand.alias.join(", ")); + } + if (foundCommand.desc) { + commandDetails.push("*💁Description:* " + foundCommand.desc); + } + if (foundCommand.use) { + commandDetails.push( + "*〽️Usage:*\n ```" + + prefix + + foundCommand.pattern + + " " + + foundCommand.use + + "```" + ); + } + if (foundCommand.usage) { + commandDetails.push( + "*〽️Usage:*\n ```" + foundCommand.usage + "```" + ); + } + await message.reply(commandDetails.join("\n")); + } + } + + let menuThemeType; + let menuThemeHeader; + let menuThemeFooter; + let menuThemeCategoryHeader; + let menuThemeCategoryFooter; + let menuThemeCommandPrefix; + let menuThemeCommandFooter; + + if (Config.menu === "") { + menuThemeType = Math.floor(Math.random() * 4) + 1; + } + + if ( + menuThemeType === 1 || + Config.menu.trim().startsWith("1") || + Config.menu.toLowerCase().includes("menu1") + ) { + menuThemeHeader = "╭━━━〔 *" + Config.botname + "* 〕━━━┈⊷"; + menuThemeCommandPrefix = "┃✵│"; + menuThemeFooter = "┃✵╰──────────────\n╰━━━━━━━━━━━━━━━┈⊷"; + menuThemeCategoryHeader = "╭─────────────┈⊷\n│「"; + menuThemeCategoryFooter = "」\n╰┬────────────┈⊷"; + menuThemeCommandPrefix = "││◦➛"; + menuThemeCommandFooter = "│╰────────────┈⊷\n╰─────────────┈⊷"; + } else if ( + menuThemeType === 2 || + Config.menu.trim().startsWith("2") || + Config.menu.toLowerCase().includes("menu2") + ) { + menuThemeHeader = + "╭═══ *" + Config.botname + "* ═══⊷\n┃❃╭──────────────"; + menuThemeCommandPrefix = "┃❃│"; + menuThemeFooter = "┃❃╰───────────────\n╰═════════════════⊷"; + menuThemeCategoryHeader = "╭─❏"; + menuThemeCategoryFooter = "❏"; + menuThemeCommandPrefix = "┃❃│"; + menuThemeCommandFooter = "┃❃╰───────────────\n╰═════════════════⊷"; + } else { + menuThemeHeader = "╭〘 " + Config.botname + " 〙"; + menuThemeCommandPrefix = "│ │"; + menuThemeFooter = "╰═══════════════⊷"; + menuThemeCategoryHeader = "╭─❍"; + menuThemeCategoryFooter = "══⊷❍"; + menuThemeCommandPrefix = "│"; + menuThemeCommandFooter = "╰════════════─⊷"; + } + + const categorizedCommands = {}; + commands.map(async (command) => { + if ( + command.dontAddCommandList === false && + command.pattern !== undefined + ) { + if (!categorizedCommands[command.category]) { + categorizedCommands[command.category] = []; + } + categorizedCommands[command.category].push(command.pattern); + } + }); + + const currentTime = message.time; + const currentDate = message.date; + let menuText = ` +${menuThemeHeader} +${menuThemeCommandPrefix} *ᴏᴡɴᴇʀ:* ${Config.ownername} +${menuThemeCommandPrefix} *ᴜᴘᴛɪᴍᴇ:* ${runtime(process.uptime())} +${menuThemeCommandPrefix} *ʀᴀᴍ ᴜsᴀɢᴇ:* ${formatp(os.totalmem() - os.freemem())} +${menuThemeCommandPrefix} *ᴛɪᴍᴇ:* ${currentTime} +${menuThemeCommandPrefix} *ᴅᴀᴛᴇ:* ${currentDate} +${menuThemeCommandPrefix} *ᴄᴏᴍᴍᴀɴᴅs:* ${commands.length} +${menuThemeCommandPrefix} *ᴜsᴀɢᴇ ᴛʀᴇɴᴅ:* ${trend_usage} +${menuThemeCommandPrefix} *ᴅᴀᴛᴀʙᴀsᴇ:* ${database_info} +${menuThemeFooter} +*ᴀsᴛᴀ ᴘᴀᴛᴄʜ 𝟸.𝟶.𝟶* +${readmore}`; + + for (const category in categorizedCommands) { + menuText += ` + ${menuThemeCategoryHeader} *${tiny( + category + )}* ${menuThemeCategoryFooter}\n`; + if (input.toLowerCase() === category.toLowerCase()) { + menuText = `${menuThemeCategoryHeader} *${tiny( + category + )}* ${menuThemeCategoryFooter}\n`; + for (const command of categorizedCommands[category]) { + menuText += `${menuThemeCommandPrefix} ${Config.HANDLERS} ${tiny( + command, + 1 + )}\n`; + } + menuText += `${menuThemeCommandFooter}\n`; + break; + } else { + for (const command of categorizedCommands[category]) { + menuText += `${menuThemeCommandPrefix} ${Config.HANDLERS} ${tiny( + command, + 1 + )}\n`; + } + menuText += `${menuThemeCommandFooter}\n`; + } + } + menuText += Config.caption; + + const messageOptions = { + caption: menuText, + ephemeralExpiration: 30, + }; + return await message.sendUi(message.chat, messageOptions, message); + } catch (error) { + await message.error(error + "\nCommand: menu", error); + } + } +); +smd( + { + pattern: "menus", + type: "MENU list", + info: "user", + dontAddCommandList: true, + }, + async (_0x22514a) => { + try { + let _0x20ed34 = ( + "\n*➮ᴜᴘ ᴛɪᴍᴇ :* " + + runtime(process.uptime()) + + "\n*➮ᴛᴏᴅᴀʏ ɪs :* " + + _0x22514a.date + + "\n*➮ɴᴏᴡ ᴛɪᴍᴇ :* " + + _0x22514a.time + + "\n\n➮Fᴏᴜɴᴅᴇʀ- Astropeda Team\n➮Oᴡɴᴇʀ - " + + Config.ownername + + "\n➮Nᴜᴍ - " + + owner.split(",")[0] + + "\n➮Mᴇᴍᴏ - " + + formatp(os.totalmem() - os.freemem()) + + "/" + + formatp(os.totalmem()) + + "\n\n *🧑‍💻 :* ᴀsᴛᴀ ᴍᴅ ɪꜱ ɴᴏᴡ Aᴠᴀɪʟᴀʙʟᴇ\n\n" + + readmore + + "\n╭──❰ *ALL MENU* ❱\n│🏮 Lɪꜱᴛ\n│🏮 Cᴀᴛᴇɢᴏʀʏ\n│🏮 Hᴇʟᴘ\n│🏮 Aʟɪᴠᴇ\n│🏮 Uᴘᴛɪᴍᴇ\n│🏮 Wᴇᴀᴛʜᴇʀ\n│🏮 Lɪɴᴋ\n│🏮 Cᴘᴜ\n│🏮 Rᴇᴘᴏꜱɪᴛᴏʀʏ\n╰─────────────⦁" + ).trim(); + return await _0x22514a.bot.sendUi(_0x22514a.from, { + caption: _0x20ed34, + }); + } catch (_0x450fce) { + await _0x22514a.error(_0x450fce + "\nCommand:menus", _0x450fce); + } + } +); +astro_patch.cmd( + { + pattern: "setcmd", + desc: "To check ping", + category: "user", + fromMe: true, + filename: __filename, + }, + async (_0x5d887, _0x291296, { Void: _0x43ee74 }) => { + try { + if (!_0x291296) { + return await _0x5d887.send( + "*_Please provide cmd name by replying a Sticker_*" + ); + } + let _0x584a9e = _0x291296.split(","); + var _0x5b0dfd; + var _0x3be11d; + let _0x17bd8a = false; + if (_0x5d887.quoted) { + let _0x1f29ea = _0x5d887.quoted.mtype; + if (_0x1f29ea == "stickerMessage" && _0x291296) { + _0x17bd8a = true; + _0x5b0dfd = _0x291296.split(" ")[0]; + _0x3be11d = "sticker-" + _0x5d887.quoted.msg.fileSha256; + } + } + if (!_0x17bd8a && _0x584a9e.length > 1) { + _0x3be11d = _0x584a9e[0].trim().toLowerCase(); + _0x5b0dfd = _0x584a9e[1].trim().toLowerCase(); + } else if (!_0x17bd8a) { + return await _0x5d887.send( + "*_Uhh Dear, Give Cmd With New Name_*\n*Eg: _.setcmd New_Name, Cmd_Name_*" + ); + } + if (_0x3be11d.length < 1) { + return await _0x5d887.reply( + "*_Uhh Please, Provide New_Cmd Name First_*" + ); + } + if (global.setCmdAlias[_0x3be11d]) { + return await _0x5d887.send( + '*_"' + + (_0x17bd8a ? "Given Sticker" : _0x3be11d) + + '" Already set for "' + + global.setCmdAlias[_0x3be11d] + + '" Cmd, Please try another ' + + (_0x17bd8a ? "Sticker" : "Name") + + "_*" + ); + } + const _0x8e739e = + astro_patch.commands.find( + (_0xd9686c) => _0xd9686c.pattern === _0x5b0dfd + ) || + astro_patch.commands.find( + (_0x31fef3) => _0x31fef3.alias && _0x31fef3.alias.includes(_0x5b0dfd) + ); + if (_0x8e739e) { + global.setCmdAlias[_0x3be11d] = _0x8e739e.pattern; + return await _0x5d887.send( + '*_Cmd "' + + global.setCmdAlias[_0x3be11d] + + '" Succesfully set to "' + + (_0x17bd8a ? "Sticker" : _0x3be11d) + + '"._*\n*_These all names are reset, If bot restart_*' + ); + } else { + return await _0x5d887.send( + "*_Provided Cmd( " + + _0x5b0dfd + + ") not found in bot cmds. Please Provide Valid cmd Name_*" + ); + } + } catch (_0x13e052) { + await _0x5d887.error(_0x13e052 + "\nCommand:setcmd", _0x13e052); + } + } +); +astro_patch.cmd( + { + pattern: "delcmd", + desc: "To check ping", + category: "user", + fromMe: true, + filename: __filename, + }, + async (_0xcfb3ed, _0x5c72db, { Void: _0x5c00fc }) => { + try { + let _0xf7499f = _0x5c72db + ? _0x5c72db.split(" ")[0].trim().toLowerCase() + : ""; + let _0x5dd184 = false; + if (_0xcfb3ed.quoted) { + if (_0xcfb3ed.quoted.mtype == "stickerMessage") { + _0x5dd184 = true; + _0xf7499f = "sticker-" + _0xcfb3ed.quoted.msg.fileSha256; + } else if (!_0x5c72db) { + return await _0xcfb3ed.send( + "*_Please reply to a Sticker that set for a Cmd_*" + ); + } + } else if (!_0x5c72db) { + return await _0xcfb3ed.send( + "*_Uhh Dear, provide Name that set to a cmd_*\n*Eg: _.delcmd Cmd_Name_*" + ); + } + if (global.setCmdAlias[_0xf7499f]) { + await _0xcfb3ed.send( + '*_"' + + (_0x5dd184 ? "Given Sticker" : _0xf7499f) + + '" deleted Succesfully at "' + + global.setCmdAlias[_0xf7499f] + + '" cmd_*' + ); + delete global.setCmdAlias[_0xf7499f]; + return; + } else { + return await _0xcfb3ed.send( + '*_"' + + (_0x5dd184 ? "Given Sticker" : _0xf7499f) + + '" not Set for any cmd._*\n *_Please Provide Valid ' + + (_0x5dd184 ? "Sticker" : "cmd Name") + + " to delete_*" + ); + } + } catch (_0x2252fb) { + await _0xcfb3ed.error(_0x2252fb + "\nCommand:delcmd", _0x2252fb); + } + } +); +astro_patch.smd( + { + pattern: "ping", + desc: "To check ping", + category: "user", + filename: __filename, + }, + async (context) => { + const startTime = new Date().getTime(); + const { key: messageKey } = await context.reply("*𝖕𝖎𝖓𝖌𝖎𝖓𝖌...*"); + const endTime = new Date().getTime(); + const pingTime = endTime - startTime; + await context.send( + `*ʟᴀᴛᴇɴᴄʏ: ${pingTime} ᴍs*`, + { edit: messageKey }, + "", + context + ); + } +); +smd( + { + pattern: "alive", + desc: "Shows system status with different designs.", + category: "general", + filename: __filename, + use: "alive", + }, + async (message, input) => { + try { + const start = new Date().getTime(); + const designs = [ + async () => { + const imageBuffer = await axios.get( + "https://i.imgur.com/z20pSwu.jpeg", + { + responseType: "arraybuffer", + } + ); + + const quoteResponse = await axios.get( + "https://api.maher-zubair.tech/misc/quote" + ); + const quote = quoteResponse.data; + if (!quote || quote.status !== 200) { + return await message.reply("*Failed to fetch a quote.*"); + } + + const quoteText = `\n\n*"${quote.result.body}"*\n_- ${quote.result.author}_`; + const end = new Date().getTime(); + const pingSeconds = (end - start) / 1000; + const captionText = `ᴀsᴛᴀ ᴍᴅ 𝟸.𝟶.𝟶 ᴘᴀᴛᴄʜ\n\n*Ping:* ${pingSeconds} seconds${quoteText}\n\nᴀsᴛᴀ ᴍᴅ`; + + return { image: imageBuffer.data, caption: captionText }; + }, + async () => { + const imageBuffer = await axios.get( + "https://i.imgur.com/lIo3cM2.jpeg", + { + responseType: "arraybuffer", + } + ); + + const factResponse = await axios.get( + "https://api.maher-zubair.tech/misc/fact" + ); + const fact = factResponse.data; + if (!fact || fact.status !== 200) { + return await message.reply("*Failed to fetch a fact.*"); + } + + const end = new Date().getTime(); + const pingSeconds = (end - start) / 1000; + const captionText = `ᴀsᴛᴀ ᴍᴅ 𝟸.𝟶.𝟶 ᴘᴀᴛᴄʜ\n\n*Ping:* ${pingSeconds} seconds\n\n*Fact:*\n${fact.result.fact}\n\nᴀsᴛᴀ ᴍᴅ`; + + return { image: imageBuffer.data, caption: captionText }; + }, + async () => { + const imageBuffer = await axios.get( + "https://i.imgur.com/OQOH4Gn.jpeg", + { + responseType: "arraybuffer", + } + ); + + const lineResponse = await axios.get( + "https://api.maher-zubair.tech/misc/lines" + ); + const line = lineResponse.data; + if (!line || line.status !== 200) { + return await message.reply("*Failed to fetch a line.*"); + } + + const end = new Date().getTime(); + const pingSeconds = (end - start) / 1000; + const captionText = `ᴀsᴛᴀ ᴍᴅ 𝟸.𝟶.𝟶 ᴘᴀᴛᴄʜ\n\n*Ping:* ${pingSeconds} seconds\n\n*Line:*\n${line.result}\n\nᴀsᴛᴀ ᴍᴅ`; + + return { image: imageBuffer.data, caption: captionText }; + }, + ]; + + const randomDesign = designs[Math.floor(Math.random() * designs.length)]; + const messageData = await randomDesign(); + + const message_options = { + quoted: message, + contextInfo: { + forwardingScore: 999, + isForwarded: true, + }, + }; + + return await message.bot.sendMessage( + message.chat, + messageData, + message_options + ); + } catch (error) { + await message.error( + error + "\n\nCommand: alive", + error, + "*Failed to show status.*" + ); + } + } +); +smd( + { + pattern: "runtime", + desc: "Show the uptime, RAM usage, and CPU name of the process.", + category: "general", + filename: __filename, + }, + async (m) => { + try { + const uptime = process.uptime(); + const uptimeHours = Math.floor(uptime / 3600); + const uptimeMinutes = Math.floor((uptime % 3600) / 60); + const uptimeSeconds = Math.floor(uptime % 60); + + const ramUsage = process.memoryUsage().heapTotal / 1024 / 1024; + + const cpuName = process.cpuData ? process.cpuData.modelName : "Unknown"; + + const message = `*Asta MD Running Since:*\n\n*Uptime:* ${uptimeHours}h ${uptimeMinutes}m ${uptimeSeconds}s\n*RAM Usage:* ${ramUsage.toFixed(2)} MB\n*CPU Name:* ${cpuName}`; + + const button = [ + { + buttonId: "ok", + buttonText: { displayText: "OK" }, + type: 1, + }, + ]; + + const contextInfo = { + isForwarded: true, + forwardingScore: 999, + title: "Asta MD Running Since", + body: message, + footerText: "Asta MD 2024", + isSendNotificationMsg: true, + mentionedJid: [], + buttons: button, + }; + + await m.bot.sendMessage(m.chat, { text: message, contextInfo }, { quoted: null }); + } catch (e) { + await m.error(`${e}\n\ncommand: runtime`, e); + } + } +); +astro_patch.cmd( + { + pattern: "list", + desc: "list menu", + category: "user", + react: "🥀", + }, + async (_0x1d5ddc) => { + try { + const { commands: _0x7cfe13 } = require("../lib"); + for (let _0x2bd72c = 0; _0x2bd72c < _0x7cfe13.length; _0x2bd72c++) { + if (_0x7cfe13[_0x2bd72c].pattern == undefined) { + continue; + } + _0x95885d += + "*" + + (_0x2bd72c + 1) + + " " + + fancytext(_0x7cfe13[_0x2bd72c].pattern, 1) + + "*\n"; + _0x95885d += " " + fancytext(_0x7cfe13[_0x2bd72c].desc, 1) + "\n"; + } + return await _0x1d5ddc.sendUi(_0x1d5ddc.chat, { + caption: _0x95885d + Config.caption, + }); + } catch (_0x3e730d) { + await _0x1d5ddc.error(_0x3e730d + "\nCommand:list", _0x3e730d); + } + } +); +astro_patch.smd( + { + pattern: "owner", + desc: "To check ping", + category: "user", + filename: __filename, + }, + async (_0x563719) => { + try { + const _0x389599 = + "BEGIN:VCARD\nVERSION:3.0\nFN:" + + Config.ownername + + "\nORG:;\nTEL;type=CELL;type=VOICE;waid=" + + global.owner?.split(",")[0] + + ":+" + + global.owner?.split(",")[0] + + "\nEND:VCARD"; + let _0x140248 = { + contacts: { + displayName: Config.ownername, + contacts: [ + { + vcard: _0x389599, + }, + ], + }, + contextInfo: { + externalAdReply: { + title: Config.ownername, + body: "Touch here.", + renderLargerThumbnail: true, + thumbnailUrl: "", + thumbnail: log0, + mediaType: 1, + mediaUrl: "", + sourceUrl: + "https://wa.me/+" + + global.owner?.split(",")[0] + + "?text=Hii+" + + Config.ownername, + }, + }, + }; + return await _0x563719.sendMessage(_0x563719.jid, _0x140248, { + quoted: _0x563719, + }); + } catch (_0x26ce8b) { + await _0x563719.error(_0x26ce8b + "\nCommand:owner", _0x26ce8b); + } + } +); +astro_patch.cmd( + { + pattern: "trt", + alias: ["translate"], + category: "user", + filename: __filename, + use: "< text >", + desc: "Translate's given text in desird language.", + }, + async (_0x15cc76, _0xa38a39) => { + try { + let _0x4b3f03 = _0xa38a39 ? _0xa38a39.split(" ")[0].toLowerCase() : "en"; + if (!_0x15cc76.reply_text) { + var _0x5eb566 = _0xa38a39.replace(_0x4b3f03, "")?.trim() || false; + } else { + var _0x5eb566 = _0x15cc76.reply_text; + } + if (!_0x5eb566) { + return await _0x15cc76.reply( + "*Please Give Me Text. Example: _" + prefix + "trt en Who are you_*" + ); + } + var _0x443df8 = await translatte(_0x5eb566, { + from: "auto", + to: _0x4b3f03, + }); + if ("text" in _0x443df8) { + return await _0x15cc76.reply(_0x443df8.text); + } + } catch (_0xfe5ca7) { + await _0x15cc76.error(_0xfe5ca7 + "\n\ncommand trt", _0xfe5ca7); + } + } +); +const readDirectory = (_0x2ccc1f) => { + return new Promise((_0x23d4da, _0x41ae43) => { + fs.readdir(_0x2ccc1f, (_0x4adeb4, _0x1ec69) => { + if (_0x4adeb4) { + _0x41ae43("Error reading directory"); + } else { + _0x23d4da(_0x1ec69); + } + }); + }); +}; +astro_patch.cmd( + { + pattern: "file", + desc: "to get extact name where that command is in repo.\nSo user can edit that.", + category: "user", + fromMe: true, + filename: __filename, + }, + async (_0x1ec907, _0x3f7dbe) => { + try { + if (!_0x3f7dbe) { + return _0x1ec907.reply("*Uhh PLease, Provide A Command/Directory*"); + } + if (_0x3f7dbe.startsWith(".")) { + let _0x4680aa = "*------------- FILE MANAGER -------------*\n"; + try { + const _0x297689 = await readDirectory(_0x3f7dbe); + _0x297689.forEach((_0x1709d6) => { + _0x4680aa += _0x1709d6 + "\n"; + }); + await _0x1ec907.reply(_0x4680aa.toString()); + } catch (_0x311055) { + _0x1ec907.reply(_0x311055); + } + return; + } + const { commands: _0x4f7532 } = require("../lib"); + let _0x2c8ec8 = []; + let _0x4984d5 = _0x3f7dbe.split(" ")[0].toLowerCase().trim(); + let _0x1df566 = + events.commands.find((_0x3d28be) => _0x3d28be.pattern === _0x4984d5) || + events.commands.find( + (_0x14526a) => _0x14526a.alias && _0x14526a.alias.includes(_0x4984d5) + ); + if (!_0x1df566) { + return await _0x1ec907.reply("*❌No Such commands.*"); + } + _0x2c8ec8.push("*🍁Command:* " + _0x1df566.pattern); + if (_0x1df566.category) { + _0x2c8ec8.push("*🧩Type:* " + _0x1df566.category); + } + if (_0x1df566.alias && _0x1df566.alias[0]) { + _0x2c8ec8.push("*🧩Alias:* " + _0x1df566.alias.join(", ")); + } + if (_0x1df566.desc) { + _0x2c8ec8.push("*✨Description:* " + _0x1df566.desc); + } + if (_0x1df566.use) { + _0x2c8ec8.push( + "*〽️Usa:*\n ```" + + prefix + + _0x1df566.pattern + + " " + + _0x1df566.use + + "```" + ); + } + if (_0x1df566.usage) { + _0x2c8ec8.push("*〽️Usage:*\n ```" + _0x1df566.usage + "```"); + } + if (_0x1df566.filename) { + _0x2c8ec8.push("*✨FileName:* " + _0x1df566.filename); + } + try { + if ( + _0x3f7dbe.includes("function") && + _0x1df566.function && + _0x1ec907.isSuhail && + _0x1df566.pattern !== "file" + ) { + _0x2c8ec8.push("*🧩Function:* " + _0x1df566.function.toString()); + } + } catch {} + await _0x1ec907.reply(_0x2c8ec8.join("\n")); + } catch (_0xe61d1f) { + await _0x1ec907.error(_0xe61d1f + "\nCommand:file", _0xe61d1f); + } + } +); +astro_patch.cmd( + { + pattern: "eval", + alias: ["$"], + category: "owner", + filename: __filename, + fromMe: true, + desc: "Runs js code on node server.", + use: "< run code >", + dontAddCommandList: true, + }, + async ( + _0x5a9ab6, + _0x3b225e, + { isCreator: _0x5aa140, cmdName: _0x83bdbc, Void: _0x4d5314 } + ) => { + try { + if (!_0x3b225e) { + return _0x5a9ab6.reply("*Provide A Query To Run Master*"); + } + let _0x1cffc8 = eval("const a = async()=>{\n" + _0x3b225e + "\n}\na()"); + if (typeof _0x1cffc8 === "object") { + await _0x5a9ab6.reply(JSON.stringify(_0x1cffc8)); + } else { + await _0x5a9ab6.reply(_0x1cffc8.toString()); + } + } catch (_0x1fb40e) { + return await _0x5a9ab6.reply(_0x1fb40e.toString()); + } + } +); +astro_patch.cmd( + { + pattern: "shell", + category: "owner", + filename: __filename, + fromMe: true, + desc: "Runs command in Heroku(server) shell.", + use: "", + dontAddCommandList: true, + }, + async (_0x32b2cc, _0x4c791b) => { + try { + if (!_0x32b2cc.isCreator) { + return _0x32b2cc.reply(tlang().owner); + } + if (!_0x4c791b) { + return _0x32b2cc.reply("*Uhh PLease, Provide A Command to Run Heroku*"); + } + exec(_0x4c791b, (_0x44a722, _0x2688ce) => { + if (_0x44a722) { + return _0x32b2cc.reply( + "----" + tlang().title + "----\n\n" + _0x44a722 + ); + } + if (_0x2688ce) { + return _0x32b2cc.reply( + "----" + tlang().title + "----\n\n" + _0x2688ce + ); + } + }); + } catch (_0x2b0925) { + await _0x32b2cc.error(_0x2b0925 + "\n\ncommand shell", _0x2b0925); + } + } +); +function _0x213c(_0x345a66, _0x1f74b8) { + const _0x593b05 = _0x593b(); + _0x213c = function (_0x213cbe, _0x58c23c) { + _0x213cbe = _0x213cbe - 353; + let _0x3d37ed = _0x593b05[_0x213cbe]; + return _0x3d37ed; + }; + return _0x213c(_0x345a66, _0x1f74b8); +} +function _0x593b() { + const _0x579036 = [ + "6522QmnZgz", + "readdir", + "toFixed", + "unlink", + "*/15 * * * *", + "category", + "reply_message", + "trim", + "startsWith", + "COMMANDS*", + "forEach", + "```\n\n", + "toLowerCase", + "help", + "```", + "57304VUSDcZ", + "276864ouXpfJ", + "7659558aRJrDI", + "66413FlbkYf", + "from", + "includes", + "sendUi", + "28JDktra", + "isPublic", + "desc", + "length", + "replace", + "use", + "dontAddCommandList", + "\n*🧩Info:* ```", + "schedule", + "_COMMANDS* \n┗━━━━━━━━━━━━━━━━━━━━━━━\n\n\n", + "text", + "┏━━━━━━━━━━━━━━━━━━━━━━━\n┃\t*ASTA-MD_", + "2716190HSgAcg", + "info", + "endsWith", + "find", + "send", + "1072iiXGaj", + "pattern", + "split", + "../lib", + "toUpperCase", + "MENU*", + "19523750lqZXVD", + "ERROR : ", + "826LaJjSA", + ]; + _0x593b = function () { + return _0x579036; + }; + return _0x593b(); +} +(function (_0x58691b, _0x4712be) { + const _0x49221f = _0x213c; + const _0x3831e3 = _0x58691b(); + while (true) { + try { + const _0x27411c = + (parseInt(_0x49221f(360)) / 1) * (parseInt(_0x49221f(364)) / 2) + + (-parseInt(_0x49221f(390)) / 3) * (-parseInt(_0x49221f(381)) / 4) + + -parseInt(_0x49221f(376)) / 5 + + -parseInt(_0x49221f(358)) / 6 + + (parseInt(_0x49221f(389)) / 7) * (parseInt(_0x49221f(357)) / 8) + + parseInt(_0x49221f(359)) / 9 + + -parseInt(_0x49221f(387)) / 10; + if (_0x27411c === _0x4712be) { + break; + } else { + _0x3831e3.push(_0x3831e3.shift()); + } + } catch (_0x41bdec) { + _0x3831e3.push(_0x3831e3.shift()); + } + } +})(_0x593b, 666953); +smd( + { + on: "text", + }, + async ( + _0x460b55, + _0x2fcc6c, + { + mek: _0x376ae1, + body: _0x6c25b0, + args: _0x213257, + botNumber: _0x615ced, + isCreator: _0x44cb69, + icmd: _0x52773f, + store: _0x1d9a76, + budy: _0x1e9bcf, + Suhail: _0x6ee677, + Void: _0x43102c, + proto: _0x5f14ef, + } + ) => { + const _0x210c92 = _0x213c; + try { + if (!cronStart) { + cron[_0x210c92(372)](_0x210c92(394), () => { + const _0x529045 = _0x210c92; + cronStart = true; + fs[_0x529045(391)]("./temp", (_0x13ab05, _0x5b39ed) => { + const _0x57a393 = _0x529045; + if (_0x13ab05) { + return; + } + _0x5b39ed[_0x57a393(400)]((_0x630e8) => { + const _0x2da99b = _0x57a393; + try { + fs[_0x2da99b(393)]("./temp/" + _0x630e8); + } catch {} + }); + }); + }); + } + if ( + !_0x460b55.reply_message || + !_0x2fcc6c || + !_0x460b55[_0x210c92(365)] + ) { + return; + } + const _0x1eb88a = _0x460b55[_0x210c92(396)][_0x210c92(374)].split("\n"); + let _0x56b5d3 = parseInt(_0x2fcc6c[_0x210c92(383)](" ")[0]); + if (!isNaN(_0x56b5d3)) { + if ( + _0x1eb88a[_0x210c92(367)] > 30 && + _0x1eb88a[1][_0x210c92(362)]("ASTA-MD_FANCY_TEXT") + ) { + var _0x7b7a13 = _0x1eb88a[_0x210c92(379)]((_0x4377cc) => + _0x4377cc.startsWith(_0x56b5d3 + " ") + ); + try { + if (_0x7b7a13) { + await _0x460b55[_0x210c92(380)]( + _0x7b7a13[_0x210c92(368)]("" + _0x56b5d3, "")[_0x210c92(397)](), + {}, + "", + _0x460b55 + ); + } else { + (""); + } + } catch {} + } + } + let _0x245187 = parseFloat(_0x2fcc6c.split(" ")[0]); + if (isNaN(_0x245187)) { + return; + } + let _0x5b0909 = _0x245187[_0x210c92(392)](1); + var _0x42e09a = _0x1eb88a[_0x210c92(379)]((_0x34ef22) => + _0x34ef22[_0x210c92(398)]("*" + _0x5b0909 + " ") + ); + if ( + _0x42e09a && + (_0x42e09a[_0x210c92(378)](_0x210c92(399)) || + _0x42e09a[_0x210c92(378)](_0x210c92(386))) + ) { + var _0x56c097 = _0x42e09a + .replace("*" + _0x5b0909, "") + [_0x210c92(368)]("|", "") + [_0x210c92(368)](/COMMANDS\*/gi, "") + [_0x210c92(368)](/MENU\*/gi, "") + [_0x210c92(354)](); + if (_0x56c097[_0x210c92(367)] > 0 && _0x56c097[_0x210c92(367)] < 20) { + const { commands: _0x4f16cc } = require(_0x210c92(384)); + const _0x59e793 = {}; + _0x4f16cc[_0x210c92(400)]((_0xc3d8cc) => { + const _0x20ed1a = _0x210c92; + if (!_0xc3d8cc[_0x20ed1a(370)] && _0xc3d8cc.pattern !== undefined) { + if (!_0x59e793[_0xc3d8cc[_0x20ed1a(395)]]) { + _0x59e793[_0xc3d8cc.category] = []; + } + _0x59e793[_0xc3d8cc[_0x20ed1a(395)]].push({ + command: _0xc3d8cc.pattern, + info: _0xc3d8cc[_0x20ed1a(366)], + help: + prefix + + _0xc3d8cc[_0x20ed1a(382)] + + " " + + (_0xc3d8cc[_0x20ed1a(369)] ? _0xc3d8cc[_0x20ed1a(369)] : ""), + }); + } + }); + let _0x5cca14 = false; + for (const _0x1af79d in _0x59e793) { + let _0x37f2ac = "" + _0x1af79d.toLowerCase(); + if (_0x56c097.includes(_0x37f2ac)) { + _0x5cca14 = + _0x210c92(375) + _0x1af79d[_0x210c92(385)]() + _0x210c92(373); + _0x59e793[_0x1af79d][_0x210c92(400)]((_0xf574fc) => { + const _0x4231a3 = _0x210c92; + _0x5cca14 += + "*🍁Command:* ```" + + _0xf574fc.command + + "``` " + + (_0xf574fc[_0x4231a3(377)] + ? _0x4231a3(371) + + _0xf574fc[_0x4231a3(377)] + + _0x4231a3(356) + : "") + + "\n*〽️Help:* ```" + + _0xf574fc[_0x4231a3(355)] + + _0x4231a3(353); + }); + _0x5cca14 += "\n\n" + Config.caption; + break; + } + } + if (_0x5cca14) { + return await _0x460b55[_0x210c92(363)](_0x460b55[_0x210c92(361)], { + caption: _0x5cca14, + }); + } + } + } + } catch (_0x3e9a32) { + console.log(_0x210c92(388), _0x3e9a32); + } + } +); +/**MASTER */ +smd( + { + on: "text", + }, + async (msg, _text, { budy, Void }) => { + const _0xd6a12a = _0x1571; + function _0x2edb() { + const _0x667561 = [ + "62454JBmitF", + "react", + "isCreator", + "reply", + "Provide me with a query to run Master!", + "2618667xpRQLH", + "2022148AUDBwx", + "text", + "1398Krkwgm", + "15pWevhh", + "format", + "log", + "16457KBRIAc", + "20604213meAmhj", + "slice", + "includes", + "chat", + "\n}\na()", + "6414720cwIFyR", + "1471072FUlQDN", + "ERROR FROM RUNNING QUERY WITH MASTER $\n", + ]; + _0x2edb = function () { + return _0x667561; + }; + return _0x2edb(); + } + (function (_0x3e0222, _0xfa3e8a) { + const _0xe793f5 = _0x1571; + const _0x1a4f58 = _0x3e0222(); + while (true) { + try { + const _0xf50973 = + -parseInt(_0xe793f5(460)) / 1 + + -parseInt(_0xe793f5(466)) / 2 + + parseInt(_0xe793f5(465)) / 3 + + (-parseInt(_0xe793f5(458)) / 4) * (parseInt(_0xe793f5(469)) / 5) + + (-parseInt(_0xe793f5(468)) / 6) * (-parseInt(_0xe793f5(472)) / 7) + + -parseInt(_0xe793f5(457)) / 8 + + parseInt(_0xe793f5(473)) / 9; + if (_0xf50973 === _0xfa3e8a) { + break; + } else { + _0x1a4f58.push(_0x1a4f58.shift()); + } + } catch (_0x556c40) { + _0x1a4f58.push(_0x1a4f58.shift()); + } + } + })(_0x2edb, 731357); + let citel = msg; + function _0x1571(_0x262039, _0x151011) { + const _0x2edb64 = _0x2edb(); + _0x1571 = function (_0x15719d, _0x45ddb3) { + _0x15719d = _0x15719d - 455; + let _0x347d5c = _0x2edb64[_0x15719d]; + return _0x347d5c; + }; + return _0x1571(_0x262039, _0x151011); + } + const { send, reply, react, sendMessage } = msg; + if (msg[_0xd6a12a(462)]) { + if ( + !Config.HANDLERS[_0xd6a12a(475)](">") && + citel[_0xd6a12a(467)].startsWith(">") + ) { + let code = budy[_0xd6a12a(474)](1); + if (!code) { + return citel[_0xd6a12a(463)](_0xd6a12a(464)); + } + try { + let resultTest = eval(code); + if (resultTest) { + return citel[_0xd6a12a(463)](util[_0xd6a12a(470)](resultTest)); + } + } catch (_0x75dc0b) { + return citel[_0xd6a12a(463)](util[_0xd6a12a(470)](_0x75dc0b)); + } + } else if ( + !Config.HANDLERS[_0xd6a12a(475)]("$") && + citel[_0xd6a12a(467)].startsWith("$") + ) { + let code = budy[_0xd6a12a(474)](1); + if (!code) { + return citel[_0xd6a12a(463)](_0xd6a12a(464)); + } + try { + let resultTest = await eval( + "const a = async()=>{\n" + code + _0xd6a12a(456) + ); + await citel[_0xd6a12a(461)]("🍁"); + if (resultTest) { + return await citel.reply(util[_0xd6a12a(470)](resultTest)); + } + } catch (_0x467251) { + console[_0xd6a12a(471)](_0xd6a12a(459), _0x467251); + return await citel.reply(util[_0xd6a12a(470)](_0x467251)); + } + } + } + } +); +smd( + { + pattern: "readmore", + alias: ["rmore", "readmor"], + desc: "Adds *readmore* in given text.", + category: "user", + filename: __filename, + }, + async (_0x5db0de, _0x38fb87) => { + try { + let _0x5ea4b8 = _0x38fb87 ? _0x38fb87 : _0x5db0de.reply_text; + if (!_0x5ea4b8) { + _0x5ea4b8 = + "*Uhh Dear,Please provide text*\n*Eg:- _.readmor text1 readmore text2_*"; + } else { + _0x5ea4b8 += " "; + } + if (_0x5ea4b8.includes("readmore")) { + await _0x5db0de.reply( + _0x5ea4b8.replace(/readmore/, String.fromCharCode(8206).repeat(4001)) + ); + } else { + await _0x5db0de.reply( + _0x5ea4b8.replace(" ", String.fromCharCode(8206).repeat(4001)) + ); + } + } catch (_0x36cb2c) { + await _0x5db0de.error( + _0x36cb2c + "\n\ncommand : readmore", + _0x36cb2c, + false + ); + } + } +); +let pmtypes = ["videoMessage", "imageMessage"]; +cmd( + { + pattern: "url", + alias: ["createurl"], + category: "user", + filename: __filename, + desc: "image to url.", + use: "