From e827cba338805ffe4b04ce31a90b694d932b4630 Mon Sep 17 00:00:00 2001 From: SkulZOnTheYT <92020118+SkulZOnTheYT@users.noreply.github.com> Date: Sun, 12 Nov 2023 13:14:57 +0700 Subject: [PATCH] Add files via upload --- plugins/menu/anime.js | 74 +++++++++++++++++++++++++++++++++++++++ plugins/menu/download.js | 72 ++++++++++++++++++++++++++++++++++++++ plugins/menu/editor.js | 73 ++++++++++++++++++++++++++++++++++++++ plugins/menu/ephoto.js | 72 ++++++++++++++++++++++++++++++++++++++ plugins/menu/fun.js | 75 ++++++++++++++++++++++++++++++++++++++++ plugins/menu/group.js | 72 ++++++++++++++++++++++++++++++++++++++ plugins/menu/nsfw.js | 75 ++++++++++++++++++++++++++++++++++++++++ plugins/menu/owner.js | 74 +++++++++++++++++++++++++++++++++++++++ plugins/menu/oxy.js | 72 ++++++++++++++++++++++++++++++++++++++ plugins/menu/textpro.js | 73 ++++++++++++++++++++++++++++++++++++++ 10 files changed, 732 insertions(+) create mode 100644 plugins/menu/anime.js create mode 100644 plugins/menu/download.js create mode 100644 plugins/menu/editor.js create mode 100644 plugins/menu/ephoto.js create mode 100644 plugins/menu/fun.js create mode 100644 plugins/menu/group.js create mode 100644 plugins/menu/nsfw.js create mode 100644 plugins/menu/owner.js create mode 100644 plugins/menu/oxy.js create mode 100644 plugins/menu/textpro.js diff --git a/plugins/menu/anime.js b/plugins/menu/anime.js new file mode 100644 index 0000000..2c52345 --- /dev/null +++ b/plugins/menu/anime.js @@ -0,0 +1,74 @@ +import db from '../../lib/database.js' +import { readMore, ranNumb, padLead } from '../../lib/func.js' +import { plugins } from '../../lib/plugins.js' +import { promises } from 'fs' +import { join } from 'path' + +let tagsanime = { + 'search': '🚀 *SEARCH*', + 'randompic': '✨ *RANDOM PIC*', + 'randommp4': '✨ *RANDOM MP4*', +} +const defaultMenu = { + before: ` +━ ━ *[ 🎎 ANIME STUFF ]* ━ ━ +`.trimStart(), + header: '╭─「 %category 」', + body: '│ • %cmd', + footer: '╰────\n', +} +let handler = async (m, { conn, usedPrefix: _p, __dirname }) => { + try { + let meh = padLead(ranNumb(43), 3) + let nais = await (await fetch('https://raw.githubusercontent.com/clicknetcafe/Databasee/main/azamibot/menus.json')).json().then(v => v.getRandom()) + let _package = JSON.parse(await promises.readFile(join(__dirname, '../package.json')).catch(_ => ({}))) || {} + let menuanime = Object.values(plugins).filter(plugin => !plugin.disabled).map(plugin => { + return { + menuanime: Array.isArray(plugin.tagsanime) ? plugin.menuanime : [plugin.menuanime], + tagsanime: Array.isArray(plugin.tagsanime) ? plugin.tagsanime : [plugin.tagsanime], + prefix: 'customPrefix' in plugin, + enabled: !plugin.disabled, + } + }) + for (let plugin of menuanime) + if (plugin && 'tagsanime' in plugin) + for (let tag of plugin.tagsanime) + if (!(tag in tagsanime) && tag) tagsanime[tag] = tag + conn.animemenu = conn.animemenu ? conn.animemenu : {} + let before = conn.animemenu.before || defaultMenu.before + let header = conn.animemenu.header || defaultMenu.header + let body = conn.animemenu.body || defaultMenu.body + let footer = conn.animemenu.footer || defaultMenu.footer + let _text = [ + before, + ...Object.keys(tagsanime).map(tag => { + return header.replace(/%category/g, tagsanime[tag]) + '\n' + [ + ...menuanime.filter(animemenu => animemenu.tagsanime && animemenu.tagsanime.includes(tag) && animemenu.menuanime).map(animemenu => { + return animemenu.menuanime.map(menuanime => { + return body.replace(/%cmd/g, animemenu.prefix ? menuanime : '%p' + menuanime) + .trim() + }).join('\n') + }), + footer + ].join('\n') + }) + ].join('\n') + let text = typeof conn.animemenu == 'string' ? conn.animemenu : typeof conn.animemenu == 'object' ? _text : '' + let replace = { + p: _p, + '%': '%', + readmore: readMore + } + text = text.replace(new RegExp(`%(${Object.keys(replace).sort((a, b) => b.length - a.length).join`|`})`, 'g'), (_, name) => '' + replace[name]) + const pp = await conn.profilePictureUrl(conn.user.jid).catch(_ => './src/avatar_contact.png') + await conn.sendFThumb(m.chat, db.data.datas.maingroupname, text.replace(`PIC* 」`, `PIC* 」${readMore}`).trim(), nais, db.data.datas.linkgc, m) + } catch (e) { + throw e + } +} + +handler.help = ['*menuanime*'] +handler.tags = ['submenu'] +handler.command = /^(animem(enu)?|m(enu)?anime)$/i + +export default handler \ No newline at end of file diff --git a/plugins/menu/download.js b/plugins/menu/download.js new file mode 100644 index 0000000..0c1d1d9 --- /dev/null +++ b/plugins/menu/download.js @@ -0,0 +1,72 @@ +import db from '../../lib/database.js' +import { readMore, ranNumb, padLead } from '../../lib/func.js' +import { plugins } from '../../lib/plugins.js' +import { promises } from 'fs' +import { join } from 'path' +import fs from 'fs' + +let tagsdownload = { + 'search': 'Supported Media', +} +const defaultMenu = { +before: ` +━ ━ *[ ⌛ DOWNLOADER ]* ━ ━ +`.trimStart(), +header: '╭─「 %category 」', +body: '│ • %cmd', +footer: '╰────\n', +} +let handler = async (m, { conn, usedPrefix: _p, __dirname }) => { + try { + let nais = 'https://i.ibb.co/Cnr25XH/zero.jpg' + let _package = JSON.parse(await promises.readFile(join(__dirname, '../package.json')).catch(_ => ({}))) || {} + let menudownload = Object.values(plugins).filter(plugin => !plugin.disabled).map(plugin => { + return { + menudownload: Array.isArray(plugin.tagsdownload) ? plugin.menudownload : [plugin.menudownload], + tagsdownload: Array.isArray(plugin.tagsdownload) ? plugin.tagsdownload : [plugin.tagsdownload], + prefix: 'customPrefix' in plugin, + enabled: !plugin.disabled, + } + }) + for (let plugin of menudownload) + if (plugin && 'tagsdownload' in plugin) + for (let tag of plugin.tagsdownload) + if (!(tag in tagsdownload) && tag) tagsdownload[tag] = tag + conn.downloadmenu = conn.downloadmenu ? conn.downloadmenu : {} + let before = conn.downloadmenu.before || defaultMenu.before + let header = conn.downloadmenu.header || defaultMenu.header + let body = conn.downloadmenu.body || defaultMenu.body + let footer = conn.downloadmenu.footer || defaultMenu.footer + let _text = [ + before, + ...Object.keys(tagsdownload).map(tag => { + return header.replace(/%category/g, tagsdownload[tag]) + '\n' + [ + ...menudownload.filter(downloadmenu => downloadmenu.tagsdownload && downloadmenu.tagsdownload.includes(tag) && downloadmenu.menudownload).map(downloadmenu => { + return downloadmenu.menudownload.map(menudownload => { + return body.replace(/%cmd/g, downloadmenu.prefix ? menudownload : '%p' + menudownload) + .trim() + }).join('\n') + }), + footer + ].join('\n') + }) + ].join('\n') + let text = typeof conn.downloadmenu == 'string' ? conn.downloadmenu : typeof conn.downloadmenu == 'object' ? _text : '' + let replace = { + p: _p, + '%': '%', + readmore: readMore + } + text = text.replace(new RegExp(`%(${Object.keys(replace).sort((a, b) => b.length - a.length).join`|`})`, 'g'), (_, name) => '' + replace[name]) + const pp = await conn.profilePictureUrl(conn.user.jid).catch(_ => './src/avatar_contact.png') + await conn.sendFThumb(m.chat, db.data.datas.maingroupname, text.replace(`fire `, `fire ${readMore}`).trim(), nais, db.data.datas.linkgc, m) + } catch (e) { + throw e + } +} + +handler.help = ['menudownload'] +handler.tags = ['submenu'] +handler.command = /^(downloadm(enu)?|m(enu)?download)$/i + +export default handler \ No newline at end of file diff --git a/plugins/menu/editor.js b/plugins/menu/editor.js new file mode 100644 index 0000000..3d5f2c8 --- /dev/null +++ b/plugins/menu/editor.js @@ -0,0 +1,73 @@ +import db from '../../lib/database.js' +import { readMore, ranNumb, padLead } from '../../lib/func.js' +import { plugins } from '../../lib/plugins.js' +import { promises } from 'fs' +import { join } from 'path' +import fs from 'fs' + +let tagseditor = { + 'search': 'Photo Effects', + 'filter': 'Photo Filters' +} +const defaultMenu = { + before: ` +━ ━ *[ 🗺 EDIT GAMBAR ]* ━ ━ +`.trimStart(), + header: '╭─「 %category 」', + body: '│ • %cmd', + footer: '╰────\n', +} +let handler = async (m, { conn, usedPrefix: _p, __dirname }) => { + try { + let nais = 'https://i.ibb.co/DfXd5XW/editor.jpg' + let _package = JSON.parse(await promises.readFile(join(__dirname, '../package.json')).catch(_ => ({}))) || {} + let menueditor = Object.values(plugins).filter(plugin => !plugin.disabled).map(plugin => { + return { + menueditor: Array.isArray(plugin.tagseditor) ? plugin.menueditor : [plugin.menueditor], + tagseditor: Array.isArray(plugin.tagseditor) ? plugin.tagseditor : [plugin.tagseditor], + prefix: 'customPrefix' in plugin, + enabled: !plugin.disabled, + } + }) + for (let plugin of menueditor) + if (plugin && 'tagseditor' in plugin) + for (let tag of plugin.tagseditor) + if (!(tag in tagseditor) && tag) tagseditor[tag] = tag + conn.editormenu = conn.editormenu ? conn.editormenu : {} + let before = conn.editormenu.before || defaultMenu.before + let header = conn.editormenu.header || defaultMenu.header + let body = conn.editormenu.body || defaultMenu.body + let footer = conn.editormenu.footer || defaultMenu.footer + let _text = [ + before, + ...Object.keys(tagseditor).map(tag => { + return header.replace(/%category/g, tagseditor[tag]) + '\n' + [ + ...menueditor.filter(editormenu => editormenu.tagseditor && editormenu.tagseditor.includes(tag) && editormenu.menueditor).map(editormenu => { + return editormenu.menueditor.map(menueditor => { + return body.replace(/%cmd/g, editormenu.prefix ? menueditor : '%p' + menueditor) + .trim() + }).join('\n') + }), + footer + ].join('\n') + }) + ].join('\n') + let text = typeof conn.editormenu == 'string' ? conn.editormenu : typeof conn.editormenu == 'object' ? _text : '' + let replace = { + p: _p, + '%': '%', + readmore: readMore + } + text = text.replace(new RegExp(`%(${Object.keys(replace).sort((a, b) => b.length - a.length).join`|`})`, 'g'), (_, name) => '' + replace[name]) + const pp = await conn.profilePictureUrl(conn.user.jid).catch(_ => './src/avatar_contact.png') + await conn.sendFThumb(m.chat, db.data.datas.maingroupname, text.replace(`skullmask`, `skullmask${readMore}`).trim(), nais, db.data.datas.linkgc, m) + } catch (e) { + throw e + } +} + +handler.help = ['menueditor'] +handler.tags = ['submenu'] +handler.command = /^(editorm(enu)?|m(enu)?editor)$/i + +export default handler \ No newline at end of file diff --git a/plugins/menu/ephoto.js b/plugins/menu/ephoto.js new file mode 100644 index 0000000..843da5e --- /dev/null +++ b/plugins/menu/ephoto.js @@ -0,0 +1,72 @@ +import db from '../../lib/database.js' +import { readMore, ranNumb, padLead } from '../../lib/func.js' +import { plugins } from '../../lib/plugins.js' +import { promises } from 'fs' +import { join } from 'path' +import fs from 'fs' + +let tagsephoto = { + 'search': 'Photo Effects', +} +const defaultMenu = { + before: ` +━ ━ *[ 💫 Ephoto 360 ]* ━ ━ +`.trimStart(), + header: '╭─「 %category 」', + body: '│ • %cmd', + footer: '╰────\n', +} +let handler = async (m, { conn, usedPrefix: _p, __dirname }) => { + try { + let nais = 'https://i.ibb.co/fYxkbj2/ephoto.jpg' + let _package = JSON.parse(await promises.readFile(join(__dirname, '../package.json')).catch(_ => ({}))) || {} + let menuephoto = Object.values(plugins).filter(plugin => !plugin.disabled).map(plugin => { + return { + menuephoto: Array.isArray(plugin.tagsephoto) ? plugin.menuephoto : [plugin.menuephoto], + tagsephoto: Array.isArray(plugin.tagsephoto) ? plugin.tagsephoto : [plugin.tagsephoto], + prefix: 'customPrefix' in plugin, + enabled: !plugin.disabled, + } + }) + for (let plugin of menuephoto) + if (plugin && 'tagsephoto' in plugin) + for (let tag of plugin.tagsephoto) + if (!(tag in tagsephoto) && tag) tagsephoto[tag] = tag + conn.ephotomenu = conn.ephotomenu ? conn.ephotomenu : {} + let before = conn.ephotomenu.before || defaultMenu.before + let header = conn.ephotomenu.header || defaultMenu.header + let body = conn.ephotomenu.body || defaultMenu.body + let footer = conn.ephotomenu.footer || defaultMenu.footer + let _text = [ + before, + ...Object.keys(tagsephoto).map(tag => { + return header.replace(/%category/g, tagsephoto[tag]) + '\n' + [ + ...menuephoto.filter(ephotomenu => ephotomenu.tagsephoto && ephotomenu.tagsephoto.includes(tag) && ephotomenu.menuephoto).map(ephotomenu => { + return ephotomenu.menuephoto.map(menuephoto => { + return body.replace(/%cmd/g, ephotomenu.prefix ? menuephoto : '%p' + menuephoto) + .trim() + }).join('\n') + }), + footer + ].join('\n') + }) + ].join('\n') + let text = typeof conn.ephotomenu == 'string' ? conn.ephotomenu : typeof conn.ephotomenu == 'object' ? _text : '' + let replace = { + p: _p, + '%': '%', + readmore: readMore + } + text = text.replace(new RegExp(`%(${Object.keys(replace).sort((a, b) => b.length - a.length).join`|`})`, 'g'), (_, name) => '' + replace[name]) + const pp = await conn.profilePictureUrl(conn.user.jid).catch(_ => './src/avatar_contact.png') + await conn.sendFThumb(m.chat, db.data.datas.maingroupname, text.replace(`flower `, `flower ${readMore}`).trim(), nais, db.data.datas.linkgc, m) + } catch (e) { + throw e + } +} + +handler.help = ['menuephoto'] +handler.tags = ['submenu'] +handler.command = /^(ephotom(enu)?|m(enu)?ephoto)$/i + +export default handler \ No newline at end of file diff --git a/plugins/menu/fun.js b/plugins/menu/fun.js new file mode 100644 index 0000000..e26deeb --- /dev/null +++ b/plugins/menu/fun.js @@ -0,0 +1,75 @@ +import db from '../../lib/database.js' +import { readMore, ranNumb, padLead } from '../../lib/func.js' +import { plugins } from '../../lib/plugins.js' +import { promises } from 'fs' +import { join } from 'path' +import fs from 'fs' + +let tagsfun = { + 'rpg': '🎮 *RPG*', + 'game': '🎮 *GAMES*', + 'anonim': '🎩 *ANONYMOUS*', + 'kerang': '🐚 *KERANG AJAIB*', +} +const defaultMenu = { + before: ` +━ ━ *[ 🦠 FUN MENU ]* ━ ━ +`.trimStart(), + header: '╭─「 %category 」', + body: '│ • %cmd', + footer: '╰────\n', +} +let handler = async (m, { conn, usedPrefix: _p, __dirname }) => { + try { + let nais = 'https://i.ibb.co/r5kygNx/anime.jpg' + let _package = JSON.parse(await promises.readFile(join(__dirname, '../package.json')).catch(_ => ({}))) || {} + let menufun = Object.values(plugins).filter(plugin => !plugin.disabled).map(plugin => { + return { + menufun: Array.isArray(plugin.tagsfun) ? plugin.menufun : [plugin.menufun], + tagsfun: Array.isArray(plugin.tagsfun) ? plugin.tagsfun : [plugin.tagsfun], + prefix: 'customPrefix' in plugin, + enabled: !plugin.disabled, + } + }) + for (let plugin of menufun) + if (plugin && 'tagsfun' in plugin) + for (let tag of plugin.tagsfun) + if (!(tag in tagsfun) && tag) tagsfun[tag] = tag + conn.funmenu = conn.funmenu ? conn.funmenu : {} + let before = conn.funmenu.before || defaultMenu.before + let header = conn.funmenu.header || defaultMenu.header + let body = conn.funmenu.body || defaultMenu.body + let footer = conn.funmenu.footer || defaultMenu.footer + let _text = [ + before, + ...Object.keys(tagsfun).map(tag => { + return header.replace(/%category/g, tagsfun[tag]) + '\n' + [ + ...menufun.filter(funmenu => funmenu.tagsfun && funmenu.tagsfun.includes(tag) && funmenu.menufun).map(funmenu => { + return funmenu.menufun.map(menufun => { + return body.replace(/%cmd/g, funmenu.prefix ? menufun : '%p' + menufun) + .trim() + }).join('\n') + }), + footer + ].join('\n') + }) + ].join('\n') + let text = typeof conn.funmenu == 'string' ? conn.funmenu : typeof conn.funmenu == 'object' ? _text : '' + let replace = { + p: _p, + '%': '%', + readmore: readMore + } + text = text.replace(new RegExp(`%(${Object.keys(replace).sort((a, b) => b.length - a.length).join`|`})`, 'g'), (_, name) => '' + replace[name]) + const pp = await conn.profilePictureUrl(conn.user.jid).catch(_ => './src/avatar_contact.png') + await conn.sendFThumb(m.chat, db.data.datas.maingroupname, text.replace(`build [item] [count]`, `build [item] [count]${readMore}`).trim(), nais, db.data.datas.linkgc, m) + } catch (e) { + throw e + } +} + +handler.help = ['*menufun*'] +handler.tags = ['submenu'] +handler.command = /^((fun|rpg|games?)m(enu)?|m(enu)?(fun|rpg|games?))$/i + +export default handler \ No newline at end of file diff --git a/plugins/menu/group.js b/plugins/menu/group.js new file mode 100644 index 0000000..6b39cbf --- /dev/null +++ b/plugins/menu/group.js @@ -0,0 +1,72 @@ +import db from '../../lib/database.js' +import { readMore, ranNumb, padLead } from '../../lib/func.js' +import { plugins } from '../../lib/plugins.js' +import { promises } from 'fs' +import { join } from 'path' +import fs from 'fs' + +let tagsgroup = { + 'group': '*Some Admin Privilages*' +} +const defaultMenu = { + before: ` +━ ━ *[ 👥 GROUP FEATURE ]* ━ ━ +`.trimStart(), + header: '╭─「 %category 」', + body: '│ • %cmd', + footer: '╰────\n', +} +let handler = async (m, { conn, usedPrefix: _p, __dirname }) => { + try { + let nais = 'https://i.ibb.co/Cnr25XH/zero.jpg' + let _package = JSON.parse(await promises.readFile(join(__dirname, '../package.json')).catch(_ => ({}))) || {} + let menugroup = Object.values(plugins).filter(plugin => !plugin.disabled).map(plugin => { + return { + menugroup: Array.isArray(plugin.tagsgroup) ? plugin.menugroup : [plugin.menugroup], + tagsgroup: Array.isArray(plugin.tagsgroup) ? plugin.tagsgroup : [plugin.tagsgroup], + prefix: 'customPrefix' in plugin, + enabled: !plugin.disabled, + } + }) + for (let plugin of menugroup) + if (plugin && 'tagsgroup' in plugin) + for (let tag of plugin.tagsgroup) + if (!(tag in tagsgroup) && tag) tagsgroup[tag] = tag + conn.groupmenu = conn.groupmenu ? conn.groupmenu : {} + let before = conn.groupmenu.before || defaultMenu.before + let header = conn.groupmenu.header || defaultMenu.header + let body = conn.groupmenu.body || defaultMenu.body + let footer = conn.groupmenu.footer || defaultMenu.footer + let _text = [ + before, + ...Object.keys(tagsgroup).map(tag => { + return header.replace(/%category/g, tagsgroup[tag]) + '\n' + [ + ...menugroup.filter(groupmenu => groupmenu.tagsgroup && groupmenu.tagsgroup.includes(tag) && groupmenu.menugroup).map(groupmenu => { + return groupmenu.menugroup.map(menugroup => { + return body.replace(/%cmd/g, groupmenu.prefix ? menugroup : '%p' + menugroup) + .trim() + }).join('\n') + }), + footer + ].join('\n') + }) + ].join('\n') + let text = typeof conn.groupmenu == 'string' ? conn.groupmenu : typeof conn.groupmenu == 'object' ? _text : '' + let replace = { + p: _p, + '%': '%', + readmore: readMore + } + text = text.replace(new RegExp(`%(${Object.keys(replace).sort((a, b) => b.length - a.length).join`|`})`, 'g'), (_, name) => '' + replace[name]) + const pp = await conn.profilePictureUrl(conn.user.jid).catch(_ => './src/avatar_contact.png') + await conn.sendFThumb(m.chat, db.data.datas.maingroupname, text.replace(`demote @tag`, `demote @tag${readMore}`).trim(), nais, db.data.datas.linkgc, m) + } catch (e) { + throw e + } +} + +handler.help = ['menugroup'] +handler.tags = ['submenu'] +handler.command = /^(gro?upm(enu)?|m(enu)?gro?up)$/i + +export default handler \ No newline at end of file diff --git a/plugins/menu/nsfw.js b/plugins/menu/nsfw.js new file mode 100644 index 0000000..7c06696 --- /dev/null +++ b/plugins/menu/nsfw.js @@ -0,0 +1,75 @@ +import db from '../../lib/database.js' +import { plugins } from '../../lib/plugins.js' +import { readMore, ranNumb, padLead } from '../../lib/func.js' +import { promises } from 'fs' +import { join } from 'path' + +let tagsnsfw = { + 'search': '🚀 *SEARCH*', + 'randompic': '✨ *RANDOM PIC*', + 'randommp4': '✨ *NSFWNIME MP4*', +} +const defaultMenu = { + before: ` +━ ━ *[ 🚫 NSFW SFX ]* ━ ━ +`.trimStart(), + header: '╭─「 %category 」', + body: '│ • %cmd', + footer: '╰────\n', +} +let handler = async (m, { conn, usedPrefix: _p, __dirname }) => { + try { + let chat = db.data.chats[m.chat] + let meh = padLead(ranNumb(23), 3) + let nais = (m.isGroup && !chat.nsfw) ? 'https://i.ibb.co/0QfCNxj/nsfwoff.jpg' : await (await fetch('https://raw.githubusercontent.com/clicknetcafe/Databasee/main/azamibot/nsfw.json')).json().then(v => v.getRandom()) + let _package = JSON.parse(await promises.readFile(join(__dirname, '../package.json')).catch(_ => ({}))) || {} + let menunsfw = Object.values(plugins).filter(plugin => !plugin.disabled).map(plugin => { + return { + menunsfw: Array.isArray(plugin.tagsnsfw) ? plugin.menunsfw : [plugin.menunsfw], + tagsnsfw: Array.isArray(plugin.tagsnsfw) ? plugin.tagsnsfw : [plugin.tagsnsfw], + prefix: 'customPrefix' in plugin, + enabled: !plugin.disabled, + } + }) + for (let plugin of menunsfw) + if (plugin && 'tagsnsfw' in plugin) + for (let tag of plugin.tagsnsfw) + if (!(tag in tagsnsfw) && tag) tagsnsfw[tag] = tag + conn.nsfwmenu = conn.nsfwmenu ? conn.nsfwmenu : {} + let before = conn.nsfwmenu.before || defaultMenu.before + let header = conn.nsfwmenu.header || defaultMenu.header + let body = conn.nsfwmenu.body || defaultMenu.body + let footer = conn.nsfwmenu.footer || defaultMenu.footer + let _text = [ + before, + ...Object.keys(tagsnsfw).map(tag => { + return header.replace(/%category/g, tagsnsfw[tag]) + '\n' + [ + ...menunsfw.filter(nsfwmenu => nsfwmenu.tagsnsfw && nsfwmenu.tagsnsfw.includes(tag) && nsfwmenu.menunsfw).map(nsfwmenu => { + return nsfwmenu.menunsfw.map(menunsfw => { + return body.replace(/%cmd/g, nsfwmenu.prefix ? menunsfw : '%p' + menunsfw) + .trim() + }).join('\n') + }), + footer + ].join('\n') + }) + ].join('\n') + let text = typeof conn.nsfwmenu == 'string' ? conn.nsfwmenu : typeof conn.nsfwmenu == 'object' ? _text : '' + let replace = { + p: _p, + '%': '%', + readmore: readMore + } + text = text.replace(new RegExp(`%(${Object.keys(replace).sort((a, b) => b.length - a.length).join`|`})`, 'g'), (_, name) => '' + replace[name]) + const pp = await conn.profilePictureUrl(conn.user.jid).catch(_ => './src/avatar_contact.png') + await conn.sendFThumb(m.chat, db.data.datas.maingroupname, text.replace(``, `${readMore}`).trim(), nais, db.data.datas.linkgc, m) + } catch (e) { + throw e + } +} + +handler.help = ['menunsfw'] +handler.tags = ['submenu'] +handler.command = /^(nsfwm(enu)?|m(enu)?nsfw)$/i + +export default handler \ No newline at end of file diff --git a/plugins/menu/owner.js b/plugins/menu/owner.js new file mode 100644 index 0000000..52575ee --- /dev/null +++ b/plugins/menu/owner.js @@ -0,0 +1,74 @@ +import db from '../../lib/database.js' +import { readMore, ranNumb, padLead } from '../../lib/func.js' +import { plugins } from '../../lib/plugins.js' +import { promises } from 'fs' +import { join } from 'path' +import fs from 'fs' + +let tagsowner = { + 'owner': '🌸 *Owner*', + 'ownerr': '🌺 *Real Owner*', + 'mods': '💮 *DEV / MODS*', +} +const defaultMenu = { + before: ` +━ ━ *[ 🪷 OWNER BOT ONLY ]* ━ ━ +`.trimStart(), + header: '╭─「 %category 」', + body: '│ • %cmd', + footer: '╰────\n', +} +let handler = async (m, { conn, usedPrefix: _p, __dirname }) => { + try { + let nais = 'https://i.ibb.co/Cnr25XH/zero.jpg' + let _package = JSON.parse(await promises.readFile(join(__dirname, '../package.json')).catch(_ => ({}))) || {} + let menuowner = Object.values(plugins).filter(plugin => !plugin.disabled).map(plugin => { + return { + menuowner: Array.isArray(plugin.tagsowner) ? plugin.menuowner : [plugin.menuowner], + tagsowner: Array.isArray(plugin.tagsowner) ? plugin.tagsowner : [plugin.tagsowner], + prefix: 'customPrefix' in plugin, + enabled: !plugin.disabled, + } + }) + for (let plugin of menuowner) + if (plugin && 'tagsowner' in plugin) + for (let tag of plugin.tagsowner) + if (!(tag in tagsowner) && tag) tagsowner[tag] = tag + conn.ownermenu = conn.ownermenu ? conn.ownermenu : {} + let before = conn.ownermenu.before || defaultMenu.before + let header = conn.ownermenu.header || defaultMenu.header + let body = conn.ownermenu.body || defaultMenu.body + let footer = conn.ownermenu.footer || defaultMenu.footer + let _text = [ + before, + ...Object.keys(tagsowner).map(tag => { + return header.replace(/%category/g, tagsowner[tag]) + '\n' + [ + ...menuowner.filter(ownermenu => ownermenu.tagsowner && ownermenu.tagsowner.includes(tag) && ownermenu.menuowner).map(ownermenu => { + return ownermenu.menuowner.map(menuowner => { + return body.replace(/%cmd/g, ownermenu.prefix ? menuowner : '%p' + menuowner) + .trim() + }).join('\n') + }), + footer + ].join('\n') + }) + ].join('\n') + let text = typeof conn.ownermenu == 'string' ? conn.ownermenu : typeof conn.ownermenu == 'object' ? _text : '' + let replace = { + p: _p, + '%': '%', + readmore: readMore + } + text = text.replace(new RegExp(`%(${Object.keys(replace).sort((a, b) => b.length - a.length).join`|`})`, 'g'), (_, name) => '' + replace[name]) + const pp = await conn.profilePictureUrl(conn.user.jid).catch(_ => './src/avatar_contact.png') + await conn.sendFThumb(m.chat, db.data.datas.maingroupname, text.replace(`addjoindurasi`, `addjoindurasi${readMore}`).trim(), nais, db.data.datas.linkgc, m) + } catch (e) { + throw e + } +} + +handler.help = ['menuowner'] +handler.tags = ['submenu'] +handler.command = /^(r?(eal)?ownerm(enu)?|m(enu)?r?(eal)?owner)$/i + +export default handler \ No newline at end of file diff --git a/plugins/menu/oxy.js b/plugins/menu/oxy.js new file mode 100644 index 0000000..53cb6f8 --- /dev/null +++ b/plugins/menu/oxy.js @@ -0,0 +1,72 @@ +import db from '../../lib/database.js' +import { readMore, ranNumb, padLead } from '../../lib/func.js' +import { plugins } from '../../lib/plugins.js' +import { promises } from 'fs' +import { join } from 'path' +import fs from 'fs' + +let tagsoxy = { + 'search': 'Make Photo Effect', +} +const defaultMenu = { + before: ` +━ ━ *[ 👼🏻 Photo Oxy ]* ━ ━ +`.trimStart(), + header: '╭─「 %category 」', + body: '│ • %cmd', + footer: '╰────\n', +} +let handler = async (m, { conn, usedPrefix: _p, __dirname }) => { + try { + let nais = 'https://i.ibb.co/K0BBGvT/oxy.jpg' + let _package = JSON.parse(await promises.readFile(join(__dirname, '../package.json')).catch(_ => ({}))) || {} + let menuoxy = Object.values(plugins).filter(plugin => !plugin.disabled).map(plugin => { + return { + menuoxy: Array.isArray(plugin.tagsoxy) ? plugin.menuoxy : [plugin.menuoxy], + tagsoxy: Array.isArray(plugin.tagsoxy) ? plugin.tagsoxy : [plugin.tagsoxy], + prefix: 'customPrefix' in plugin, + enabled: !plugin.disabled, + } + }) + for (let plugin of menuoxy) + if (plugin && 'tagsoxy' in plugin) + for (let tag of plugin.tagsoxy) + if (!(tag in tagsoxy) && tag) tagsoxy[tag] = tag + conn.oxymenu = conn.oxymenu ? conn.oxymenu : {} + let before = conn.oxymenu.before || defaultMenu.before + let header = conn.oxymenu.header || defaultMenu.header + let body = conn.oxymenu.body || defaultMenu.body + let footer = conn.oxymenu.footer || defaultMenu.footer + let _text = [ + before, + ...Object.keys(tagsoxy).map(tag => { + return header.replace(/%category/g, tagsoxy[tag]) + '\n' + [ + ...menuoxy.filter(oxymenu => oxymenu.tagsoxy && oxymenu.tagsoxy.includes(tag) && oxymenu.menuoxy).map(oxymenu => { + return oxymenu.menuoxy.map(menuoxy => { + return body.replace(/%cmd/g, oxymenu.prefix ? menuoxy : '%p' + menuoxy) + .trim() + }).join('\n') + }), + footer + ].join('\n') + }) + ].join('\n') + let text = typeof conn.oxymenu == 'string' ? conn.oxymenu : typeof conn.oxymenu == 'object' ? _text : '' + let replace = { + p: _p, + '%': '%', + readmore: readMore + } + text = text.replace(new RegExp(`%(${Object.keys(replace).sort((a, b) => b.length - a.length).join`|`})`, 'g'), (_, name) => '' + replace[name]) + const pp = await conn.profilePictureUrl(conn.user.jid).catch(_ => './src/avatar_contact.png') + await conn.sendFThumb(m.chat, db.data.datas.maingroupname, text.replace(`message `, `message ${readMore}`).trim(), nais, db.data.datas.linkgc, m) + } catch (e) { + throw e + } +} + +handler.help = ['menuoxy'] +handler.tags = ['submenu'] +handler.command = /^(oxym(enu)?|m(enu)?oxy)$/i + +export default handler \ No newline at end of file diff --git a/plugins/menu/textpro.js b/plugins/menu/textpro.js new file mode 100644 index 0000000..f03ea6e --- /dev/null +++ b/plugins/menu/textpro.js @@ -0,0 +1,73 @@ +import db from '../../lib/database.js' +import { readMore, ranNumb, padLead } from '../../lib/func.js' +import { plugins } from '../../lib/plugins.js' +import { promises } from 'fs' +import { join } from 'path' +import fs from 'fs' + +let tagstextpro = { + 'offi': 'textpro.me Official', + 'search': 'Make Text Effect', +} +const defaultMenu = { + before: ` +━ ━ *[ 🎨 Text Pro Me ]* ━ ━ +`.trimStart(), + header: '╭─「 %category 」', + body: '│ • %cmd', + footer: '╰────\n', +} +let handler = async (m, { conn, usedPrefix: _p, __dirname }) => { + try { + let nais = 'https://i.ibb.co/n6T8RbJ/textpro.jpg' + let _package = JSON.parse(await promises.readFile(join(__dirname, '../package.json')).catch(_ => ({}))) || {} + let menutextpro = Object.values(plugins).filter(plugin => !plugin.disabled).map(plugin => { + return { + menutextpro: Array.isArray(plugin.tagstextpro) ? plugin.menutextpro : [plugin.menutextpro], + tagstextpro: Array.isArray(plugin.tagstextpro) ? plugin.tagstextpro : [plugin.tagstextpro], + prefix: 'customPrefix' in plugin, + enabled: !plugin.disabled, + } + }) + for (let plugin of menutextpro) + if (plugin && 'tagstextpro' in plugin) + for (let tag of plugin.tagstextpro) + if (!(tag in tagstextpro) && tag) tagstextpro[tag] = tag + conn.textpromenu = conn.textpromenu ? conn.textpromenu : {} + let before = conn.textpromenu.before || defaultMenu.before + let header = conn.textpromenu.header || defaultMenu.header + let body = conn.textpromenu.body || defaultMenu.body + let footer = conn.textpromenu.footer || defaultMenu.footer + let _text = [ + before, + ...Object.keys(tagstextpro).map(tag => { + return header.replace(/%category/g, tagstextpro[tag]) + '\n' + [ + ...menutextpro.filter(textpromenu => textpromenu.tagstextpro && textpromenu.tagstextpro.includes(tag) && textpromenu.menutextpro).map(textpromenu => { + return textpromenu.menutextpro.map(menutextpro => { + return body.replace(/%cmd/g, textpromenu.prefix ? menutextpro : '%p' + menutextpro) + .trim() + }).join('\n') + }), + footer + ].join('\n') + }) + ].join('\n') + let text = typeof conn.textpromenu == 'string' ? conn.textpromenu : typeof conn.textpromenu == 'object' ? _text : '' + let replace = { + p: _p, + '%': '%', + readmore: readMore + } + text = text.replace(new RegExp(`%(${Object.keys(replace).sort((a, b) => b.length - a.length).join`|`})`, 'g'), (_, name) => '' + replace[name]) + const pp = await conn.profilePictureUrl(conn.user.jid).catch(_ => './src/avatar_contact.png') + await conn.sendFThumb(m.chat, db.data.datas.maingroupname, text.replace(`summer `, `summer ${readMore}`).trim(), nais, db.data.datas.linkgc, m) + } catch (e) { + throw e + } +} + +handler.help = ['menutextpro'] +handler.tags = ['submenu'] +handler.command = /^(textprom(enu)?|m(enu)?textpro)$/i + +export default handler \ No newline at end of file