Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
SkulZOnTheYT authored Nov 12, 2023
1 parent 5d0b372 commit e827cba
Show file tree
Hide file tree
Showing 10 changed files with 732 additions and 0 deletions.
74 changes: 74 additions & 0 deletions plugins/menu/anime.js
Original file line number Diff line number Diff line change
@@ -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
72 changes: 72 additions & 0 deletions plugins/menu/download.js
Original file line number Diff line number Diff line change
@@ -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 <url>`, `fire <url>${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
73 changes: 73 additions & 0 deletions plugins/menu/editor.js
Original file line number Diff line number Diff line change
@@ -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
72 changes: 72 additions & 0 deletions plugins/menu/ephoto.js
Original file line number Diff line number Diff line change
@@ -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 <text>`, `flower <text>${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
75 changes: 75 additions & 0 deletions plugins/menu/fun.js
Original file line number Diff line number Diff line change
@@ -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
Loading

0 comments on commit e827cba

Please sign in to comment.