├── README.md ├── app.json ├── config.json ├── handler.js ├── index.js ├── lib ├── P ├── afk.js ├── client.js ├── func.js ├── greet.js ├── http-server.js ├── json │ ├── P │ ├── dataGc.json │ ├── dataUser.json │ └── vn.json ├── log.js ├── temp │ ├── P │ ├── close.webp │ ├── doge.jpg │ ├── domge.jpg │ ├── menus.webp │ ├── open.webp │ └── sticks.webp ├── text.js └── vn │ ├── P │ ├── Wkwk.mp3 │ └── p.mp3 ├── package.json └── public ├── P ├── configs.html ├── index.html └── y.png /README.md: -------------------------------------------------------------------------------- 1 | # SC-BOT-WA 2 | Subscribe Channel Hanbu FF 3 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "H e l g a B o t", 3 | "description": "whatsapp bot build with nodejs", 4 | "repository": "https://github.com/justpiple/whatsapp-bot", 5 | "logo": "https://i.postimg.cc/XNFmqpr1/76271a67a3e6162e0d0f80b1bc1d17f4.jpg", 6 | "keywords": ["nodejs", "bot", "whatsapp bot", "whatsapp automation"] 7 | } -------------------------------------------------------------------------------- /config.json: -------------------------------------------------------------------------------- 1 | { 2 | "prefix": "multi", 3 | "defaultSessionName": "kurrxd", 4 | "zeksKey": "CpGSLymOQy9KfTKgQZr9eDSYqqR", 5 | "autoRead": true, 6 | "self": false, 7 | "maxLimit": 30, 8 | "ownerList": ["6282138919347@s.whatsapp.net", "6282138919347@s.whatsapp.net"], 9 | "apiUrl": "https://api.zeks.me", 10 | "imgUrl": "https://i.postimg.cc/XNFmqpr1/76271a67a3e6162e0d0f80b1bc1d17f4.jpg", 11 | "pack": "Yang Nyolong Nak Babi", 12 | "author": "H e l g a B o t" 13 | } -------------------------------------------------------------------------------- /handler.js: -------------------------------------------------------------------------------- 1 | /*Elios and Ben*/ 2 | 3 | const { GroupSettingChange, WAMessageProto, MessageType, prepareMessageFromContent, relayWAMessage } = require('@adiwajshing/baileys') 4 | const { exec } = require('child_process'); 5 | const axios = require('axios') 6 | const fs = require('fs') 7 | let FormData = require('form-data') 8 | let fetch = require('node-fetch') 9 | const afkJs = require('./lib/afk') 10 | const moment = require('moment-timezone'); 11 | const { mess, menu, ingfo, listCode } = require('./lib/text') 12 | const { color, getBuffer, convertMp3 } = require('./lib/func') 13 | moment.tz.setDefault('Asia/Jakarta').locale('id'); 14 | module.exports = handle = (client, Client) => { 15 | try { 16 | /*DOWNLOADER*/ 17 | Client.cmd.on('ytmp4', async (data) => { 18 | try { 19 | if(isLimit(data.sender)) return data.reply(mess.limit) 20 | if(data.body == "") return data.reply(`Kirim perintah *${data.prefix}ytmp4 [ link ]*\nContoh : ${data.prefix}ytmp4 https://www.youtube.com/watch?v=0maWbr0FHKY`) 21 | data.reply(mess.wait) 22 | res = await axios.get(`${configs.apiUrl}/api/ytmp4/2?apikey=${configs.zeksKey}&url=${data.body}`) 23 | if(res.data.status == false) data.reply(res.data.message) 24 | ytm = res.data.result 25 | teks = `*Data berhasil didapatkan!*\n\n*Judul* : ${ytm.title}\n*Ukuran* : ${ytm.size}\n*Kualitas* : ${ytm.quality}\n*Ext* : ${ytm.ext}\n\n_Silahkan tunggu file media sedang dikirim mungkin butuh beberapa menit_` 26 | if(Number(ytm.size.split(' MB')[0]) >= 50.00) return Client.sendFileFromUrl(data.from, `${ytm.thumb}`, 'thumb.jpg', `*Data Berhasil Didapatkan!*\n\n*Title* : ${ytm.title}\n*Ukuran* : ${ytm.size}\n*Kualitas* : ${ytm.quality}\n*Ext* : mp4\n*Link* : ${ytm.link}\n\n_Untuk durasi lebih dari batas disajikan dalam bentuk link_`, data.message) 27 | Client.sendFileFromUrl(data.from, `${ytm.thumb}`, 'thumb.jpg', teks, data.message) 28 | Client.sendFileFromUrl(data.from, `${ytm.link}`, `${ytm.title} - Download.mp4`, `Video telah terkirim @${data.sender.split('@')[0]}`, data.message) 29 | } catch { 30 | data.reply('Ups maaf server sedang error atau mungkin apikey invalid') 31 | } 32 | }) 33 | Client.cmd.on('ytmp3', async (data) => { 34 | try { 35 | if(isLimit(data.sender)) return data.reply(mess.limit) 36 | if(data.body == "") return data.reply(`Kirim perintah *${data.prefix}ytmp3 [ link ]*\nContoh : ${data.prefix}ytmp3 https://www.youtube.com/watch?v=0maWbr0FHKY`) 37 | data.reply(mess.wait) 38 | res = await axios.get(`${configs.apiUrl}/api/ytmp3/2?apikey=${configs.zeksKey}&url=${data.body}`) 39 | if(res.data.status == false) data.reply(res.data.message) 40 | ytm = res.data.result 41 | teks = `*Data berhasil didapatkan!*\n\n*Judul* : ${ytm.title}\n*Ukuran* : ${ytm.size}\n*Kualitas* : ${ytm.quality}\n*Ext* : ${ytm.ext}\n\n_Silahkan tunggu file media sedang dikirim mungkin butuh beberapa menit_` 42 | if(Number(ytm.size.split(' MB')[0]) >= 50.00) return Client.sendFileFromUrl(data.from, `${ytm.thumb}`, 'thumb.jpg', `*Data Berhasil Didapatkan!*\n\n*Title* : ${ytm.title}\n*Ukuran* : ${ytm.size}\n*Kualitas* : ${ytm.quality}\n*Ext* : mp3\n*Link* : ${ytm.link}\n\n_Untuk durasi lebih dari batas disajikan dalam bentuk link_`, data.message) 43 | Client.sendFileFromUrl(data.from, `${ytm.thumb}`, 'thumb.jpg', teks, data.message) 44 | Client.sendFileFromUrl(data.from, `${ytm.link}`, `${ytm.title} - Download.mp3`, ``, data.message) 45 | } catch { 46 | data.reply('Ups maaf server sedang error atau mungkin apikey invalid') 47 | } 48 | }) 49 | Client.cmd.on('playvid', async (data) => { 50 | try { 51 | if(isLimit(data.sender)) return data.reply(mess.limit) 52 | if(data.body == "") return data.reply(`Kirim perintah *${data.prefix}playvid [ query ]*\nContoh : ${data.prefix}playvid amv`) 53 | data.reply(mess.wait) 54 | res = await axios.get(`${configs.apiUrl}/api/ytplaymp4/2?apikey=${configs.zeksKey}&q=${data.body}`) 55 | if(res.data.status == false) data.reply(res.data.message) 56 | ytm = res.data.result 57 | teks = `*Data berhasil didapatkan!*\n\n*Judul* : ${ytm.title}\n*Ukuran* : ${ytm.size}\n*Kualitas* : ${ytm.quality}\n*Ext* : ${ytm.ext}\n*Source* : ${ytm.source}\n\n_Silahkan tunggu file media sedang dikirim mungkin butuh beberapa menit_` 58 | if(Number(ytm.size.split(' MB')[0]) >= 50.00) return Client.sendFileFromUrl(data.from, `${ytm.thumb}`, 'thumb.jpg', `*Data Berhasil Didapatkan!*\n\n*Title* : ${ytm.title}\n*Ukuran* : ${ytm.size}\n*Kualitas* : ${ytm.quality}\n*Ext* : mp4\n*Source* : ${ytm.source}\n*Link* : ${ytm.link}\n\n_Untuk durasi lebih dari batas disajikan dalam bentuk link_`, data.message) 59 | Client.sendFileFromUrl(data.from, `${ytm.thumb}`, 'thumb.jpg', teks, data.message) 60 | Client.sendFileFromUrl(data.from, `${ytm.link}`, 'video.mp4', `Video telah terkirim @${data.sender.split('@')[0]}`, data.message) 61 | } catch (e) { 62 | data.reply('Ups maaf server sedang error atau mungkin apikey invalid') 63 | } 64 | }) 65 | Client.cmd.on('play', async (data) => { 66 | try { 67 | if(isLimit(data.sender)) return data.reply(mess.limit) 68 | if(data.body == "") return data.reply(`Kirim perintah *${data.prefix}play [ link ]*\nContoh : ${data.prefix}play alone`) 69 | data.reply(mess.wait) 70 | res = await axios.get(`${configs.apiUrl}/api/ytplaymp3/2?apikey=${configs.zeksKey}&q=${data.body}`) 71 | if(res.data.status == false) data.reply(res.data.message) 72 | ytm = res.data.result 73 | teks = `*Data berhasil didapatkan!*\n\n*Judul* : ${ytm.title}\n*Ukuran* : ${ytm.size}\n*Kualitas* : ${ytm.quality}\n*Ext* : ${ytm.ext}\n*Source* : ${ytm.source}\n\n_Silahkan tunggu file media sedang dikirim mungkin butuh beberapa menit_` 74 | if(Number(ytm.size.split(' MB')[0]) >= 50.00) return Client.sendFileFromUrl(data.from, `${ytm.thumb}`, 'thumb.jpg', `*Data Berhasil Didapatkan!*\n\n*Title* : ${ytm.title}\n*Ukuran* : ${ytm.size}\n*Kualitas* : ${ytm.quality}\n*Ext* : mp3\n*Source* : ${ytm.source}\n*Link* : ${ytm.link}\n\n_Untuk durasi lebih dari batas disajikan dalam bentuk link_`, data.message) 75 | Client.sendFileFromUrl(data.from, ytm.thumb, 'thumb.jpg', teks, data.message) 76 | Client.sendFileFromUrl(data.from, ytm.link, `${ytm.title} - Download.mp3`, ``, data.message) 77 | } catch { 78 | data.reply('Ups maaf server sedang error atau mungkin apikey invalid') 79 | } 80 | }) 81 | Client.cmd.on('ig', async (data) => { 82 | if(isLimit(data.sender)) return data.reply(mess.limit) 83 | if(data.body == "") return data.reply(`Kirim perintah *${data.prefix}ig [ link ]*\nContoh : ${data.prefix}ig https://www.instagram.com/p/CJ8XKFmJ4al/?igshid=1acpcqo44kgkn`) 84 | data.reply(mess.wait) 85 | getresult = await axios.get(`${configs.apiUrl}/api/ig?apikey=${configs.zeksKey}&url=${data.body}`) 86 | if(getresult.data.status == false) return data.reply(getresult.data.message) 87 | for(let i = 0; i < getresult.data.result.length; i++) { 88 | Client.sendFileFromUrl(data.from, getresult.data.result[i].url, `ig.${getresult.data.result[i].type}`, `「 INSTAGRAM 」\n\n*Username*: ${getresult.data.owner}\n*Caption*: ${getresult.data.caption}`, data.message); 89 | } 90 | }) 91 | Client.cmd.on('igstory', async (data) => { 92 | try { 93 | if(isLimit(data.sender)) return data.reply(mess.limit) 94 | if(data.body == "") return data.reply(`Kirim perintah *${data.prefix}igstory [ username ]*\nContoh : ${data.prefix}igstory jessnolimit`) 95 | data.reply(mess.wait) 96 | stomr = await axios.get(`${configs.apiUrl}/api/igs?apikey=${configs.zeksKey}&username=${data.body}`) 97 | if(stomr.data.status == false) return data.reply(stomr.data.message) 98 | for(let i = 0; i < stomr.data.data.length; i++) { 99 | Client.sendFileFromUrl(data.from, stomr.data.data[i].url, `ig.${stomr.data.data[i].type}`, `「 INSTAGRAM 」\n\n*Username*: ${stomr.data.username}\n*Type*: ${stomr.data.data[i].type}`, data.message); 100 | } 101 | } catch { 102 | data.reply('Username tidak ditemukan') 103 | } 104 | }) 105 | Client.cmd.on('joox', async (data) => { 106 | try { 107 | if(isLimit(data.sender)) return data.reply(mess.limit) 108 | if(data.body == "") return data.reply(`Kirim perintah *${data.prefix}joox [ lagu ]*\nContoh : ${data.prefix}joox bad liar`) 109 | data.reply(mess.wait) 110 | res = await axios.get(`${configs.apiUrl}/api/joox?apikey=${configs.zeksKey}&q=${data.body}`) 111 | if(res.data.status == false) data.reply(jox.data.message) 112 | jox = res.data.data[0] 113 | teks = `*Data berhasil didapatkan!*\n\n*Judul* : ${jox.judul}\n*Artis* : ${jox.artist}\n*Album* : ${jox.album}\n*Ukuran* : ${jox.size}\n\n_Silahkan tunggu file media sedang dikirim mungkin butuh beberapa menit_` 114 | Client.sendFileFromUrl(data.from, `${jox.thumb}`, 'thumb.jpg', teks, data.message) 115 | Client.sendFileFromUrl(data.from, `${jox.audio}`, 'audio.mp3', ``, data.message) 116 | } catch { 117 | data.reply('Maaf lagu tidak ditemukan') 118 | } 119 | }) 120 | /*RANDOM*/ 121 | Client.cmd.on('fml', async (data) => { 122 | if(isLimit(data.sender)) return data.reply(mess.limit) 123 | res = await axios.get(`${configs.apiUrl}/api/fml?apikey=${configs.zeksKey}`) 124 | data.reply(res.data.result) 125 | }) 126 | Client.cmd.on('randomquran', async (data) => { 127 | if(isLimit(data.sender)) return data.reply(mess.limit) 128 | res = await axios.get(`${configs.apiUrl}/api/randomquran?apikey=${configs.zeksKey}`) 129 | rquran = res.data.result 130 | teks = `*Surah* : ${rquran.nama}\n*Arti* : ${rquran.arti}\n*Ayat* : ${rquran.asma}\n*Keterangan* : ${rquran.keterangan}` 131 | data.reply(teks) 132 | Client.sendFileFromUrl(data.from, rquran.audio, 'quran.mp3', ``, data.message) 133 | }) 134 | Client.cmd.on('estetikpic', async (data) => { 135 | if(isLimit(data.sender)) return data.reply(mess.limit) 136 | Client.sendFileFromUrl(data.from, `${configs.apiUrl}/api/estetikpic?apikey=${configs.zeksKey}`, 'estetik.jpg', ``, data.message) 137 | }) 138 | Client.cmd.on('meme', async (data) => { 139 | if(isLimit(data.sender)) return data.reply(mess.limit) 140 | res = await axios.get(`${configs.apiUrl}/api/memeindo?apikey=${configs.zeksKey}`) 141 | Client.sendFileFromUrl(data.from, res.data.result, 'p.jpg', ``, data.message) 142 | }) 143 | Client.cmd.on('darkjoke', async (data) => { 144 | if(isLimit(data.sender)) return data.reply(mess.limit) 145 | res = await axios.get(`${configs.apiUrl}/api/darkjokes?apikey=${configs.zeksKey}`) 146 | Client.sendFileFromUrl(data.from, res.data.result, 'p.jpg', ``, data.message) 147 | }) 148 | Client.cmd.on('nickepep', async (data) => { 149 | if(isLimit(data.sender)) return data.reply(mess.limit) 150 | res = await axios.get(`${configs.apiUrl}/api/nickepep?apikey=${configs.zeksKey}`) 151 | n = res.data.result 152 | nick = n[Math.floor(Math.random() * n.length)] 153 | data.reply(nick) 154 | }) 155 | Client.cmd.on('quotes', async (data) => { 156 | if(isLimit(data.sender)) return data.reply(mess.limit) 157 | res = await axios.get(`${configs.apiUrl}/api/quote?apikey=${configs.zeksKey}`) 158 | que = res.data.result 159 | teks = `*Author* : ${que.author}\n*Quotes* : ${que.quotes}` 160 | data.reply(teks) 161 | }) 162 | Client.cmd.on('pantun', async (data) => { 163 | if(isLimit(data.sender)) return data.reply(mess.limit) 164 | res = await axios.get(`${configs.apiUrl}/api/pantun?apikey=${configs.zeksKey}`) 165 | data.reply(res.data.result.pantun) 166 | }) 167 | Client.cmd.on('limit', async (data) => { 168 | const dataUser = JSON.parse(fs.readFileSync('./lib/json/dataUser.json')) 169 | if(dataUser[data.sender].premium) return data.reply(`Hai @${data.sender.split('@')[0]} 👋🏻\nAnda adalah user premium yang memiliki akses tanpa batas limit!`) 170 | limits = configs.maxLimit - dataUser[data.sender].limit 171 | if(limits <= 0) return data.reply("```" + `Limit anda sudah habis` + "```") 172 | data.reply(`Hai @${data.sender.split('@')[0]} 👋🏻\n Limit anda tersisa ${limits || 30}\nLimit setiap hari di reset jam 00.00\nJika anda ingin mendapatkan unlimited limit silahkan chat owner bot ketik !owner`) 173 | }) 174 | Client.cmd.on('info', async (data) => { 175 | data.reply(ingfo) 176 | }) 177 | /*ANIME*/ 178 | Client.cmd.on('waifu', async (data) => { 179 | if(isLimit(data.sender)) return data.reply(mess.limit) 180 | const res = await axios.get(`https://waifu.pics/api/sfw/waifu`) 181 | const mediaMsg = await client.prepareMessageMedia(await getBuffer(res.data.url), 'imageMessage') 182 | const buttonMessage = { 183 | contentText: 'Waifu', 184 | footerText: 'Press the button below to get a random waifu image', 185 | "contextInfo": { 186 | participant: data.sender, 187 | stanzaId: data.message.key.id, 188 | quotedMessage: data.message.message, 189 | }, 190 | buttons: [ 191 | { 192 | buttonId: `${data.prefix}waifu`, 193 | buttonText: { 194 | displayText: `⏯️ Get again` 195 | }, 196 | "type": "RESPONSE" 197 | }, 198 | ], 199 | headerType: 4, 200 | ...mediaMsg 201 | } 202 | let zz = await client.prepareMessageFromContent(data.from, {buttonsMessage: buttonMessage}, {}) 203 | client.relayWAMessage(zz, {waitForAck: true}) 204 | }) 205 | Client.cmd.on('anime', async (data) => { 206 | try { 207 | if(isLimit(data.sender)) return data.reply(mess.limit) 208 | if(data.body == "") return data.reply(`Kirim perintah *${data.prefix}anime [ query ]*\nContoh : ${data.prefix}anime naruto`) 209 | data.reply(mess.wait) 210 | const res = await fetch(`https://api.jikan.moe/v3/search/anime?q=${data.body}`) 211 | const damta = await res.json() 212 | const { title, synopsis, episodes, url, rated, score, image_url } = damta.results[0] 213 | Client.sendFileFromUrl(data.from, image_url, 'p.jpg', `*Anime found!*\n\n*Title:* ${title}\n*Episodes:* ${episodes}\n*Rating:* ${rated}\n*Score:* ${score}\n*Synopsis:* ${synopsis}\n*URL*: ${url}`, data.message) 214 | } catch { 215 | data.reply('Anime not found') 216 | } 217 | }) 218 | Client.cmd.on('manga', async (data) => { 219 | try { 220 | if(isLimit(data.sender)) return data.reply(mess.limit) 221 | if(data.body == "") return data.reply(`Kirim perintah *${data.prefix}manga [ query ]*\nContoh : ${data.prefix}manga naruto`) 222 | data.reply(mess.wait) 223 | const res = await fetch(`https://api.jikan.moe/v3/search/manga?q=${data.body}`) 224 | const damta = await res.json() 225 | const { title, synopsis, chapters, url, rated, score, image_url } = damta.results[0] 226 | Client.sendFileFromUrl(data.from, image_url, 'p.jpg', `*Manga found!*\n\n*Title:* ${title}\n*Chapters:* ${chapters}\n*Rating:* ${rated}\n*Score:* ${score}\n*Synopsis:* ${synopsis}\n*URL*: ${url}`, data.message) 227 | } catch { 228 | data.reply('Manga not found') 229 | } 230 | }) 231 | Client.cmd.on('chara', async (data) => { 232 | try { 233 | if(isLimit(data.sender)) return data.reply(mess.limit) 234 | if(data.body == "") return data.reply(`Kirim perintah *${data.prefix}chara [ query ]*\nContoh : ${data.prefix}manga naruto`) 235 | data.reply(mess.wait) 236 | const res = await fetch(`https://api.jikan.moe/v3/search/character?q=${data.body}`) 237 | const damta = await res.json() 238 | const { name, alternative_names, url, image_url } = damta.results[0] 239 | Client.sendFileFromUrl(data.from, image_url, 'p.jpg', `*Character found!*\n\n*Name:* ${name}\n*Alternative names:* ${alternative_names}\n*URL*: ${url}`, data.message) 240 | } catch { 241 | data.reply('Character not found') 242 | } 243 | }) 244 | /*OWNER*/ 245 | Client.cmd.on('setpp', async (data) => { 246 | if(!data.isOwner) return data.reply(mess.ownerOnly) 247 | if(!data.isQuotedImage && data.type != 'imageMessage') return data.reply(`Wrong format!, please send image with caption ${data.prefix}setgroupicon, or reply image with ${data.prefix}setgroupicon`) 248 | const getbuff = data.isQuotedImage ? JSON.parse(JSON.stringify(data.message).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo : data.message 249 | const dlfile = await client.downloadMediaMessage(getbuff) 250 | client.updateProfilePicture(client.user.jid, dlfile) 251 | data.reply(`success!, profile picture has been changed by @${data.sender.split('@')[0]}`) 252 | }) 253 | Client.cmd.on('block', async (data) => { 254 | if(!data.isOwner) return data.reply(mess.ownerOnly) 255 | if(data.mentionedJidList.length == 0) return data.reply(`Kirim perintah *${data.prefix}${data.command} [ @tag ]*\nContoh : ${data.prefix}${data.command} @0`) 256 | data.mentionedJidList.forEach(jids => client.blockUser(jids, "add")) 257 | data.reply(`Succecs block @${data.mentionedJidList.join(' @').replace(/@s.whatsapp.net/g, '')}`) 258 | }) 259 | Client.cmd.on('unblock', async (data) => { 260 | if(!data.isOwner) return data.reply(mess.ownerOnly) 261 | if(data.mentionedJidList.length == 0) return data.reply(`Kirim perintah *${data.prefix}${data.command} [ @tag ]*\nContoh : ${data.prefix}${data.command} @0`) 262 | data.mentionedJidList.forEach(jids => client.blockUser(jids, "remove")) 263 | data.reply(`Succecs unblock @${data.mentionedJidList.join(' @').replace(/@s.whatsapp.net/g, '')}`) 264 | }) 265 | Client.cmd.on('addvn', async (data) => { 266 | if(!data.isOwner) return data.reply(mess.ownerOnly) 267 | if(!data.isQuotedAudio) return data.reply('Reply vn/audio!') 268 | if(data.body == "") return data.reply(`Kirim perintah ${data.prefix}addvn [ nama ]\nContoh ${data.command}addvn hai`) 269 | if(vn.includes(data.body)) return data.reply('Nama vn sudah ada, harap gunakan nama lain') 270 | nv = await data.downloadMediaQuotedMessage() 271 | fs.writeFileSync(`./lib/vn/${data.body}.mp3`, nv) 272 | global.vn.push(data.body) 273 | fs.writeFileSync('./lib/json/vn.json', JSON.stringify(vn)) 274 | data.reply(`Berhasil menambahkan vn ${data.body} dari database`) 275 | }) 276 | Client.cmd.on('delvn', async (data) => { 277 | if(!data.isOwner) return data.reply(mess.ownerOnly) 278 | if(data.body == "") return data.reply(`Kirim perintah ${data.prefix}addvn [ nama ]\nContoh ${data.command}addvn hai`) 279 | if(!vn.includes(data.body)) return data.reply('vn tidak ditemukan!') 280 | global.vn.splice(vn.indexOf(data.body), 1) 281 | fs.writeFileSync('./lib/json/vn.json', JSON.stringify(vn, null, 2)) 282 | fs.unlinkSync(`./lib/vn/${data.body}.mp3`) 283 | data.reply(`Berhasil mengahpus vn ${data.body} dari database`) 284 | }) 285 | Client.cmd.on('listvn', async (data) => { 286 | let listvn = 'Ketik nama vn untuk mendownload vn\n\n*List vn*:\n\n' 287 | vn.forEach((vnn, i) => listvn += `*${i+1}*. ${vnn}\n`) 288 | data.reply(listvn) 289 | }) 290 | Client.cmd.on('tebakgambar', async (data) => { 291 | if(isLimit(data.sender)) return data.reply(mess.limit) 292 | if (global.tebakgambar[data.from] && global.tebakgambar[data.from].id) return data.reply("Masih ada soal yang berjalan") 293 | const getSoal = await axios.get(`${configs.apiUrl}/api/tebakgambar?apikey=${configs.zeksKey}`) 294 | ses = Date.now() 295 | send = await Client.sendFileFromUrl(data.from, getSoal.data.result.soal, "soal.jpg", "Waktu menjawab 30 detik!", data.message) 296 | global.tebakgambar[data.from] = {jawaban: getSoal.data.result.jawaban, id: ses} 297 | await sleep(10000) 298 | if (global.tebakgambar[data.from].id != ses) return 299 | Client.reply(data.from,"Waktu tersisa 20 detik", send) 300 | await sleep(10000) 301 | if (global.tebakgambar[data.from].id != ses) return 302 | Client.reply(data.from,"Waktu tersisa 10 detik", send) 303 | await sleep(10000) 304 | if (global.tebakgambar[data.from].id != ses) return 305 | Client.reply(data.from, "Waktu habis", send) 306 | Client.reply(data.from,`Jawabannya adalah: ${getSoal.data.result.jawaban}`, send) 307 | global.tebakgambar[data.from] = {} 308 | 309 | }) 310 | Client.cmd.on('clearall', async (data) => { 311 | if(!data.isOwner) return data.reply(mess.ownerOnly) 312 | const getAll = await client.chats.all() 313 | getAll.forEach(async chats => { 314 | if(chats.jid.endsWith('@g.us')) await client.modifyChat(chats.jid, 'clear') 315 | else await client.modifyChat(chats.jid, 'delete') 316 | }) 317 | data.reply('OkE') 318 | }) 319 | Client.cmd.on('resetlimit', async (data) => { 320 | if(!data.isOwner) return data.reply('Owner only!') 321 | const dataUser = JSON.parse(fs.readFileSync('./lib/json/dataUser.json')) 322 | for(users in dataUser) { 323 | dataUser[users].limit = 0 324 | } 325 | fs.writeFileSync('./lib/json/dataUser.json', JSON.stringify(dataUser)) 326 | console.log(color('[ INFO ]', 'cyan'), 'LIMIT RESETED!') 327 | data.reply('Sukses!') 328 | }) 329 | Client.cmd.on('bc', async (data) => { 330 | if(!data.isOwner) return data.reply(mess.ownerOnly) 331 | if(data.body == '') return 332 | var list = await client.chats.all() 333 | mediaBuffer = data.type == 'extendedTextMessage' ? await data.downloadMediaQuotedMessage() : data.type == 'imageMessage' || data.type == 'videoMessage' ? await data.downloadMediaMessage() : null 334 | var ext = data.isQuotedImage ? 'jpg' : 'mp4' 335 | list.forEach(async dataC => { 336 | if(mediaBuffer) Client.sendFileFromBase64(dataC.jid, mediaBuffer.toString('base64'), `bc.${ext}`, `*BOT BROADCAST*\n\n${data.body} ${dataC.jid.endsWith('@g.us') ?'\n\n_#izin admin grup _*'+dataC.name+'*_' : ''}`) 337 | else Client.sendText(dataC.jid, `*BOT BROADCAST*\n\n${data.body}\n\n_#izin admin grup *${dataC.name}*_`) 338 | }) 339 | }) 340 | Client.cmd.on('join', async (data) => { 341 | if(!data.isOwner) return data.reply(mess.ownerOnly) 342 | if(data.body == "") return data.reply(`Link nya?`) 343 | Client.acceptInviteLink(data.body).then(() => data.reply('ok')).catch(() => data.reply('failed')) 344 | }) 345 | Client.cmd.on('owner', async (data) => { 346 | Client.sendContact(data.from, { number: configs.ownerList[0].split('@')[0], name: 'owner' }, data.message) 347 | }) 348 | Client.cmd.on('premium', async (data) => { 349 | if(!data.isOwner) return data.reply(mess.ownerOnly) 350 | const dataUser = JSON.parse(fs.readFileSync('./lib/json/dataUser.json')) 351 | dataToPr = data.mentionedJidList.length ? data.mentionedJidList : [data.args[1] + "@s.whatsapp.net"] || null 352 | 353 | if(data.args[0].toLowerCase() == 'add') { 354 | if(data.args.length < 2) return data.reply('what?') 355 | dataToPr.forEach(nums => { 356 | if(!dataUser[nums]) dataUser[nums] = { 357 | limit: 0 358 | } 359 | dataUser[nums].premium = true 360 | }) 361 | fs.writeFileSync('./lib/json/dataUser.json', JSON.stringify(dataUser)) 362 | data.reply(`Berhasil menambahkan user premium @${dataToPr.join(' @').replace(/@s.whatsapp.net/g, '')}`) 363 | } else if(data.args[0].toLowerCase() == 'del') { 364 | if(data.args.length < 2) return data.reply('what?') 365 | dataToPr.forEach(nums => { 366 | if(!dataUser[nums] || !dataUser[nums].premium) return data.reply(`User @${nums.split('@')[0]} not premium!`) 367 | dataUser[nums].premium = false 368 | data.reply(`berasil menghapus user premium @${nums.split('@')[0]}`) 369 | }) 370 | fs.writeFileSync('./lib/json/dataUser.json', JSON.stringify(dataUser)) 371 | } else if(data.args[0].toLowerCase() == 'list') { 372 | strings = `LIST PREMIUM\n\n` 373 | for(var [num, val] of Object.entries(dataUser)) 374 | if(val.premium) strings += `~> @${num.split('@')[0]}\n` 375 | data.reply(strings) 376 | } else data.reply(`do u need example?\n\nExample:\n${data.prefix}premium add @0 \nor\n${data.prefix}premium add 62xxxx`) 377 | }) 378 | /*NEWS*/ 379 | Client.cmd.on('tribunnews', async (data) => { 380 | if(isLimit(data.sender)) return data.reply(mess.limit) 381 | res = await axios.get(`${configs.apiUrl}/api/tribunews?apikey=${configs.zeksKey}`) 382 | if(res.data.status == false) data.reply(res.data.message) 383 | ttt = res.data.result 384 | var teks = `*「 TRIBUNNEWS 」*\n\n` 385 | for(let i = 0; i < ttt.length; i++) { 386 | teks += `*Title* : ${ttt[i].title}\n*Waktu* : ${ttt[i].time}\n*Keterangan*: ${ttt[i].ket}\n*Link*: ${ttt[i].url}\n\n` 387 | } 388 | await data.reply(teks) 389 | }) 390 | Client.cmd.on('liputannews', async (data) => { 391 | if(isLimit(data.sender)) return data.reply(mess.limit) 392 | res = await axios.get(`${configs.apiUrl}/api/liputan6?apikey=${configs.zeksKey}`) 393 | if(res.data.status == false) data.reply(res.data.message) 394 | ttt = res.data.result 395 | var teks = `*「 LIPUTANNEWS 」*\n\n` 396 | for(let i = 0; i < ttt.length; i++) { 397 | teks += `*Title* : ${ttt[i].title}\n*Waktu* : ${ttt[i].time}\n*Keterangan*: ${ttt[i].ket}\n*Kategori*: ${ttt[i].category}\n*Link*: ${ttt[i].url}\n\n` 398 | } 399 | await Client.sendFileFromUrl(data.from, ttt[0].thumb, 'p.jpg', teks, data.message) 400 | }) 401 | Client.cmd.on('foxnews', async (data) => { 402 | if(isLimit(data.sender)) return data.reply(mess.limit) 403 | res = await axios.get(`${configs.apiUrl}/api/foxnews?apikey=${configs.zeksKey}`) 404 | if(res.data.status == false) data.reply(res.data.message) 405 | ttt = res.data.result 406 | var teks = `*「 FOXNEWS 」*\n\n` 407 | for(let i = 0; i < ttt.length; i++) { 408 | teks += `*Title* : ${ttt[i].title}\n*Waktu* : ${ttt[i].time}\n*Keterangan*: ${ttt[i].content}\n*Negara*: ${ttt[i].country}\n*Link*: ${ttt[i].url}\n\n` 409 | } 410 | await Client.sendFileFromUrl(data.from, ttt[0].thumb, 'p.jpg', teks, data.message) 411 | }) 412 | /*GROUP*/ 413 | Client.cmd.on('afk', (data) => { 414 | if(!data.isGroup) return data.reply(mess.group) 415 | timesNow = moment(data.t * 1000).format('YYYY-MM-DD HH:mm:ss') 416 | afkJs.addAfk(data.from, data.sender, data.body, timesNow) 417 | Client.sendText(data.from, "```" + `${data.pushname} [@${data.sender.split('@')[0]}] sedang AFK\n\nAlasan: ${data.body}\nTime: ${timesNow}` + "```") 418 | }) 419 | Client.cmd.on('welcome', (data) => { 420 | if(!data.isGroup) return data.reply(mess.admin) 421 | if(!data.isAdmin) return data.reply(mess.admin) 422 | const dataGc = JSON.parse(fs.readFileSync('./lib/json/dataGc.json')) 423 | if(data.args[0].toLowerCase() == 'on') { 424 | if(dataGc[data.from].welcome) return data.reply('Already on!') 425 | dataGc[data.from].welcome = true 426 | fs.writeFileSync('./lib/json/dataGc.json', JSON.stringify(dataGc)) 427 | data.reply('Sukses!') 428 | } else if(data.args[0].toLowerCase() == 'off') { 429 | if(!dataGc[data.from].welcome) return data.reply('Already off!') 430 | dataGc[data.from].welcome = false 431 | fs.writeFileSync('./lib/json/dataGc.json', JSON.stringify(dataGc)) 432 | data.reply('Sukses!') 433 | } else { 434 | let po = client.prepareMessageFromContent(data.from, { 435 | "listMessage":{ 436 | "title": "*Helga Gz*", 437 | "description": "pilh on/off", 438 | "buttonText": "COMMANDS", 439 | "listType": "SINGLE_SELECT", 440 | "sections": [ 441 | { 442 | "rows": [ 443 | { 444 | "title": "on", 445 | "rowId": `${data.prefix}${data.command} on` 446 | }, 447 | { 448 | "title": "off", 449 | "rowId": `${data.prefix}${data.command} off` 450 | } 451 | ] 452 | }]}}, {}) 453 | client.relayWAMessage(po, {waitForAck: true}) 454 | } 455 | }) 456 | Client.cmd.on('youtubedl', async (data) =>{ 457 | if(isLimit(data.sender)) return data.reply(mess.limit) 458 | if(data.body == "") return data.reply(`Kirim perintah *${data.prefix}youtubedl [ query ]*\nContoh : ${data.prefix}youtubedl Alan walker`) 459 | data.reply(mess.wait) 460 | axios.get(`${configs.apiUrl}/api/yts?apikey=${configs.zeksKey}&q=${data.body}`).then((xres) =>{ 461 | if (!xres.data.status || !xres.data.result) return data.reply(xres.data.message) 462 | secs = [] 463 | xres.data.result.splice(5, xres.data.result.length) 464 | xres.data.result.forEach((xres, i) =>{ 465 | secs.push({ 466 | "rows": [ 467 | { 468 | "title": "MP3", 469 | description: `Title: ${xres.video.title}\n\nUploader: ${xres.uploader.username}`, 470 | "rowId": `${data.prefix}ytmp3 ${xres.video.url}` 471 | }, 472 | { 473 | "title": "MP4", 474 | description: `Title: ${xres.video.title}\n\nUploader: ${xres.uploader.username}`, 475 | "rowId": `${data.prefix}ytmp4 ${xres.video.url}` 476 | } 477 | ], title: i+1}) 478 | }) 479 | let po = client.prepareMessageFromContent(data.from, { 480 | "listMessage":{ 481 | "title": "*YOUTUBE DOWNLOAD*", 482 | "description": `*Result for : ${data.body}*\n*Download video by click button bellow*`, 483 | "buttonText": "Result", 484 | "listType": "SINGLE_SELECT", 485 | "sections": secs}}, {}) 486 | client.relayWAMessage(po, {waitForAck: true}) 487 | }) 488 | }) 489 | Client.cmd.on('leave', (data) => { 490 | if(!data.isGroup) return data.reply(mess.admin) 491 | if(!data.isAdmin) return data.reply(mess.admin) 492 | const dataGc = JSON.parse(fs.readFileSync('./lib/json/dataGc.json')) 493 | if(data.args[0].toLowerCase() == 'on') { 494 | if(dataGc[data.from].leave) return data.reply('Already on!') 495 | dataGc[data.from].leave = true 496 | fs.writeFileSync('./lib/json/dataGc.json', JSON.stringify(dataGc)) 497 | data.reply('Sukses!') 498 | } else if(data.args[0].toLowerCase() == 'off') { 499 | if(!dataGc[data.from].leave) return data.reply('Already off!') 500 | dataGc[data.from].leave = false 501 | fs.writeFileSync('./lib/json/dataGc.json', JSON.stringify(dataGc)) 502 | data.reply('Sukses!') 503 | } else { 504 | let po = client.prepareMessageFromContent(data.from, { 505 | "listMessage":{ 506 | "title": "*Helga Gz*", 507 | "description": "pilh on/off", 508 | "buttonText": "COMMANDS", 509 | "listType": "SINGLE_SELECT", 510 | "sections": [ 511 | { 512 | "rows": [ 513 | { 514 | "title": "on", 515 | "rowId": `${data.prefix}${data.command} on` 516 | }, 517 | { 518 | "title": "off", 519 | "rowId": `${data.prefix}${data.command} off` 520 | } 521 | ] 522 | }]}}, {}) 523 | client.relayWAMessage(po, {waitForAck: true}) 524 | } 525 | }) 526 | Client.cmd.on('antiviewonce', (data) => { 527 | if(!data.isGroup) return data.reply(mess.admin) 528 | if(!data.isAdmin) return data.reply(mess.admin) 529 | const dataGc = JSON.parse(fs.readFileSync('./lib/json/dataGc.json')) 530 | if(data.args[0].toLowerCase() == 'on') { 531 | if(dataGc[data.from].antiviewonce) return data.reply('Already on!') 532 | dataGc[data.from].antiviewonce = true 533 | fs.writeFileSync('./lib/json/dataGc.json', JSON.stringify(dataGc)) 534 | data.reply('Sukses!') 535 | } else if(data.args[0].toLowerCase() == 'off') { 536 | if(!dataGc[data.from].antiviewonce) return data.reply('Already off!') 537 | dataGc[data.from].antiviewonce = false 538 | fs.writeFileSync('./lib/json/dataGc.json', JSON.stringify(dataGc)) 539 | data.reply('Sukses!') 540 | } else { 541 | let po = client.prepareMessageFromContent(data.from, { 542 | "listMessage":{ 543 | "title": "*Helga Gz*", 544 | "description": "pilh on/off", 545 | "buttonText": "COMMANDS", 546 | "listType": "SINGLE_SELECT", 547 | "sections": [ 548 | { 549 | "rows": [ 550 | { 551 | "title": "on", 552 | "rowId": `${data.prefix}${data.command} on` 553 | }, 554 | { 555 | "title": "off", 556 | "rowId": `${data.prefix}${data.command} off` 557 | } 558 | ] 559 | }]}}, {}) 560 | client.relayWAMessage(po, {waitForAck: true}) 561 | } 562 | }) 563 | Client.cmd.on('antitagall', (data) => { 564 | if(!data.isGroup) return data.reply(mess.admin) 565 | if(!data.isAdmin) return data.reply(mess.admin) 566 | if(!data.botIsAdmin) return data.reply(mess.botAdmin) 567 | const dataGc = JSON.parse(fs.readFileSync('./lib/json/dataGc.json')) 568 | if(data.args[0].toLowerCase() == 'on') { 569 | if(dataGc[data.from].antitagall) return data.reply('Already on!') 570 | dataGc[data.from].antitagall = true 571 | fs.writeFileSync('./lib/json/dataGc.json', JSON.stringify(dataGc)) 572 | data.reply('Sukses!') 573 | } else if(data.args[0].toLowerCase() == 'off') { 574 | if(!dataGc[data.from].antitagall) return data.reply('Already off!') 575 | dataGc[data.from].antitagall = false 576 | fs.writeFileSync('./lib/json/dataGc.json', JSON.stringify(dataGc)) 577 | data.reply('Sukses!') 578 | } else { 579 | let po = client.prepareMessageFromContent(data.from, { 580 | "listMessage":{ 581 | "title": "*Helga Gz*", 582 | "description": "pilh on/off", 583 | "buttonText": "COMMANDS", 584 | "listType": "SINGLE_SELECT", 585 | "sections": [ 586 | { 587 | "rows": [ 588 | { 589 | "title": "on", 590 | "rowId": `${data.prefix}${data.command} on` 591 | }, 592 | { 593 | "title": "off", 594 | "rowId": `${data.prefix}${data.command} off` 595 | } 596 | ] 597 | }]}}, {}) 598 | client.relayWAMessage(po, {waitForAck: true}) 599 | } 600 | }) 601 | Client.cmd.on('antilink', (data) => { 602 | if(!data.isGroup) return data.reply(mess.admin) 603 | if(!data.isAdmin) return data.reply(mess.admin) 604 | if(!data.botIsAdmin) return data.reply(mess.botAdmin) 605 | const dataGc = JSON.parse(fs.readFileSync('./lib/json/dataGc.json')) 606 | if(data.args[0].toLowerCase() == 'on') { 607 | if(dataGc[data.from].antilink) return data.reply('Already on!') 608 | dataGc[data.from].antilink = true 609 | fs.writeFileSync('./lib/json/dataGc.json', JSON.stringify(dataGc)) 610 | data.reply('Sukses!') 611 | } else if(data.args[0].toLowerCase() == 'off') { 612 | if(!dataGc[data.from].antilink) return data.reply('Already off!') 613 | dataGc[data.from].antilink = false 614 | fs.writeFileSync('./lib/json/dataGc.json', JSON.stringify(dataGc)) 615 | data.reply('Sukses!') 616 | } else { 617 | let po = client.prepareMessageFromContent(data.from, { 618 | "listMessage":{ 619 | "title": "*Helga Gz*", 620 | "description": "pilh on/off", 621 | "buttonText": "COMMANDS", 622 | "listType": "SINGLE_SELECT", 623 | "sections": [ 624 | { 625 | "rows": [ 626 | { 627 | "title": "on", 628 | "rowId": `${data.prefix}${data.command} on` 629 | }, 630 | { 631 | "title": "off", 632 | "rowId": `${data.prefix}${data.command} off` 633 | } 634 | ] 635 | }]}}, {}) 636 | client.relayWAMessage(po, {waitForAck: true}) 637 | } 638 | }) 639 | Client.cmd.on('revoke', (data) => { 640 | if(!data.isGroup) return data.reply(mess.group) 641 | if(!data.botIsAdmin) return data.reply(mess.botAdmin) 642 | if(!data.isAdmin) return data.reply(mess.admin) 643 | client.revokeInvite(data.from) 644 | data.reply(`Linkgroup berhasil di reset oleh admin @${data.sender.split('@')[0]}`) 645 | }) 646 | Client.cmd.on('group', (data) => { 647 | if(!data.isGroup) return data.reply(mess.group) 648 | if(!data.isAdmin) return data.reply(mess.admin) 649 | if(!data.botIsAdmin) return data.reply(mess.botAdmin) 650 | if(data.args[0] && data.args[0].toLowerCase() == 'open') { 651 | client.groupSettingChange(data.from, GroupSettingChange.messageSend, false) 652 | data.reply(`Group telah dibuka oleh admin @${data.sender.split('@')[0]}`) 653 | } else if(data.args[0] && data.args[0].toLowerCase() == 'close') { 654 | client.groupSettingChange(data.from, GroupSettingChange.messageSend, true) 655 | data.reply(`Group telah ditutup oleh admin @${data.sender.split('@')[0]}`) 656 | } else { 657 | let po = client.prepareMessageFromContent(data.from, { 658 | "listMessage":{ 659 | "title": "*Helga Gz*", 660 | "description": "pilh open/close", 661 | "buttonText": "COMMANDS", 662 | "listType": "SINGLE_SELECT", 663 | "sections": [ 664 | { 665 | "rows": [ 666 | { 667 | "title": "open", 668 | "rowId": `${data.prefix}${data.command} open` 669 | }, 670 | { 671 | "title": "close", 672 | "rowId": `${data.prefix}${data.command} close` 673 | } 674 | ] 675 | }]}}, {}) 676 | client.relayWAMessage(po, {waitForAck: true}) 677 | } 678 | }) 679 | Client.cmd.on('bye', (data) => { 680 | if(!data.isGroup) return data.reply(mess.group) 681 | if(!data.isAdmin) return data.reply(mess.admin) 682 | client.groupLeave(data.from) 683 | }) 684 | Client.cmd.on('tagall', async (data) => { 685 | if(!data.isGroup) return data.reply(mess.group) 686 | if(!data.isAdmin) return data.reply(mess.admin) 687 | text = `『 *_TAG ALL_* 』\n\n*Total member*: ${data.groupMetadata.participants.length} 688 | 689 | 690 | ` 691 | data.groupMetadata.participants.forEach((member, i) => { 692 | text += `${i+1}. ⤷@${member.jid.split('@')[0]}\n` 693 | }) 694 | Client.sendText(data.from, text) 695 | }) 696 | Client.cmd.on('setgroupicon', async (data) => { 697 | if(!data.isGroup) return data.reply(mess.group) 698 | if(!data.isAdmin) return data.reply(mess.admin) 699 | if(!data.botIsAdmin) return data.reply(mess.botAdmin) 700 | if(!data.isQuotedImage && data.type != 'imageMessage') return data.reply(`Wrong format!, please send image with caption ${data.prefix}setgroupicon, or reply image with ${data.prefix}setgroupicon`) 701 | const getbuff = data.isQuotedImage ? JSON.parse(JSON.stringify(data.message).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo : data.message 702 | const dlfile = await client.downloadMediaMessage(getbuff) 703 | client.updateProfilePicture(data.from, dlfile) 704 | data.reply(`success!, group icon has been changed by @${data.sender.split('@')[0]}`) 705 | }) 706 | Client.cmd.on('setgroupname', async (data) => { 707 | if(!data.isGroup) return data.reply(mess.group) 708 | if(!data.isAdmin) return data.reply(mess.admin) 709 | if(!data.botIsAdmin) return data.reply(mess.botAdmin) 710 | if(data.body == "") return data.reply(`Kirim perintah *${data.prefix}${data.command} [ text ]*\nContoh : ${data.prefix}${data.command} Elios`) 711 | client.groupUpdateSubject(data.from, `${data.body}`) 712 | data.reply(`Nama group telah diganti oleh admin @${data.sender.split('@')[0]}`) 713 | }) 714 | Client.cmd.on('setgroupdesc', async (data) => { 715 | if(!data.isGroup) return data.reply(mess.group) 716 | if(!data.isAdmin) return data.reply(mess.admin) 717 | if(!data.botIsAdmin) return data.reply(mess.botAdmin) 718 | if(data.body == "") return data.reply(`Kirim perintah *${data.prefix}${data.command} [ text ]*\nContoh : ${data.prefix}${data.command} Elios`) 719 | client.groupUpdateDescription(data.from, `${data.body}`) 720 | data.reply(`Deskripsi group telah diganti oleh admin @${data.sender.split('@')[0]}`) 721 | }) 722 | Client.cmd.on('promote', async (data) => { 723 | if(isLimit(data.sender)) return data.reply(mess.limit) 724 | if(!data.isGroup) return data.reply(mess.group) 725 | if(!data.isAdmin) return data.reply(mess.admin) 726 | if(!data.botIsAdmin) return data.reply(mess.botAdmin) 727 | if(data.mentionedJidList.length == 0) return data.reply(`Kirim perintah *${data.prefix}${data.command} [ @tag ]*\nContoh : ${data.prefix}${data.command} @0`) 728 | client.groupMakeAdmin(data.from, data.mentionedJidList).then(() => data.reply(`Perintah diterima, menambahkan @${data.mentionedJidList.join(' @').replace(/@s.whatsapp.net/g, '')} sebagai admin.`)).catch(() => data.reply('Gagal!')) 729 | }) 730 | Client.cmd.on('demote', async (data) => { 731 | if(isLimit(data.sender)) return data.reply(mess.limit) 732 | if(!data.isGroup) return data.reply(mess.group) 733 | if(!data.isAdmin) return data.reply(mess.admin) 734 | if(!data.botIsAdmin) return data.reply(mess.botAdmin) 735 | if(data.mentionedJidList.length == 0) return data.reply(`Kirim perintah *${data.prefix}${data.command} [ @tag ]*\nContoh : ${data.prefix}${data.command} @0`) 736 | client.groupDemoteAdmin(data.from, data.mentionedJidList).then(() => data.reply(`Perintah diterima, menghapus admin @${data.mentionedJidList.join(' @').replace(/@s.whatsapp.net/g, '')}`)).catch(() => data.reply('Gagal!')) 737 | }) 738 | Client.cmd.on('kick', async (data) => { 739 | if(isLimit(data.sender)) return data.reply(mess.limit) 740 | if(!data.isGroup) return data.reply(mess.group) 741 | if(!data.isAdmin) return data.reply(mess.admin) 742 | if(!data.botIsAdmin) return data.reply(mess.botAdmin) 743 | if(data.mentionedJidList.length == 0) return data.reply(`Kirim perintah *${data.prefix}${data.command} [ @tag ]*\nContoh : ${data.prefix}${data.command} @0`) 744 | data.mentionedJidList.forEach(async jid =>{ client.groupRemove(data.from, [jid]).then(x => data.reply(`Sukses kick @${jid.split('@')[0]}`)).catch(x => data.reply(`Gagal kick @${jid.split('@')[0]}`)); await sleep(2000)}) 745 | }) 746 | Client.cmd.on('add', async (data) => { 747 | if(isLimit(data.sender)) return data.reply(mess.limit) 748 | if(!data.isGroup) return data.reply(mess.group) 749 | if(!data.isAdmin) return data.reply(mess.admin) 750 | if(!data.botIsAdmin) return data.reply(mess.botAdmin) 751 | if(data.body == "") return data.reply(`Kirim perintah *${data.prefix}${data.command} [ nomor ]*\nContoh : ${data.prefix}${data.command} 6285736996646`) 752 | args = data.args.map(mp => mp + "@s.whatsapp.net") 753 | client.groupAdd(data.from, args).then(() => data.reply(`Berhasil menambahkan @${data.args.join(' @')}`)).catch(() => data.reply('Unable to invite')) 754 | }) 755 | Client.cmd.on('testing', async (data) => { 756 | console.log(client) 757 | }) 758 | /*IMAGE MAKER*/ 759 | Client.cmd.on('missing', async (data) => { 760 | if(isLimit(data.sender)) return data.reply(mess.limit) 761 | data.reply(mess.wait) 762 | if(data.isQuotedImage || data.type == 'imageMessage') { 763 | const getbuffs = data.isQuotedImage ? await data.downloadMediaQuotedMessage() : await data.downloadMediaMessage() 764 | bodyForm = new FormData() 765 | bodyForm.append('image', getbuffs, 'missing.jpeg') 766 | text = data.body.split('|') 767 | const getAxios = await axios(`${configs.apiUrl}/api/missing-image?apikey=${configs.zeksKey}&text1=${text[0]}&text2=${text[1]}&text3=${text[2]}`, { 768 | method: 'POST', 769 | responseType: "arraybuffer", 770 | headers: { 771 | ...bodyForm.getHeaders() 772 | }, 773 | data: bodyForm.getBuffer() 774 | }) 775 | Client.sendFileFromBase64(data.from, getAxios.data.toString('base64'), 'missing.jpg', '*Gambar berhasil dibuat!* ', data.message) 776 | } else if(data.mentionedJidList.length > 0) { 777 | text = data.body.split('|') 778 | ppUrl = await client.getProfilePicture(data.mentionedJidList[0]) 779 | if(!ppUrl) return data.reply('Profile picture not found!') 780 | Client.sendFileFromUrl(data.from, `${configs.apiUrl}/api/missing-image?apikey=${configs.zeksKey}&image=${encodeURIComponent(ppUrl)}&text1=${text[0]}&text2=${text[1]}&text3=${text[2]}`, 'missing.jpg', '*Gambar berhasil dibuat!* ', data.message) 781 | } else data.reply(`Wrong format!, Example: tag someone or reply image\n${data.prefix}missing lost|idk|call xxxxx|@${client.user.jid.split('@')[0]}`) 782 | 783 | }) 784 | Client.cmd.on('calender', async (data) => { 785 | if(isLimit(data.sender)) return data.reply(mess.limit) 786 | data.reply(mess.wait) 787 | if(data.isQuotedImage || data.type == 'imageMessage') { 788 | const getbuffs = data.isQuotedImage ? await data.downloadMediaQuotedMessage() : await data.downloadMediaMessage() 789 | bodyForm = new FormData() 790 | bodyForm.append('image', getbuffs, 'myimg.jpeg') 791 | const getAxios = await axios(`${configs.apiUrl}/api/calender?apikey=${configs.zeksKey}`, { 792 | method: 'POST', 793 | responseType: "arraybuffer", 794 | headers: { 795 | ...bodyForm.getHeaders() 796 | }, 797 | data: bodyForm.getBuffer() 798 | }) 799 | Client.sendFileFromBase64(data.from, getAxios.data.toString('base64'), 'p.jpg', '*Gambar berhasil dibuat!* ', data.message) 800 | } else if(data.mentionedJidList.length > 0) { 801 | ppUrl = await client.getProfilePicture(data.mentionedJidList[0]) 802 | if(!ppUrl) return data.reply('Profile picture not found!') 803 | Client.sendFileFromUrl(data.from, `${configs.apiUrl}/api/calender?apikey=${configs.zeksKey}&image=${encodeURIComponent(ppUrl)}`, 'calender.jpg', '*Gambar berhasil dibuat!* ', data.message) 804 | } else data.reply(`Wrong format!, tag someone or reply image with ${data.prefix}calender`) 805 | 806 | }) 807 | Client.cmd.on('removebg', async (data) => { 808 | if(isLimit(data.sender)) return data.reply(mess.limit) 809 | data.reply(mess.wait) 810 | if(data.isQuotedImage || data.type == 'imageMessage') { 811 | const getbuffs = data.isQuotedImage ? await data.downloadMediaQuotedMessage() : await data.downloadMediaMessage() 812 | bodyForm = new FormData() 813 | bodyForm.append('image', getbuffs, 'myimg.jpeg') 814 | const getAxios = await axios(`${configs.apiUrl}/api/removebg?apikey=${configs.zeksKey}`, { 815 | method: 'POST', 816 | responseType: "arraybuffer", 817 | headers: { 818 | ...bodyForm.getHeaders() 819 | }, 820 | data: bodyForm.getBuffer() 821 | }) 822 | Client.sendFileFromBase64(data.from, getAxios.data.toString('base64'), 'p.jpg', '*Gambar berhasil dibuat!* ', data.message) 823 | } else if(data.mentionedJidList.length > 0) { 824 | ppUrl = await client.getProfilePicture(data.mentionedJidList[0]) 825 | if(!ppUrl) return data.reply('Profile picture not found!') 826 | Client.sendFileFromUrl(data.from, `${configs.apiUrl}/api/removebg?apikey=${configs.zeksKey}&image=${encodeURIComponent(ppUrl)}`, 'calender.jpg', '*Gambar berhasil dibuat!* ', data.message) 827 | } else data.reply(`Wrong format!, tag someone or reply image with ${data.prefix}calender`) 828 | 829 | }) 830 | Client.cmd.on('drawing', async (data) => { 831 | if(isLimit(data.sender)) return data.reply(mess.limit) 832 | data.reply(mess.wait) 833 | if(data.isQuotedImage || data.type == 'imageMessage') { 834 | const getbuffs = data.isQuotedImage ? await data.downloadMediaQuotedMessage() : await data.downloadMediaMessage() 835 | bodyForm = new FormData() 836 | bodyForm.append('image', getbuffs, 'myimg.jpeg') 837 | const getAxios = await axios(`${configs.apiUrl}/api/draw-image?apikey=${configs.zeksKey}`, { 838 | method: 'POST', 839 | responseType: "arraybuffer", 840 | headers: { 841 | ...bodyForm.getHeaders() 842 | }, 843 | data: bodyForm.getBuffer() 844 | }) 845 | Client.sendFileFromBase64(data.from, getAxios.data.toString('base64'), 'p.jpg', '*Gambar berhasil dibuat!* ', data.message) 846 | } else if(data.mentionedJidList.length > 0) { 847 | ppUrl = await client.getProfilePicture(data.mentionedJidList[0]) 848 | if(!ppUrl) return data.reply('Profile picture not found!') 849 | Client.sendFileFromUrl(data.from, `${configs.apiUrl}/api/draw-image?apikey=${configs.zeksKey}&image=${encodeURIComponent(ppUrl)}`, 'calender.jpg', '*Gambar berhasil dibuat!* ', data.message) 850 | } else data.reply(`Wrong format!, tag someone or reply image with ${data.prefix}drawing`) 851 | 852 | }) 853 | Client.cmd.on('sketch', async (data) => { 854 | if(isLimit(data.sender)) return data.reply(mess.limit) 855 | data.reply(mess.wait) 856 | if(data.isQuotedImage || data.type == 'imageMessage') { 857 | const getbuffs = data.isQuotedImage ? await data.downloadMediaQuotedMessage() : await data.downloadMediaMessage() 858 | bodyForm = new FormData() 859 | bodyForm.append('image', getbuffs, 'myimg.jpeg') 860 | const getAxios = await axios(`${configs.apiUrl}/api/sketch-image?apikey=${configs.zeksKey}`, { 861 | method: 'POST', 862 | responseType: "arraybuffer", 863 | headers: { 864 | ...bodyForm.getHeaders() 865 | }, 866 | data: bodyForm.getBuffer() 867 | }) 868 | Client.sendFileFromBase64(data.from, getAxios.data.toString('base64'), 'p.jpg', '*Gambar berhasil dibuat!* ', data.message) 869 | } else if(data.mentionedJidList.length > 0) { 870 | ppUrl = await client.getProfilePicture(data.mentionedJidList[0]) 871 | if(!ppUrl) return data.reply('Profile picture not found!') 872 | Client.sendFileFromUrl(data.from, `${configs.apiUrl}/api/sketch-image?apikey=${configs.zeksKey}&image=${encodeURIComponent(ppUrl)}`, 'calender.jpg', '*Gambar berhasil dibuat!* ', data.message) 873 | } else data.reply(`Wrong format!, tag someone or reply image with ${data.prefix}drawing`) 874 | 875 | }) 876 | //If you want case method 877 | Client.cmd.on('*', async (data) => { 878 | const { 879 | args, 880 | body, 881 | message, 882 | prefix, 883 | from, 884 | sender, 885 | command, 886 | isOwner, 887 | type, 888 | isQuotedVideo, 889 | isQuotedImage, 890 | isQuotedSticker, 891 | isQuotedAudio, 892 | groupMetadata, 893 | isAdmin, 894 | botIsAdmin, 895 | pushname, 896 | t 897 | } = data 898 | switch(command.toLowerCase()) { 899 | case 'self': 900 | if (!isOwner) return data.reply(mess.ownerOnly) 901 | if (Client.self) return data.reply('Already Self Mode') 902 | Client.self = true 903 | data.reply('OK') 904 | break 905 | case 'public': 906 | if (!isOwner) return data.reply(mess.ownerOnly) 907 | if (!Client.self) return data.reply('Already Public Mode') 908 | Client.self = false 909 | data.reply('OK') 910 | break 911 | case 'command': 912 | case 'cmd': 913 | case 'menu': 914 | case 'help': 915 | case 'list': 916 | const mediaMsg = await client.prepareMessageMedia(await getBuffer(configs.imgUrl), 'imageMessage') 917 | const buttonMessage = { 918 | contentText: menu(data.prefix, data.pushname), 919 | footerText: '𝐖𝐇𝐀𝐓𝐒𝐀𝐏𝐏-𝐁𝐎𝐓', 920 | "contextInfo": { 921 | mentionedJid: [configs.ownerList[0]], 922 | participant: sender, 923 | stanzaId: message.key.id, 924 | quotedMessage: message.message, 925 | }, 926 | buttons: [ 927 | { 928 | buttonId: `${data.prefix}info`, 929 | buttonText: { 930 | displayText: "📒 𝐈𝐍𝐅𝐎" 931 | }, 932 | "type": "RESPONSE" 933 | }, 934 | { 935 | buttonId: `${data.prefix}owner`, 936 | buttonText: { 937 | displayText: "🪀 𝐎𝐖𝐍𝐄𝐑" 938 | }, 939 | "type": "RESPONSE" 940 | }, 941 | ], 942 | headerType: 4, 943 | ...mediaMsg 944 | } 945 | let zz = await client.prepareMessageFromContent(from, {buttonsMessage: buttonMessage}, {}) 946 | client.relayWAMessage(zz, {waitForAck: true}) 947 | break 948 | /*STICKER*/ 949 | case 'sgif': 950 | case 'sticker': 951 | case 's': 952 | case 'stiker': 953 | case 'stickergif': 954 | case 'stikergif': 955 | if(isLimit(data.sender)) return data.reply(mess.limit) 956 | if(type != 'videoMessage' && !isQuotedVideo && !isQuotedImage && type != 'imageMessage') return data.reply('Wrong format!') 957 | const getbuff = data.isQuotedVideo || data.isQuotedImage ? JSON.parse(JSON.stringify(data.message).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo : data.message 958 | const dlfile = await client.downloadMediaMessage(getbuff) 959 | if(type == 'videoMessage' || isQuotedVideo) Client.sendMp4AsSticker(from, dlfile.toString('base64'), message, { pack: `${configs.pack}`, author: `${configs.author}` }) 960 | else Client.sendImageAsSticker(from, dlfile.toString('base64'), message, { pack: `${configs.pack}`, author: `${configs.author}` }) 961 | break 962 | case 'tomp3': 963 | if(isLimit(data.sender)) return data.reply(mess.limit) 964 | data.reply(mess.wait) 965 | if(type != 'videoMessage' && !isQuotedVideo) return data.reply('Wrong format!') 966 | const getbuffz = data.isQuotedVideo ? JSON.parse(JSON.stringify(message).replace('quotedM','m')).message.extendedTextMessage.contextInfo : data.message 967 | const dlfilez = await client.downloadMediaMessage(getbuffz) 968 | convertMp3(dlfilez).then(data =>Client.sendFileFromUrl(from, data, 'p.mp3', '', message)).catch(er => Client.reply(from, 'Unexpected error!', message)) 969 | break 970 | case 'stikerwm': 971 | case 'stickerwm': 972 | case 'swm': 973 | if(isLimit(data.sender)) return data.reply(mess.limit) 974 | if(type != 'videoMessage' && !isQuotedVideo && !isQuotedImage && type != 'imageMessage') return data.reply('Wrong format!') 975 | if(data.body == "") return data.reply(`Kirim perintah *${data.prefix}${data.command} [ pack|author ]*\nContoh : ${data.prefix}${data.command} punya|elios`) 976 | data.reply(mess.wait) 977 | const getbuffs = data.isQuotedVideo || data.isQuotedImage ? JSON.parse(JSON.stringify(data.message).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo : data.message 978 | const dlfiles = await client.downloadMediaMessage(getbuffs) 979 | text = data.body.split('|') 980 | if(type == 'videoMessage' || isQuotedVideo) Client.sendMp4AsSticker(from, dlfiles.toString('base64'), message, { crop: false, pack: `${text[0]}`, author: `${text[1]}` }) 981 | else Client.sendImageAsSticker(from, dlfiles.toString('base64'), message, { pack: `${text[0]}`, author: `${text[1]}`, emojis: data.body.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g) }) 982 | break 983 | case 'stikeremoji': 984 | case 'stickeremoji': 985 | case 'semoji': 986 | try { 987 | if(isLimit(data.sender)) return data.reply(mess.limit) 988 | if(data.body == "") return data.reply(`Kirim perintah *${data.prefix}${data.command} [ emoji ]*\nContoh : ${data.prefix}${data.command} 😃`) 989 | Client.sendStickerFromUrl(from, `${configs.apiUrl}/api/emoji-image?apikey=${configs.zeksKey}&emoji=${encodeURIComponent(data.body)}`, message, { pack: `${configs.pack}`, author: `${configs.author}`, emojis: data.body.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g)}) 990 | } catch { 991 | data.reply('error') 992 | } 993 | break 994 | case 'takestick': 995 | case 'takestik': 996 | if(isLimit(data.sender)) return data.reply(mess.limit) 997 | if(!data.isQuotedSticker) return data.reply('Reply sticker!') 998 | if(data.body == "") return data.reply(`Kirim perintah *${data.prefix}${data.command} [ pack|author ]*\nContoh : ${data.prefix}${data.command} punya|elios`) 999 | data.reply(mess.wait) 1000 | p = data.body 1001 | text = p.split('|') 1002 | const buff = await client.downloadMediaMessage(JSON.parse(JSON.stringify(data.message).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo) 1003 | Client.sendWebpAsSticker(data.from, buff.toString('base64'), data.message, {pack: `${text[0]}`, author: `${text[1]}`, emojis: data.body.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g)}) 1004 | break 1005 | case 'stikerfire': 1006 | case 'stickerfire': 1007 | case 'sfire': 1008 | if(isLimit(data.sender)) return data.reply(mess.limit) 1009 | if(data.isQuotedImage || data.type == 'imageMessage') { 1010 | const getbuffs = data.isQuotedImage ? await data.downloadMediaQuotedMessage() : await data.downloadMediaMessage() 1011 | bodyForm = new FormData() 1012 | bodyForm.append('image', getbuffs, 'myimg.jpeg') 1013 | const getAxios = await axios(`${configs.apiUrl}/api/burning-image?apikey=${configs.zeksKey}`, { 1014 | method: 'POST', 1015 | responseType: "arraybuffer", 1016 | headers: { 1017 | ...bodyForm.getHeaders() 1018 | }, 1019 | data: bodyForm.getBuffer() 1020 | }) 1021 | Client.sendMediaAsSticker(data.from, getAxios.data.toString('base64'), data.message, { 1022 | pack: `${configs.pack}`, 1023 | author: `${configs.author}` 1024 | }) 1025 | } else if(data.mentionedJidList.length > 0) { 1026 | ppUrl = await client.getProfilePicture(data.mentionedJidList[0]) 1027 | if(!ppUrl) return data.reply('Profile picture not found!') 1028 | Client.sendStickerFromUrl(data.from, `${configs.apiUrl}/api/burning-image?apikey=${configs.zeksKey}&image=${encodeURIComponent(ppUrl)}`, data.message, { 1029 | pack: `${configs.pack}`, 1030 | author: `${configs.author}` 1031 | }) 1032 | } else data.reply(`Wrong format!, tag someone or reply image with ${data.prefix}stickerfire`) 1033 | break 1034 | case 'stikernobg': 1035 | case 'stickernobg': 1036 | case 'snobg': 1037 | if(isLimit(data.sender)) return data.reply(mess.limit) 1038 | if(data.isQuotedImage || data.type == 'imageMessage') { 1039 | const getbuffs = data.isQuotedImage ? await data.downloadMediaQuotedMessage() : await data.downloadMediaMessage() 1040 | bodyForm = new FormData() 1041 | bodyForm.append('image', getbuffs, 'myimg.jpeg') 1042 | const getAxios = await axios(`${configs.apiUrl}/api/removebg?apikey=${configs.zeksKey}`, { 1043 | method: 'POST', 1044 | responseType: "arraybuffer", 1045 | headers: { 1046 | ...bodyForm.getHeaders() 1047 | }, 1048 | data: bodyForm.getBuffer() 1049 | }) 1050 | Client.sendMediaAsSticker(data.from, getAxios.data.toString('base64'), data.message, { 1051 | pack: `${configs.pack}`, 1052 | author: `${configs.author}` 1053 | }) 1054 | } else if(data.mentionedJidList.length > 0) { 1055 | ppUrl = await client.getProfilePicture(data.mentionedJidList[0]) 1056 | if(!ppUrl) return data.reply('Profile picture not found!') 1057 | Client.sendStickerFromUrl(data.from, `${configs.apiUrl}/api/removebg?apikey=${configs.zeksKey}&image=${encodeURIComponent(ppUrl)}`, data.message, { 1058 | pack: `${configs.pack}`, 1059 | author: `${configs.author}` 1060 | }) 1061 | } else data.reply(`Wrong format!, tag someone or reply image with ${data.prefix}stickerfire`) 1062 | break 1063 | /*TEXT MAKER*/ 1064 | case 'qrencode': 1065 | case 'barcode': 1066 | case 'bneon': 1067 | case 'matrix': 1068 | case 'breakwall': 1069 | case 'gneon': 1070 | case 'dropwater': 1071 | case 'tfire': 1072 | case 'sandw': 1073 | case 'epep': 1074 | case 'gplaybutton': 1075 | case 'splaybutton': 1076 | case 'text3dbox': 1077 | case 'text3d': 1078 | case 'logobp': 1079 | case 'leavest': 1080 | case 'thundertext': 1081 | case 'tlight': 1082 | case 'naruto': 1083 | case 'crosslogo': 1084 | case 'cslogo': 1085 | case 'crismes': 1086 | case 'flametext': 1087 | case 'glowtext': 1088 | case 'smoketext': 1089 | case 'flowertext': 1090 | case 'lithgtext': 1091 | case 'nulis': 1092 | try { 1093 | if(isLimit(data.sender)) return data.reply(mess.limit) 1094 | if(data.body == "") return data.reply(`Kirim perintah *${data.prefix}${data.command} [ teks ]*\nContoh : ${data.prefix}${data.command} shiro`) 1095 | data.reply(mess.wait) 1096 | Client.sendFileFromUrl(from, `${configs.apiUrl}/api/${command}?text=${data.body}&apikey=${configs.zeksKey}`, 'gambar.jpg', `*Gambar berhasil dibuat!* @${data.sender.split('@')[0]}`, message) 1097 | } catch { 1098 | data.reply('error') 1099 | } 1100 | break 1101 | case 'wolflogo': 1102 | case 'logoaveng': 1103 | case 'phlogo': 1104 | case 'marvellogo': 1105 | case 'gtext': 1106 | case 'pubglogo': 1107 | case 'snowwrite': 1108 | case 'watercolour': 1109 | try { 1110 | if(isLimit(data.sender)) return data.reply(mess.limit) 1111 | if(data.body == "") return data.reply(`Kirim perintah *${data.prefix}${data.command} [ teks1|teks2 ]*\nContoh : ${data.prefix}${data.command} shiro|elios`) 1112 | data.reply(mess.wait) 1113 | p = data.body 1114 | text = p.split('|') 1115 | Client.sendFileFromUrl(from, `${configs.apiUrl}/api/${command}?apikey=${configs.zeksKey}&text1=${text[0]}&text2=${text[1]}`, 'p.jpg', `*Gambar berhasil dibuat!* @${data.sender.split('@')[0]}`, message) 1116 | } catch { 1117 | data.reply('error') 1118 | } 1119 | break 1120 | case 'tahta': 1121 | case 'harta': 1122 | case 'hartatahta': 1123 | if(isLimit(data.sender)) return data.reply(mess.limit) 1124 | if(data.body == "") return data.reply(`Kirim perintah *${data.prefix}${data.command} [ teks ]*\nContoh : ${data.prefix}${data.command} shiro`) 1125 | data.reply(mess.wait) 1126 | Client.sendFileFromUrl(from, `${configs.apiUrl}/api/hartatahta?text=${data.body}&apikey=${configs.zeksKey}`, 'harta.jpg', `*Gambar berhasil dibuat!* @${data.sender.split('@')[0]}`, message) 1127 | Client.sendStickerFromUrl(from, `${configs.apiUrl}/api/hartatahta?text=${data.body}&apikey=${configs.zeksKey}`, message, { 1128 | crop: false, 1129 | pack: 'Pack', 1130 | author: 'AUTHOR' 1131 | }) 1132 | break 1133 | /*SEARCHING*/ 1134 | case 'playstore': 1135 | try { 1136 | if(isLimit(data.sender)) return data.reply(mess.limit) 1137 | if(data.body == "") return data.reply(`Kirim perintah *${data.prefix}playstore [ apk ]*\nContoh : ${data.prefix}playstore pubg`) 1138 | data.reply(mess.wait) 1139 | res = await axios.get(`${configs.apiUrl}/api/sgplay?apikey=${configs.zeksKey}&q=${data.body}`) 1140 | ttt = res.data.result 1141 | var teks = `*「 PLAYSTORE 」*\n\n*Hasil Pencarian : ${data.body}*\n\n` 1142 | for(let i = 0; i < ttt.length; i++) { 1143 | teks += `*Title* : ${ttt[i].title}\n*Harga* : ${ttt[i].price}\n*Rate*: ${ttt[i].rating}\n*Link*: ${ttt[i].url}\n\n` 1144 | } 1145 | await Client.sendFileFromUrl(from, ttt[0].thumb, 'p.jpg', teks, message) 1146 | } catch { 1147 | data.reply(`Maaf aplikasi ${data.body} tidak ditemukan`) 1148 | } 1149 | break 1150 | case 'wiki': 1151 | try { 1152 | if(isLimit(data.sender)) return data.reply(mess.limit) 1153 | if(data.body == "") return data.reply(`Kirim perintah *${data.prefix}wiki [ query ]*\nContoh : ${data.prefix}wiki manusia`) 1154 | data.reply(mess.wait) 1155 | res = await axios.get(`${configs.apiUrl}/api/wiki?apikey=${configs.zeksKey}&q=${data.body}`) 1156 | te = `*Hasil pencarian dari* : ${data.body}\n\n*Result* : ${res.data.result.result}` 1157 | data.reply(te) 1158 | } catch { 1159 | data.reply(`Maaf wiki ${data.body} tidak ditemukan`) 1160 | } 1161 | break 1162 | case 'kbbi': 1163 | try { 1164 | if(isLimit(data.sender)) return data.reply(mess.limit) 1165 | if(data.body == "") return data.reply(`Kirim perintah *${data.prefix}kbbi [ query ]*\nContoh : ${data.prefix}kbbi manusia`) 1166 | data.reply(mess.wait) 1167 | res = await axios.get(`${configs.apiUrl}/api/kbbi?apikey=${configs.zeksKey}&q=${data.body}`) 1168 | te = `*Hasil pencarian dari* : ${data.body}\n\n*Result* : ${res.data.result}\n*Source* : ${res.data.source}` 1169 | data.reply(te) 1170 | } catch { 1171 | data.reply(`Maaf kbbi ${data.body} tidak ditemukan`) 1172 | } 1173 | break 1174 | case 'film': 1175 | try { 1176 | if(isLimit(data.sender)) return data.reply(mess.limit) 1177 | if(data.body == "") return data.reply(`Kirim perintah *${data.prefix}film [ film ]*\nContoh : ${data.prefix}film doraemon`) 1178 | data.reply(mess.wait) 1179 | res = await axios.get(`${configs.apiUrl}/api/film?apikey=${configs.zeksKey}&q=${data.body}`) 1180 | ttt = res.data.result 1181 | var teks = `*「 FILM 」*\n\n*Hasil Pencarian : ${data.body}*\n\n` 1182 | for(let i = 0; i < ttt.length; i++) { 1183 | teks += `*Title* : ${ttt[i].title}\n*Link*: ${ttt[i].url}\n\n` 1184 | } 1185 | await Client.sendFileFromUrl(from, ttt[0].thumb, 'p.jpg', teks, message) 1186 | } catch { 1187 | data.reply(`Maaf film ${data.body} tidak ditemukan`) 1188 | } 1189 | break 1190 | case 'happymod': 1191 | try { 1192 | if(isLimit(data.sender)) return data.reply(mess.limit) 1193 | if(data.body == "") return data.reply(`Kirim perintah *${data.prefix}happymod [ apk ]*\nContoh : ${data.prefix}happymod pubg`) 1194 | data.reply(mess.wait) 1195 | res = await axios.get(`${configs.apiUrl}/api/happymod?apikey=${configs.zeksKey}&q=${data.body}`) 1196 | ttt = res.data.result 1197 | var teks = `*「 HAPPYMOD 」*\n\n*Hasil Pencarian : ${data.body}*\n\n` 1198 | for(let i = 0; i < ttt.length; i++) { 1199 | teks += `*Title* : ${ttt[i].title}\n*Rate*: ${ttt[i].rating}\n*Link*: ${ttt[i].url}\n\n` 1200 | } 1201 | await Client.sendFileFromUrl(from, ttt[0].thumb, 'p.jpg', teks, message) 1202 | } catch { 1203 | data.reply(`Maaf aplikasi MOD ${data.body} tidak ditemukan`) 1204 | } 1205 | break 1206 | case 'iguser': 1207 | try { 1208 | if(isLimit(data.sender)) return data.reply(mess.limit) 1209 | if(data.body == "") return data.reply(`Kirim perintah *${data.prefix}iguser [ username ]*\nContoh : ${data.prefix}iguser jessnolimit`) 1210 | data.reply(mess.wait) 1211 | res = await axios.get(`${configs.apiUrl}/api/iguser?apikey=${configs.zeksKey}&q=${data.body}`) 1212 | ttt = res.data.result 1213 | var teks = `*「 INSTAGRAM USER 」*\n\n*Hasil Pencarian : ${data.body}*\n\n` 1214 | for(let i = 0; i < ttt.length; i++) { 1215 | teks += `*Username* : ${ttt[i].username}\n*Full name*: ${ttt[i].full_name}\n*Akun private* : ${ttt[i].private_user}\n*Verified*: ${ttt[i].verified_user}\n*Link*: https://instagram.com/${ttt[i].username}\n\n` 1216 | } 1217 | await Client.sendFileFromUrl(from, ttt[0].profile_pic, 'p.jpg', teks, message) 1218 | } catch { 1219 | data.reply(`Maaf username ${data.body} tidak ditemukan`) 1220 | } 1221 | break 1222 | case 'ytsearch': 1223 | try { 1224 | if(isLimit(data.sender)) return data.reply(mess.limit) 1225 | if(data.body == "") return data.reply(`Kirim perintah *${data.prefix}ytsearch [ query ]*\nContoh : ${data.prefix}ytsearch jessnolimit`) 1226 | data.reply(mess.wait) 1227 | res = await axios.get(`${configs.apiUrl}/api/yts?apikey=${configs.zeksKey}&q=${data.body}`) 1228 | ttt = res.data.result 1229 | var teks = `*「 YOUTUBE 」*\n\n*Hasil Pencarian : ${data.body}*\n\n` 1230 | for(let i = 0; i < ttt.length; i++) { 1231 | teks += `*Title* : ${ttt[i].video.title}\n*Durasi*: ${ttt[i].video.duration}\n*Upload* : ${ttt[i].video.upload_date}\n*View*: ${ttt[i].video.views}\n*Channel*: ${ttt[i].uploader.username}\n*Link*: ${ttt[i].video.url}\n\n` 1232 | } 1233 | await Client.sendFileFromUrl(from, ttt[0].video.thumbnail_src, 'axis.jpg', teks, message) 1234 | } catch(e) { 1235 | data.reply(`Maaf pencarian ${data.body} tidak ditemukan`) 1236 | } 1237 | break 1238 | case 'ytplaylist': 1239 | try { 1240 | if(isLimit(data.sender)) return data.reply(mess.limit) 1241 | if(data.body == "") return data.reply(`Kirim perintah *${data.prefix}ytplaylist[ channel ]*\nContoh : ${data.prefix}ytplaylist jessnolimit`) 1242 | data.reply(mess.wait) 1243 | res = await axios.get(`${configs.apiUrl}/api/ytplaylist?apikey=${configs.zeksKey}&q=${data.body}`) 1244 | ttt = res.data.result 1245 | var tekss = `*「 YOUTUBE PLAYLIST 」*\n\n*Hasil Pencarian : ${data.body}*\n\n` 1246 | for(let i = 0; i < ttt.length; i++) { 1247 | tekss += `*Nama* : ${ttt[i].title}\n*Jumlah video*: ${ttt[i].video_count}\n*Channel*: ${ttt[i].uploader.username}\n*Link*: ${ttt[i].url}\n\n` 1248 | } 1249 | await Client.sendFileFromUrl(from, ttt[0].thumbnail, 'axis.jpg', tekss, message) 1250 | } catch(e) { 1251 | data.reply(`Maaf pencarian ${data.body} tidak ditemukan`) 1252 | } 1253 | break 1254 | case 'ytchannel': 1255 | try { 1256 | if(isLimit(data.sender)) return data.reply(mess.limit) 1257 | if(data.body == "") return data.reply(`Kirim perintah *${data.prefix}ytchannel [ channel ]*\nContoh : ${data.prefix}ytchannel jessnolimit`) 1258 | data.reply(mess.wait) 1259 | res = await axios.get(`${configs.apiUrl}/api/ytchannel?apikey=${configs.zeksKey}&q=${data.body}`) 1260 | ttt = res.data.result 1261 | var eks = `*「 YOUTUBE CHANNEL 」*\n\n*Hasil Pencarian : ${data.body}*\n\n` 1262 | for(let i = 0; i < ttt.length; i++) { 1263 | eks += `*Nama* : ${ttt[i].title}\n*Deskripsi*: ${ttt[i].description}\n*Verified* : ${ttt[i].verified}\n*Jumlah video*: ${ttt[i].video_count}\n*Subcriber*: ${ttt[i].subscriber_count}\n*Link*: ${ttt[i].url}\n\n` 1264 | } 1265 | await Client.sendFileFromUrl(from, ttt[0].thumbnail, 'axis.jpg', eks, message) 1266 | } catch(e) { 1267 | data.reply(`Maaf pencarian ${data.body} tidak ditemukan`) 1268 | } 1269 | break 1270 | case 'shopee': 1271 | try { 1272 | if(isLimit(data.sender)) return data.reply(mess.limit) 1273 | if(data.body == "") return data.reply(`Kirim perintah *${data.prefix}shopee [ query ]*\nContoh : ${data.prefix}shopee sepatu`) 1274 | data.reply(mess.wait) 1275 | res = await axios.get(`${configs.apiUrl}/api/shopee?apikey=${configs.zeksKey}&q=${data.body}`) 1276 | ttt = res.data.data 1277 | var teks = `*「 SHOPEE 」*\n\n*Hasil Pencarian : ${data.body}*\n\n` 1278 | for(let i = 0; i < ttt.length; i++) { 1279 | teks += `*Nama* : ${ttt[i].name}\n*Harga*: ${ttt[i].harga}\n*Terjual* : ${ttt[i].terjual}\n*Lokasi*: ${ttt[i].location}\n*Deskripsi*: ${ttt[i].desc}\n*Stok*: ${ttt[i].stock}\n*Informasi*: ${ttt[i].information}\n*Link*: ${ttt[i].url}\n\n` 1280 | } 1281 | await Client.sendFileFromUrl(from, ttt[0].img_detail[0], 'p.jpg', teks, message) 1282 | } catch { 1283 | data.reply(`Maaf produk ${data.body} tidak ditemukan`) 1284 | } 1285 | break 1286 | case 'igstalk': 1287 | try { 1288 | if(isLimit(data.sender)) return data.reply(mess.limit) 1289 | if(data.body == "") return data.reply(`Kirim perintah *${data.prefix}igstalk [ query ]*\nContoh : ${data.prefix}igstalk elios_xyz`) 1290 | data.reply(mess.wait) 1291 | res = await axios.get(`${configs.apiUrl}/api/igstalk?apikey=${configs.zeksKey}&username=${data.body}`) 1292 | pe = res.data 1293 | tek = `*「 INSTAGRAM PROFILE 」* 1294 | 1295 | *Username:* @${pe.username} 1296 | *Nama:* ${pe.fullname} 1297 | *Pengikut:* ${pe.follower} 1298 | *Mengikuti*: ${pe.following} 1299 | *Deskripsi:* ${pe.bio} 1300 | *Link:* https://instagram.com/${pe.username} 1301 | ` 1302 | Client.sendFileFromUrl(from, pe.profile_pic, 'p.jpg', tek, message) 1303 | } catch { 1304 | data.reply(`Maaf username ${data.body} tidak ditemukan`) 1305 | } 1306 | break 1307 | case 'brainly': 1308 | try { 1309 | if(isLimit(data.sender)) return data.reply(mess.limit) 1310 | if(data.body == "") return data.reply(`Kirim perintah *${data.prefix}brainly [ query ]*\nContoh : ${data.prefix}brainly siapa penemu lampu`) 1311 | data.reply(mess.wait) 1312 | res = await axios.get(`${configs.apiUrl}/api/brainly?apikey=${configs.zeksKey}&q=${data.body}&count=3`) 1313 | for(let i = 0; i < res.data.data.length; i++) { 1314 | await Client.reply(from, `Pertanyaan : ${res.data.data[i].question}\n\nJawaban : ${res.data.data[i].answer[0].text}`, message) 1315 | } 1316 | } catch { 1317 | data.reply(`Maaf jawaban tidak ditemukan`) 1318 | } 1319 | break 1320 | case 'spotify': 1321 | try { 1322 | if(isLimit(data.sender)) return data.reply(mess.limit) 1323 | if(data.body == "") return data.reply(`Kirim perintah *${data.prefix}spotify [ lagu ]*\nContoh : ${data.prefix}spotify melukis senja`) 1324 | data.reply(mess.wait) 1325 | res = await axios.get(`${configs.apiUrl}/api/spotify?apikey=${configs.zeksKey}&q=${data.body}`) 1326 | ttt = res.data.data 1327 | var teks = `*「 SPOTIFY 」*\n\n*Hasil Pencarian : ${data.body}*\n\n` 1328 | for(let i = 0; i < ttt.length; i++) { 1329 | teks += `*Judul* : ${ttt[i].title}\n*Artis*: ${ttt[i].artists}\n*Album* : ${ttt[i].album}\n*Link*: ${ttt[i].url}\n*Preview*: ${ttt[i].preview_mp3}\n\n` 1330 | } 1331 | await Client.sendFileFromUrl(from, ttt[0].thumb, 'p.jpg', teks, message) 1332 | } catch { 1333 | data.reply(`Maaf lagu ${data.body} tidak ditemukan`) 1334 | } 1335 | break 1336 | case 'gsmarena': 1337 | try { 1338 | if(isLimit(data.sender)) return data.reply(mess.limit) 1339 | if(data.body == "") return data.reply(`Kirim perintah *${data.prefix}gsmarena [ hp ]*\nContoh : ${data.prefix}gsmarena asus rog phone 3`) 1340 | data.reply(mess.wait) 1341 | res = await axios.get(`${configs.apiUrl}/api/gsmArena?apikey=${configs.zeksKey}&q=${data.body}`) 1342 | captions = `*HP* : ${res.data.data.title}\n\n${res.data.data.full_desc.string}\n${res.data.data.link}` 1343 | Client.sendFileFromUrl(from, res.data.data.thumb, 'p.jpg', captions, message) 1344 | } catch (e) { 1345 | data.reply(`Maaf hp ${data.body} tidak ditemukan`) 1346 | } 1347 | break 1348 | case 'searchmusic': 1349 | case 'searchmusik': 1350 | if(isLimit(data.sender)) return data.reply(mess.limit) 1351 | if(data.isQuotedAudio) { 1352 | files = await client.downloadMediaMessage(JSON.parse(JSON.stringify(message).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo) 1353 | bodyForm = new FormData() 1354 | bodyForm.append('audio', files, 'music.mp3') 1355 | axios(`${configs.apiUrl}/api/searchmusic?apikey=${configs.zeksKey}`, { 1356 | method: 'POST', 1357 | headers: { 1358 | ...bodyForm.getHeaders() 1359 | }, 1360 | data: bodyForm.getBuffer() 1361 | }) 1362 | .then(({ 1363 | data 1364 | }) => { 1365 | if(data.status) { 1366 | Client.reply(from, `_[ *Search Music* ]_\n\n*Title*: ${data.data.title}\n*Artists*: ${data.data.artists}\n*Genre*: ${data.data.genre}\n*Album*: ${data.data.album}\n*Release date*: ${data.data.release_date}`, message) 1367 | } else Client.reply(from, data.message, message) 1368 | }).catch(() => Client.reply(from, 'Internal server error!, try again later', message)) 1369 | } else Client.reply(from, 'Wrong format!', message) 1370 | break 1371 | case 'wallpaper': 1372 | try{ 1373 | if(isLimit(data.sender)) return data.reply(mess.limit) 1374 | if(data.body == "") return data.reply(`Kirim perintah *${data.prefix}wallpaper [ query ]*\nContoh : ${data.prefix}wallpaper kucing`) 1375 | data.reply(mess.wait) 1376 | res = await axios.get(`${configs.apiUrl}/api/unsplash?apikey=${configs.zeksKey}&q=${data.body}`) 1377 | if(res.data.status == false) data.reply(res.data.message) 1378 | n = res.data.result 1379 | image = n[Math.floor(Math.random() * n.length)] 1380 | Client.sendFileFromUrl(from, image.img_hd, 'p.jpg', `*Hasil pecarian* : ${data.body}`, message) 1381 | } catch { 1382 | data.reply(`error`) 1383 | } 1384 | break 1385 | case 'pinterest': 1386 | try{ 1387 | if(isLimit(data.sender)) return data.reply(mess.limit) 1388 | if(data.body == "") return data.reply(`Kirim perintah *${data.prefix}pinterest [ query ]*\nContoh : ${data.prefix}pinterest kucing`) 1389 | data.reply(mess.wait) 1390 | res = await axios.get(`${configs.apiUrl}/api/pinimg?apikey=${configs.zeksKey}&q=${data.body}`) 1391 | n = res.data.data 1392 | image = n[Math.floor(Math.random() * n.length)] 1393 | Client.sendFileFromUrl(from, image, 'p.jpg', `*Hasil pecarian* : ${data.body}`, message) 1394 | } catch { 1395 | data.reply(`error`) 1396 | } 1397 | break 1398 | case 'googleimage': 1399 | try{ 1400 | if(isLimit(data.sender)) return data.reply(mess.limit) 1401 | if(data.body == "") return data.reply(`Kirim perintah *${data.prefix}googleimage [ query ]*\nContoh : ${data.prefix}googleimage kucing`) 1402 | data.reply(mess.wait) 1403 | res = await axios.get(`${configs.apiUrl}/api/gimg?apikey=${configs.zeksKey}&q=${data.body}`) 1404 | n = res.data.data 1405 | image = n[Math.floor(Math.random() * n.length)] 1406 | Client.sendFileFromUrl(from, image, 'p.jpg', `*Hasil pecarian* : ${data.body}`, message) 1407 | } catch { 1408 | data.reply(`error`) 1409 | } 1410 | break 1411 | case 'jagokata': 1412 | if(isLimit(data.sender)) return data.reply(mess.limit) 1413 | if(data.body == "") return data.reply(`Kirim perintah *${data.prefix}jagokata [ apk ]*\nContoh : ${data.prefix}jagokata bersyukurlah`) 1414 | data.reply(mess.wait) 1415 | res = await axios.get(`${configs.apiUrl}/api/jagokata?apikey=${configs.zeksKey}&q=${data.body}`) 1416 | if(res.data.status == false) data.reply(res.data.message) 1417 | ttt = res.data.result 1418 | var teks = `*「 JAGOKATA 」*\n\n*Hasil Pencarian : ${data.body}*\n\n` 1419 | ttt.forEach(tt1 => teks += `*Kata* : ${tt1.kata}\n*Author* : ${tt1.author}\n*Info*: ${tt1.author_info}\n*Link*: ${tt1.author_url}\n\n` ) 1420 | await data.reply(teks) 1421 | break 1422 | /*PRIMBON*/ 1423 | case 'jodoh': 1424 | case 'ramalpasangan': 1425 | case 'pasangan': 1426 | if(isLimit(data.sender)) return data.reply(mess.limit) 1427 | if(data.body == "") return data.reply(`Kirim perintah *${data.prefix}${data.command} [ kamu|dia ]*\nContoh : ${data.prefix}${data.command} shiro|elios`) 1428 | data.reply(mess.wait) 1429 | p = data.body 1430 | text = p.split('|') 1431 | res = await axios.get(`${configs.apiUrl}/api/primbonjodoh?apikey=${configs.zeksKey}&nama1=${text[0]}&nama2=${text[1]}`) 1432 | if(res.data.status == false) data.reply(res.data.message) 1433 | p = res.data.result 1434 | tek = `*Nama kamu* : ${p.nama1}\n*Nama dia* : ${p.nama2}\n\n*Hasil positif* : ${p.positif}\n*Hasil negatif* : ${p.negatif}` 1435 | Client.sendFileFromUrl(from, p.thumb, 'p.jpg', tek, message) 1436 | break 1437 | case 'artinama': 1438 | if(isLimit(data.sender)) return data.reply(mess.limit) 1439 | if(data.body == "") return data.reply(`Kirim perintah *${data.prefix}artinama [ nama ]*\nContoh : ${data.prefix}artinama elios`) 1440 | data.reply(mess.wait) 1441 | res = await axios.get(`${configs.apiUrl}/api/artinama?apikey=${configs.zeksKey}&nama=${data.body}`) 1442 | if(res.data.status == false) data.reply(res.data.message) 1443 | data.reply(res.data.result) 1444 | break 1445 | case 'artimimpi': 1446 | if(isLimit(data.sender)) return data.reply(mess.limit) 1447 | if(data.body == "") return data.reply(`Kirim perintah *${data.prefix}artimimpi[ mimpi ]*\nContoh : ${data.prefix}artimimpi ular`) 1448 | data.reply(mess.wait) 1449 | res = await axios.get(`${configs.apiUrl}/api/artimimpi?apikey=${configs.zeksKey}&q=${data.body}`) 1450 | if(res.data.status == false) data.reply(res.data.message) 1451 | data.reply(res.data.result.string) 1452 | break 1453 | /*OTHER*/ 1454 | case 'jsholat': 1455 | case 'jadwalsholat': 1456 | case 'jadwalshalat': 1457 | if(isLimit(data.sender)) return data.reply(mess.limit) 1458 | if(data.body == "") return data.reply(`Kirim perintah *${data.prefix}${data.command} [ teks ]*\nContoh : ${data.prefix}${data.command} jakarta`) 1459 | data.reply(mess.wait) 1460 | res = await axios.get(`${configs.apiUrl}/api/jadwalsholat?apikey=${configs.zeksKey}&daerah=${data.body}`) 1461 | data.reply(res.data.data.string) 1462 | break 1463 | case 'jadwaltv': 1464 | if(isLimit(data.sender)) return data.reply(mess.limit) 1465 | if(data.body == "") return data.reply(`Kirim perintah *${data.prefix}${data.command} [ teks ]*\nContoh : ${data.prefix}${data.command} antv`) 1466 | data.reply(mess.wait) 1467 | res = await axios.get(`${configs.apiUrl}/api/jadwaltv?apikey=${configs.zeksKey}&channel=${data.body}`) 1468 | data.reply(res.data.result) 1469 | break 1470 | case 'tts': 1471 | if(isLimit(data.sender)) return data.reply(mess.limit) 1472 | if(data.body == "") return data.reply(`Kirim perintah *${data.prefix}${data.command} [ code|teks ]*\nContoh : ${data.prefix}${data.command} id|hello world`) 1473 | p = data.body 1474 | text = p.split('|') 1475 | Client.sendFileFromUrl(from, `${configs.apiUrl}/api/tts?apikey=${configs.zeksKey}&code=${text[0]}&text=${text[1]}`, 'p.mp3', '', message, {ptt: true}).catch(er => data.reply(listCode)) 1476 | break 1477 | /*GROUP*/ 1478 | case 'hidetag': 1479 | case 'everyone': 1480 | if(!isAdmin) return data.reply('only be used by admin!') 1481 | var mention = [] 1482 | data.groupMetadata.participants.forEach((member, i) => { 1483 | mention.push(member.jid) 1484 | }) 1485 | data.reply(`${data.body}`, { 1486 | contextInfo: { 1487 | "mentionedJid": mention 1488 | } 1489 | }) 1490 | break 1491 | case 'linkgroup': 1492 | if(!data.isGroup) return data.reply(mess.group) 1493 | if(!data.botIsAdmin) return data.reply(mess.botAdmin) 1494 | linkgc = await client.groupInviteCode(data.from) 1495 | data.reply(`https://chat.whatsapp.com/${linkgc}`) 1496 | break 1497 | /*DLL*/ 1498 | case 'stickermenu': 1499 | Client.sendRawWebpAsSticker(from, fs.readFileSync('./lib/temp/menus.webp'), message).then(resData => Client.sendText(from, 'gunakan sticker ini untuk menampilkan menu!', { 1500 | quoted: resData 1501 | })) 1502 | Client.sendRawWebpAsSticker(from, fs.readFileSync('./lib/temp/sticks.webp'), message).then(resData => Client.sendText(from, 'gunakan sticker ini untuk membuat sticker dengan cara reply image/video dengan sticker ini', { 1503 | quoted: resData 1504 | })) 1505 | Client.sendRawWebpAsSticker(from, fs.readFileSync('./lib/temp/open.webp'), message).then(resData => Client.sendText(from, 'gunakan sticker ini untuk membuka group', { 1506 | quoted: resData 1507 | })) 1508 | Client.sendRawWebpAsSticker(from, fs.readFileSync('./lib/temp/close.webp'), message).then(resData => Client.sendText(from, 'gunakan sticker ini untuk menutup group', { 1509 | quoted: resData 1510 | })) 1511 | break 1512 | case 'tes': 1513 | data.reply('auto upt') 1514 | break 1515 | case 'return': 1516 | case 'eval': 1517 | if(!data.isOwner) return data.reply(mess.ownerOnly) 1518 | try { 1519 | data.reply(JSON.stringify(eval(body), null, 3)) 1520 | } catch (ers) { 1521 | data.reply(ers.toString()) 1522 | } 1523 | break 1524 | case 'term': 1525 | if(!data.isOwner) return data.reply(mess.ownerOnly) 1526 | exec(data.body, (err, stdout) => { 1527 | if (err) return data.reply(err.toString()) 1528 | if (stdout) return data.reply(stdout) 1529 | }) 1530 | break 1531 | case 'getquoted': 1532 | data.reply(JSON.stringify(message.message.extendedTextMessage.contextInfo, null, 3)) 1533 | break 1534 | case 'toimg': 1535 | case 'togif': 1536 | case 'tomedia': 1537 | case 'toimage': 1538 | if(!isQuotedSticker) return data.reply('reply sticker!') 1539 | const mtdt = await data.downloadMediaQuotedMessage() 1540 | if(message.message.extendedTextMessage.contextInfo.quotedMessage.stickerMessage.isAnimated) { 1541 | axios(`https://serv-api.zeks.xyz/sticker/togif`, { method: "post", headers: { "content-type": 'application/json' }, data: {base64: mtdt.toString('base64')}}).then(bf => { 1542 | Client.sendFileFromBase64(from, bf.data.result, 'to.gif', 'nih', message) 1543 | }) 1544 | } else { 1545 | axios(`https://api.zeks.me/sticker/png`, { method: "post", headers: { "content-type": 'application/json' }, data: { base64: mtdt.toString('base64')}}).then(bf => { 1546 | Client.sendFileFromBase64(from, bf.data.result, 'to.png', 'nih', message) 1547 | }) 1548 | } 1549 | break 1550 | } 1551 | }) 1552 | //Handler Sticker Command 1553 | Client.handlerStick.on("*", async (datas) => { 1554 | const { 1555 | idStick, 1556 | message, 1557 | from, 1558 | sender, 1559 | isOwner, 1560 | isQuotedVideo, 1561 | isQuotedImage, 1562 | isQuotedSticker, 1563 | isQuotedAudio, 1564 | groupMetadata, 1565 | isAdmin, 1566 | botIsAdmin, 1567 | pushname, 1568 | t 1569 | } = datas 1570 | //console.log(`ID STICKER: ${idStick}`) //digunakan untuk mendapatkan id sticker 1571 | /* Cara bikin stickercmd 1572 | -ambil id sticker lewat console.log 1573 | -id sticker nya dibuat case 1574 | -case 'idnya': contoh ada dibawah 1575 | */ 1576 | switch(idStick) { 1577 | case '2.453746655066493e+123': 1578 | datas.reply(menu(configs.prefix == 'multi' ? '/' : configs.prefix)) 1579 | break 1580 | case '1.415045466145215e+123': 1581 | if(datas.isQuotedImage || datas.isQuotedVideo) { 1582 | const getBuffs = await client.downloadMediaMessage(JSON.parse(JSON.stringify(datas.message.message.stickerMessage.contextInfo).replace('quotedMessage', 'message'))) 1583 | if(isQuotedVideo) Client.sendMp4AsSticker(from, getBuffs.toString('base64'), message, { pack: `${configs.pack}`, author: `${configs.author}` }) 1584 | else Client.sendImageAsSticker(from, getBuffs.toString('base64'), message, { pack: `${configs.pack}`, author: `${configs.author}` }) 1585 | } 1586 | break 1587 | case '1.4129505721465047e+123': 1588 | if(!datas.isGroup) return datas.reply(mess.group) 1589 | if(!datas.isAdmin) return datas.reply(mess.admin) 1590 | if(!datas.botIsAdmin) return datas.reply(mess.botAdmin) 1591 | client.groupSettingChange(from, GroupSettingChange.messageSend, false) 1592 | datas.reply(`Group telah dibuka oleh admin @${datas.sender.split('@')[0]}`) 1593 | break 1594 | case '1.3049292658533466e+123': 1595 | if(!datas.isGroup) return datas.reply(mess.group) 1596 | if(!datas.isAdmin) return datas.reply(mess.admin) 1597 | if(!datas.botIsAdmin) return datas.reply(mess.botAdmin) 1598 | client.groupSettingChange(from, GroupSettingChange.messageSend, true) 1599 | datas.reply(`Group telah ditutup oleh admin @${datas.sender.split('@')[0]}`) 1600 | break 1601 | } 1602 | }) 1603 | } catch (e) { 1604 | console.log(e) 1605 | } 1606 | } 1607 | 1608 | function isLimit(sender, count) { 1609 | const dataUser = JSON.parse(fs.readFileSync('./lib/json/dataUser.json')) 1610 | if(dataUser[sender].premium) return false 1611 | if(dataUser[sender].limit >= configs.maxLimit) return true 1612 | dataUser[sender].limit += count || 1 1613 | fs.writeFileSync('./lib/json/dataUser.json', JSON.stringify(dataUser)) 1614 | return false 1615 | } 1616 | function sleep(ms) { 1617 | return new Promise(resolve => setTimeout(resolve, ms)); 1618 | } 1619 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | const { 2 | WAConnection, 3 | MessageType, 4 | Presence, 5 | MessageOptions, 6 | Mimetype, 7 | WALocationMessage, 8 | WA_MESSAGE_STUB_TYPES, 9 | messageStubType, 10 | ReconnectMode, 11 | ProxyAgent, 12 | waChatKey, 13 | WAMessageProto, 14 | prepareMessageFromContent, 15 | relayWAMessage, 16 | } = require("@adiwajshing/baileys"); 17 | const fs = require('fs'); 18 | const moment = require('moment-timezone'); 19 | const afkJs = require('./lib/afk') 20 | const yargs = require('yargs/yargs') 21 | const vn = JSON.parse(fs.readFileSync('./lib/json/vn.json')) 22 | const ClientJs = require('./lib/client'); 23 | const cron = require('node-cron'); 24 | global.configs = JSON.parse(fs.readFileSync('./config.json')); 25 | let dataUser = JSON.parse(fs.readFileSync('./lib/json/dataUser.json')) 26 | global.vn = JSON.parse(fs.readFileSync('./lib/json/vn.json')) 27 | global.tebakgambar = {} 28 | moment.tz.setDefault('Asia/Jakarta').locale('id'); 29 | const { color } = require('./lib/func') 30 | const Crypto = require('crypto') 31 | 32 | const starts = async (sesName) => { 33 | try { 34 | const Client = new ClientJs(global.configs, sesName || global.configs.defaultSessionName) 35 | const client = Client.mainClient 36 | require("./lib/http-server")(client) 37 | Client.starts() 38 | detectChange('./handler.js', (mdl) =>{ 39 | try{ 40 | Client.cmd.removeAllListeners() 41 | Client.handlerStick.removeAllListeners() 42 | require('./handler')(client, Client) 43 | console.log(color('[ INFO ]', 'cyan'), `${mdl} auto updated!`) 44 | } catch (err) { 45 | console.error(err) 46 | } 47 | }) 48 | require('./handler')(client, Client) 49 | 50 | client.on('CB:Presence', asd => { 51 | asd = asd[1] 52 | if (!asd.id.endsWith('@g.us')) return 53 | if((asd.type == 'composing' || asd.type == 'recording') && afkJs.detectingAfk(asd.id, asd.participant)) { 54 | Client.sendText(asd.id, `@${asd.participant.split('@')[0]} terdeteksi melakukan aktivitas!, status afkMu telah dihapus`) 55 | } 56 | }) 57 | client.on('CB:Call', json => { 58 | client.query({json: ["action","call",["call",{"from":client.user.jid,"to":json[1].from,"id":generateMessageID()},[["reject",{"call-id":json[1].id,"call-creator":json[1].from,"count":"0"},null]]]]}).then(() =>{ 59 | setTimeout(async () =>{ 60 | if (Client.blocklist.includes(json[1].from)) return 61 | client.blockUser(json[1].from, 'add') 62 | }, 3000) 63 | }).catch() 64 | }) 65 | client.on('new-msg', (message) => { 66 | if(message.key && message.key.remoteJid == 'status@broadcast') return 67 | if(message.key.fromMe && !Client.self || !message.key.fromMe && Client.self) return 68 | let dataGc = JSON.parse(fs.readFileSync('./lib/json/dataGc.json')) 69 | const body = message.body 70 | const from = message.key.remoteJid 71 | const isGroup = from.endsWith('@g.us') 72 | const sender = isGroup ? message.participant : from 73 | if (global.tebakgambar[from] && global.tebakgambar[from].id && global.tebakgambar[from].jawaban.toLowerCase() == body.toLowerCase()) Client.reply(from, `YES TEBAK GAMBAR BERHASIL DIJAWAB OLEH @${sender.split("@")[0]}`, message).then(() => global.tebakgambar[from] = {}) 74 | if (global.vn.includes(body)) Client.sendPtt(from, `./lib/vn/${body}.mp3`, message) 75 | if (isGroup && !dataGc[from]){ 76 | dataGc[from] = {afk:{}} 77 | fs.writeFileSync('./lib/json/dataGc.json', JSON.stringify(dataGc, null, 2)) 78 | } 79 | if (isGroup && dataGc[from].antitagall && !message.isAdmin && (message.mentionedJidList.length == message.groupMembers.length || message.mentionedJidList.length-1 == message.groupMembers.length)){ 80 | Client.reply(from, 'Tagall detected', message) 81 | client.groupRemove(from, [sender]).catch(() => Client.reply(from, `Jadikan bot admin agar bisa menggunakan fitur antitagall`, message)) 82 | } 83 | if (isGroup && dataGc[from].antiviewonce && message.type == 'viewOnceMessage'){ 84 | var msg = {...message} 85 | msg.message = message.message.viewOnceMessage.message 86 | msg.message[Object.keys(msg.message)[0]].viewOnce = false 87 | Client.reply(from, 'ViewOnce detected!', message) 88 | client.forwardMessage(from, msg) 89 | } 90 | if (isGroup && !message.isAdmin && dataGc[from].antilink && /chat\.whatsapp\.com/gi.test(body)){ 91 | let dtclink = body.match(/chat.whatsapp.com\/(?:invite\/)?([0-9A-Za-z]{18,26})/gi) || [] 92 | dtclink.forEach(async l => { 93 | checks = await Client.checkInviteLink(l) 94 | if(checks.status == 200){ 95 | Client.reply(from, `Group link detected!`, message) 96 | client.groupRemove(from, [sender]).catch(() => Client.reply(from, `Jadikan bot admin agar bisa menggunakan fitur antilink`, message)) 97 | } 98 | }) 99 | } 100 | if (!dataUser[sender]){ 101 | dataUser[sender] = {limit: 0, premium: false} 102 | fs.writeFileSync('./lib/json/dataUser.json', JSON.stringify(dataUser)) 103 | } 104 | if(isGroup) { 105 | if(afkJs.detectingAfk(from, sender)) Client.sendText(from, `@${sender.split('@')[0]} sekarang tidak afk!`) 106 | if(message.message.extendedTextMessage && message.message.extendedTextMessage.contextInfo && message.message.extendedTextMessage.contextInfo.mentionedJid) { 107 | jids = message.message.extendedTextMessage.contextInfo.mentionedJid 108 | jids.forEach(jid => { 109 | takeData = afkJs.tagDetect(from, jid) 110 | if(!takeData) return 111 | duration = moment.duration(moment(takeData.time).diff(moment())) 112 | Client.reply(from, `@${jid.split('@')[0]} sedang afk\nReason: ${takeData.reason}\nTime: ${duration.days()} Hari ${duration.hours()} Jam ${duration.minutes()} Menit ${duration.seconds()} detik`) 113 | }) 114 | } 115 | } 116 | }) 117 | client.on('group-participants-update', (jdgn) => require('./lib/greet.js')(jdgn, Client, client)) 118 | } catch (e) { 119 | console.error(e) 120 | } 121 | } 122 | 123 | cron.schedule('0 0 * * *', () => { 124 | for (users in dataUser){ 125 | dataUser[users].limit = 0 126 | } 127 | fs.writeFileSync('./lib/json/dataUser.json', JSON.stringify(dataUser)) 128 | console.log(color('[ INFO ]', 'cyan'), 'LIMIT RESETED!') 129 | }); 130 | detectChange('./lib/text.js', (mdl) => console.log(color('[ INFO ]', 'cyan'), `${mdl} change is detected!`)) 131 | detectChange('./lib/greet.js', (mdl) => console.log(color('[ INFO ]', 'cyan'), `${mdl} change is detected!`)) 132 | function detectChange(module, cb){ 133 | fs.watchFile(require.resolve(module), () => { 134 | delete require.cache[require.resolve(module)] 135 | if (cb) cb(module) 136 | }) 137 | } 138 | const randomBytes = (length) => { 139 | return Crypto.randomBytes(length) 140 | } 141 | global.generateMessageID = () => { 142 | return '3EB0' + randomBytes(7).toString('hex').toUpperCase() 143 | } 144 | global.optn = yargs(process.argv.slice(2)).exitProcess(false).parse() 145 | starts(process.argv[2]) 146 | -------------------------------------------------------------------------------- /lib/P: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /lib/afk.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const dataGc = JSON.parse(fs.readFileSync('./lib/json/dataGc.json')); 3 | 4 | 5 | const detectingAfk = (gc, sender) => { 6 | if (!dataGc[gc]) dataGc[gc] = {afk: {}} 7 | sender = sender.endsWith('@c.us') ? sender.replace('@c.us', '@s.whatsapp.net') : sender 8 | if (dataGc[gc].afk && dataGc[gc].afk[sender]){ 9 | delete dataGc[gc].afk[sender] 10 | fs.writeFileSync('./lib/json/dataGc.json', JSON.stringify(dataGc, null, 2)) 11 | return true 12 | } 13 | return null 14 | } 15 | 16 | const addAfk = (gc, sender, reason, time) =>{ 17 | dataGc[gc].afk[sender] = {reason,time} 18 | fs.writeFileSync('./lib/json/dataGc.json', JSON.stringify(dataGc, null, 2)) 19 | return 20 | } 21 | 22 | const tagDetect = (gc, sender) =>{ 23 | return dataGc[gc].afk && dataGc[gc].afk[sender] ? dataGc[gc].afk[sender] : null 24 | } 25 | 26 | module.exports = { 27 | detectingAfk, 28 | addAfk, 29 | tagDetect 30 | } -------------------------------------------------------------------------------- /lib/func.js: -------------------------------------------------------------------------------- 1 | const chalk = require('chalk') 2 | const axios = require('axios') 3 | let FormData = require('form-data') 4 | 5 | 6 | module.exports.filterGroupAdmin = (participants) => { 7 | listadmin = new Array(); 8 | participants.forEach(a =>{ 9 | a.isAdmin ? listadmin.push(a.jid) : '' 10 | }) 11 | return listadmin 12 | } 13 | module.exports.urlshortner = async (url) => { 14 | const getdt = await axios.get(`https://tinyurl.com/api-create.php?url=${url}&alias=bots-${this.randomString(7)}`) 15 | return getdt.data 16 | } 17 | module.exports.randomString = (length) => { 18 | var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyzsadw' 19 | let str = ''; 20 | lengt = length || 9 21 | for (var i = 0; i < length; i++) { 22 | str += chars[Math.floor(Math.random() * 65)]; 23 | } 24 | return str 25 | } 26 | module.exports.getBuffer = async (url, opts) => { 27 | try { 28 | const reqdata = await axios({ 29 | method: "get", 30 | url, 31 | headers: { 32 | 'DNT': 1, 33 | 'Upgrade-Insecure-Requests': 1, 34 | 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36' 35 | }, 36 | ...opts, 37 | responseType: 'arraybuffer' 38 | }); 39 | return reqdata.data 40 | } catch (e) { 41 | throw e 42 | } 43 | } 44 | module.exports.color = (text, color) => { 45 | return chalk.keyword(color || 'green')(text) 46 | } 47 | module.exports.convertMp3 = (buffer, resBuffer) => new Promise(async (resolve, reject) =>{ 48 | let dataForm = new FormData() 49 | dataForm.append("class", 'audio') 50 | dataForm.append("from", 'mp4') 51 | dataForm.append("to", 'mp3') 52 | dataForm.append("source", 'file') 53 | dataForm.append("file", buffer, 'file.mp4') 54 | const gethost = await axios.get('https://www.onlineconverter.com/get/host',{ 55 | headers: { 56 | 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36', 57 | origin: 'https://www.onlineconverter.com', 58 | referer: 'https://www.onlineconverter.com/', 59 | } 60 | }) 61 | axios(gethost.data,{ 62 | method: 'POST', 63 | headers: { 64 | 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36', 65 | "Content-Type": 'multipart/form-data', 66 | origin: 'https://www.onlineconverter.com', 67 | referer: 'https://www.onlineconverter.com/', 68 | ...dataForm.getHeaders() 69 | }, 70 | data: dataForm.getBuffer() 71 | }).then(async ({data}) =>{ 72 | const fileId = data.split('\u0000\u0000\u0000')[0].split('convert/')[1] 73 | await sleep(5000) 74 | const dlLink = gethost.data.split('send')[0]+fileId+'/download' 75 | if (resBuffer){ 76 | axios.get(dlLink,{ 77 | responseType: 'arraybuffer', 78 | headers: { 79 | 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36' 80 | } 81 | }).then(({data}) =>resolve(data)).catch(reject) 82 | } else resolve(dlLink) 83 | }).catch(reject) 84 | }) 85 | 86 | module.exports.parseMs = (milliseconds) => { 87 | if (typeof milliseconds !== 'number') throw new TypeError('Parameter must be filled with number'); 88 | return { 89 | days: Math.trunc(milliseconds / 86400000), 90 | hours: Math.trunc(milliseconds / 3600000) % 24, 91 | minutes: Math.trunc(milliseconds / 60000) % 60, 92 | seconds: Math.trunc(milliseconds / 1000) % 60, 93 | milliseconds: Math.trunc(milliseconds) % 1000, 94 | microseconds: Math.trunc(milliseconds * 1000) % 1000, 95 | nanoseconds: Math.trunc(milliseconds * 1e6) % 1000 96 | }; 97 | } 98 | const converters = { 99 | days: value => value * 864e5, 100 | hours: value => value * 36e5, 101 | minutes: value => value * 6e4, 102 | seconds: value => value * 1e3, 103 | milliseconds: value => value, 104 | microseconds: value => value / 1e3, 105 | nanoseconds: value => value / 1e6 106 | }; 107 | module.exports.toMs = (objs) => { 108 | if (typeof objs !== 'object') throw new TypeError('parameter must be filled with object') 109 | let totalMilliseconds = 0; 110 | for (var [key, value] of Object.entries(objs)) { 111 | if (typeof value !== 'number') throw new TypeError(`Expected a \`number\` for key \`${key}\`, got \`${value}\` (${typeof value})`); 112 | const converter = converters[key]; 113 | if (!converter) throw new Error(`Unsupported time key: ${key}`); 114 | totalMilliseconds += converter(value); 115 | } 116 | return totalMilliseconds; 117 | }; 118 | function sleep(ms) { 119 | return new Promise(resolve => setTimeout(resolve, ms)); 120 | } -------------------------------------------------------------------------------- /lib/greet.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs') 2 | module.exports = async (jdgn, Client, client) =>{ 3 | try { 4 | const dataGc = JSON.parse(fs.readFileSync('./lib/json/dataGc.json')) 5 | from = jdgn.jid 6 | if (!dataGc[from] || !dataGc[from].welcome && !dataGc[from].leave) return 7 | const mdata = await client.groupMetadata(from) 8 | jdgn.participants.forEach(async num =>{ 9 | if (num == client.user.jid) return 10 | if (jdgn.action == 'add') { 11 | stst = await client.getStatus(`${num.split('@')[0]}@c.us`) 12 | stst = stst.status == 401 ? '' : stst.status 13 | ppimg = await client.getProfilePicture(`${num.split('@')[0]}@c.us`).catch(() => ppimg = 'https://cdn.pixabay.com/photo/2015/10/05/22/37/blank-profile-picture-973460_1280.png') 14 | teks = `*[ NEW MEMBER IN GROUP ${mdata.subject} ]*\n\n*――――――――――――――*\n⤔ *Name*: @${num.split('@')[0]}\n⤔ *Bio*: ${stst}\n*――――――――――――――*\n\nWelcome 🎊🎊🎉!` 15 | let pushname = client.contacts[num].vname || client.contacts[num].notify || num.split('@')[0] 16 | Client.sendFileFromUrl(jdgn.jid, ppimg, 'user.jpg', teks, null, {contextInfo: {"mentionedJid": Client.getMentionedJidList(teks), "stanzaId":"xxxx","participant":"0@s.whatsapp.net","quotedMessage":{"groupInviteMessage":{"groupJid":from,"inviteCode":"OKOKLAH","inviteExpiration":9999,"groupName":from,"caption":`Participant Added/Join ${pushname}`}},"remoteJid":num}}) 17 | } else if (jdgn.action == 'remove') { 18 | stst = await client.getStatus(`${num.split('@')[0]}@c.us`) 19 | stst = stst.status == 401 ? '' : stst.status 20 | var ppimg; 21 | ppimg = await client.getProfilePicture(`${num.split('@')[0]}@c.us`).catch(() => ppimg = 'https://cdn.pixabay.com/photo/2015/10/05/22/37/blank-profile-picture-973460_1280.png') 22 | teks = `*[ MEMBER LEAVE/REMOVED IN GROUP ${mdata.subject} ]*\n\n*――――――――――――――*\n⤔ *Name*: @${num.split('@')[0]}\n⤔ *Bio*: ${stst}\n*――――――――――――――*\n\nbye :(` 23 | let pushname = client.contacts[num].vname || client.contacts[num].notify || num.split('@')[0] 24 | Client.sendFileFromUrl(jdgn.jid, ppimg, 'user.jpg', teks, null, {contextInfo: {"mentionedJid": Client.getMentionedJidList(teks), "stanzaId":"xxxx","participant":"0@s.whatsapp.net","quotedMessage":{"groupInviteMessage":{"groupJid":from,"inviteCode":"OKOKLAH","inviteExpiration":9999,"groupName":from,"caption":`Participant Removed/Leave ${pushname}`}},"remoteJid":num}}) 25 | } 26 | }) 27 | } catch (e) { 28 | console.log(e) 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lib/http-server.js: -------------------------------------------------------------------------------- 1 | const express = require('express') 2 | const fs = require("fs") 3 | const qrcode = require('qrcode') 4 | const app = express(); 5 | const server = require('http').createServer(app); 6 | const io = require('socket.io')(server); 7 | const PORT = optn.port || process.env.PORT || 5000; 8 | 9 | module.exports = (client) => { 10 | try{ 11 | let lastqr = false 12 | client.on("qr", qr =>{ 13 | qrcode.toDataURL(qr, function (err, url) { 14 | lastqr = url 15 | io.emit('qr', lastqr) 16 | }) 17 | }) 18 | client.on("open", () =>{ 19 | io.emit('con', {jid: client.user.jid}) 20 | lastqr = false 21 | }) 22 | client.on("close", () => io.emit('close', "IDLE")) 23 | io.on('connection', () => io.emit('config', global.configs)) 24 | io.on('connection', (socket) => lastqr ? io.emit('qr', lastqr) : io.emit('con', {jid: client.user ? client.user.jid : false})); 25 | app.use(express.static('public')) 26 | app.get("/configs", (req, res)=>{ 27 | if (req.query.submit) { 28 | delete req.query.submit 29 | for (s in req.query){ 30 | if (s == "ownerList") global.configs[s] = req.query[s].split("\r\n") 31 | else if (s == "maxLimit") global.configs[s] = Number(req.query[s]) 32 | else global.configs[s] = req.query[s] 33 | } 34 | if (!req.query["autoRead"]) global.configs["autoRead"] = false 35 | if (req.query["autoRead"]) global.configs["autoRead"] = true 36 | fs.writeFileSync("./config.json", JSON.stringify(global.configs, null, 3)) 37 | } 38 | res.sendFile("public/configs.html", {root: "./"}) 39 | }) 40 | server.listen(PORT, () => { 41 | console.log(`Server Running on Port ${PORT}`) 42 | }); 43 | } catch { 44 | 45 | } 46 | } -------------------------------------------------------------------------------- /lib/json/P: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /lib/json/dataGc.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /lib/json/dataUser.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /lib/json/vn.json: -------------------------------------------------------------------------------- 1 | [ 2 | "Wkwk" 3 | ] -------------------------------------------------------------------------------- /lib/log.js: -------------------------------------------------------------------------------- 1 | const {color} = require('./func') 2 | const moment = require('moment-timezone') 3 | moment.tz.setDefault('Asia/Jakarta').locale('id') 4 | module.exports = logs = async (message, body, prefix, client) =>{ 5 | // if (message.key.fromMe) return 6 | const from = message.key.remoteJid 7 | const isCmd = body.startsWith(prefix) 8 | const command = body.slice(prefix.length).trim().split(/ +/).shift().toLowerCase() 9 | const isGroup = from.endsWith('@g.us') 10 | const groupMetadata = isGroup ? await client.groupMetadata(from) : '' 11 | const groupName = isGroup ? groupMetadata.subject : '' 12 | const sender = isGroup ? message.participant : message.key.remoteJid 13 | const t = message.messageTimestamp.low 14 | let authorname = message.key.fromMe ? 'ME/SELF' : client.contacts[sender] ? client.contacts[sender].vname || client.contacts[sender].notify || sender.split('@')[0] || undefined : sender.split('@')[0] 15 | 16 | if (isGroup){ 17 | if (isCmd) console.log(color('[ CMD ]', 'yellow'), color(moment(t * 1000).format('DD/MM/YY HH:mm:ss'), 'green'), command,color('from', 'yellow'), authorname, color('in'), groupName) 18 | if (!isCmd) console.log(color('[ MSG ]', 'purple'), color(moment(t * 1000).format('DD/MM/YY HH:mm:ss'), 'green'), color('from', 'yellow'), authorname, color('in'), groupName) 19 | } 20 | if (!isGroup){ 21 | if (isCmd) console.log(color('[ CMD ]', 'yellow'), color(moment(t * 1000).format('DD/MM/YY HH:mm:ss'), 'green'), command,color('from', 'yellow'), authorname) 22 | if (!isCmd) console.log(color('[ MSG ]', 'purple'),color(moment(t * 1000).format('DD/MM/YY HH:mm:ss'), 'green') ,color('from', 'yellow'), authorname) 23 | } 24 | } -------------------------------------------------------------------------------- /lib/temp/P: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /lib/temp/close.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelgaIlham/SC-BOT-WAA/58619dcae4fa9abd17a4a0c0efb6ed7bae27be35/lib/temp/close.webp -------------------------------------------------------------------------------- /lib/temp/doge.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelgaIlham/SC-BOT-WAA/58619dcae4fa9abd17a4a0c0efb6ed7bae27be35/lib/temp/doge.jpg -------------------------------------------------------------------------------- /lib/temp/domge.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelgaIlham/SC-BOT-WAA/58619dcae4fa9abd17a4a0c0efb6ed7bae27be35/lib/temp/domge.jpg -------------------------------------------------------------------------------- /lib/temp/menus.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelgaIlham/SC-BOT-WAA/58619dcae4fa9abd17a4a0c0efb6ed7bae27be35/lib/temp/menus.webp -------------------------------------------------------------------------------- /lib/temp/open.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelgaIlham/SC-BOT-WAA/58619dcae4fa9abd17a4a0c0efb6ed7bae27be35/lib/temp/open.webp -------------------------------------------------------------------------------- /lib/temp/sticks.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelgaIlham/SC-BOT-WAA/58619dcae4fa9abd17a4a0c0efb6ed7bae27be35/lib/temp/sticks.webp -------------------------------------------------------------------------------- /lib/text.js: -------------------------------------------------------------------------------- 1 | const moment = require('moment-timezone'); 2 | const menu = (prefix, pushname) => { 3 | var tim = new Date().getHours(), salam = tim > 2 && tim < 4 ? "Daybreak" : tim < 11 ? "Morning" : tim < 16 ? "Afternoon" : tim < 19 ? "Evening" : "Night" 4 | let p = 0 5 | return ` *WHATSAPP-BOT* 6 | 7 | Good ${salam} ${pushname}, Have a nice day :) 8 | 9 | *📚 Total commands : 137* 10 | *🪀 Owner* : @${configs.ownerList[0].split('@')[0]} 11 | *🖊️ Prefix* : Multi 12 | *⏰ Time* : ${moment().utcOffset('1000').format('YYYY-MM-DD HH:mm:ss')} WIB 13 | *💌 Rest API's* : https://zeks.me 14 | 15 | *GROUP ONLY* 16 | *${p+=1}.* ${prefix}group _open|close_ 17 | *${p+=1}.* ${prefix}antilink _on|off_ 18 | *${p+=1}.* ${prefix}antitagall _on|off_ 19 | *${p+=1}.* ${prefix}antiviewonce _on|off_ 20 | *${p+=1}.* ${prefix}welcome _on|off_ 21 | *${p+=1}.* ${prefix}leave _on|off_ 22 | *${p+=1}.* ${prefix}setgroupicon _replyImage_ 23 | *${p+=1}.* ${prefix}setgroupname _text_ 24 | *${p+=1}.* ${prefix}setgroupdesc _text_ 25 | *${p+=1}.* ${prefix}hidetag _text_ 26 | *${p+=1}.* ${prefix}promote _@tag_ 27 | *${p+=1}.* ${prefix}demote _@tag_ 28 | *${p+=1}.* ${prefix}kick _@tag_ 29 | *${p+=1}.* ${prefix}add _number_ 30 | *${p+=1}.* ${prefix}getpp _@tag_ 31 | *${p+=1}.* ${prefix}tagall 32 | *${p+=1}.* ${prefix}linkgroup 33 | *${p+=1}.* ${prefix}revoke 34 | *${p+=1}.* ${prefix}leave 35 | 36 | *DOWNLOADER* 37 | *${p+=1}.* ${prefix}play _query_ 38 | *${p+=1}.* ${prefix}playvid _query_ 39 | *${p+=1}.* ${prefix}youtubedl _query_ 40 | *${p+=1}.* ${prefix}ytmp3 _link_ 41 | *${p+=1}.* ${prefix}ytmp4 _link_ 42 | *${p+=1}.* ${prefix}igstory _username_ 43 | *${p+=1}.* ${prefix}ig _link_ 44 | *${p+=1}.* ${prefix}joox _song_ 45 | 46 | *STICKER* 47 | *${p+=1}.* ${prefix}stickerwm _pack|author_ 48 | *${p+=1}.* ${prefix}takestick _pack|author_ 49 | *${p+=1}.* ${prefix}toimg _replySticker_ 50 | *${p+=1}.* ${prefix}togif _replySticker_ 51 | *${p+=1}.* ${prefix}semoji _emoji_ 52 | *${p+=1}.* ${prefix}stickerfire 53 | *${p+=1}.* ${prefix}stickernobg 54 | *${p+=1}.* ${prefix}stickergif 55 | *${p+=1}.* ${prefix}sticker 56 | 57 | *ANIME* 58 | *${p+=1}.* ${prefix}anime _query_ 59 | *${p+=1}.* ${prefix}manga _query_ 60 | *${p+=1}.* ${prefix}chara _query_ 61 | *${p+=1}.* ${prefix}waifu 62 | 63 | *EDUCATION* 64 | *${p+=1}.* ${prefix}nulis _text_ 65 | *${p+=1}.* ${prefix}brainly _query_ 66 | *${p+=1}.* ${prefix}kbbi _query_ 67 | *${p+=1}.* ${prefix}wiki _query_ 68 | 69 | *SEARCHING* 70 | *${p+=1}.* ${prefix}playstore _apk_ 71 | *${p+=1}.* ${prefix}happymod _apk_ 72 | *${p+=1}.* ${prefix}iguser _username_ 73 | *${p+=1}.* ${prefix}igstalk _username_ 74 | *${p+=1}.* ${prefix}ytsearch _query_ 75 | *${p+=1}.* ${prefix}ytplaylist _query_ 76 | *${p+=1}.* ${prefix}ytchannel _channel_ 77 | *${p+=1}.* ${prefix}shoope _product_ 78 | *${p+=1}.* ${prefix}spotify _song_ 79 | *${p+=1}.* ${prefix}gsmarena _hp_ 80 | *${p+=1}.* ${prefix}searchmusic _replyAudio_ 81 | *${p+=1}.* ${prefix}wallpaper _query_ 82 | *${p+=1}.* ${prefix}pinterest _query_ 83 | *${p+=1}.* ${prefix}googleimage _query_ 84 | *${p+=1}.* ${prefix}jagokata _kata_ 85 | 86 | *PRIMBON* 87 | *${p+=1}.* ${prefix}jodoh _kamu|dia_ 88 | *${p+=1}.* ${prefix}artinama _nama_ 89 | *${p+=1}.* ${prefix}artimimpi _mimpi_ 90 | 91 | *RANDOM* 92 | *${p+=1}.* ${prefix}fml 93 | *${p+=1}.* ${prefix}randomquran 94 | *${p+=1}.* ${prefix}meme 95 | *${p+=1}.* ${prefix}darkjoke 96 | *${p+=1}.* ${prefix}pantun 97 | *${p+=1}.* ${prefix}nickepep 98 | *${p+=1}.* ${prefix}quotes 99 | *${p+=1}.* ${prefix}estetikpic 100 | 101 | *TEXTMAKER* 102 | *${p+=1}.* ${prefix}wolflogo _text1|text2_ 103 | *${p+=1}.* ${prefix}logoaveng _text1|text2_ 104 | *${p+=1}.* ${prefix}phlogo _text1|text2_ 105 | *${p+=1}.* ${prefix}marvellogo _text1|text2_ 106 | *${p+=1}.* ${prefix}gtext _text1|text2_ 107 | *${p+=1}.* ${prefix}pubglogo _text1|text2_ 108 | *${p+=1}.* ${prefix}snowwrite _text1|text2_ 109 | *${p+=1}.* ${prefix}watercolour _text1|text2_ 110 | *${p+=1}.* ${prefix}harta _text_ 111 | *${p+=1}.* ${prefix}thundertext _text_ 112 | *${p+=1}.* ${prefix}flametext _text_ 113 | *${p+=1}.* ${prefix}glowtext _text_ 114 | *${p+=1}.* ${prefix}smoketext _text_ 115 | *${p+=1}.* ${prefix}lithgtext _text_ 116 | *${p+=1}.* ${prefix}flowertext _text_ 117 | *${p+=1}.* ${prefix}bneon _text_ 118 | *${p+=1}.* ${prefix}matrix _text_ 119 | *${p+=1}.* ${prefix}breakwall _text_ 120 | *${p+=1}.* ${prefix}gneon _text_ 121 | *${p+=1}.* ${prefix}dropwater _text_ 122 | *${p+=1}.* ${prefix}tfire _text_ 123 | *${p+=1}.* ${prefix}sandw _text_ 124 | *${p+=1}.* ${prefix}epep _text_ 125 | *${p+=1}.* ${prefix}gplaybutton _text_ 126 | *${p+=1}.* ${prefix}splaybutton _text_ 127 | *${p+=1}.* ${prefix}text3dbox _text_ 128 | *${p+=1}.* ${prefix}text3d _text_ 129 | *${p+=1}.* ${prefix}logobp _text_ 130 | *${p+=1}.* ${prefix}leavest _text_ 131 | *${p+=1}.* ${prefix}tlight _text_ 132 | *${p+=1}.* ${prefix}naruto _text_ 133 | *${p+=1}.* ${prefix}crosslogo _text_ 134 | *${p+=1}.* ${prefix}cslogo _text_ 135 | *${p+=1}.* ${prefix}crismes _text_ 136 | 137 | *IMAGEMAKER* 138 | *${p+=1}.* ${prefix}missing _text1|text2|text3|@tag_ 139 | *${p+=1}.* ${prefix}calender _replyImage / @tag_ 140 | *${p+=1}.* ${prefix}drawing _replyImage / @tag_ 141 | *${p+=1}.* ${prefix}sketch _replyImage / @tag_ 142 | 143 | *OTHER* 144 | *${p+=1}.* ${prefix}tomp3 _replyVideo_ 145 | *${p+=1}.* ${prefix}removebg _replyImage / @tag_ 146 | *${p+=1}.* ${prefix}tts _code|text_ 147 | *${p+=1}.* ${prefix}qrencode _text_ 148 | *${p+=1}.* ${prefix}barcode _text_ 149 | *${p+=1}.* ${prefix}jadwalsholat _daerah_ 150 | *${p+=1}.* ${prefix}jadwaltv _channel_ 151 | *${p+=1}.* ${prefix}tebakgambar 152 | 153 | *INFO* 154 | *${p+=1}.* ${prefix}stickermenu 155 | *${p+=1}.* ${prefix}owner 156 | *${p+=1}.* ${prefix}limit 157 | *${p+=1}.* ${prefix}info 158 | *${p+=1}.* ${prefix}listvn 159 | 160 | *OWNER* 161 | *${p+=1}.* ${prefix}setpp _replyImage_ 162 | *${p+=1}.* ${prefix}eval _text_ 163 | *${p+=1}.* ${prefix}term _code_ 164 | *${p+=1}.* ${prefix}block _@tag_ 165 | *${p+=1}.* ${prefix}unblock _@tag_ 166 | *${p+=1}.* ${prefix}join _link_ 167 | *${p+=1}.* ${prefix}bc _text_ 168 | *${p+=1}.* ${prefix}addvn _replyAudio/vn_ 169 | *${p+=1}.* ${prefix}delvn _name_ 170 | *${p+=1}.* ${prefix}premium add _@tag_ 171 | *${p+=1}.* ${prefix}premium del _@tag_ 172 | *${p+=1}.* ${prefix}premium list 173 | *${p+=1}.* ${prefix}clearall 174 | *${p+=1}.* ${prefix}resetlimit 175 | *${p+=1}.* ${prefix}self 176 | *${p+=1}.* ${prefix}public 177 | ` 178 | } 179 | 180 | const ingfo = `Bot ini di Sewakan Harga: 181 | 1minggu:5k 182 | 1bulan:10k 183 | permanen:20k 184 | JIKA MINAT KETIK #owner 185 | ` 186 | 187 | const listCode = `Kode bahasa jgviy tidak ada\n Code Bahasa\n sq Albanian\n ar Arabic\n hy Armenian\n ca Catalan\n zh Chinese\n zh-cn Chinese (China)\n zh-tw Chinese (Taiwan)\n zh-yue Chinese (Cantonese)\n hr Croatian\n cs Czech\n da Danish\n nl Dutch\n en English\n en-au English (Australia)\n en-uk English (United Kingdom)\n en-us English (United States)\n eo Esperanto\n fi Finnish\n fr French\n de German\n el Greek\n ht Haitian Creole\n hi Hindi\n hu Hungarian\n is Icelandic\n id Indonesian\n it Italian\n ja Japanese\n ko Korean\n la Latin\n lv Latvian\n mk Macedonian\n no Norwegian\n pl Polish\n pt Portuguese\n pt-br Portuguese (Brazil)\n ro Romanian\n ru Russian\n sr Serbian\n sk Slovak\n es Spanish\n es-es Spanish (Spain)\n es-us Spanish (United States)\n sw Swahili\n sv Swedish\n ta Tamil\n th Thai\n tr Turkish\n vi Vietnamese\n cy Welsh\n ` 188 | 189 | const mess = { 190 | wait: 'Tunggu sebentar yaa', 191 | group: 'this command can only be used in groups!', 192 | admin: 'only be used by admin!', 193 | botAdmin: 'this command can only be used if the bot is an admin groups', 194 | limit: 'Limit penggunaan anda sudah habis, \n\nNote: limit akan direset setiap 00.00', 195 | ownerOnly: 'This command is only for the owner!' 196 | } 197 | 198 | module.exports = { 199 | menu, 200 | ingfo, 201 | listCode, 202 | mess 203 | } 204 | -------------------------------------------------------------------------------- /lib/vn/P: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /lib/vn/Wkwk.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelgaIlham/SC-BOT-WAA/58619dcae4fa9abd17a4a0c0efb6ed7bae27be35/lib/vn/Wkwk.mp3 -------------------------------------------------------------------------------- /lib/vn/p.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelgaIlham/SC-BOT-WAA/58619dcae4fa9abd17a4a0c0efb6ed7bae27be35/lib/vn/p.mp3 -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "whatsapp-bot", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "directories": { 7 | "lib": "lib" 8 | }, 9 | "dependencies": { 10 | "@adiwajshing/baileys": "^3.5.2", 11 | "axios": "^0.21.1", 12 | "child_process": "^1.0.2", 13 | "express": "^4.17.1", 14 | "file-type": "^16.5.0", 15 | "form-data": "^4.0.0", 16 | "mime-types": "^2.1.31", 17 | "moment-timezone": "^0.5.33", 18 | "node-cron": "^3.0.0", 19 | "node-fetch": "^2.6.1", 20 | "qrcode": "^1.4.4", 21 | "socket.io": "^4.1.2", 22 | "spinnies": "^0.5.1", 23 | "yargs": "^17.0.1" 24 | }, 25 | "engines": { 26 | "node": "16.6.1" 27 | }, 28 | "scripts": { 29 | "start": "node ." 30 | }, 31 | "repository": { 32 | "type": "git", 33 | "url": "git+https://github.com/justpiple/whatsapp-bot.git" 34 | }, 35 | "author": "ben", 36 | "license": "ISC", 37 | "bugs": { 38 | "url": "https://github.com/justpiple/whatsapp-bot/issues" 39 | }, 40 | "homepage": "https://github.com/justpiple/whatsapp-bot#readme" 41 | } 42 | -------------------------------------------------------------------------------- /public/P: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /public/configs.html: -------------------------------------------------------------------------------- 1 |