Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- case "broadcast": {
- if (!text || !text.includes("|")) return reply(`- *example:* ${prefix + command} url|info|title`)
- const [url, display_text, topic] = text.split("|").map(v => v.trim())
- const data = await sock.newsletterFetchAllSubscribe()
- const ids = data.filter(v => v.viewer_metadata?.role === "ADMIN").map(v => v.id)
- const interactiveMessage = {
- title: topic,
- footer: "telegram: @yumevtc",
- image: { url: "https://github.com/kiuur.png" },
- nativeFlowMessage: {
- messageParamsJson: JSON.stringify({
- bottom_sheet: {
- list_title: "Menu"
- }
- }),
- buttons: [
- {
- name: "cta_url",
- buttonParamsJson: JSON.stringify({
- display_text: display_text,
- url: url
- })
- }
- ]
- }
- }
- for (const jid of ids) {
- await sock.sendMessage(jid, { interactiveMessage })
- await new Promise(r => setTimeout(r, 4500))
- }
- await reply(`broadcast selesai ke ${ids.length} channel.`)
- }
- break
- // use baileys: "@whiskeysockets/baileys": "github:kiuur/baileys",
Advertisement
Add Comment
Please, Sign In to add comment