| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- let handler = async (m, { conn, text, usedPrefix, command }) => {
- let fkontak = { "key": { "participants":"[email protected]", "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": "[email protected]" }
- 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] <days>']
- 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 "
- }
|