herramientas-nowa.js 1.9 KB

1234567891011121314151617181920212223242526272829
  1. /*---------------------------------------------------------------------------------------
  2. ๐Ÿ€ โ€ข By https://github.com/ALBERTO9883
  3. ๐Ÿ€ โ€ข โš˜Alberto Y Ashlyโš˜
  4. -----------------------------------------------------------------------------------------*/
  5. let handler = async (m, { conn, text, usedPrefix, command }) => {
  6. let regex = /x/g
  7. if (!text) return await conn.reply(m.chat, 'โš ๏ธ ๐™” ๐™š๐™ก ๐™ฃ๐™ชฬ๐™ข๐™š๐™ง๐™ค ๐Ÿค”', m, {contextInfo: { externalAdReply :{ mediaUrl: null, mediaType: 1, description: null, title: ag, body: '๐’๐ฎ๐ฉ๐ž๐ซ ๐๐จ๐ญ ๐ƒ๐ž ๐–๐ก๐š๐ญ๐ฌ๐€๐ฉ๐ฉ', previewType: 0, thumbnail: imagen4, sourceUrl: [md, yt, fb, tiktok].getRandom()}}})
  8. if (!text.match(regex)) throw `*๐‘ฌ๐’‹๐’†๐’Ž๐’‘๐’๐’ ๐’…๐’†๐’ ๐’–๐’”๐’: ${usedPrefix + command} 521999340434x*`
  9. let random = text.match(regex).length, total = Math.pow(10, random), array = []
  10. for (let i = 0; i < total; i++) {
  11. let list = [...i.toString().padStart(random, '0')]
  12. let result = text.replace(regex, () => list.shift()) + '@s.whatsapp.net'
  13. if (await conn.onWhatsApp(result).then(v => (v[0] || {}).exists)) {
  14. let info = await conn.fetchStatus(result).catch(_ => {})
  15. array.push({ exists: true, jid: result, ...info })
  16. } else {
  17. array.push({ exists: false, jid: result })
  18. }}
  19. let txt = 'โ€ข ๐‘๐ž๐ ๐ข๐ฌ๐ญ๐ซ๐š๐๐จ\n\n' + array.filter(v => v.exists).map(v => `โ€ข ๐๐ฎ๐ฆ๐ž๐ซ๐จ: wa.me/${v.jid.split('@')[0]}\n*โ€ข ๐‘ซ๐’†๐’”๐’„:* ${v.status || 'Sin descripcion'}\n*โ€ข ๐…๐ž๐œ๐ก๐š::* ${formatDate(v.setAt)}`).join('\n\n') + '\n\n*๐๐จ ๐ซ๐ž๐ ๐ข๐ฌ๐ญ๐ซ๐š๐๐จ:*\n\n' + array.filter(v => !v.exists).map(v => v.jid.split('@')[0]).join('\n')
  20. m.reply(txt)
  21. }
  22. handler.help = ["nowa"]
  23. handler.tags = ["tools"]
  24. handler.command = /^nowa$/i
  25. handler.register = true
  26. export default handler
  27. function formatDate(n, locale = 'id') {
  28. let d = new Date(n)
  29. return d.toLocaleDateString(locale, { timeZone: 'Asia/Jakarta' })}