forked from KrizynOfc/Furry-Bot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patho-broadcastvn.js
More file actions
56 lines (53 loc) · 2 KB
/
o-broadcastvn.js
File metadata and controls
56 lines (53 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
const { toAudio, toPTT } = require('../lib/converter')
let fs = require('fs')
let fetch = require("node-fetch")
let handler = async (m, { conn, text }) => {
let user = global.db.data.users[m.sender]
let haori = {
key : {
remoteJid: 'status@broadcast',
participant : '0@s.whatsapp.net'
},
message: {
orderMessage: {
itemCount : 999999999999,
status: 404,
surface : 404,
message: `© CUTE BROADCAST\nFrom ${conn.getName(m.sender)} 🌠`,
orderTitle: `▮By Zivfurr ▸`,
thumbnail: await (await fetch('https://telegra.ph/file/d22003d24ff779724cc58.jpg')).buffer(),
}
}
}
let q = m.quoted ? m.quoted : m
let mime = (m.quoted ? m.quoted : m.msg).mimetype || ''
let media = await q.download()
if (!media) throw 'Media tidak dapat diunduh'
let audio = await toPTT(media, 'mp4')
if (!audio.data) throw 'Gagal melakukan konversi.'
let chats = Object.keys(await conn.chats)
conn.reply(m.chat, `_Mengirim pesan broadcast ke ${chats.length} chat_`, m)
for (let id of chats) {
await conn.delay(1500)
await await await conn.sendFile(id, audio.data, 'error.mp3', null, m, true, {
type: 'audioMessage', // paksa tanpa convert di ffmpeg
ptt: true, contextInfo: { forwardingScore: 999, isForwarded: true,
externalAdReply: {
title: 'ꕥ─────•「 AUDIO BROADCAST 」•─────ꕥ',
body: '📢 Isi Pesan :' + text,
description: '',
mediaType: 2,
thumbnail: await (await fetch(fla + 'Broadcast')).buffer(),
mediaUrl: `https://youtu.be/35w7z9QFLwY`
}
}
})
}
m.reply('_*Broadcast Finished*_')
}
handler.help = ['bcavn'].map(v => v + ' <teks>')
handler.tags = ['owner']
handler.command = /^(broadcastvn|bcvn)$/i
handler.owner = true
module.exports = handler
const delay = time => new Promise(res => setTimeout(res, time))