zhwzein / Killua-Zoldyck

WhatsApp Bot Script

Home Page:http://api.ouzen.xyz/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bcall / broadcast all error di store

cantiir2 opened this issue · comments

Cara nambahin broadcast all gimana ? saya mengalami error untuk pendambahan broadcast ke semua chat. berikut code saya

let { exec: execS } = require("child_process")
const util = require("util")
const P = require ('pino')
let {sleep} = require('./../../lib/Function')
module.exports = {
    name: "bcall",
    alias: ["broadcastall","bcall"],
    use: "<query>",
    desc: "Running Broadcast to everyone",
    type: "owner",
    start: async(killua, m, { text, store }) => {
        try{
        if(!text) m.reply('Apa isi pesannya tuan ?')
        let anu = await store.chats.all().map(v => v.id)
        m.reply(`Mengirim Broadcast Ke ${anu.length} Group Chat, Waktu Selesai ${anu.length * 1.5} detik`)
        for (let i of anu) {
            await sleep(1500)
              let txt = `「 Broadcast Bot 」\n\n${text}`
          let templateButtons = [
              {index: 1, urlButton: { displayText: "Source Code", url: "https://github.com/cantiir2/Sociality-Bot" }},
              {index: 2, urlButton: { displayText: "Main APIs", url: "http://zenzapis.xyz" }},
              {index: 3, quickReplyButton: {displayText: '► Ping CPU', id: 'ping CPU'}},
                       ]

          let templateMessage = {
              image: { url: 'https://i.ibb.co/XDqpvm3/sbot.jpg' },
              caption: txt,
              footer: config.footer,
              templateButtons: templateButtons
          }

          killua.sendMessage(i, templateMessage, { quoted: m })
            }
            m.reply(`Sukses Mengirim Broadcast Ke ${anu.length} Group`)
        } catch (err){
            m.reply(`Error :${err}`)
        }
       // for (let yoi of panu) {
         //       await sleep(delayy)
           //     let txt = `*「 Sociality BOT BROADCAST 」*\n\n${text}`
             //   killua.sendText(yoi, txt)
        //    }
    },
    isOwner: true
}

Berikut gambar permasalahan saya

image

commented

fixed next update