let handler = async (m, { conn, text, usedPrefix, command }) => { let fkontak = { "key": { "participants":"0@s.whatsapp.net", "remoteJid": "status@broadcast", "fromMe": false, "id": "Halo" }, "message": { "contactMessage": { "vcard": `BEGIN:VCARD\nVERSION:3.0\nN:Sy;Bot;;;\nFN:y\nitem1.TEL;waid=${m.sender.split('@')[0]}:${m.sender.split('@')[0]}\nitem1.X-ABLabel:Ponsel\nEND:VCARD` }}, "participant": "0@s.whatsapp.net" } let who if (m.isGroup) who = m.mentionedJid[0] ? m.mentionedJid[0] : m.quoted ? m.quoted.sender : false else who = m.chat let user = global.db.data.users[who] if (!who) throw `*⚠️ πŒπ„ππ‚πˆπŽππ€/π‘π„ππŽππƒπ€ 𝐀𝐋 πŒπ„ππ’π€π‰π„ 𝐃𝐄 𝐋𝐀 ππ„π‘π’πŽππ€ 𝐐𝐔𝐄 𝐒𝐄𝐑𝐀́ ππ‘π„πŒπˆπ”πŒ*\n\n*${usedPrefix + command} @${m.sender.split`@`[0]} 1*\n*${usedPrefix + command} 1*` let txt = text.replace('@' + who.split`@`[0], '').trim() let name = await '@' + who.split`@`[0] var hora1 = 3600000 * txt //1h var dia1 = 86400000 * txt //1d var semana1 = 604800000 * txt //1s var mes1 = 2629800000 * txt //1m var now = new Date() * 1 if (!txt && !m.quoted) throw `*FALTA EL TIEMPO PREMIUM*` if (txt == 0 || txt == null) throw `*DEBE INGRESAR EL TIEMPO PREMIUM*\n\n*${usedPrefix + command} @${m.sender.split`@`[0]} 1*\n*${usedPrefix + command} 1*` if (isNaN(txt)) return m.reply(`*SOLO NÚMERO*\n\n*${usedPrefix + command} @${m.sender.split`@`[0]} 1*`) /*let titulo = [ 'PREMIUM 1', 'PREMIUM 2', 'PREMIUM 3', 'PREMIUM 4', 'PREMIUM 5', 'PREMIUM 6'] let nombre = [ 'PREMIUM BÁSICO', 'PREMIUM NORMAL', 'PREMIUM ESPECIAL', 'PREMIUM PRO', 'PREMIUM PLUS', 'PREMIUM MAGISTRAL'] let descripciΓ³n = [ 'Premium durante 1 Hora', 'Premium durante 3 Horas', 'Premium durante 5 Horas', 'Premium durante 1 DΓ­a', 'Premium durante 1 Semana', 'Premium durante 1 Mes'] let tiempo = [ hora1, hora3, hora5, dia1, semana1, mes1] let comando = [ 'premium1', `${command[2]}`, `${command[3]}`, `${command[4]}`, `${command[5]}`, `${command[6]}`] let sections = Object.keys(titulo, nombre, descripciΓ³n, tiempo, comando).map((v, index) => ({ title: `${titulo[v]}`, rows: [{ title: `${nombre[v]}`, description: `${1 + index}. ${descripciΓ³n[v]}`, rowId: usedPrefix + comando[v] + ' ' + `${res ? `${res.map(v => '@' + v.split("@")[0])}` : ''}` + txt, }], })) const listMessage = { text: `*ELIJA EL TIEMPO PREMIUM* *${name}* ${wm}`, title: null, buttonText: `TIEMPO AQUÍ `, sections } if (command == 'addprem') { //if (!txt || !text) return await conn.sendMessage(m.chat, listMessage, {quoted: fkontak})}*/ if (command == 'addprem' || command == 'userpremium') { if (now < user.premiumTime) user.premiumTime += hora1 else user.premiumTime = now + hora1 user.premium = true conn.reply(m.chat, `*🎟️ π™π™Žπ™π™€π˜Ώ π˜Όπ™ƒπ™Šπ™π˜Ό π™€π™Ž π™‹π™π™€π™ˆπ™„π™π™ˆ!!!* *✨ π™‰π™Šπ™ˆπ˜½π™π™€ Β» ${name}* *πŸ• π™π™„π™€π™ˆπ™‹π™Š : π™π™„π™ˆπ™€ Β»* ${msToTime(hora1 - new Date())} *πŸ“‰ π™π™„π™ˆπ™€π™ Β» ${user.premiumTime - now} seg*`, m, {contextInfo: {mentionedJid: conn.parseMention(name)}})} if (command == 'addprem2' || command == 'userpremium2') { if (now < user.premiumTime) user.premiumTime += dia1 else user.premiumTime = now + dia1 user.premium = true conn.reply(m.chat, `*🎟️ π™π™Žπ™π™€π˜Ώ π˜Όπ™ƒπ™Šπ™π˜Ό π™€π™Ž π™‹π™π™€π™ˆπ™„π™π™ˆ!!!* *✨ π™‰π™Šπ™ˆπ˜½π™π™€ Β» ${name}* *πŸ• π™π™„π™€π™ˆπ™‹π™Š : π™π™„π™ˆπ™€ Β» ${msToTime(dias1 - new Date())}* *πŸ“‰ π™π™„π™ˆπ™€π™ Β» ${user.premiumTime - now} seg*`, m, {contextInfo: {mentionedJid: conn.parseMention(name)}})} if (command == 'addprem3' || command == 'userpremium3') { if (now < user.premiumTime) user.premiumTime += semana1 else user.premiumTime = now + semana1 user.premium = true conn.reply(m.chat, `*🎟️ π™π™Žπ™π™€π˜Ώ π˜Όπ™ƒπ™Šπ™π˜Ό π™€π™Ž π™‹π™π™€π™ˆπ™„π™π™ˆ!!!* *✨ π™‰π™Šπ™ˆπ˜½π™π™€ Β» ${name}* *πŸ• π™π™„π™€π™ˆπ™‹π™Š : π™π™„π™ˆπ™€ Β» ${msToTime(semana1 - new Date())}* *πŸ“‰ π™π™„π™ˆπ™€π™ Β» ${user.premiumTime - now} seg*`, m, {contextInfo: {mentionedJid: conn.parseMention(name)}})} if (command == 'addprem4' || command == 'userpremium4') { if (now < user.premiumTime) user.premiumTime += mes1 else user.premiumTime = now + mes1 user.premium = true conn.reply(m.chat, `*🎟️ π™π™Žπ™π™€π˜Ώ π˜Όπ™ƒπ™Šπ™π˜Ό π™€π™Ž π™‹π™π™€π™ˆπ™„π™π™ˆ!!!* *✨ π™‰π™Šπ™ˆπ˜½π™π™€ Β» ${name}* *πŸ• π™π™„π™€π™ˆπ™‹π™Š : π™π™„π™ˆπ™€ Β» ${msToTime(mes1 - new Date())}* *πŸ“‰ π™π™„π™ˆπ™€π™ Β» ${user.premiumTime - now} seg*`, m, {contextInfo: {mentionedJid: conn.parseMention(name)}})} } handler.help = ['addprem [@user] '] handler.tags = ['owner'] handler.command = ['addprem', 'userpremium', 'addprem2', 'userpremium2', 'addprem3', 'userpremium3', 'addprem4', 'userpremium4'] handler.group = true handler.owner = true //handler.botAdmin = true 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 " + seconds + " Segundos " }