| 123456789101112131415161718192021222324252627282930313233343536373839 |
- import { randomBytes } from 'crypto'
- let handler = async (m, { conn, command, participants, usedPrefix, text }) => {
- 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=${conn.user.jid.split('@')[0]}:${conn.user.jid.split('@')[0]}\nitem1.X-ABLabel:Ponsel\nEND:VCARD` }}, "participant": "[email protected]" }
- if (!text && !m.quoted) return m.reply('*โ ๏ธ ๐๐ง๐ ๐ซ๐๐ฌ๐ ๐๐ฅ ๐ฆ๐๐ง๐ฌ๐๐ฃ๐ ๐ช๐ฎ๐ ๐ช๐ฎ๐ข๐๐ซ๐ ๐ญ๐ซ๐๐ฆ๐ข๐ญ๐*')
- let users = participants.map(u => conn.decodeJid(u.id))
- let cc2 = text ? m : m.quoted ? await m.getQuotedObj() : false || m
- let teks2 = text ? text : cc2.text
- //let d = new Date(new Date + 3600000)
- //let locale = lenguajeGB.lenguaje()
- //let dia = d.toLocaleDateString(locale, { weekday: 'long' })
- //let fecha = d.toLocaleDateString(lenguajeGB.lenguaje(), { day: 'numeric', month: 'numeric', year: 'numeric' })
- //let mes = d.toLocaleDateString(", { month: 'long' })
- //let aรฑo = d.toLocaleDateString(lenguajeGB.lenguaje(), { year: 'numeric' })
- //let tiempo = d.toLocaleString('es-CO', { hour: 'numeric', minute: 'numeric', second: 'numeric', hour12: true })
- let groups = Object.keys(await conn.groupFetchAllParticipating())
- let usersTag = participants.map(u => conn.decodeJid(u.id))
- let readMS = String.fromCharCode(8206).repeat(850)
- await m.reply(`*Enviando mensaje oficial, espere un momento...*`)
- for (let i = 0; i < groups.length; i++) {
- const id = groups[i];
- //const infoGP = lenguajeGB.smsChatGP2(readMS, dia, mes, aรฑo, fecha, tiempo)
- const delay = i * 4000 //4 seg
- setTimeout(async () => {
- await conn.sendMessage(id, { text: `โ
*COMUNICADO OFICIAL* โ
\n\n` + teks2, mentions: [m.sender], mentions: (await conn.groupMetadata(id)).participants.map(v => v.id) }, { quoted: fkontak })
- //await conn.reply(id, infoGP + teks2, { mentions: (await conn.groupMetadata(id)).participants.map(v => v.id) }, { quoted: fkontak });
- }, delay)}
- let totalGP = groups.length
- await m.reply(`โ
๐๐๐ง๐ฌ๐๐ฃ๐ ๐๐ง๐ฏ๐ข๐๐๐จ ๐ ${groups.length} ๐๐ซ๐ฎ๐ฉ๐จ/๐ฌ*\n\n*๐๐๐๐: ๐๐ฌ ๐ฉ๐จ๐ฌ๐ข๐๐ฅ๐ ๐ช๐ฎ๐ ๐ญ๐๐ง๐ ๐ ๐๐๐ฅ๐ฅ๐จ๐ฌ ๐๐ฌ๐ญ๐ ๐๐จ๐ฆ๐๐ง๐๐จ ๐ฒ ๐ง๐จ ๐ฌ๐ ๐๐ง๐ฏ๐ข๐ ๐ ๐ญ๐จ๐๐จ๐ฌ ๐ฅ๐จ๐ฌ ๐๐ก๐๐ญ๐ฌ, ๐๐ข๐ฌ๐๐ฎ๐ฅ๐ฉ๐ ๐ฉ๐จ๐ซ ๐๐ฅ ๐ฆ๐จ๐ฆ๐๐ง๐ญ๐จ*`)
- }
- handler.help = ['broadcastgroup', 'bcgc'].map(v => v + ' <teks>')
- handler.tags = ['owner']
- handler.command = /^(broadcast|bc)(group|grup|gc)$/i
- handler.owner = true
- export default handler
- const more = String.fromCharCode(8206)
- const readMore = more.repeat(4001)
- const delay = time => new Promise(res => setTimeout(res, time))
|