diff --git a/plugins/_antilink.js b/plugins/_antilink.js deleted file mode 100644 index 73de07d9a..000000000 --- a/plugins/_antilink.js +++ /dev/null @@ -1,27 +0,0 @@ - -const linkRegex = /chat.whatsapp.com\/(?:invite\/)?([0-9A-Za-z]{20,24})/i - -export async function before(m, {conn, isAdmin, isBotAdmin }) { - if (m.isBaileys && m.fromMe) - return !0 - if (!m.isGroup) return !1 - let chat = global.db.data.chats[m.chat] - let bot = global.db.data.settings[this.user.jid] || {} - const isGroupLink = linkRegex.exec(m.text) - - if (chat.antiLink && isGroupLink && !isAdmin) { - if (isBotAdmin) { - const linkThisGroup = `https://chat.whatsapp.com/${await this.groupInviteCode(m.chat)}` - if (m.text.includes(linkThisGroup)) return !0 - } - await conn.reply(m.chat, `*≡ Enlace Detectado* - -No permitimos enlaces de otros grupos -lo siento *@${m.sender.split('@')[0]}* serás expulsado del grupo ${isBotAdmin ? '' : '\n\nNo soy admin así que no te puedo expulsar :"v'}`, null, { mentions: [m.sender] } ) - if (isBotAdmin && chat.antiLink) { - await conn.sendMessage(m.chat, { delete: m.key }) - await conn.groupParticipantsUpdate(m.chat, [m.sender], 'remove') - } else if (!chat.antiLink) return //m.reply('') - } - return !0 -} diff --git a/plugins/_autobio.js b/plugins/_autobio.js deleted file mode 100644 index 7d81d08e8..000000000 --- a/plugins/_autobio.js +++ /dev/null @@ -1,28 +0,0 @@ - -let handler = m => m -handler.all = async function (m) { - let setting = global.db.data.settings[this.user.jid] - -let _muptime - if (process.send) { - process.send('uptime') - _muptime = await new Promise(resolve => { - process.once('message', resolve) - setTimeout(resolve, 1000) - }) * 1000 - } - let muptime = clockString(_muptime) - let bio = `\n🟢 Tiempo Activo ${muptime}\n\n ┃ 💎 By FG98` - await this.updateProfileStatus(bio).catch(_ => _) - setting.status = new Date() * 1 - -} -export default handler - -function clockString(ms) { - let d = isNaN(ms) ? '--' : Math.floor(ms / 86400000) - let h = isNaN(ms) ? '--' : Math.floor(ms / 3600000) % 24 - let m = isNaN(ms) ? '--' : Math.floor(ms / 60000) % 60 - let s = isNaN(ms) ? '--' : Math.floor(ms / 1000) % 60 - return [d, ' Día(s) ️', h, ' Hora(s) ', m, ' Minuto(s)'].map(v => v.toString().padStart(2, 0)).join('') -} diff --git a/plugins/_autolevelup.js b/plugins/_autolevelup.js deleted file mode 100644 index cfa815b23..000000000 --- a/plugins/_autolevelup.js +++ /dev/null @@ -1,24 +0,0 @@ -//import db from '../lib/database.js' -import { canLevelUp } from '../lib/levelling.js' - -export async function before(m, { conn }) { - let user = global.db.data.users[m.sender] - if (!user.autolevelup) - return !0 - let before = user.level * 1 - while (canLevelUp(user.level, user.exp, global.multiplier)) - user.level++ - user.role = global.rpg.role(user.level).name - if (before !== user.level) { - m.reply(` -*▢ SUBISTE DE NIVEL* - - *${before}* ‣ *${user.level}* - Rango : *${user.role}* - - _para desactivar escribe_ -_*/off autolevelup*_ - `.trim()) - } -} - diff --git a/plugins/_chatbot.js b/plugins/_chatbot.js deleted file mode 100644 index 83d6146fd..000000000 --- a/plugins/_chatbot.js +++ /dev/null @@ -1,16 +0,0 @@ - -import fetch from 'node-fetch' - -export async function before(m, { conn }) { -if (m.isBaileys && m.fromMe) - return !0 - if (!m.isGroup) return !1 - let user = global.db.data.users[m.sender] - - if (!user.chatbot) - return !0 - let api = await fetch(`https://api.simsimi.net/v2/?text=${m.text}&lc=es`) - let res = await api.json() - m.reply(res.success.replace('simsimi', 'DyLux').replace('Simsimi', 'DyLux').replace('sim simi', 'DyLux')) - -} diff --git a/plugins/_cmdWithMedia.js b/plugins/_cmdWithMedia.js deleted file mode 100644 index 210fbfc46..000000000 --- a/plugins/_cmdWithMedia.js +++ /dev/null @@ -1,29 +0,0 @@ -const { - proto, - generateWAMessage, - areJidsSameUser -} = (await import('@whiskeysockets/baileys')).default - -export async function all(m, chatUpdate) { - if (m.isBaileys) return - if (!m.message) return - if (!m.msg.fileSha256) return - if (!(Buffer.from(m.msg.fileSha256).toString('base64') in global.db.data.sticker)) return - - let hash = global.db.data.sticker[Buffer.from(m.msg.fileSha256).toString('base64')] - let { text, mentionedJid } = hash - let messages = await generateWAMessage(m.chat, { text: text, mentions: mentionedJid }, { - userJid: this.user.id, - quoted: m.quoted && m.quoted.fakeObj - }) - messages.key.fromMe = areJidsSameUser(m.sender, this.user.id) - messages.key.id = m.key.id - messages.pushName = m.pushName - if (m.isGroup) messages.participant = m.sender - let msg = { - ...chatUpdate, - messages: [proto.WebMessageInfo.fromObject(messages)], - type: 'append' - } - this.ev.emit('messages.upsert', msg) -} diff --git a/plugins/_expired-gp.js b/plugins/_expired-gp.js deleted file mode 100644 index f6ae4132c..000000000 --- a/plugins/_expired-gp.js +++ /dev/null @@ -1,13 +0,0 @@ - -export async function all(m) { - if (!m.isGroup) - return - let chats = global.db.data.chats[m.chat] - if (!chats.expired) - return !0 - if (+new Date() > chats.expired) { - await this.reply(m.chat, `🔴 Adiós shavales *${this.user.name}* saldrá del grupo \n\nfinalizo su alquiler`) - await this.groupLeave(m.chat) - chats.expired = null - } -} diff --git a/plugins/_fakeReply.js b/plugins/_fakeReply.js deleted file mode 100644 index f4e05d532..000000000 --- a/plugins/_fakeReply.js +++ /dev/null @@ -1,20 +0,0 @@ - -import fetch from 'node-fetch' -export async function before(m,{conn }) { - - let who = m.sender ? m.sender : conn.user.jid && conn.user.jid ? conn.user.jid : '0@s.whatsapp.net' - let pp = await this.profilePictureUrl(who, 'image').catch(_ => 'https://i.imgur.com/whjlJSf.jpg') - - //reply link wa - global.rpl = { contextInfo: { externalAdReply: { mediaUrl: dygp, mediaType: 'VIDEO', description: 'support group', title: packname, body: 'grupo de soporte', thumbnailUrl: pp, sourceUrl: dygp }}} - - //reply link PayPal - global.rpyp = { contextInfo: { externalAdReply: { mediaUrl: fgpyp, mediaType: 'VIDEO', description: 'Donate', title: 'PayPal', body: 'ayuda a mantener el bot activo', thumbnailUrl: pp, sourceUrl: fgpyp }}} - - //reply Instagram - global.rpig = { contextInfo: { externalAdReply: { mediaUrl: fgig, mediaType: 'VIDEO', description: 'Sigueme por Instagram', title: 'FG98', body: 'sigueme por Instagram', thumbnailUrl: pp, sourceUrl: fgig }}} - - //reply link yt - global.rpyt = { contextInfo: { externalAdReply: { showAdAttribution: true, mediaUrl: fgyt, mediaType: 'VIDEO', description: 'Suscribete : ' + fgyt, title: 'FG YouTube', body: 'aprende a crear tus propios bots', thumbnailUrl: pp, sourceUrl: fgyt }}} - -} diff --git a/plugins/_getmsg.js b/plugins/_getmsg.js deleted file mode 100644 index b121f01da..000000000 --- a/plugins/_getmsg.js +++ /dev/null @@ -1,23 +0,0 @@ -//import db from '../lib/database.js' - -export async function all(m) { - if (!m.chat.endsWith('.net') || m.fromMe || m.key.remoteJid.endsWith('status@broadcast')) return - if (global.db.data.chats[m.chat].isBanned) return - if (global.db.data.users[m.sender].banned) return - if (m.isBaileys) return - let msgs = global.db.data.msgs - if (!(m.text in msgs)) return - let _m = this.serializeM(JSON.parse(JSON.stringify(msgs[m.text]), (_, v) => { - if ( - v !== null && - typeof v === 'object' && - 'type' in v && - v.type === 'Buffer' && - 'data' in v && - Array.isArray(v.data)) { - return Buffer.from(v.data) - } - return v - })) - await _m.copyNForward(m.chat, true) -} diff --git a/plugins/_jsjs.js b/plugins/_jsjs.js deleted file mode 100644 index de204a1b5..000000000 --- a/plugins/_jsjs.js +++ /dev/null @@ -1,19 +0,0 @@ -import { sticker } from '../lib/sticker.js' -import fetch from 'node-fetch' -import axios from 'axios' - -let handler = async (m, { conn, text, usedPrefix, command }) => { - let img = (await axios.get(`https://raw.githubusercontent.com/fgmods/fg-team/main/img/hu.json`)).data - let stiker = await sticker(null, global.API(`${pickRandom(img)}`), global.packname, global.author) - if (stiker) return await conn.sendFile(m.chat, stiker, 'sticker.webp', { asSticker: true }, m) - throw stiker.toString() -} - -handler.customPrefix = /^(khajs)$/i -handler.command = new RegExp - -export default handler - -function pickRandom(list) { - return list[Math.floor(list.length * Math.random())] -} diff --git a/plugins/_onlyLatan.js b/plugins/_onlyLatan.js deleted file mode 100644 index 42d6f688b..000000000 --- a/plugins/_onlyLatan.js +++ /dev/null @@ -1,24 +0,0 @@ - -let handler = m => m - -handler.before = async function (m, {conn, isAdmin, isBotAdmin, isOwner} ) { - if (!m.isGroup) return !1 - let chat = global.db.data.chats[m.chat]; - - if (isBotAdmin && chat.onlyLatinos && !isAdmin && !isOwner) { - let forbidPrefixes = ["212", "265", "234", "258", "263", "967", "20", "92", "91"]; - - for (let prefix of forbidPrefixes) { - if (m.sender.startsWith(prefix)) { - m.reply('✳️ En este grupo solo se permite personas de habla hispana', m.sender) - await conn.groupParticipantsUpdate(m.chat, [m.sender], 'remove'); - return false; - } - } - } - - return true; -} - - -export default handler; diff --git a/plugins/_ranks.js b/plugins/_ranks.js deleted file mode 100644 index eb9a0596a..000000000 --- a/plugins/_ranks.js +++ /dev/null @@ -1,21 +0,0 @@ - -global.rpg = { - - role(level) { - level = parseInt(level) - if (isNaN(level)) return { name: '', level: '' } - - const role = [ - { name: "Novice", level: 0 }, { name: "Apprentice", level: 4 }, - { name: "Adept", level: 8 }, { name: "Magus", level: 12 }, - { name: "Master", level: 16 }, { name: "Guardian", level: 20 }, - { name: "Champion", level: 24 }, { name: "Hero", level: 28 }, - { name: "Legend", level: 32 }, { name: "Myth", level: 36 }, - { name: "Wizard", level: 48 }, { name: "Archmage", level: 52 }, - { name: "Sage", level: 56 }, { name: "Divine", level: 60 }, - { name: "All-Father", level: 100 } - ]; - - return role.reverse().find(role => level >= role.level) - } -} diff --git a/plugins/_templateResponse.js b/plugins/_templateResponse.js deleted file mode 100644 index 1bd012836..000000000 --- a/plugins/_templateResponse.js +++ /dev/null @@ -1,80 +0,0 @@ -const { - proto, - generateWAMessage, - areJidsSameUser -} = (await import('@whiskeysockets/baileys')).default - -export async function all(m, chatUpdate) { - if (m.isBaileys) - return - if (!m.message) - return - if (!(m.message.buttonsResponseMessage || m.message.templateButtonReplyMessage || m.message.listResponseMessage)) - return - let id = m.message.buttonsResponseMessage?.selectedButtonId || m.message.templateButtonReplyMessage?.selectedId || m.message.listResponseMessage?.singleSelectReply?.selectedRowId - let text = m.message.buttonsResponseMessage?.selectedDisplayText || m.message.templateButtonReplyMessage?.selectedDisplayText || m.message.listResponseMessage?.title - let isIdMessage = false, usedPrefix - for (let name in global.plugins) { - let plugin = global.plugins[name] - if (!plugin) - continue - if (plugin.disabled) - continue - if (!opts['restrict']) - if (plugin.tags && plugin.tags.includes('admin')) - continue - if (typeof plugin !== 'function') - continue - if (!plugin.command) - continue - const str2Regex = str => str.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&') - let _prefix = plugin.customPrefix ? plugin.customPrefix : this.prefix ? this.prefix : global.prefix - let match = (_prefix instanceof RegExp ? // RegExp Mode? - [[_prefix.exec(id), _prefix]] : - Array.isArray(_prefix) ? // Array? - _prefix.map(p => { - let re = p instanceof RegExp ? // RegExp in Array? - p : - new RegExp(str2Regex(p)) - return [re.exec(id), re] - }) : - typeof _prefix === 'string' ? // String? - [[new RegExp(str2Regex(_prefix)).exec(id), new RegExp(str2Regex(_prefix))]] : - [[[], new RegExp]] - ).find(p => p[1]) - if ((usedPrefix = (match[0] || '')[0])) { - let noPrefix = id.replace(usedPrefix, '') - let [command] = noPrefix.trim().split` `.filter(v => v) - command = (command || '').toLowerCase() - let isId = plugin.command instanceof RegExp ? // RegExp Mode? - plugin.command.test(command) : - Array.isArray(plugin.command) ? // Array? - plugin.command.some(cmd => cmd instanceof RegExp ? // RegExp in Array? - cmd.test(command) : - cmd === command - ) : - typeof plugin.command === 'string' ? // String? - plugin.command === command : - false - if (!isId) - continue - isIdMessage = true - } - - } - let messages = await generateWAMessage(m.chat, { text: isIdMessage ? id : text, mentions: m.mentionedJid }, { - userJid: this.user.id, - quoted: m.quoted && m.quoted.fakeObj - }) - messages.key.fromMe = areJidsSameUser(m.sender, this.user.id) - messages.key.id = m.key.id - messages.pushName = m.name - if (m.isGroup) - messages.key.participant = messages.participant = m.sender - let msg = { - ...chatUpdate, - messages: [proto.WebMessageInfo.fromObject(messages)].map(v => (v.conn = this, v)), - type: 'append' - } - this.ev.emit('messages.upsert', msg) -} \ No newline at end of file diff --git a/plugins/afk-_afk.js b/plugins/afk-_afk.js deleted file mode 100644 index 1539794f4..000000000 --- a/plugins/afk-_afk.js +++ /dev/null @@ -1,31 +0,0 @@ -//import db from '../lib/database.js' - -export function before(m) { - let user = global.db.data.users[m.sender] - if (user.afk > -1) { - m.reply(` - ✅ Dejaste de estar AFK -${user.afkReason ? ' \n▢ *Razón :* ' + user.afkReason : ''} -▢ *AFK Durante :* ${(new Date - user.afk).toTimeString()} - `.trim()) - user.afk = -1 - user.afkReason = '' - } - let jids = [...new Set([...(m.mentionedJid || []), ...(m.quoted ? [m.quoted.sender] : [])])] - for (let jid of jids) { - let user = global.db.data.users[jid] - if (!user) - continue - let afkTime = user.afk - if (!afkTime || afkTime < 0) - continue - let reason = user.afkReason || '' - m.reply(` -💤 El usuario que mencionas está AFK - -${reason ? '▢ *Razón* : ' + reason : '▢ *Razón* : Sin razón'} -▢ *AFK Durante :* ${(new Date - afkTime).toTimeString()} - `.trim()) - } - return true -} diff --git a/plugins/afk-afk.js b/plugins/afk-afk.js deleted file mode 100644 index d74db3dec..000000000 --- a/plugins/afk-afk.js +++ /dev/null @@ -1,19 +0,0 @@ -//import db from '../lib/database.js' - -let handler = async (m, { text, conn }) => { - let user = global.db.data.users[m.sender] - user.afk = + new Date - user.afkReason = text - m.reply(` - 😴 *AFK* -Ahora estas afk hasta que envies un mensaje -▢ *Usuario:* ${conn.getName(m.sender)} -▢ *Razon:* ${text ? text : ''} - `) -} -handler.help = ['afk '] -handler.tags = ['fun'] -handler.command = ['afk'] -handler.group = true - -export default handler diff --git a/plugins/anime-rkill.js b/plugins/anime-rkill.js deleted file mode 100644 index 5cbacaa9c..000000000 --- a/plugins/anime-rkill.js +++ /dev/null @@ -1,33 +0,0 @@ - -import fetch from 'node-fetch' -import axios from 'axios' -import { sticker } from '../lib/sticker.js' -let handler = async (m, { conn, args, usedPrefix, command }) => { - - let who - if (m.isGroup) who = m.mentionedJid[0] ? m.mentionedJid[0] : m.quoted ? m.quoted.sender : false - else who = m.chat - if (!who) throw `✳️ Etiqueta o menciona a alguien\n\n📌 Ejemplo : ${usedPrefix + command} @tag` - - let user = global.db.data.users[who] - let name = conn.getName(who) - let name2 = conn.getName(m.sender) - m.react(rwait) - - let rki = await fetch(`https://api.waifu.pics/sfw/kill`) - if (!rki.ok) throw await rki.text() - let jkis = await rki.json() - let { url } = jkis - let stiker = await sticker(null, url, `(${name2}) mató a`, `${name}`) - conn.sendFile(m.chat, stiker, null, { asSticker: true }, m) - m.react('🗡️') - -} - -handler.help = ['kill @tag'] -handler.tags = ['rnime'] -handler.command = /^(kill|matar)$/i -handler.diamond = true -handler.group = true - -export default handler diff --git a/plugins/anime-rkiss.js b/plugins/anime-rkiss.js deleted file mode 100644 index 1fbcdd145..000000000 --- a/plugins/anime-rkiss.js +++ /dev/null @@ -1,32 +0,0 @@ - -import fetch from 'node-fetch' -import { sticker } from '../lib/sticker.js' -let handler = async (m, { conn, args, usedPrefix, command }) => { - - let who - if (m.isGroup) who = m.mentionedJid[0] ? m.mentionedJid[0] : m.quoted ? m.quoted.sender : false - else who = m.chat - if (!who) throw `✳️ Etiqueta o menciona a alguien\n\n📌 Ejemplo : ${usedPrefix + command} @tag` - - let user = global.db.data.users[who] - let name = conn.getName(who) - let name2 = conn.getName(m.sender) - m.react(rwait) - - let rki = await fetch(`https://api.waifu.pics/sfw/kiss`) - if (!rki.ok) throw await rki.text() - let jkis = await rki.json() - let { url } = jkis - let stiker = await sticker(null, url, `(${name2}) le dio un beso a`, `${name}`) - conn.sendFile(m.chat, stiker, null, { asSticker: true }, m) - m.react('😚') - -} - -handler.help = ['kiss @tag'] -handler.tags = ['rnime'] -handler.command = /^(kiss|beso)$/i -handler.diamond = true -handler.group = true - -export default handler diff --git a/plugins/anime-rpat.js b/plugins/anime-rpat.js deleted file mode 100644 index 96d93f05b..000000000 --- a/plugins/anime-rpat.js +++ /dev/null @@ -1,33 +0,0 @@ -import fetch from 'node-fetch' -import { sticker } from '../lib/sticker.js' -//import db from '../lib/database.js' - -let handler = async (m, { conn, args, usedPrefix, command }) => { - - let who - if (m.isGroup) who = m.mentionedJid[0] ? m.mentionedJid[0] : m.quoted ? m.quoted.sender : false - else who = m.chat - if (!who) throw `✳️ Etiqueta o menciona a alguien\n\n📌 Ejemplo : ${usedPrefix + command} @tag` - - let user = global.db.data.users[who] - let name = conn.getName(who) - let name2 = conn.getName(m.sender) - m.react(rwait) - - let rpat = await fetch(`https://api.waifu.pics/sfw/pat`) - if (!rpat.ok) throw await rpat.text() - let json = await rpat.json() - let { url } = json - let stiker = await sticker(null, url, `(${name2}) acarició a`, `${name}`) - conn.sendFile(m.chat, stiker, null, { asSticker: true }, m) - m.react('☺️') - -} - -handler.help = ['pat @tag'] -handler.tags = ['rnime'] -handler.command = /^(acariciar|pat)$/i -handler.diamond = true -handler.group = true - -export default handler diff --git a/plugins/anime-rslap.js b/plugins/anime-rslap.js deleted file mode 100644 index 992d35869..000000000 --- a/plugins/anime-rslap.js +++ /dev/null @@ -1,33 +0,0 @@ -import fetch from 'node-fetch' -import { sticker } from '../lib/sticker.js' -//import db from '../lib/database.js' - -let handler = async (m, { conn, args, usedPrefix, command }) => { - - let who - if (m.isGroup) who = m.mentionedJid[0] ? m.mentionedJid[0] : m.quoted ? m.quoted.sender : false - else who = m.chat - if (!who) throw `✳️ Etiqueta o menciona a alguien\n\n📌 Ejemplo : ${usedPrefix + command} @tag` - - let user = global.db.data.users[who] - let name = conn.getName(who) - let name2 = conn.getName(m.sender) - m.react(rwait) - - let rki = await fetch(`https://api.waifu.pics/sfw/slap`) - if (!rki.ok) throw await rki.text() - let jkis = await rki.json() - let { url } = jkis - let stiker = await sticker(null, url, `(${name2}) le dio una bofetada a`, `${name}`) - conn.sendFile(m.chat, stiker, null, { asSticker: true }, m) - m.react('👊🏻') - -} - -handler.help = ['slap @tag'] -handler.tags = ['rnime'] -handler.command = /^(slap|bofetada)$/i -handler.diamond = true -handler.group = true - -export default handler diff --git a/plugins/anime-waifupics.js b/plugins/anime-waifupics.js deleted file mode 100644 index a48ad9525..000000000 --- a/plugins/anime-waifupics.js +++ /dev/null @@ -1,39 +0,0 @@ - -import fetch from 'node-fetch' -let handler = async (m, { conn, args, usedPrefix, command }) => { -m.react(rwait) - -let type = (command).toLowerCase() - -switch (type) { - - case 'loli': - case 'neko': - let loli = await conn.getFile(global.API('fgmods', `/api/img/${command}`, { }, 'apikey')) - conn.sendFile(m.chat, loli.data, 'img.jpg', `✅ Random ${command}`, m) - m.react(dmoji) - break - -case 'waifu': -case 'megumin': - let res = await fetch(`https://api.waifu.pics/sfw/${command}`) - if (!res.ok) throw await res.text() - let json = await res.json() - if (!json.url) throw '❎ Error' - conn.sendFile(m.chat, json.url, 'img.jpg', `✅ Random ${command}`, m) - m.react(dmoji) -break - -default: - } -} -handler.help = ['waifu', 'neko', 'megumin', 'loli'] -handler.tags = ['nime'] -handler.command = ['waifu', 'neko', 'megumin', 'loli'] -handler.diamond = true - -export default handler - -function pickRandom(list) { - return list[Math.floor(list.length * Math.random())] -} diff --git a/plugins/av-audios.js b/plugins/av-audios.js deleted file mode 100644 index fbe4ea5ed..000000000 --- a/plugins/av-audios.js +++ /dev/null @@ -1,23 +0,0 @@ - -let handler = m => m -handler.all = async function (m) { - for (const message in audioMsg) { - if (new RegExp(`^${message}$`, 'i').test(m.text)) { - this.sendFile(m.chat, audioMsg[message], 'audio.mp3', null, m, true) - break - } - } - return !0 - } - -export default handler - - -let audioMsg = { - 'fino señores': './src/mp3/fino.mp3', - 'buenos días': 'https://j.top4top.io/m_26464yyei1.mp3', - 'buenas tardes': 'https://i.top4top.io/m_2646qxac91.mp3', - 'buenas noches': 'https://h.top4top.io/m_26460eg6v1.mp3', - 'sad': 'https://h.top4top.io/m_2474fhcbh1.mp3', - '@5492622271736|@59172945992': 'https://l.top4top.io/m_2492i4mdu1.mp3' -} diff --git a/plugins/av-bot.js b/plugins/av-bot.js deleted file mode 100644 index f257c2ffd..000000000 --- a/plugins/av-bot.js +++ /dev/null @@ -1,22 +0,0 @@ - -let handler = async (m, { conn}) => { - -let name = conn.getName(m.sender) -let av = `./src/mp3/${pickRandom(["criss", "andrea"])}.mp3` - -conn.sendButton(m.chat, `Hola *${name}* \n \nNecesitas ayuda? \n`, fgig, null, [ - ['⦙☰ Menu', '/help'], - ['⦙☰ Menu 2', '/menu2'], - ['⌬ Grupos', '/gpdylux'] - ], m) -conn.sendFile(m.chat, av, 'audio.mp3', null, m, true, { type: 'audioMessage', ptt: true }) -} - -handler.customPrefix = /^(bot|dylux)$/i -handler.command = new RegExp - -export default handler - -function pickRandom(list) { - return list[Math.floor(list.length * Math.random())] -} diff --git a/plugins/cmd-del.js b/plugins/cmd-del.js deleted file mode 100644 index 70ddbb7e4..000000000 --- a/plugins/cmd-del.js +++ /dev/null @@ -1,19 +0,0 @@ -//import db from '../lib/database.js' - -let handler = async (m, { text }) => { - let hash = text - if (m.quoted && m.quoted.fileSha256) hash = m.quoted.fileSha256.toString('hex') - if (!hash) throw `✳️ Ingrese el nombre del comamdo` - let sticker = global.db.data.sticker - if (sticker[hash] && sticker[hash].locked) throw '✳️ No puedes borrar este comando' - delete sticker[hash] - m.reply(`✅ Comando eliminado`) -} - - -handler.help = ['cmd'].map(v => 'del' + v + ' ') -handler.tags = ['cmd'] -handler.command = ['delcmd'] -handler.owner = true - -export default handler diff --git a/plugins/cmd-list.js b/plugins/cmd-list.js deleted file mode 100644 index 53dc575b0..000000000 --- a/plugins/cmd-list.js +++ /dev/null @@ -1,22 +0,0 @@ -//import db from '../lib/database.js' - -let handler = async (m, { conn }) => { - conn.reply(m.chat, ` -*LISTA DE COMANDOS* - -▢ *Info:* Si esta en *negrita* esta bloqueado - -────────────────── -${Object.entries(global.db.data.sticker).map(([key, value], index) => `${index + 1}. ${value.locked ? `(bloqueado) ${key}` : key} : ${value.text}`).join('\n')} - -`.trim(), null, { - mentions: Object.values(global.db.data.sticker).map(x => x.mentionedJid).reduce((a, b) => [...a, ...b], []) - }) -} - - -handler.help = ['listcmd'] -handler.tags = ['cmd'] -handler.command = ['listcmd'] - -export default handler diff --git a/plugins/cmd-set.js b/plugins/cmd-set.js deleted file mode 100644 index 4f9a64ce3..000000000 --- a/plugins/cmd-set.js +++ /dev/null @@ -1,27 +0,0 @@ -//import db from '../lib/database.js' - -let handler = async (m, { text, usedPrefix, command }) => { - global.db.data.sticker = global.db.data.sticker || {} - if (!m.quoted) throw `✳️Responde a un mensaje con *${usedPrefix + command}*` - if (!m.quoted.fileSha256) throw '⚠️ Menciona al mensaje' - if (!text) throw `✳️ Falta el comando` - let sticker = global.db.data.sticker - let hash = m.quoted.fileSha256.toString('base64') - if (sticker[hash] && sticker[hash].locked) throw '⚠️ No tienes permiso para cambiar este comando de Sticker' - sticker[hash] = { - text, - mentionedJid: m.mentionedJid, - creator: m.sender, - at: + new Date, - locked: false, - } - m.reply(`✅ Comando guardado`) -} - - -handler.help = ['cmd'].map(v => 'set' + v + ' ') -handler.tags = ['cmd'] -handler.command = ['setcmd'] -handler.owner = true - -export default handler diff --git a/plugins/dl-facebook.js b/plugins/dl-facebook.js deleted file mode 100644 index fc4aadb7e..000000000 --- a/plugins/dl-facebook.js +++ /dev/null @@ -1,24 +0,0 @@ - -import fg from 'api-dylux' -let handler = async (m, { conn, args, usedPrefix, command }) => { - - if (!args[0]) throw `✳️ Envíe el link de un video de Facebook\n\n📌 Ejemplo :\n*${usedPrefix + command}* https://fb.watch/d7nB8-L-gR/` - m.react(rwait) - try { - let result = await fg.fbdl(args[0]); - let tex = ` -┌─⊷ *FBDL* -▢ *Título:* ${result.title} -└───────────`; - conn.sendFile(m.chat, result.videoUrl, 'fb.mp4', tex, m); - m.react(done); - } catch (error) { - m.reply('Error: Intente de nuevo con otro link') - } -} -handler.help = ['facebook'].map(v => v + ' ') -handler.tags = ['dl'] -handler.command = /^((facebook|fb)(downloder|dl)?)$/i -handler.diamond = true - -export default handler diff --git a/plugins/dl-gdrive.js b/plugins/dl-gdrive.js deleted file mode 100644 index 41c10ba30..000000000 --- a/plugins/dl-gdrive.js +++ /dev/null @@ -1,27 +0,0 @@ - -import fg from 'api-dylux' -let handler = async (m, { conn, args, usedPrefix, command }) => { - - if (!args[0]) throw `✳️ Ingrese un link de Google Drive` - m.react(rwait) - try { - let res = await fg.GDriveDl(args[0]) - await m.reply(` -≡ *Google Drive DL* -▢ *Nombre:* ${res.fileName} -▢ *Tamaño:* ${res.fileSize} -▢ *tipo:* ${res.mimetype}`) - - conn.sendMessage(m.chat, { document: { url: res.downloadUrl }, fileName: res.fileName, mimetype: res.mimetype }, { quoted: m }) - m.react(done) - } catch { - m.reply('Error: Revisa el link o intenta con otro link') - } -} -handler.help = ['gdrive'] -handler.tags = ['dl', 'prem'] -handler.command = ['gdrive'] -handler.diamond = true -handler.premium = true - -export default handler diff --git a/plugins/dl-gitclone.js b/plugins/dl-gitclone.js deleted file mode 100644 index 9f34fa91f..000000000 --- a/plugins/dl-gitclone.js +++ /dev/null @@ -1,20 +0,0 @@ - -import fetch from 'node-fetch' -const regex = /(?:https|git)(?::\/\/|@)github\.com[\/:]([^\/:]+)\/(.+)/i -let handler = async (m, { conn, args, usedPrefix, command }) => { - if (!args[0]) throw `¿Dónde está el enlace de github?\n\n📌 Ejemplo : ${usedPrefix + command} https://github.com/FG98F/dylux-fg` - if (!regex.test(args[0])) throw '⚠️ link incorrecto' - let [_, user, repo] = args[0].match(regex) || [] - repo = repo.replace(/.git$/, '') - let url = `https://api.github.com/repos/${user}/${repo}/zipball` - let filename = (await fetch(url, { method: 'HEAD' })).headers.get('content-disposition').match(/attachment; filename=(.*)/)[1] - - m.reply(`✳️ *Espere, enviando repositorio..*`) - conn.sendFile(m.chat, url, filename, null, m) -} -handler.help = ['gitclone '] -handler.tags = ['dl'] -handler.command = ['gitclone'] -handler.diamond = true - -export default handler diff --git a/plugins/dl-igstalk.js b/plugins/dl-igstalk.js deleted file mode 100644 index 523ba3a69..000000000 --- a/plugins/dl-igstalk.js +++ /dev/null @@ -1,27 +0,0 @@ - -import fg from 'api-dylux' -let handler= async (m, { conn, args, text, usedPrefix, command }) => { - - if (!args[0]) throw `✳️ Ingrese el Username de Instagram\n\n📌Ejemplo: ${usedPrefix + command} fg98_ff` - try { - let res = await fg.igStalk(args[0]) - let te = ` -┌──「 *STALKING* -▢ *🔖Nombre:* ${res.name} -▢ *🔖Username:* ${res.username} -▢ *👥Seguidores:* ${res.followersH} -▢ *🫂Siguiendo:* ${res.followingH} -▢ *📌Bio:* ${res.description} -▢ *🏝️Posts:* ${res.postsH} -▢ *🔗 Link* : https://instagram.com/${res.username.replace(/^@/, '')} -└────────────` - await conn.sendFile(m.chat, res.profilePic, 'igstalk.png', te, m) - } catch { - m.reply(`✳️ Revisa que el nombre de usuario sea de *Instagram*`) - } -} -handler.help = ['igstalk'] -handler.tags = ['dl'] -handler.command = ['igstalk'] - -export default handler diff --git a/plugins/dl-igstory.js b/plugins/dl-igstory.js deleted file mode 100644 index fe4c6f049..000000000 --- a/plugins/dl-igstory.js +++ /dev/null @@ -1,18 +0,0 @@ - -import fg from 'api-dylux' -let handler = async (m, { conn, args, usedPrefix, command }) => { - if (!args[0]) throw `✳️ Ingrese un nombre de usuario\n📌Ejemplo: *${usedPrefix + command}* auronplay` - m.react(rwait) - let res = await fg.igstory(args[0]) - for (let { url, type } of res.results) { - conn.sendFile(m.chat, url, 'igstory.bin', `✅ Historia de *${res.username}*`, m) - } - - m.react(done) -} -handler.help = ['igstory'] -handler.tags = ['dl'] -handler.command = ['igstory', 'ighistoria'] -handler.diamond = true - -export default handler diff --git a/plugins/dl-instagram.js b/plugins/dl-instagram.js deleted file mode 100644 index 397b6a5f2..000000000 --- a/plugins/dl-instagram.js +++ /dev/null @@ -1,18 +0,0 @@ - -import fg from 'api-dylux' - -let handler = async (m, { conn, args, usedPrefix, command }) => { - if (!args[0]) throw `✳️ Uso del comamdo\n *${usedPrefix + command}* https://www.instagram.com/p/CYHeKxyMj-J/?igshid=YmMyMTA2M2Y=` - m.react(rwait) - let res = await fg.igdl(args[0]) - for (let result of res.url_list) { - conn.sendFile(m.chat, result, 'igdl.mp4', `✅ Resultado`, m) - m.react(done) - } -} -handler.help = ['instagram '] -handler.tags = ['dl'] -handler.command = ['ig', 'igdl', 'instagram', 'igimg', 'igvid'] -handler.diamond = true - -export default handler diff --git a/plugins/dl-mediafire.js b/plugins/dl-mediafire.js deleted file mode 100644 index cd1bd15c9..000000000 --- a/plugins/dl-mediafire.js +++ /dev/null @@ -1,63 +0,0 @@ - -import fetch from 'node-fetch' -import { mediafiredl } from '@bochilteam/scraper' -import fg from 'api-dylux' -let free = 150 // limite de descarga -let prem = 300 //si su servidor tienes menos de 2GB baja el límite -let handler = async (m, { conn, args, text, usedPrefix, command, isOwner, isPrems }) => { - - if (!args[0]) throw `✳️ Ingrese el link de mediafire junto al comando` - if (!args[0].match(/mediafire/gi)) throw `❎ Link incorrecto` - m.react(rwait) - - let limit = isPrems || isOwner ? prem : free - let u = /https?:\/\//.test(args[0]) ? args[0] : 'https://' + args[0] - let ss = await (await fetch(global.API('nrtm', '/api/ssweb', { delay: 1000, url: u }))).buffer() - try { - let res = await mediafiredl(args[0]) - let { url, url2, filename, ext, aploud, filesize, filesizeH } = res - let isLimit = limit * 1024 < filesize - let caption = ` - ≡ *MEDIAFIRE* -▢ *Nombre:* ${filename} -▢ *Tamaño:* ${filesizeH} -▢ *Extension:* ${ext} -▢ *Subido:* ${aploud} -${isLimit ? `\n▢ El archivo supera el límite de descarga *+${free} MB*\nPásate a premium para poder descargar archivos más de *${prem} MB*` : ''} -`.trim() - await conn.sendFile(m.chat, ss, 'ssweb.png', caption, m) - if(!isLimit) await conn.sendFile(m.chat, url, filename, '', m, null, { mimetype: ext, asDocument: true }) - m.react(done) - - } catch { - - try { - let res = await fg.mediafireDl(args[0]) - let { url, url2, filename, ext, upload_date, filesize, filesizeB } = res - let isLimit = limit * 1024 < filesizeB - let caption = ` - ≡ *MEDIAFIRE* -▢ *Nombre:* ${filename} -▢ *Tamaño:* ${filesize} -▢ *Extension:* ${ext} -▢ *Subido:* ${upload_date} -${isLimit ? `\n▢ El archivo supera el límite de descarga *+${free} MB*\nPásate a premium para poder descargar archivos más de *${prem} MB*` : ''} -`.trim() - -await conn.sendFile(m.chat, ss, 'ssweb.png', caption, m) -if(!isLimit) await conn.sendFile(m.chat, url, filename, '', m, null, { mimetype: ext, asDocument: true }) - m.react(done) -} catch { - m.reply(`Error: intenta con otro link`) -} - - } - -} -handler.help = ['mediafire '] -handler.tags = ['dl', 'prem'] -handler.command = ['mediafire', 'mfire'] -handler.diamond = true -handler.premium = false - -export default handler diff --git a/plugins/dl-play.js b/plugins/dl-play.js deleted file mode 100644 index d29c409d8..000000000 --- a/plugins/dl-play.js +++ /dev/null @@ -1,30 +0,0 @@ - -import yts from 'yt-search' -let handler = async (m, { conn, command, text, usedPrefix }) => { - - if (!text) throw `✳️ Ingresa el título de una canción\n\n📌Ejemplo *${usedPrefix + command}* Lil Peep hate my life` - let res = await yts(text) - let vid = res.videos[0] - if (!vid) throw `✳️ Vídeo/Audio no encontrado` - let { title, description, thumbnail, videoId, timestamp, views, ago, url } = vid - //const url = 'https://www.youtube.com/watch?v=' + videoId - m.react('🎧') - let play = ` - ≡ *FG MUSIC* -┌────────────── -▢ 📌 *Título* : ${title} -▢ 📆 *Publicado:* ${ago} -▢ ⌚ *Duración:* ${timestamp} -▢ 👀 *Vistas:* ${views} -└──────────────` - await conn.sendButton(m.chat, play, fgig, thumbnail, [ - ['🎶 MP3', `${usedPrefix}fgmp3 ${url}`], - ['🎥 MP4', `${usedPrefix}fgmp4 ${url}`] - ], m, rpl) -} -handler.help = ['play'] -handler.tags = ['dl'] -handler.command = ['play', 'playvid'] -handler.disabled = true - -export default handler diff --git a/plugins/dl-play2.js b/plugins/dl-play2.js deleted file mode 100644 index 341121bac..000000000 --- a/plugins/dl-play2.js +++ /dev/null @@ -1,54 +0,0 @@ - -import yts from 'yt-search' -import { youtubedl, youtubedlv2 } from '@bochilteam/scraper' -let limit = 320 -let handler = async (m, { conn, text, args, isPrems, isOwner, usedPrefix, command }) => { - - if (!text) throw `✳️ Ingresa el título de una canción\n\n📌Ejemplo *${usedPrefix + command}* Lil Peep hate my life` - let chat = global.db.data.chats[m.chat] - let res = await yts(text) - //let vid = res.all.find(video => video.seconds < 3600) - let vid = res.videos[0] - if (!vid) throw `✳️ Vídeo/Audio no encontrado` - let isVideo = /vid$/.test(command) - m.react('🎧') - - try { - let q = isVideo ? '360p' : '128kbps' - let v = vid.url - let yt = await youtubedl(v).catch(async () => await youtubedlv2(v)) - let dl_url = await (isVideo ? yt.video[q].download() : yt.audio[q].download()) - let title = await yt.title - let size = await (isVideo ? yt.video[q].fileSizeH : yt.audio[q].fileSizeH) - let play = ` - ≡ *FG MUSIC* -┌────────────── -▢ 📌 *Título* : ${vid.title} -▢ 📆 *Publicado:* ${vid.ago} -▢ ⌚ *Duración:* ${vid.timestamp} -▢ 👀 *Vistas:* ${vid.views} -└────────────── - -_Enviando..._` -conn.sendFile(m.chat, vid.thumbnail, 'play', play, m, null, rpig) - -if (size.split('MB')[0] >= limit) return m.reply(` ≡ *FG YTDL*\n\n▢ *⚖️Peso* : ${size}\n▢ *🎞️Calidad* : ${q}\n\n▢ _El archivo supera el límite de descarga_ *+${limit} MB*`) -if (size.includes('GB')) return m.reply(` ≡ *FG YTDL*\n\n▢ *⚖️Peso* : ${size}\n▢ *🎞️Calidad* : ${q}\n\n▢ _El archivo supera el límite de descarga_ *+${limit} MB*`) - conn.sendFile(m.chat, dl_url, title + '.mp' + (3 + /vid$/.test(command)), ` - ≡ *FG YTDL* - -▢ *📌Título* : ${title} -▢ *🎞️Calidad* : ${q} -▢ *⚖️Peso* : ${size} -`.trim(), m, false, { mimetype: isVideo ? '' : 'audio/mpeg', asDocument: chat.useDocument }) - m.react(done) - } catch { - m.reply(`Error: intenta de nuevo`) - } - -} -handler.help = ['play'] -handler.tags = ['dl'] -handler.command = ['play', 'playvid'] - -export default handler diff --git a/plugins/dl-playlist.js b/plugins/dl-playlist.js deleted file mode 100644 index f127aa11e..000000000 --- a/plugins/dl-playlist.js +++ /dev/null @@ -1,24 +0,0 @@ - -import { youtubeSearch } from '@bochilteam/scraper' -import yts from 'yt-search' -let handler = async(m, { conn, usedPrefix, text, args, command }) => { - - if (!text) throw `✳️ Ingresa el título de una canción\n\n*📌 Ejemplo*\n*${usedPrefix + command}* Lil Peep hate my fuccn life ` - m.react('📀') - let result = await yts(text) - let ytres = result.videos - let listSections = [] - Object.values(ytres).map((v, index) => { - listSections.push([`${index}┃ ${v.title}`, [ - ['🎶 MP3', `${usedPrefix}fgmp3 ${v.url}`, `▢ ⌚ *Duración:* ${v.timestamp}\n▢ 👀 *Vistas:* ${v.views}\n▢ 📌 *Título* : ${v.title}\n▢ 📆 *Publicado:* ${v.ago}\n`], - ['🎥 MP4', `${usedPrefix}fgmp4 ${v.url}`, `▢ ⌚ *Duración:* ${v.timestamp}\n▢ 👀 *Vistas:* ${v.views}\n▢ 📌 *Título* : ${v.title}\n▢ 📆 *Publicado:* ${v.ago}\n`] - ]]) - }) - return conn.sendList(m.chat, ' ≡ *FG MUSIC*🔎', `\n 📀 Aqui una lista de resultados de :\n *${text}*`, fgig, `Click Aquí `, listSections, m) -} -handler.help = ['play2'] -handler.tags = ['dl'] -handler.command = ['play2', 'playvid2', 'playlist', 'playlista'] -handler.disabled = true - -export default handler diff --git a/plugins/dl-tiktok.js b/plugins/dl-tiktok.js deleted file mode 100644 index 357376a6f..000000000 --- a/plugins/dl-tiktok.js +++ /dev/null @@ -1,47 +0,0 @@ - -import fg from 'api-dylux' -import fetch from 'node-fetch' -let handler = async (m, { conn, text, args, usedPrefix, command }) => { - - if (!args[0]) throw `✳️ Ingrese un link de Tiktok\n\n 📌 Ejemplo : ${usedPrefix + command} https://vm.tiktok.com/ZMjkj76X6/` - if (!args[0].match(/tiktok/gi)) throw `❎ verifica que el link sea de tiktok` - m.react(rwait) - try { - let res = await fetch(global.API('fgmods', '/api/downloader/tiktok2', { url: args[0] }, 'apikey')) - let data = await res.json() - - if (data.result.video) { - let tex = ` -┌─⊷ *TIKTOK DL* -▢ *Nombre:* ${data.result.author.name} -▢ *Username:* ${data.result.author.unique_id} -▢ *Duración:* ${data.result.video.durationFormatted} -▢ *Calidad:* ${data.result.video.ratio} -▢ *Likes:* ${data.result.stats.likeCount} -▢ *Vistas:* ${data.result.stats.playCount} -▢ *Descripción:* ${data.result.title} -└─────────── -` - conn.sendFile(m.chat, data.result.video.noWatermark, 'tiktok.mp4', tex, m); - m.react(done) - } else { - let cap = ` -▢ *Descripción:* ${data.result.title} -▢ *Likes:* ${data.result.stats.likeCount} -` - for (let tt of data.result.images) { - conn.sendMessage(m.chat, { image: { url: tt.url }, caption: cap }, { quoted: m }) - } - conn.sendFile(m.chat, data.result.music.play_url, 'tiktok.mp3', '', m, null, { mimetype: 'audio/mp4' }) - m.react(done) - } - } catch (error) { - m.reply(`❎ Error al descargar el video`) - } -} -handler.help = ['tiktok'] -handler.tags = ['dl'] -handler.command = ['tiktok', 'tt', 'tiktokimg', 'tiktokslide'] -handler.diamond = true - -export default handler diff --git a/plugins/dl-tiktokstalk.js b/plugins/dl-tiktokstalk.js deleted file mode 100644 index c32dee1a4..000000000 --- a/plugins/dl-tiktokstalk.js +++ /dev/null @@ -1,27 +0,0 @@ - -import fg from 'api-dylux' -let handler = async (m, { conn, text, args }) => { - - if (!text) throw `✳️ Ingrese el Username de un usuario de TikTok` -try { - let res = await fg.ttStalk(args[0]) - let txt = ` -┌──「 *TIKTOK STALK* -▢ *🔖Nombre:* ${res.name} -▢ *🔖Username:* ${res.username} -▢ *👥Seguidores:* ${res.followers} -▢ *🫂Siguiendo:* ${res.following} -▢ *📌Desc:* ${res.desc} - -▢ *🔗 Link* : https://tiktok.com/${res.username} -└────────────` - await conn.sendFile(m.chat, res.profile, 'tt.png', txt, m) -} catch { - m.reply(`✳️ Revisa que el nombre de usuario sea de TikTok`) -} -} -handler.help = ['tiktokstalk'] -handler.tags = ['dl'] -handler.command = /^t(tstalk|iktokstalk)$/i - -export default handler diff --git a/plugins/dl-twitter.js b/plugins/dl-twitter.js deleted file mode 100644 index 420dd6cf9..000000000 --- a/plugins/dl-twitter.js +++ /dev/null @@ -1,24 +0,0 @@ - -import fg from 'api-dylux' -let handler = async (m, { conn, args, usedPrefix, command }) => { -if (!args[0]) throw `📌 Ejemplo : \n*${usedPrefix + command}* https://twitter.com/fernandavasro/status/1569741835555291139?t=ADxk8P3Z3prq8USIZUqXCg&s=19` - m.react(rwait) - try { - let { SD, HD, desc, thumb, audio } = await fg.twitter(args[0]) - let te = ` -┌─⊷ *TWITTER DL* -▢ Descripción: ${desc} -└───────────` -conn.sendFile(m.chat, HD, 'twitter.mp4', te, m) -m.react(done) -} catch (e) { - m.reply(`✳️ verifica que el link sea de Twitter`) - } - -} -handler.help = ['twitter'].map(v => v + ' ') -handler.tags = ['dl'] -handler.command = /^(twitter|tw)$/i -handler.diamond = true - -export default handler diff --git a/plugins/dl-yta.js b/plugins/dl-yta.js deleted file mode 100644 index 03ca9e1a2..000000000 --- a/plugins/dl-yta.js +++ /dev/null @@ -1,32 +0,0 @@ - -import { youtubedl, youtubedlv2 } from '@bochilteam/scraper'; -let handler = async (m, { conn, text, args, isPrems, isOwner, usedPrefix, command }) => { - if (!args || !args[0]) throw `✳️ Ejemplo :\n${usedPrefix + command} https://youtu.be/YzkTFFwxtXI` - if (!args[0].match(/youtu/gi)) throw `❎ Verifica que el link de YouTube` - m.react(rwait) - let chat = global.db.data.chats[m.chat] - try { - let q = '128kbps' - let v = args[0] - const yt = await youtubedl(v).catch(async () => await youtubedlv2(v)) - const dl_url = await yt.audio[q].download() - const title = await yt.title - const size = await yt.audio[q].fileSizeH - conn.sendFile(m.chat, dl_url, title + '.mp3', ` - ≡ *FG YTDL* - -▢ *📌Titulo* : ${title} -▢ *⚖️Tamaño* : ${size} -`.trim(), m, false, { mimetype: 'audio/mpeg', asDocument: chat.useDocument }) - m.react(done) - } catch { - await m.reply(`❎ Error: no se pudo descargar el audio`) -} - -} -handler.help = ['ytmp3 '] -handler.tags = ['dl'] -handler.command = ['ytmp3', 'fgmp3'] -handler.diamond = true - -export default handler diff --git a/plugins/dl-yts.js b/plugins/dl-yts.js deleted file mode 100644 index de602e888..000000000 --- a/plugins/dl-yts.js +++ /dev/null @@ -1,31 +0,0 @@ - -import yts from 'yt-search' - -let handler = async (m, {conn, text }) => { - if (!text) throw '✳️ Que quieres que busque en YouTube?' - let results = await yts(text) - let tes = results.all - let teks = results.all.map(v => { - switch (v.type) { - case 'video': return ` -▢ ${v.title} -▢ *Link* : ${v.url} -▢ *Duración* : ${v.timestamp} -▢ *Subido :* ${v.ago} -▢ *Vistas:* ${v.views} - - `.trim() - case 'canal': return ` -▢ *${v.name}* (${v.url}) -▢${v.subCountLabel} (${v.subCount}) Suscribirse -▢ ${v.videoCount} videos -`.trim() - } - }).filter(v => v).join('\n\n________________________\n\n') - conn.sendFile(m.chat, tes[0].thumbnail, 'yts.jpeg', teks, m) -} -handler.help = ['ytsearch'] -handler.tags = ['dl'] -handler.command = ['ytsearch', 'yts'] - -export default handler diff --git a/plugins/dl-ytv.js b/plugins/dl-ytv.js deleted file mode 100644 index 17042b4b3..000000000 --- a/plugins/dl-ytv.js +++ /dev/null @@ -1,39 +0,0 @@ - -import fg from 'api-dylux' -import { youtubedl, youtubedlv2 } from '@bochilteam/scraper' -let limit = 350 -let handler = async (m, { conn, args, isPrems, isOwner, usedPrefix, command }) => { - if (!args || !args[0]) throw `✳️ Ejemplo :\n${usedPrefix + command} https://youtu.be/YzkTFFwxtXI` - if (!args[0].match(/youtu/gi)) throw `❎ Verifica que el link de YouTube` - let chat = global.db.data.chats[m.chat] - m.react(rwait) - try { - let q = args[1] || '360p' - let v = args[0] - const yt = await youtubedl(v).catch(async () => await youtubedlv2(v)) - const dl_url = await yt.video[q].download() - const title = await yt.title - const size = await yt.video[q].fileSizeH - - if (size.split('MB')[0] >= limit) return m.reply(` ≡ *FG YTDL*\n\n▢ *⚖️Peso* : ${size}\n▢ *🎞️Calidad* : ${q}\n\n▢ _El archivo supera el límite de descarga_ *+${limit} MB*`) - conn.sendFile(m.chat, dl_url, title + '.mp4', ` - ≡ *FG YTDL* - -▢ *📌Título* : ${title} -▢ *📟 Ext* : mp4 -▢ *🎞️Calidad* : ${q} -▢ *⚖️Peso* : ${size} -`.trim(), m, false, { asDocument: chat.useDocument }) - m.react(done) - - } catch { - m.reply(`✳️ Error al descargar el video intenta con otro`) - } - -} -handler.help = ['ytmp4 '] -handler.tags = ['dl'] -handler.command = ['ytmp4', 'fgmp4'] -handler.diamond = true - -export default handler diff --git a/plugins/econ-adddi.js b/plugins/econ-adddi.js deleted file mode 100644 index 5b5544f9b..000000000 --- a/plugins/econ-adddi.js +++ /dev/null @@ -1,31 +0,0 @@ -//import db from '../lib/database.js' - -let handler = async (m, { conn, text }) => { - let who - if (m.isGroup) who = m.mentionedJid[0] - else who = m.chat - if (!who) throw '✳️ Taguea al usuario' - let txt = text.replace('@' + who.split`@`[0], '').trim() - if (!txt) throw '✳️ Ingrese la cantidad de *Diamantes* que quiere añadir' - if (isNaN(txt)) throw '🔢 sólo números' - let dmt = parseInt(txt) - let diamond = dmt - - if (diamond < 1) throw '✳️ Mínimo es *1*' - let users = global.db.data.users - users[who].diamond += dmt - - await m.reply(`≡ *💎 AÑADIDO* -┌────────────── -▢ *Total:* ${dmt} -└──────────────`) - conn.fakeReply(m.chat, `▢ Recibiste \n\n *+${dmt}* Diamantes`, who, m.text) -} - -handler.help = ['adddi <@user>'] -handler.tags = ['econ'] -handler.command = ['adddi'] -handler.rowner = true - -export default handler - diff --git a/plugins/econ-addxp.js b/plugins/econ-addxp.js deleted file mode 100644 index 5be285a75..000000000 --- a/plugins/econ-addxp.js +++ /dev/null @@ -1,31 +0,0 @@ -//import db from '../lib/database.js' - -let handler = async (m, { conn, text }) => { - let who - if (m.isGroup) who = m.mentionedJid[0] - else who = m.chat - if (!who) throw '✳️ Taguea al usuario' - let txt = text.replace('@' + who.split`@`[0], '').trim() - if (!txt) throw '✳️ Ingrese la cantidad de *XP* que quiere añadir' - if (isNaN(txt)) throw ' 🔢 sólo números' - let xp = parseInt(txt) - let exp = xp - - if (exp < 1) throw '✳️ Mínimo es *1*' - let users = global.db.data.users - users[who].exp += xp - - await m.reply(`≡ *XP AÑADIDO* -┌────────────── -▢ *Total:* ${xp} -└──────────────`) - conn.fakeReply(m.chat, `▢ Recibiste \n\n *+${xp} XP*`, who, m.text) -} - -handler.help = ['addxp <@user>'] -handler.tags = ['econ'] -handler.command = ['addxp'] -handler.rowner = true - -export default handler - diff --git a/plugins/econ-balance.js b/plugins/econ-balance.js deleted file mode 100644 index ed403d506..000000000 --- a/plugins/econ-balance.js +++ /dev/null @@ -1,23 +0,0 @@ - -let handler = async (m, {conn, usedPrefix}) => { - - let who = m.quoted ? m.quoted.sender : m.mentionedJid && m.mentionedJid[0] ? m.mentionedJid[0] : m.fromMe ? conn.user.jid : m.sender - let user = global.db.data.users[who] - if (!(who in global.db.data.users)) throw `✳️ El usuario no se encuentra en mi base de datos` - conn.reply(m.chat, ` -┌───⊷ *BALANCE* ⊶ -▢ *📌Nombre* : _@${who.split('@')[0]}_ -▢ *💎Diamantes* : _${user.diamond}_ -▢ *⬆️XP* : _Total ${user.exp}_ -└────────────── - -*NOTA :* -Puedes comprar 💎 diamantes usando los comandos -❏ *${usedPrefix}buy * -❏ *${usedPrefix}buyall*`, m, { mentions: [who] }) -} -handler.help = ['balance'] -handler.tags = ['econ'] -handler.command = ['bal', 'diamantes', 'diamond', 'balance'] - -export default handler diff --git a/plugins/econ-daily.js b/plugins/econ-daily.js deleted file mode 100644 index 45cb88442..000000000 --- a/plugins/econ-daily.js +++ /dev/null @@ -1,38 +0,0 @@ - -//import db from '../lib/database.js' - -const free = 5000 -const prem = 20000 - -let handler = async (m, {conn, isPrems }) => { - let time = global.db.data.users[m.sender].lastclaim + 86400000 - if (new Date - global.db.data.users[m.sender].lastclaim < 86400000) throw `🎁 *Ya recogiste tu recompensa diaria*\n\n🕚 Vuelve en *${msToTime(time - new Date())}* ` - global.db.data.users[m.sender].exp += isPrems ? prem : free - m.reply(` -🎁 *RECOMPENSA DIARIA* - -▢ *Has recibido:* -🆙 *XP* : +${isPrems ? prem : free}`) - global.db.data.users[m.sender].lastclaim = new Date * 1 -} -handler.help = ['daily'] -handler.tags = ['econ'] -handler.command = ['daily', 'claim'] - -export default handler - - - -function msToTime(duration) { - var milliseconds = parseInt((duration % 1000) / 100), - seconds = Math.floor((duration / 1000) % 60), - minutes = Math.floor((duration / (1000 * 60)) % 60), - hours = Math.floor((duration / (1000 * 60 * 60)) % 24) - - hours = (hours < 10) ? "0" + hours : hours - minutes = (minutes < 10) ? "0" + minutes : minutes - seconds = (seconds < 10) ? "0" + seconds : seconds - - return hours + " Horas " + minutes + " Minutos" -} - diff --git a/plugins/econ-leaderboard.js b/plugins/econ-leaderboard.js deleted file mode 100644 index 2673572d5..000000000 --- a/plugins/econ-leaderboard.js +++ /dev/null @@ -1,58 +0,0 @@ - -import { areJidsSameUser } from '@whiskeysockets/baileys' - -let handler = async (m, { conn, args, participants }) => { - let users = Object.entries(global.db.data.users).map(([key, value]) => { - return {...value, jid: key} - }) - let sortedExp = users.map(toNumber('exp')).sort(sort('exp')) - let sortedLim = users.map(toNumber('diamond')).sort(sort('diamond')) - let sortedLevel = users.map(toNumber('level')).sort(sort('level')) - let usersExp = sortedExp.map(enumGetKey) - let usersLim = sortedLim.map(enumGetKey) - let usersLevel = sortedLevel.map(enumGetKey) - let len = args[0] && args[0].length > 0 ? Math.min(50, Math.max(parseInt(args[0]), 5)) : Math.min(5, sortedExp.length) - let text = ` - ≡ *TABLA DE CLASIFICACION* - -▢ *TOP ${len} XP* 🧬 -Tú : *${usersExp.indexOf(m.sender) + 1}* de *${usersExp.length}* - -${sortedExp.slice(0, len).map(({ jid, exp }, i) => `*${i + 1}.* ${participants.some(p => areJidsSameUser(jid, p.id)) ? `(${conn.getName(jid)}) wa.me/` : '@'}${jid.split`@`[0]} ➭ _*XP ${exp}*_`).join`\n`} - -▢ *TOP ${len} DIAMANTES💎* -Tú : *${usersLim.indexOf(m.sender) + 1}* de *${usersLim.length}* - -${sortedLim.slice(0, len).map(({ jid, diamond }, i) => `*${i + 1}.* ${participants.some(p => areJidsSameUser(jid, p.id)) ? `(${conn.getName(jid)}) wa.me/` : '@'}${jid.split`@`[0]} ➭ _*Diamantes ${diamond}*_`).join`\n`} - -▢ *TOP ${len} NIVEL* ⬆️ -Tú : *${usersLevel.indexOf(m.sender) + 1}* de *${usersLevel.length}* - -${sortedLevel.slice(0, len).map(({ jid, level }, i) => `*${i + 1}.* ${participants.some(p => areJidsSameUser(jid, p.id)) ? `(${conn.getName(jid)}) wa.me/` : '@'}${jid.split`@`[0]} ➭ _*Nivel ${level}*_`).join`\n`} -`.trim() - conn.reply(m.chat, text, m, { - mentions: [...usersExp.slice(0, len), ...usersLim.slice(0, len), ...usersLevel.slice(0, len)].filter(v => !participants.some(p => areJidsSameUser(v, p.id) )) -}) - -} -handler.help = ['leaderboard'] -handler.tags = ['econ'] -handler.command = ['leaderboard', 'lb', 'top'] - -export default handler - -function sort(property, ascending = true) { - if (property) return (...args) => args[ascending & 1][property] - args[!ascending & 1][property] - else return (...args) => args[ascending & 1] - args[!ascending & 1] -} - -function toNumber(property, _default = 0) { - if (property) return (a, i, b) => { - return {...b[i], [property]: a[property] === undefined ? _default : a[property]} - } - else return a => a === undefined ? _default : a -} - -function enumGetKey(a) { - return a.jid -} diff --git a/plugins/econ-levelup.js b/plugins/econ-levelup.js deleted file mode 100644 index 23c7a2d8c..000000000 --- a/plugins/econ-levelup.js +++ /dev/null @@ -1,64 +0,0 @@ - -import { canLevelUp, xpRange } from '../lib/levelling.js' -let handler = async (m, { conn }) => { - let name = conn.getName(m.sender) - let pp = await conn.profilePictureUrl(m.sender, 'image').catch(_ => 'https://i.ibb.co/1ZxrXKJ/avatar-contact.jpg') - let user = global.db.data.users[m.sender] - if (!canLevelUp(user.level, user.exp, global.multiplier)) { - let { min, xp, max } = xpRange(user.level, global.multiplier) - let txt = ` -┌───⊷ *NIVEL* -▢ Nombre : *${name}* -▢ Nivel : *${user.level}* -▢ XP : *${user.exp - min}/${xp}* -▢ Rango : *${user.role}* -└────────────── - -Te falta *${max - user.exp}* de *XP* para subir de nivel -`.trim() -try { - let imgg = API('fgmods', '/api/maker/rank', { - username: name, - xp: user.exp - min, - exp: xp, - avatar: pp, - level: user.level, - ranklog: 'https://i.ibb.co/7gfnyMw/gold.png', - background: 'https://i.ibb.co/CsNgBYw/qiyana.jpg' -}, 'apikey') - - conn.sendFile(m.chat, imgg, 'level.jpg', txt, m) -} catch (e) { - m.reply(txt) -} - } - let before = user.level * 1 - while (canLevelUp(user.level, user.exp, global.multiplier)) user.level++ - if (before !== user.level) { - user.role = global.rpg.role(user.level).name - - let str = ` -┌─⊷ *LEVEL UP* -▢ Nivel anterior : *${before}* -▢ Nivel actual : *${user.level}* -▢ Rango : *${user.role}* -└────────────── - -*_Cuanto más interactúes con los bots, mayor será tu nivel_* -`.trim() - try { - let img = API('fgmods', '/api/maker/levelup', { - avatar: pp - }, 'apikey') - conn.sendFile(m.chat, img, 'levelup.jpg', str, m) - } catch (e) { - m.reply(str) - } - } -} - -handler.help = ['levelup'] -handler.tags = ['econ'] -handler.command = ['nivel', 'lvl', 'levelup', 'level'] - -export default handler diff --git a/plugins/econ-mine.js b/plugins/econ-mine.js deleted file mode 100644 index a45f1732a..000000000 --- a/plugins/econ-mine.js +++ /dev/null @@ -1,30 +0,0 @@ -//import db from '../lib/database.js' - -let handler = async (m, { conn }) => { - - let hasil = Math.floor(Math.random() * 5000) - let time = global.db.data.users[m.sender].lastmiming + 14400000 - if (new Date - global.db.data.users[m.sender].lastmiming < 14400000) throw `⏳ _Espera_ *${msToTime(time - new Date())}* _para regresar a la mina_` - global.db.data.users[m.sender].exp += hasil - m.reply(` -🎉 Genial! minaste *${hasil} XP*`) - global.db.data.users[m.sender].lastmiming = new Date * 1 -} -handler.help = ['mine'] -handler.tags = ['econ'] -handler.command = ['minar', 'miming', 'mine'] - -export default handler - -function msToTime(duration) { - var milliseconds = parseInt((duration % 1000) / 100), - seconds = Math.floor((duration / 1000) % 60), - minutes = Math.floor((duration / (1000 * 60)) % 60), - hours = Math.floor((duration / (1000 * 60 * 60)) % 24) - - hours = (hours < 10) ? "0" + hours : hours - minutes = (minutes < 10) ? "0" + minutes : minutes - seconds = (seconds < 10) ? "0" + seconds : seconds - - return hours + " hora(s) " + minutes + " minuto(s) " + seconds + " segundo(s)" -} diff --git a/plugins/econ-rob.js b/plugins/econ-rob.js deleted file mode 100644 index 1c4acb474..000000000 --- a/plugins/econ-rob.js +++ /dev/null @@ -1,41 +0,0 @@ - -let ro = 3000 -let handler = async (m, { conn, usedPrefix, command}) => { - let time = global.db.data.users[m.sender].lastrob + 7200000 - if (new Date - global.db.data.users[m.sender].lastrob < 7200000) throw `⏱️¡Hey! Espera *${msToTime(time - new Date())}* para volver a robar` - let who - if (m.isGroup) who = m.mentionedJid[0] ? m.mentionedJid[0] : m.quoted ? m.quoted.sender : false - else who = m.chat - if (!who) throw `✳️ Etiqueta a alguien para robar` - if (!(who in global.db.data.users)) throw `✳️ El usuario no se encuentra en mi base de datos` - let users = global.db.data.users[who] - let rob = Math.floor(Math.random() * ro) - if (users.exp < rob) return m.reply(`🔖 @${who.split`@`[0]} tiene menos de *${ro} xp*\nNo robes a un podre v":`, null, { mentions: [who] }) - global.db.data.users[m.sender].exp += rob - global.db.data.users[who].exp -= rob - - m.reply(` - ‣ Robaste *${rob} XP* a @${who.split`@`[0]} - `, null, { mentions: [who] }) - global.db.data.users[m.sender].lastrob = new Date * 1 - } - - handler.help = ['rob'] - handler.tags = ['econ'] - handler.command = ['robar', 'rob'] - - export default handler - - function msToTime(duration) { - var milliseconds = parseInt((duration % 1000) / 100), - seconds = Math.floor((duration / 1000) % 60), - minutes = Math.floor((duration / (1000 * 60)) % 60), - hours = Math.floor((duration / (1000 * 60 * 60)) % 24) - - hours = (hours < 10) ? "0" + hours : hours - minutes = (minutes < 10) ? "0" + minutes : minutes - seconds = (seconds < 10) ? "0" + seconds : seconds - - return hours + " Hora(s) " + minutes + " Minuto(s)" - } - diff --git a/plugins/econ-shop.js b/plugins/econ-shop.js deleted file mode 100644 index 028db31d1..000000000 --- a/plugins/econ-shop.js +++ /dev/null @@ -1,24 +0,0 @@ -//import db from '../lib/database.js' - -const xpperdiamond = 350 -let handler = async (m, { conn, command, args }) => { - let count = command.replace(/^buy/i, '') - count = count ? /all/i.test(count) ? Math.floor(global.db.data.users[m.sender].exp / xpperdiamond) : parseInt(count) : args[0] ? parseInt(args[0]) : 1 - count = Math.max(1, count) - if (global.db.data.users[m.sender].exp >= xpperdiamond * count) { - global.db.data.users[m.sender].exp -= xpperdiamond * count - global.db.data.users[m.sender].diamond += count - conn.reply(m.chat, ` -┌─「 *NOTA DE PAGO* 」 -‣ *Compra nominal* : + ${count}💎 -‣ *Gastado* : -${xpperdiamond * count} XP -└──────────────`, m) - } else conn.reply(m.chat, `❎ Lo siento, no tienes suficientes *XP* para comprar *${count}* Diamantes💎\n\n Puedes conseguir *XP* usando los comandos del *menú juegos y economía*`, m) -} -handler.help = ['buy', 'buyall'] -handler.tags = ['econ'] -handler.command = ['buy', 'buyall'] - -handler.disabled = false - -export default handler diff --git a/plugins/econ-transfer.js b/plugins/econ-transfer.js deleted file mode 100644 index d1b1d90c7..000000000 --- a/plugins/econ-transfer.js +++ /dev/null @@ -1,85 +0,0 @@ -const items = ['diamond', 'exp'] -let confirmation = {} - -async function handler(m, { conn, args, usedPrefix, command }) { - if (confirmation[m.sender]) return m.reply('estas haciendo una transferencia') - let user = global.db.data.users[m.sender] - const item = items.filter(v => v in user && typeof user[v] == 'number') - let lol = `✳️ Uso correcto del comamdo -*${usedPrefix + command}* [tipo] [cantidad] [@user] - -📌 Ejemplo : -*${usedPrefix + command}* exp 65 @${m.sender.split('@')[0]} - -📍 Artículos transferibles -┌────────────── -▢ *diamond* = Diamante 💎 -▢ *exp* = Experiencia 🆙 -└────────────── -`.trim() - const type = (args[0] || '').toLowerCase() - if (!item.includes(type)) return conn.reply(m.chat, lol, m, { mentions: [m.sender] }) - const count = Math.min(Number.MAX_SAFE_INTEGER, Math.max(1, (isNumber(args[1]) ? parseInt(args[1]) : 1))) * 1 - let who = m.mentionedJid && m.mentionedJid[0] ? m.mentionedJid[0] : args[2] ? (args[2].replace(/[@ .+-]/g, '') + '@s.whatsapp.net') : '' - if (!who) return m.reply('✳️ Taguea al usuario') - if (!(who in global.db.data.users)) return m.reply(`✳️ El Usuario no está en mi base de datos`) - if (user[type] * 1 < count) return m.reply(`✳️ *${type}* insuficiente para transferir`) - let confirm = ` -¿Está seguro de que desea transferir *${count}* _*${type}*_ a *@${(who || '').replace(/@s\.whatsapp\.net/g, '')}* ? - -- Tienes *60s* -_responde *si* o *no*_ -`.trim() - - //conn.sendButton(m.chat, confirm, fgig, null, [['si'], ['no']], m, { mentions: [who] }) - m.reply(confirm, null, { mentions: [who] }) - confirmation[m.sender] = { - sender: m.sender, - to: who, - message: m, - type, - count, - timeout: setTimeout(() => (m.reply('⏳ Se acabó el tiempo'), delete confirmation[m.sender]), 60 * 1000) - } -} - -handler.before = async m => { - if (m.isBaileys) return - if (!(m.sender in confirmation)) return - if (!m.text) return - let { timeout, sender, message, to, type, count } = confirmation[m.sender] - if (m.id === message.id) return - let user = global.db.data.users[sender] - let _user = global.db.data.users[to] - if (/no?/g.test(m.text.toLowerCase())) { - clearTimeout(timeout) - delete confirmation[sender] - return m.reply('✅ Transferencia Cancelado') - } - if (/si?/g.test(m.text.toLowerCase())) { - let previous = user[type] * 1 - let _previous = _user[type] * 1 - user[type] -= count * 1 - _user[type] += count * 1 - if (previous > user[type] * 1 && _previous < _user[type] * 1) m.reply(`✅ Se realizo la transferencia de \n\n*${count}* *${type}* a @${(to || '').replace(/@s\.whatsapp\.net/g, '')}`, null, { mentions: [to] }) - else { - user[type] = previous - _user[type] = _previous - m.reply(`❎ Error al transferir *${count}* ${type} a *@${(to || '').replace(/@s\.whatsapp\.net/g, '')}*`, null, { mentions: [to] }) - } - clearTimeout(timeout) - delete confirmation[sender] - } -} - -handler.help = ['transfer'].map(v => v + ' [tipo] [monto] [@tag]') -handler.tags = ['econ'] -handler.command = ['payxp','paydi', 'transfer', 'darxp','dardi',] - -handler.disabled = false - -export default handler - -function isNumber(x) { - return !isNaN(x) -} diff --git a/plugins/econ-work.js b/plugins/econ-work.js deleted file mode 100644 index dbe1c1bbe..000000000 --- a/plugins/econ-work.js +++ /dev/null @@ -1,41 +0,0 @@ - -import fetch from 'node-fetch' -import axios from 'axios' -let handler = async (m, { conn, usedPrefix, command }) => { - - let hasil = Math.floor(Math.random() * 2000) - let time = global.db.data.users[m.sender].lastwork + 3600000 - if (new Date - global.db.data.users[m.sender].lastwork < 3600000) throw `*🧘🏻‍♂️ Estas cansado* y por lo tanto hay que esperar *${msToTime(time - new Date())}* para volver a trabajar!` - - /*let w = await axios.get(global.API('fgmods', '/api/work', { }, 'apikey')) - let res = w.data.result*/ - let anu = (await axios.get('https://raw.githubusercontent.com/fgmods/fg-team/main/games/work.json')).data - let res = pickRandom(anu) - global.db.data.users[m.sender].exp += hasil - - m.reply(` -‣ ${res.fgwork} *${hasil} XP* -`) - global.db.data.users[m.sender].lastwork = new Date * 1 -} -handler.help = ['work'] -handler.tags = ['econ'] -handler.command = ['work', 'w', 'trabajar'] - -export default handler - -function msToTime(duration) { - var milliseconds = parseInt((duration % 1000) / 100), - seconds = Math.floor((duration / 1000) % 60), - minutes = Math.floor((duration / (1000 * 60)) % 60), - hours = Math.floor((duration / (1000 * 60 * 60)) % 24) - - hours = (hours < 10) ? "0" + hours : hours - minutes = (minutes < 10) ? "0" + minutes : minutes - seconds = (seconds < 10) ? "0" + seconds : seconds - - return minutes + " minuto(s) " + seconds + " segundo(s)" -} -function pickRandom(list) { - return list[Math.floor(list.length * Math.random())] -} diff --git a/plugins/enable.js b/plugins/enable.js deleted file mode 100644 index c12d0aff7..000000000 --- a/plugins/enable.js +++ /dev/null @@ -1,218 +0,0 @@ -//import db from '../lib/database.js' - -let handler = async (m, { conn, usedPrefix, command, args, isOwner, isAdmin, isROwner }) => { - -const sections = [ - { - title: `≡ Lista de Opciones`, - rows: [ - {title: "🔮 | Welcome", rowId: `${usedPrefix + command} welcome`}, - {title: "🌎 | Public", rowId: `${usedPrefix + command} public`}, - {title: "🔞 | Nsfw", rowId: `${usedPrefix + command} nsfw`}, - {title: "🧬 | OnlyLatinos", rowId: `${usedPrefix + command} onlylatinos`}, - {title: "🔗 | Antilink", rowId: `${usedPrefix + command} antilink`}, - {title: "🚫 | Antidelete", rowId: `${usedPrefix + command} antidelete`}, - {title: "⏏️ | Autolevelup", rowId: `${usedPrefix + command} autolevelup`}, - {title: "🗣️ | ChatBot", rowId: `${usedPrefix + command} chatbot`}, - {title: "🔎 | Detect", rowId: `${usedPrefix + command} detect`}, - {title: "📑 | Document", rowId: `${usedPrefix + command} document`}, - {title: "🛡️ | Restrict", rowId: `${usedPrefix + command} restrict`}, - {title: "💬 | OnlyPv", rowId: `${usedPrefix + command} onlydm`}, - {title: "👥 | OnlyGp", rowId: `${usedPrefix + command} onlygp`} - ] - }, -] - -const listMessage = { - text: '\nAquí tiene una lista de lo que puede activar y desactivar', - footer: fgig, - title: `≡ Lista de Opciones`, - buttonText: "Click Aquí", - sections -} - - let isEnable = /true|enable|(turn)?on|1/i.test(command) - let chat = global.db.data.chats[m.chat] - let user = global.db.data.users[m.sender] - let bot = global.db.data.settings[conn.user.jid] || {} - let type = (args[0] || '').toLowerCase() - let isAll = false, isUser = false - switch (type) { - case 'welcome': - case 'bv': - case 'bienvenida': - if (!m.isGroup) { - if (!isOwner) { - global.dfail('group', m, conn) - throw false - } - } else if (!isAdmin) { - global.dfail('admin', m, conn) - throw false - } - chat.welcome = isEnable - break - - case 'detect': - case 'detector': - if (!m.isGroup) { - if (!isOwner) { - global.dfail('group', m, conn) - throw false - } - } else if (!isAdmin) { - global.dfail('admin', m, conn) - throw false - } - chat.detect = isEnable - break - - case 'antidelete': - case 'delete': - if (m.isGroup) { - if (!(isAdmin || isOwner)) { - global.dfail('admin', m, conn) - throw false - } - } - chat.delete = !isEnable - break - - case 'document': - case 'documento': - if (m.isGroup) { - if (!(isAdmin || isOwner)) return dfail('admin', m, conn) - } - chat.useDocument = isEnable - break - case 'public': - case 'publico': - isAll = true - if (!isROwner) { - global.dfail('rowner', m, conn) - throw false - } - global.opts['self'] = !isEnable - break - case 'antilink': - case 'antilinkwa': - case 'antilinkwha': - if (m.isGroup) { - if (!(isAdmin || isOwner)) { - global.dfail('admin', m, conn) - throw false - } - } - chat.antiLink = isEnable - break - - case 'sololatinos': - case 'sololatino': - case 'onlylatinos': - case 'onlylat': - case 'onlylatan': - case 'sololatan': - if (m.isGroup) { - if (!(isAdmin || isOwner)) { - global.dfail('admin', m, conn) - throw false - } - } - chat.onlyLatinos = isEnable - break - - case 'nsfw': - case '+18': - if (m.isGroup) { - if (!(isAdmin || isOwner)) { - global.dfail('admin', m, conn) - throw false - }} - chat.nsfw = isEnable - break - - case 'autolevelup': - isUser = true - user.autolevelup = isEnable - break - - case 'chatbot': - case 'autosimi': - case 'autosimsimi': - isUser = true - user.chatbot = isEnable - break - - case 'restrict': - case 'restringir': - isAll = true - if (!isOwner) { - global.dfail('owner', m, conn) - throw false - } - bot.restrict = isEnable - break - - case 'onlypv': - case 'onlydm': - case 'onlymd': - case 'solopv': - isAll = true - if (!isROwner) { - global.dfail('rowner', m, conn) - throw false - } - global.opts['pconly'] = isEnable - break - - case 'gponly': - case 'onlygp': - case 'grouponly': - case 'sologp': - case 'sologrupo': - isAll = true - if (!isROwner) { - global.dfail('rowner', m, conn) - throw false - } - global.opts['gconly'] = isEnable - break - - default: - if (!/[01]/.test(command)) return m.reply(` -≡ Lista de Opciones - -┌─⊷ *ADMIN* -▢ welcome -▢ antilink -▢ detect -▢ document -▢ nsfw -▢ onlylatinos -└───────────── -┌─⊷ *USERS* -▢ autolevelup -▢ chatbot -└───────────── -┌─⊷ *OWNER* -▢ public -▢ solopv -▢ sologp -└───────────── -*📌 Ejemplo :* -*${usedPrefix}on* welcome -*${usedPrefix}off* welcome -`) - throw false -} - -m.reply(` -✅ *${type}* Se *${isEnable ? 'Activó' : 'Desactivó'}* ${isAll ? 'para este bot' : isUser ? '' : 'para este chat'} -`.trim()) - -} -handler.help = ['en', 'dis'].map(v => v + 'able