How to use fetchJSON method in Puppeteer

Best JavaScript code snippet using puppeteer

index.js

Source:index.js Github

copy

Full Screen

1/*2* Om mau ngapain om, jangan om...3* Hayo mau ngapainn4* Jangan diganti kecuali yg gua bolehin!!!5* By Fadhil Graphy6* TQTO ada di paling bawah!!!7* cari report sama request ganti nomor lu!!!8*/910const {11 WAConnection,12 MessageType,13 Presence,14 Mimetype,15 GroupSettingChange16} = require('@adiwajshing/baileys')17const { color, bgcolor } = require('./lib/color')18const { help } = require('./src/help')19const { wait, simih, getBuffer, h2k, generateMessageID, getGroupAdmins, getRandom, banner, start, info, success, close } = require('./lib/functions')20const { fetchJson } = require('./lib/fetcher')21const { recognize } = require('./lib/ocr')22const fs = require('fs')23const moment = require('moment-timezone')24const { exec } = require('child_process')25const kagApi = require('@kagchi/kag-api')26const fetch = require('node-fetch')27const tiktod = require('tiktok-scraper')28const ffmpeg = require('fluent-ffmpeg')29const { removeBackgroundFromImageFile } = require('remove.bg')30const imgbb = require('imgbb-uploader')31const welkom = JSON.parse(fs.readFileSync('./src/welkom.json'))32const nsfw = JSON.parse(fs.readFileSync('./src/nsfw.json'))33const adminNumber = JSON.parse(fs.readFileSync('./src/admin.json'))34const anime = JSON.parse(fs.readFileSync('./src/anime.json'))35const samih = JSON.parse(fs.readFileSync('./src/simi.json'))36const vcard = 'BEGIN:VCARD\n' // ANAK ANJING MAU NGAPAIN ASU!?37 + 'VERSION:3.0\n' // SANA BUAT SENDIRI ENAK BENER LU!!!38 + 'DEV\n' // NAMA OWNER BOT39 + 'FN:Creator Robby Pratama W;\n' // KASIH CREDITS GUA FADHIL GRAPHY SU!!!40 + 'TEL;type=CELL;type=VOICE;waid=6285277262021:+62 852-7726-2021\n' // GANTI NOMOR LU41 + 'END:VCARD'42prefix = '/'43prex = ''44blocked = []4546function kyun(seconds){47 function pad(s){48 return (s < 10 ? '0' : '') + s;49 }50 var hours = Math.floor(seconds / (60*60));51 var minutes = Math.floor(seconds % (60*60) / 60);52 var seconds = Math.floor(seconds % 60);5354 //return pad(hours) + ':' + pad(minutes) + ':' + pad(seconds)55 return `${pad(hours)} Jam ${pad(minutes)} Menit ${pad(seconds)} Detik`56}5758async function starts() {59 const client = new WAConnection()60 client.logger.level = 'warn'61 console.log(banner.string)62 client.on('qr', () => {63 console.log(color('[','white'), color('!','red'), color(']','white'), color(' Scan the qr code above'))64 })65 client.on('credentials-updated', () => {66 fs.writeFileSync('./BarBar.json', JSON.stringify(client.base64EncodedAuthInfo(), null, '\t'))67 info('2', 'Login Info Updated')68 })69 fs.existsSync('./BarBar.json') && client.loadAuthInfo('./BarBar.json')70 client.on('connecting', () => {71 start('2', 'Connecting...')72 })73 client.on('open', () => {74 success('2', 'Connected')75 })76 await client.connect({timeoutMs: 30*1000})7778 client.on('group-participants-update', async (anu) => {79 if (!welkom.includes(anu.jid)) return80 try {81 const mdata = await client.groupMetadata(anu.jid)82 console.log(anu)83 if (anu.action == 'add') {84 num = anu.participants[0]85 try {86 ppimg = await client.getProfilePicture(`${anu.participants[0].split('@')[0]}@c.us`)87 } catch {88 ppimg = 'https://i0.wp.com/www.gambarunik.id/wp-content/uploads/2019/06/Top-Gambar-Foto-Profil-Kosong-Lucu-Tergokil-.jpg'89 }90 teks = `[ *WELCOME IN GC ${mdata.subject}* ] \n*___________________________*\n@${num.split('@')[0]} Intro/Dikick!!! \nNama : \nUmur : \nAskot : \nGender : \nUdah Punya Doi/Blm?: \n*Sertakan Pap Muka!!!* \n nama instagram? \n Save No Admin! \n *___________________________*\nSemoga betah Di group!!`91 let buff = await getBuffer(ppimg)92 client.sendMessage(mdata.id, buff, MessageType.image, {caption: teks, contextInfo: {"mentionedJid": [num]}})93 } else if (anu.action == 'remove') {94 num = anu.participants[0]95 try {96 ppimg = await client.getProfilePicture(`${num.split('@')[0]}@c.us`)97 } catch {98 ppimg = 'https://i0.wp.com/www.gambarunik.id/wp-content/uploads/2019/06/Top-Gambar-Foto-Profil-Kosong-Lucu-Tergokil-.jpg'99 }100 teks = `SAYONARA... @${num.split('@')[0]}👋* \n_Hati-Hati Dijalan, Kalo Balik Nitip Gorengan Ya_`101 let buff = await getBuffer(ppimg)102 client.sendMessage(mdata.id, buff, MessageType.image, {caption: teks, contextInfo: {"mentionedJid": [num]}})103 }104 } catch (e) {105 console.log('Error : %s', color(e, 'red'))106 }107 })108 client.on('CB:Blocklist', json => {109 if (blocked.length > 2) return110 for (let i of json[1].blocklist) {111 blocked.push(i.replace('c.us','s.whatsapp.net'))112 }113 })114115 client.on('message-new', async (mek) => {116 try {117 if (!mek.message) return118 if (mek.key && mek.key.remoteJid == 'status@broadcast') return119 if (mek.key.fromMe) return120 global.prefix121 global.blocked122 const content = JSON.stringify(mek.message)123 const from = mek.key.remoteJid124 const type = Object.keys(mek.message)[0]125 const apiKey = 'pJ6xKSMPCT8QMcvBzGFY'126 //const apiKey = 'SLpvUgOcMYwIx0pFeELt'127128 const { text, extendedText, contact, location, liveLocation, image, video, sticker, document, audio, product } = MessageType129 const speed = require('performance-now')130 const time = moment.tz('Asia/Jakarta').format('DD/MM HH:mm:ss')131 body = (type === 'conversation' && mek.message.conversation.startsWith(prefix)) ? mek.message.conversation : (type == 'imageMessage') && mek.message.imageMessage.caption.startsWith(prefix) ? mek.message.imageMessage.caption : (type == 'videoMessage') && mek.message.videoMessage.caption.startsWith(prefix) ? mek.message.videoMessage.caption : (type == 'extendedTextMessage') && mek.message.extendedTextMessage.text.startsWith(prefix) ? mek.message.extendedTextMessage.text : ''132 budy = (type === 'conversation') ? mek.message.conversation : (type === 'extendedTextMessage') ? mek.message.extendedTextMessage.text : ''133 const command = body.slice(1).trim().split(/ +/).shift().toLowerCase()134 const cond = body.slice(0).trim().split(/ +/).shift().toLowerCase()135 const args = body.trim().split(/ +/).slice(1)136 const isCmd = body.startsWith(prefix)137 client.chatRead (from)138139 mess = {140 wait: '❬ WAIT ❭* _Sedang di Prosess...⏳_',141 success: '*❬ SUCCESS ❭* _Sudah jadi kak..._',142 error: {143 stick: '*Gagal, terjadi kesalahan saat mengkonversi gambar ke sticker*',144 Iv: '*Link tidak valid*'145 },146 only: {147 group: '*Perintah ini hanya bisa di gunakan dalam group!*',148 ownerG: '*Perintah ini hanya bisa di gunakan oleh owner group!*',149 ownerB: '*Perintah ini hanya bisa di gunakan oleh owner bot!* ',150 admin: '*Perintah ini hanya bisa di gunakan oleh admin group!*',151 Badmin: '*Perintah ini hanya bisa di gunakan ketika bot menjadi admin!*'152 }153 }154155 const botNumber = client.user.jid156 const ownerNumber = ["6285277262021@s.whatsapp.net"] // GANTI NOMOR LU157 const adminbotnumber = ["6285277262021@s.whatsapp.net"] // GANTI NOMOR LU158 const frendsowner = ["6285277262021@s.whatsapp.net"] // GAUSAH DIGANTI!!!159 const isGroup = from.endsWith('@g.us')160 const sender = isGroup ? mek.participant : mek.key.remoteJid161 const groupMetadata = isGroup ? await client.groupMetadata(from) : ''162 const groupName = isGroup ? groupMetadata.subject : ''163 const groupId = isGroup ? groupMetadata.jid : ''164 const groupMembers = isGroup ? groupMetadata.participants : ''165 const groupDesc = isGroup ? groupMetadata.desc : ''166 const groupAdmins = isGroup ? getGroupAdmins(groupMembers) : ''167 const isBotGroupAdmins = groupAdmins.includes(botNumber) || false168 const isGroupAdmins = groupAdmins.includes(sender) || false169 const isWelkom = isGroup ? welkom.includes(from) : false170 const isNsfw = isGroup ? nsfw.includes(from) : false171 const isAnime = isGroup ? anime.includes(from) : false172 const isSimi = isGroup ? samih.includes(from) : false173 const isOwner = ownerNumber.includes(sender)174 const isadminbot = adminbotnumber.includes(sender)175 const isfrendsowner = frendsowner.includes(sender)176 const isUrl = (url) => {177 return url.match(new RegExp(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)/, 'gi'))178 }179 const reply = (teks) => {180 client.sendMessage(from, teks, text, {quoted:mek})181 }182 const sendMess = (hehe, teks) => {183 client.sendMessage(hehe, teks, text)184 }185 const mentions = (teks, memberr, id) => {186 (id == null || id == undefined || id == false) ? client.sendMessage(from, teks.trim(), extendedText, {contextInfo: {"mentionedJid": memberr}}) : client.sendMessage(from, teks.trim(), extendedText, {quoted: mek, contextInfo: {"mentionedJid": memberr}})187 }188189 colors = ['red','white','black','blue','yellow','green']190 const isMedia = (type === 'imageMessage' || type === 'videoMessage')191 const isQuotedImage = type === 'extendedTextMessage' && content.includes('imageMessage')192 const isQuotedVideo = type === 'extendedTextMessage' && content.includes('videoMessage')193 const isQuotedSticker = type === 'extendedTextMessage' && content.includes('stickerMessage')194 if (!isGroup && isCmd) console.log('\x1b[1;31m~\x1b[1;37m>', '[\x1b[1;32mEXEC\x1b[1;37m]', time, color(command), 'from', color(sender.split('@')[0]), 'args :', color(args.length))195 if (!isGroup && !isCmd) console.log('\x1b[1;31m~\x1b[1;37m>', '[\x1b[1;31mRECV\x1b[1;37m]', time, color('Message'), 'from', color(sender.split('@')[0]), 'args :', color(args.length))196 if (isCmd && isGroup) console.log('\x1b[1;31m~\x1b[1;37m>', '[\x1b[1;32mEXEC\x1b[1;37m]', time, color(command), 'from', color(sender.split('@')[0]), 'in', color(groupName), 'args :', color(args.length))197 if (!isCmd && isGroup) console.log('\x1b[1;31m~\x1b[1;37m>', '[\x1b[1;31mRECV\x1b[1;37m]', time, color('Message'), 'from', color(sender.split('@')[0]), 'in', color(groupName), 'args :', color(args.length))198 switch(budy){ 199 case 'assalamualaikum' :200 case 'Assalamualaikum' :201 case `Assalamu'alaikum`:202 case `assalamu'alaikum`:203 reply ('Walaikumsalam Bro , Ada Yang Bisa Di Bantu ?')204 break205 }206207208 switch(command) {209 case 'help':210 case 'menu':211 client.sendMessage(from, help(prefix), text)212 break213 case 'info':214 me = client.user215 uptime = process.uptime()216 teks = `➽ *Nama Bot* : _${me.name}_\n➽ *Nomer Bot* : _@${me.jid.split('@')[0]}_\n➽ *prefix* : _${prefix}_\n➽ *Total Block* : _${blocked.length}_\n➽ *Aktif Sejak* : _${kyun(uptime)}_\n➽ *Instagram* : https://www.instagram.com/officials_robby\n➽ *YouTube* : https://youtube.com/channel/Robbypratamaw\n➽ *Script By* : _Robby_ [ᴏʙʏĐᷢeͦꪜᷨ]\n➽ *Note* : _Ini SC pribadi no minta SC_\n➽ *Sepecial Thangks To* :\n➽ _Allah SWT_`217 buffer = await getBuffer(me.imgUrl)218 client.sendMessage(from, buffer, image, {caption: teks, contextInfo:{mentionedJid: [me.jid]}})219 break220 case 'blocklist':221 teks = 'This is list of blocked number :\n'222 for (let block of blocked) {223 teks += `~> @${block.split('@')[0]}\n`224 }225 teks += `Total : ${blocked.length}`226 client.sendMessage(from, teks.trim(), extendedText, {quoted: mek, contextInfo: {"mentionedJid": blocked}})227 break228 case 'ocr':229 if ((isMedia && !mek.message.videoMessage || isQuotedImage) && args.length == 0) {230 const encmedia = isQuotedImage ? JSON.parse(JSON.stringify(mek).replace('quotedM','m')).message.extendedTextMessage.contextInfo : mek231 const media = await client.downloadAndSaveMediaMessage(encmedia)232 reply(mess.wait)233 await recognize(media, {lang: 'eng+ind', oem: 1, psm: 3})234 .then(teks => {235 reply(teks.trim())236 fs.unlinkSync(media)237 })238 .catch(err => {239 reply(err.message)240 fs.unlinkSync(media)241 })242 } else {243 reply('Foto aja mas')244 }245 break246 case 'stiker':247 case 'sticker':248 if ((isMedia && !mek.message.videoMessage || isQuotedImage) && args.length == 0) {249 const encmedia = isQuotedImage ? JSON.parse(JSON.stringify(mek).replace('quotedM','m')).message.extendedTextMessage.contextInfo : mek250 const media = await client.downloadAndSaveMediaMessage(encmedia)251 ran = getRandom('.webp')252 await ffmpeg(`./${media}`)253 .input(media)254 .on('start', function (cmd) {255 console.log(`Started : ${cmd}`)256 })257 .on('error', function (err) {258 console.log(`Error : ${err}`)259 fs.unlinkSync(media)260 reply(mess.error.stick)261 })262 .on('end', function () {263 console.log('Finish')264 buff = fs.readFileSync(ran)265 client.sendMessage(from, buff, sticker, {quoted: mek})266 fs.unlinkSync(media)267 fs.unlinkSync(ran)268 })269 .addOutputOptions([`-vcodec`,`libwebp`,`-vf`,`scale='min(320,iw)':min'(320,ih)':force_original_aspect_ratio=decrease,fps=15, pad=320:320:-1:-1:color=white@0.0, split [a][b]; [a] palettegen=reserve_transparent=on:transparency_color=ffffff [p]; [b][p] paletteuse`])270 .toFormat('webp')271 .save(ran)272 } else if ((isMedia && mek.message.videoMessage.seconds < 11 || isQuotedVideo && mek.message.extendedTextMessage.contextInfo.quotedMessage.videoMessage.seconds < 11) && args.length == 0) {273 const encmedia = isQuotedVideo ? JSON.parse(JSON.stringify(mek).replace('quotedM','m')).message.extendedTextMessage.contextInfo : mek274 const media = await client.downloadAndSaveMediaMessage(encmedia)275 ran = getRandom('.webp')276 reply(mess.wait)277 await ffmpeg(`./${media}`)278 .inputFormat(media.split('.')[1])279 .on('start', function (cmd) {280 console.log(`Started : ${cmd}`)281 })282 .on('error', function (err) {283 console.log(`Error : ${err}`)284 fs.unlinkSync(media)285 tipe = media.endsWith('.mp4') ? 'video' : 'gif'286 reply(`❌ Gagal, pada saat mengkonversi ${tipe} ke stiker`)287 })288 .on('end', function () {289 console.log('Finish')290 buff = fs.readFileSync(ran)291 client.sendMessage(from, buff, sticker, {quoted: mek})292 fs.unlinkSync(media)293 fs.unlinkSync(ran)294 })295 .addOutputOptions([`-vcodec`,`libwebp`,`-vf`,`scale='min(320,iw)':min'(320,ih)':force_original_aspect_ratio=decrease,fps=15, pad=320:320:-1:-1:color=white@0.0, split [a][b]; [a] palettegen=reserve_transparent=on:transparency_color=ffffff [p]; [b][p] paletteuse`])296 .toFormat('webp')297 .save(ran)298 } else if ((isMedia || isQuotedImage) && args[0] == 'nobg') {299 const encmedia = isQuotedImage ? JSON.parse(JSON.stringify(mek).replace('quotedM','m')).message.extendedTextMessage.contextInfo : mek300 const media = await client.downloadAndSaveMediaMessage(encmedia)301 ranw = getRandom('.webp')302 ranp = getRandom('.png')303 reply(mess.wait)304 keyrmbg = 'bcAvZyjYAjKkp1cmK8ZgQvWH'305 await removeBackgroundFromImageFile({path: media, apiKey: keyrmbg.result, size: 'auto', type: 'auto', ranp}).then(res => {306 fs.unlinkSync(media)307 let buffer = Buffer.from(res.base64img, 'base64')308 fs.writeFileSync(ranp, buffer, (err) => {309 if (err) return reply('Gagal, Terjadi kesalahan, silahkan coba beberapa saat lagi.')310 })311 exec(`ffmpeg -i ${ranp} -vcodec libwebp -filter:v fps=fps=20 -lossless 1 -loop 0 -preset default -an -vsync 0 -s 512:512 ${ranw}`, (err) => {312 fs.unlinkSync(ranp)313 if (err) return reply(mess.error.stick)314 buff = fs.readFileSync(ranw)315 client.sendMessage(from, buff, sticker, {quoted: mek})316 })317 })318 /*} else if ((isMedia || isQuotedImage) && colors.includes(args[0])) {319 const encmedia = isQuotedImage ? JSON.parse(JSON.stringify(mek).replace('quotedM','m')).message.extendedTextMessage.contextInfo : mek320 const media = await client.downloadAndSaveMediaMessage(encmedia)321 ran = getRandom('.webp')322 await ffmpeg(`./${media}`)323 .on('start', function (cmd) {324 console.log('Started :', cmd)325 })326 .on('error', function (err) {327 fs.unlinkSync(media)328 console.log('Error :', err)329 })330 .on('end', function () {331 console.log('Finish')332 fs.unlinkSync(media)333 buff = fs.readFileSync(ran)334 client.sendMessage(from, buff, sticker, {quoted: mek})335 fs.unlinkSync(ran)336 })337 .addOutputOptions([`-vcodec`,`libwebp`,`-vf`,`scale='min(320,iw)':min'(320,ih)':force_original_aspect_ratio=decrease,fps=15, pad=320:320:-1:-1:color=${args[0]}@0.0, split [a][b]; [a] palettegen=reserve_transparent=off; [b][p] paletteuse`])338 .toFormat('webp')339 .save(ran)*/340 } else {341 reply(`Kirim gambar dengan caption ${prefix}sticker atau tag gambar yang sudah dikirim`)342 }343 break344 case 'owner':345 client.sendMessage(from, {displayname: "ᴏʙʏĐᷢeͦꪜᷨ", vcard: vcard}, MessageType.contact, { quoted: mek})346 client.sendMessage(from, 'itu pacar ku eh owner ku ><',MessageType.text, { quoted: mek} )347 break348 case 'fitnah': 349 case 'fake': 350 if (!isGroup) return reply(mess.only.group)351 arg = body.substring(body.indexOf(' ') + 1)352 isi = arg.split(' |')[0] 353 pesan = arg.split('|')[1] 354 pesan2 = arg.split('|')[2] 355 costum(pesan, isi, pesan2)356 break357 case 'fakereplay':358 client.reply(from, 'ange mas', 'mending lari', "0823-877101916")359 break360 case 'but':361 client.reply(from, 'asw', Message.Type.text)362 break363 case 'infogc':364 client.updatePresence(from, Presence.composing)365 if (!isGroup) return reply(mess.only.group)366 try {367 ppimg = await client.getProfilePicture(from)368 } catch {369 ppimg = 'https://i.ibb.co/NthF8ds/IMG-20201223-WA0740.jpg'370 }371 let buf = await getBuffer(ppimg)372 teks = (args.length > 1) ? body.slice(8).trim() : ''373 teks += `*Nama grup :* ${groupName}\n*Deskripsi :* ${groupDesc}\n*Jumlah Admin :* ${groupAdmins.length}\n*Jumlah Member :* ${groupMembers.length}`374 no = 0375 for (let admon of groupAdmins) {376 no += 1377 teks += `[${no.toString()}]`378 }379 client.sendMessage(from, buf, image, {quoted: mek, caption: teks})380 break381 case 'grupinfo':382 client.updatePresence(from, Presence.composing)383 if (!isGroup) return reply(mess.only.group)384 ppUrl = await client.getProfilePicture(from) // leave empty to get your own385 buffer = await getBuffer(ppUrl)386 client.sendMessage(from, buffer, image, {quoted: mek, caption: `*NAME* : ${groupName}\n*MEMBER* : ${groupMembers.length}\n*ADMIN* : ${groupAdmins.length}\n*DESK* : ${groupDesc}`})387 break388 case 'testime':389 setTimeout( () => {390 client.sendMessage(from, '10', text) // ur cods391 client.sendMessage(from, '20', text) // ur cods392 client.sendMessage(from, '30', text)393 client.sendMessage(from, '40', text) // ur cods394 client.sendMessage(from, '50', text) // ur cods395 client.sendMessage(from, '60', text) 396 client.sendMessage(from, '70', text) // ur cods397 client.sendMessage(from, '80', text) // ur cods398 client.sendMessage(from, '90', text) 399 client.sendMessage(from, '100', text) // ur cods400 client.sendMessage(from, 'TimeDone !', text) // ur cods401 client.sendMessage(from, '👍👍👍', text) // ur cods402403 }, 10000) // 1000 = 1s,404 break405 case 'linkgroup':406 case 'linkgrup':407 case 'linkgc':408 if (!isGroup) return reply(mess.only.group)409 if (!isBotGroupAdmins) return reply(mess.only.Badmin)410 linkgc = await client.groupInviteCode (from)411 yeh = `https://chat.whatsapp.com/${linkgc}\n\nlink Group *${groupName}*`412 client.sendMessage(from, yeh, text, {quoted: mek})413 break414 case 'hidetag':415 if (!isGroup) return reply(mess.only.group)416 if (!isOwner) return reply('kamu siapa?')417 var value = body.slice(9)418 var group = await client.groupMetadata(from)419 var member = group['participants']420 var mem = []421 member.map( async adm => {422 mem.push(adm.id.replace('c.us', 's.whatsapp.net'))423 })424 var options = {425 text: value,426 contextInfo: { mentionedJid: mem },427 quoted: mek428 }429 client.sendMessage(from, options, text)430 break431 case 'block':432 client.updatePresence(from, Presence.composing) 433 client.chatRead (from)434 if (!isGroup) return reply(mess.only.group)435 if (!isOwner) return reply(mess.only.ownerB)436 client.blockUser (`${body.slice(7)}@c.us`, "add")437 client.sendMessage(from, `perintah Diterima, memblokir ${body.slice(7)}@c.us`, text)438 break439 case 'unblock':440 if (!isGroup) return reply(mess.only.group)441 if (!isOwner) return reply(mess.only.ownerB)442 client.blockUser (`${body.slice(9)}@c.us`, "remove")443 client.sendMessage(from, `perintah Diterima, membuka blokir ${body.slice(9)}@c.us`, text)444 break445 case 'quotemaker':446 var gh = body.slice(12)447 var quote = gh.split("|")[0];448 var wm = gh.split("|")[1];449 var bg = gh.split("|")[2];450 const pref = `Usage: \n${prefix}quotemaker teks|watermark|theme\n\nEx :\n${prefix}quotemaker ini contoh|bicit|random`451 if (args.length < 1) return reply(pref)452 reply(mess.wait)453 anu = await fetchJson(`https://terhambar.com/aw/qts/?kata=${quote}&author=${wm}&tipe=${bg}`, {method: 'get'})454 buffer = await getBuffer(anu.result)455 client.sendMessage(from, buffer, image, {caption: 'Nih dah jadi kak', quoted: mek})456 break457 case 'galaxtext':458 if (args.length < 1) return reply('mau apa om')459 teks = body.slice(12)460 if (teks.length > 8) return reply('Teksnya kepanjangan, maksimal 8 karakter')461 reply(mess.wait)462 buffer = await getBuffer(`https://api.vhtear.com/galaxytext?text=${teks}&apikey=ANTIGRATISNIHANJENKKK`)463 client.sendMessage(from, buffer, image, {quoted: mek})464 break465 case 'phlogo':466 var gh = body.slice(10)467 var gbl1 = gh.split("|")[0];468 var gbl2 = gh.split("|")[1];469 if (args.length < 1) return reply('Teksnya mana um')470 reply(mess.wait)471 anu = await fetchJson(`https://mhankbarbars.herokuapp.com/api/textpro?theme=pornhub&text1=${gbl1}&text2=${gbl2}`, {method: 'get'})472 buffer = await getBuffer(anu.result)473 client.sendMessage(from, buffer, image, {quoted: mek})474 break475 case 'primbonjodoh':476 var gh = body.slice(14)477 var gbl1 = gh.split("|")[0];478 var gbl2 = gh.split("|")[1];479 anu = await fetchJson(`https://api.vhtear.com/primbonjodoh?nama=${gbl1}&pasangan=${gbl2}&apikey=ANTIGRATISNIHANJENKKK`)480 reply(anu.result.hasil)481 break482 case 'ramaljadian':483 var gh = body.slice(10)484 var gbl1 = gh.split("|")[0];485 var gbl2 = gh.split("|")[1];486 var gbl3 = gh.split("|")[2];487 anu = await fetchJson(`https://api.vhtear.com/harijadian?tgl=${gbl1}&bln=${gbl2}&thn=${gbl3}&apikey=ANTIGRATISNIHANJENKKK`)488 reply(anu.result.hasil)489 break490 case 'tahta':491 if (args.length < 1) return reply(mess.blank)492 teks = body.slice(7)493 if (teks.length > 9) return reply('Teksnya kepanjangan, maksimal 9 karakter')494 reply(mess.wait)495 buffer = await getBuffer(`https://api.vhtear.com/hartatahta?text=${teks}&apikey=ANTIGRATISNIHANJENKKK`)496 client.sendMessage(from, buffer, image, {quoted: mek, caption: 'Harta Tahta '+teks})497 break498 case 'testing':499 var gh = body.slice(5)500 var gbl3 = gh.split("|")[0];501 var gbl4 = gh.split("|")[1];502 if (args.length < 1) return reply('Teksnya mana um')503 reply(mess.wait)504 anu = await fetchJson(`https://zeksapi.herokuapp.com/api/watercolour?text1=${gbl3}&text2=${gbl4}&apikey=xptnbot352`, {method: 'get'})505 buffer = await getBuffer(anu.result)506 client.sendMessage(from, buffer, image, {quoted: mek})507 break508 case 'snowrite':509 var gh = body.slice(10)510 var gbl7 = gh.split("|")[0];511 var gbl8 = gh.split("|")[1];512 if (args.length < 1) return reply('Teksnya mana um')513 reply(mess.wait)514 anu = await fetchJson(`https://zeksapi.herokuapp.com/api/snowwrite?text1=${gbl7}&text2=${gbl8}&apikey=xptnbot352`, {method: 'get'})515 buffer = await getBuffer(anu.result)516 client.sendMessage(from, buffer, image, {quoted: mek})517 break518 case 'marvelogo':519 var gh = body.slice(9)520 var gbl5 = gh.split("|")[0];521 var gbl6 = gh.split("|")[1];522 if (args.length < 1) return reply('Teksnya mana um')523 reply(mess.wait)524 anu = await fetchJson(`https://zeksapi.herokuapp.com/api/marvellogo?text1=${gbl5}&text2=${gbl6}&apikey=xptnbot352`, {method: 'get'})525 buffer = await getBuffer(anu.result)526 client.sendMessage(from, buffer, image, {quoted: mek})527 break528 case 'lovemake':529 if (args.length < 1) return reply('Teksnya mana um')530 love = body.slice(10)531 if (love.length > 12) return reply('Teksnya kepanjangan, maksimal 9 karakter')532 reply(mess.wait)533 buffer = await getBuffer(`https://api.vhtear.com/lovemessagetext?text=${love}&apikey=ANTIGRATISNIHANJENKKK`)534 client.sendMessage(from, buffer, image, {quoted: mek, caption: ' '+love})535 break536 case 'thunder':537 if (args.length < 1) return reply('Teksnya mana um')538 thun = body.slice(9)539 if (thun.length > 10) return reply('Teksnya kepanjangan, maksimal 9 karakter')540 reply(mess.wait)541 buffer = await getBuffer(`https://api.vhtear.com/thundertext?text=${thun}&apikey=ANTIGRATISNIHANJENKKK`)542 client.sendMessage(from, buffer, image, {quoted: mek, caption: ' '+thun})543 break544 case 'stiltext':545 if (args.length < 1) return reply('Teks nya mana?')546 gh = body.slice(11)547 gl1 = gh.split("|")[0];548 gl2 = gh.split("|")[1];549 buff = await getBuffer(`https://api.vhtear.com/silktext?text=${gl1}&text2=${gl2}&apikey=ANTIGRATISNIHANJENKKK`)550 reply(mess.wait)551 client.sendMessage(from, buff, image, {quoted: mek, caption: 'thund ni '+gh})552 break553 case 'testing':554 var gh = body.slice(9)555 coli1 = gh.split("|")[0];556 coli2 = gh.split("|")[1];557 if (args.length < 1) return reply('Teks nya mana?')558 reply(mess.wait)559 buffer = await getBuffer(`https://zeksapi.herokuapp.com/api/watercolour?text1=${coli1}&text2=${coli2}&apikey=xptnbot352`)560 client.sendMessage(from, buffer, image, {quoted: mek})561 break562 case 'testing2':563 var gh = body.slice(9)564 coli1 = gh.split("|")[0];565 coli2 = gh.split("|")[1];566 if (args.length < 1) return reply('Teks nya mana?')567 reply(mess.wait)568 party = await getBuffer(`https://api.vhtear.com/partytext?text=${coli1}&text2=${coli2}&apikey=ANTIGRATISNIHANJENKKK`)569 client.sendMessage(from, party, image, {quoted: mek})570 break571 case 'ninjalogo':572 if (args.length < 1) return reply('Teks nya mana?')573 gh = body.slice(11)574 gl1 = gh.split("|")[0];575 gl2 = gh.split("|")[1];576 reply(mess.wait)577 anu = await fetchJson(`https://tobz-api.herokuapp.com/api/textpro?theme=ninjalogo&text1=${gl1}&text2=${gl2}`, {method: 'get'})578 buff = await getBuffer(anu.result)579 client.sendMessage(from, buff, image, {quoted: mek})580 break581 case 'glitch':582 var gh = body.slice(8)583 var tels3 = gh.split("|")[0];584 var tels4 = gh.split("|")[1];585 if (args.length < 1) return reply(mess.blank)586 reply(mess.wait)587 anu = await fetchJson(`https://tobz-api.herokuapp.com/api/textpro?theme=glitch&text1=${tels3}&text2=${tels4}`, {method: 'get'})588 buffer = await getBuffer(anu.result)589 client.sendMessage(from, buffer, image, {quoted: mek})590 break591 case 'party':592 if (args.length < 1) return reply(mess.blank)593 part = body.slice(7)594 if (part.length > 20) return reply('Teksnya kepanjangan, maksimal 20 karakter')595 reply(mess.wait)596 buffer = await getBuffer(`https://api.vhtear.com/partytext?text=${part}&apikey=ANTIGRATISNIHANJENKKK`)597 client.sendMessage(from, buffer, image, {caption: 'Nih kak', quoted: mek})598 break599 case 'rtext':600 if (args.length < 1) return reply(mess.blank)601 tels5 = body.slice(7)602 if (tels5.length > 10) return reply('Teksnya kepanjangan, maksimal 10 karakter')603 reply(mess.wait)604 buffer = await getBuffer(`https://api.vhtear.com/romancetext?text=${tels5}&apikey=ANTIGRATISNIHANJENKKK`)605 client.sendMessage(from, buffer, image, {quoted: mek, caption: tels5})606 break607 case 'water':608 if (args.length < 1) return reply(mess.blank)609 tels = body.slice(7)610 if (tels.length > 15) return reply('Teksnya kepanjangan, maksimal 20 karakter')611 reply(mess.wait)612 anu = await fetchJson(`https://zeksapi.herokuapp.com/api/tfire?text=${tels}&apikey=xptnbot352`, {method: 'get'})613 buffer = await getBuffer(anu.result)614 client.sendMessage(from, buffer, image, {quoted: mek})615 break616 case 'firetext':617 if (args.length < 1) return reply(mess.blank)618 tels = body.slice(7)619 if (tels.ength > 10) return reply('Teksnya kepanjangan, maksimal 9 karakter')620 reply(mess.wait)621 anu = await fetchJson(`https://zeksapi.herokuapp.com/api/tlight?text=${tels}&apikey=xptnbot352`, {method: 'get'})622 buff = await getBuffer(anu.result)623 client.sendMessage(from, buff, image, {quoted: mek})624 break625 case 'textdark':626 if (args.length < 1) return reply(mess.blank)627 tels = body.slice(9)628 if (tels.ength > 10) return reply('Teksnya kepanjangan, maksimal 9 karakter')629 reply(mess.wait)630 anu = await fetchJson(`http://melodicxt.herokuapp.com/api/txtcustom?theme=metal_dark_gold&text=${tels}&apiKey=administrator`, {method: 'get'})631 buff = await getBuffer(anu.result)632 client.sendMessage(from, buff, image, {quoted: mek})633 break634 case 'textblue':635 if (args.length < 1) return reply(mess.blank)636 tels = body.slice(9)637 if (tels.ength > 10) return reply('Teksnya kepanjangan, maksimal 9 karakter')638 reply(mess.wait)639 anu = await fetchJson(`http://melodicxt.herokuapp.com/api/txtcustom?theme=blue_metal&text=${tels}&apiKey=administrator`, {method: 'get'})640 buff = await getBuffer(anu.result)641 client.sendMessage(from, buff, image, {quoted: mek})642 break643 case 'textsky':644 if (args.length < 1) return reply(mess.blank)645 tels = body.slice(9)646 if (tels.ength > 10) return reply('Teksnya kepanjangan, maksimal 9 karakter')647 reply(mess.wait)648 anu = await fetchJson(`https://hujanapi.herokuapp.com/api/sky_online?text=${tels}&apiKey=freetrial`, {method: 'get'})649 buff = await getBuffer(anu.result.result)650 client.sendMessage(from, buff, image, {quoted: mek})651 break652 case 'texteng':653 if (args.length < 1) return reply(mess.blank)654 tels = body.slice(9)655 if (tels.ength > 10) return reply('Teksnya kepanjangan, maksimal 9 karakter')656 reply(mess.wait)657 anu = await fetchJson(`http://melodicxt.herokuapp.com/api/txtcustom?theme=sand_engraved&text=${tels}&apiKey=administrator`, {method: 'get'})658 buff = await getBuffer(anu.result)659 client.sendMessage(from, buff, image, {quoted: mek})660 break661 case 'wolflogo':662 if (args.length < 1) return reply('Teks nya mana?')663 gh = body.slice(9)664 gl1 = gh.split("|")[0];665 gl2 = gh.split("|")[1];666 reply(mess.wait)667 anu = await fetchJson(`https://tobz-api.herokuapp.com/api/textpro?theme=wolflogo1&text1=${gl1}&text2=${gl2}`, {method: 'get'})668 buff = await getBuffer(anu.result)669 client.sendMessage(from, buff, image, {quoted: mek})670 break671 case 'lionlogo':672 if (args.length < 1) return reply('Teks nya mana?')673 gh = body.slice(9)674 gl1 = gh.split("|")[0];675 gl2 = gh.split("|")[1];676 reply(mess.wait)677 anu = await fetchJson(`https://tobz-api.herokuapp.com/api/textpro?theme=lionlogo&text1=${gl1}&text2=${gl2}`, {method: 'get'})678 buff = await getBuffer(anu.result)679 client.sendMessage(from, buff, image, {quoted: mek})680 break681 case 'leave': 682 if (!isGroup) return reply(mess.only.group)683 if (!isOwner) return reply(mess.only.ownerB)684 anu = await client.groupLeave(from, '𝗕𝘆𝗲𝗲', groupId)685 break686 case 'getses':687 if (!isOwner) return client.reply(from, 'Perintah ini hanya untuk Owner bot', id)688 const sesPic = await client.getSnapshot()689 client.sendFile(from, sesPic, 'session.png', 'Neh...', id)690 break691 case 'setname':692 if (!isGroup) return reply(mess.only.group)693 if (!isGroupAdmins) return reply(mess.only.admin)694 if (!isBotGroupAdmins) return reply(mess.only.Badmin)695 client.groupUpdateSubject(from, `${body.slice(9)}`)696 client.sendMessage(from, 'Succes, Ganti Nama Grup', text, {quoted: mek})697 break698 case 'setdesc':699 if (!isGroup) return reply(mess.only.group)700 if (!isGroupAdmins) return reply(mess.only.admin)701 if (!isBotGroupAdmins) return reply(mess.only.Badmin)702 client.groupUpdateDescription(from, `${body.slice(9)}`)703 client.sendMessage(from, 'Succes, Ganti Deskripsi Grup', text, {quoted: mek})704 break705 case 'tts':706 if (args.length < 1) return client.sendMessage(from, 'Kode bahasanya mana om?', text, {quoted: mek})707 const gtts = require('./lib/gtts')(args[0])708 if (args.length < 2) return client.sendMessage(from, 'Textnya mana om', text, {quoted: mek})709 dtt = body.slice(9)710 ranm = getRandom('.mp3')711 rano = getRandom('.ogg')712 dtt.length > 600713 ? reply('Textnya kebanyakan om')714 : gtts.save(ranm, dtt, function() {715 exec(`ffmpeg -i ${ranm} -ar 48000 -vn -c:a libopus ${rano}`, (err) => {716 fs.unlinkSync(ranm)717 buff = fs.readFileSync(rano)718 if (err) return reply('Gagal om:(')719 client.sendMessage(from, buff, audio, {quoted: mek, ptt:true})720 fs.unlinkSync(rano)721 })722 })723 break724 case 'setpp':725 if (!isGroup) return reply(mess.only.group)726 if (!isGroupAdmins) return reply(mess.only.admin)727 if (!isBotGroupAdmins) return reply(mess.only.Badmin)728 media = await client.downloadAndSaveMediaMessage(mek)729 await client.updateProfilePicture (from, media)730 reply('Sukses mengganti icon Grup')731 break732 case 'apakah':733 apakah = body.slice(1)734 const apa =['Iya','Tidak','Bisa Jadi','Coba Ulangi']735 const kah = apa[Math.floor(Math.random() * apa.length)]736 client.sendMessage(from, 'Pertanyaan : *'+apakah+'*\n\nJawaban : '+ kah, text, { quoted: mek })737 738 break739 case 'rate':740 rate = body.slice(1)741 const ra =['4','9','17','28','34','48','59','62','74','83','97','100','29','94','75','82','41','39']742 const te = ra[Math.floor(Math.random() * ra.length)]743 client.sendMessage(from, 'Pertanyaan : *'+rate+'*\n\nJawaban : '+ te+'%', text, { quoted: mek })744 break745 case 'watak':746 watak = body.slice(1)747 const wa =['peny ayang','pem urah','Pem arah','Pem aaf','Pen urut','Ba ik','bap eran','Baik Hati','peny abar','Uw u','top deh, poko knya','Suka Memb antu']748 const tak = wa[Math.floor(Math.random() * wa.length)]749 client.sendMessage(from, 'Pertanyaan : *'+watak+'*\n\nJawaban : '+ tak, text, { quoted: mek })750 break751 case 'hobby':752 hobby = body.slice(1)753 const hob =['Memasak','Membantu Atok','Mabar','Nobar','Sosmedtan','Membantu Orang lain','Nonton Anime','Nonton Drakor','Naik Motor','Nyanyi','Menari','Bertumbuk','Menggambar','Foto fotoan Ga jelas','Maen Game','Berbicara Sendiri']754 const by = hob[Math.floor(Math.random() * hob.length)]755 client.sendMessage(from, 'Pertanyaan : *'+hobby+'*\n\nJawaban : '+ by, text, { quoted: mek })756 break757 case 'bisakah':758 bisakah = body.slice(1)759 const bisa =['Bisa','Tidak Bisa','Coba Ulangi']760 const keh = bisa[Math.floor(Math.random() * bisa.length)]761 client.sendMessage(from, 'Pertanyaan : *'+bisakah+'*\n\nJawaban : '+ keh, text, { quoted: mek })762 break763 case 'kapankah':764 kapankah = body.slice(1)765 const kapan =['Besok','Lusa','Tadi','4 Hari Lagi','5 Hari Lagi','6 Hari Lagi','1 Minggu Lagi','2 Minggu Lagi','3 Minggu Lagi','1 Bulan Lagi','2 Bulan Lagi','3 Bulan Lagi','4 Bulan Lagi','5 Bulan Lagi','6 Bulan Lagi','1 Tahun Lagi','2 Tahun Lagi','3 Tahun Lagi','4 Tahun Lagi','5 Tahun Lagi','6 Tahun Lagi','1 Abad lagi','3 Hari Lagi']766 const koh = kapan[Math.floor(Math.random() * kapan.length)]767 client.sendMessage(from, 'Pertanyaan : *'+kapankah+'*\n\nJawaban : '+ koh, text, { quoted: mek })768 break769 case 'truth':770 const trut =['Pernah suka sama siapa aja? berapa lama?','Kalau boleh atau kalau mau, di gc/luar gc siapa yang akan kamu jadikan sahabat?(boleh beda/sma jenis)','apa ketakutan terbesar kamu?','pernah suka sama orang dan merasa orang itu suka sama kamu juga?','Siapa nama mantan pacar teman mu yang pernah kamu sukai diam diam?','pernah gak nyuri uang nyokap atau bokap? Alesanya?','hal yang bikin seneng pas lu lagi sedih apa','pernah cinta bertepuk sebelah tangan? kalo pernah sama siapa? rasanya gimana brou?','pernah jadi selingkuhan orang?','hal yang paling ditakutin','siapa orang yang paling berpengaruh kepada kehidupanmu','hal membanggakan apa yang kamu dapatkan di tahun ini','siapa orang yang bisa membuatmu sange','siapa orang yang pernah buatmu sange','(bgi yg muslim) pernah ga solat seharian?','Siapa yang paling mendekati tipe pasangan idealmu di sini','suka mabar(main bareng)sama siapa?','pernah nolak orang? alasannya kenapa?','Sebutkan kejadian yang bikin kamu sakit hati yang masih di inget','pencapaian yang udah didapet apa aja ditahun ini?','kebiasaan terburuk lo pas di sekolah apa?']771 const ttrth = trut[Math.floor(Math.random() * trut.length)]772 truteh = await getBuffer(`https://i.ibb.co/305yt26/bf84f20635dedd5dde31e7e5b6983ae9.jpg`)773 client.sendMessage(from, truteh, image, { caption: '*Truth*\n\n'+ ttrth, quoted: mek })774 break775 case 'dare':776 const dare =['Kirim pesan ke mantan kamu dan bilang "aku masih suka sama kamu','telfon crush/pacar sekarang dan ss ke pemain','pap ke salah satu anggota grup','Bilang "KAMU CANTIK BANGET NGGAK BOHONG" ke cowo','ss recent call whatsapp','drop emot "🦄💨" setiap ngetik di gc/pc selama 1 hari','kirim voice note bilang can i call u baby?','drop kutipan lagu/quote, terus tag member yang cocok buat kutipan itu','pake foto sule sampe 3 hari','ketik pake bahasa daerah 24 jam','ganti nama menjadi "gue anak lucinta luna" selama 5 jam','chat ke kontak wa urutan sesuai %batre kamu, terus bilang ke dia "i lucky to hv you','prank chat mantan dan bilang " i love u, pgn balikan','record voice baca surah al-kautsar','bilang "i hv crush on you, mau jadi pacarku gak?" ke lawan jenis yang terakhir bgt kamu chat (serah di wa/tele), tunggu dia bales, kalo udah ss drop ke sini','sebutkan tipe pacar mu!','snap/post foto pacar/crush','teriak gajelas lalu kirim pake vn kesini','pap mukamu lalu kirim ke salah satu temanmu','kirim fotomu dengan caption, aku anak pungut','teriak pake kata kasar sambil vn trus kirim kesini','teriak " anjimm gabutt anjimmm " di depan rumah mu','ganti nama jadi " BOWO " selama 24 jam','Pura pura kerasukan, contoh : kerasukan maung, kerasukan belalang, kerasukan kulkas, dll']777 const der = dare[Math.floor(Math.random() * dare.length)]778 tod = await getBuffer(`https://i.ibb.co/305yt26/bf84f20635dedd5dde31e7e5b6983ae9.jpg`)779 client.sendMessage(from, tod, image, { quoted: mek, caption: '*Dare*\n\n'+ der })780 break 781 case `assalamualaikum`:782 client.sendMessage(from, `Waalaikumsalam Mas :)`)783 break784 case 'speed':785 const timestamp = speed();786 const latensi = speed() - timestamp787 client.sendMessage(from, `Speed: ${latensi.toFixed(4)} _Second_`, text, { quoted: mek})788 break789 case 'tagme':790 var nom = mek.participant791 const tag = {792 text: `@${nom.split("@s.whatsapp.net")[0]} tagged!`,793 contextInfo: { mentionedJid: [nom] }794 }795 client.sendMessage(from, tag, text, {quoted: mek})796 break797 case 'donasi':798 case 'donate':799 client.sendMessage(from, 'Mau donasi ya om?✨\n\n اتَّقوا النَّارَ ولو بشقِّ تمرةٍ ، فمن لم يجِدْ فبكلمةٍ طيِّبةٍ\n_“jauhilah api neraka, walau hanya dengan bersedekah sebiji kurma (sedikit). Jika kamu tidak punya, maka bisa dengan kalimah thayyibah” [HR. Bukhari 6539, Muslim 1016]_\n\n*Pulsa XL :* _0852-7726-2021_\n*Dana :* _0852-7726-2021_\n*Gopay :* _0852-7726-2021_\n*OVO :* _0852-7726-2021_', text, { quoted: mek })800 break801 case 'tes':802 client.sendMessage(from, 'ok', text, {quoted: mek})803 case 'ttp':804 if (args.length < 1) return reply('Textnya mana um?')805 ranp = getRandom('.png')806 rano = getRandom('.webp')807 ttp = body.slice(5).trim()808 anu = await fetchJson(`https://mhankbarbars.herokuapp.com/api/text2image?text=${ttp}&apiKey=SLpvUgOcMYwIx0pFeELt`, {method: 'get'})809 if (anu.error) return reply(anu.error)810 exec(`wget ${anu.result} -O ${ranp} && ffmpeg -i ${ranp} -vcodec libwebp -filter:v fps=fps=20 -lossless 1 -loop 0 -preset default -an -vsync 0 -s 512:512 ${rano}`, (err) => {811 fs.unlinkSync(ranp)812 if (err) return reply(mess.error.stick)813 buff = fs.readFileSync(rano)814 client.sendMessage(from, buff, sticker, {quoted: mek})815 fs.unlinkSync(rano)816 })817 break818 case 'lirik':819 teks = body.slice(7)820 anu = await fetchJson(`http://scrap.terhambar.com/lirik?word=${teks}`, {method: 'get'})821 reply('Lirik dari lagu '+teks+' adalah :\n\n'+anu.result.lirik)822 break823 case 'anime':824 teks = body.slice(7)825 anu = await fetchJson(`https://mnazria.herokuapp.com/api/anime?query=${teks}`, {method: 'get'})826 reply('anime nya ni '+teks+' adalah :\n\n'+anu.title)827 break828 case 'report':829 const pesan = body.slice(8)830 if (pesan.length > 300) return client.sendMessage(from, 'Maaf Teks Terlalu Panjang, Maksimal 300 Teks', msgType.text, {quoted: mek})831 var nomor = mek.participant832 const teks1 = `*[REPORT]*\nNomor : @${nomor.split("@s.whatsapp.net")[0]}\nPesan : ${pesan}`833834 var options = {835 text: teks1,836 contextInfo: {mentionedJid: [nomor]},837 }838 client.sendMessage('6285277262021@s.whatsapp.net', options, text, {quoted: mek})839 reply('Masalah telah di laporkan ke owner BOT, laporan palsu/main2 tidak akan ditanggapi.')840 break841 case 'request':842 const cfrr = body.slice(8)843 if (cfrr.length > 300) return client.sendMessage(from, 'Maaf Teks Terlalu Panjang, Maksimal 300 Teks', msgType.text, {quoted: mek})844 var nomor = mek.participant845 const ress = `*[REQUEST VITUR]*\nNomor : @${nomor.split("@s.whatsapp.net")[0]}\nPesan : ${cfrr}`846847 var options = {848 text: ress,849 contextInfo: {mentionedJid: [nomor]},850 }851 client.sendMessage('6287720646259@s.whatsapp.net', options, text, {quoted: mek})852 reply('REQUEST ANDA TELAH SAMPAI ke owner BOT, Requests palsu/main2 tidak akan ditanggapi.')853 break854 case 'meme':855 meme = await kagApi.memes()856 buffer = await getBuffer(`https://imgur.com/${meme.hash}.jpg`)857 client.sendMessage(from, buffer, image, {quoted: mek, caption: '.......'})858 break859 case 'memeindo':860 memein = await kagApi.memeindo()861 buffer = await getBuffer(`https://imgur.com/${memein.hash}.jpg`)862 client.sendMessage(from, buffer, image, {quoted: mek, caption: '.......'})863 break864 case 'ssweb':865 if (args.length < 1) return reply('Urlnya mana om')866 teks = body.slice(7)867 reply(mess.wait)868 anu = await fetchJson(`https://mnazria.herokuapp.com/api/screenshotweb?url=${teks}`)869 buff = await getBuffer(anu.gambar)870 client.sendMessage(from, buff, image, {quoted: mek})871 break872 case 'walpaperhd':873 if (args.length < 1) return reply('teks nya mana om')874 teks = body.slice(7)875 reply(mess.wait)876 anu = await fetchJson(`https://api.vhtear.com/walpaper?query=${teks}&apikey=ANTIGRATISNIHANJENKKK`)877 buff = await getBuffer(anu.result.LinkImg)878 client.sendMessage(from, buff, image, {quoted: mek})879 break880 case 'nekonime':881 try {882 res = await fetchJson(`https://tobz-api.herokuapp.com/api/nekonime`, {method: 'get'})883 buffer = await getBuffer(res.result)884 client.sendMessage(from, buffer, image, {quoted: mek, caption: 'Ingat! Cintai nekonime'})885 } catch (e) {886 console.log(`Error :`, color(e,'red'))887 reply('❌ *ERROR* ❌')888 }889 break890 case 'loli':891 try {892 res = await fetchJson(`https://api.lolis.life/random`, {method: 'get'})893 buffer = await getBuffer(res.url)894 client.sendMessage(from, buffer, image, {quoted: mek, caption: 'Ingat! Citai Lolimu'})895 } catch (e) {896 console.log(`Error :`, color(e,'red'))897 reply('❌ *ERROR* ❌')898 }899 break900 case 'imagetest':901 try {902 res = await fetchJson(`https://api.i-tech.id/anim/baguette?key=oc2nvC-F4HS1e-OteAXu-5QkGag-J8WC94`, {method: 'get'})903 buffer = await getBuffer(anu.result.result)904 client.sendMessage(from, buffer, image, {quoted: mek, caption: 'Ingat! Cintai waifu!'})905 } catch (e) {906 console.log(`Error :`, color(e,'red'))907 reply('❌ *ERROR* ❌')908 }909 break910 case 'waifu':911 try {912 res = await fetchJson(`https://tobz-api.herokuapp.com/api/waifu`, {method: 'get'})913 buffer = await getBuffer(res.image)914 client.sendMessage(from, buffer, image, {quoted: mek, caption: 'Ingat! Cintai waifu!'})915 } catch (e) {916 console.log(`Error :`, color(e,'red'))917 reply('❌ *ERROR* ❌')918 }919 break920 case 'waifu2':921 reply(mess.wait)922 anu = await fetchJson(`https://tobz-api.herokuapp.com/api/waifu`, {method: 'get'})923 if (anu.error) return reply(anu.error)924 buffer = await getBuffer(anu.image)925 waifu = `*${anu.desc}`926 client.sendMessage(from, buffer, image, {quoted: mek, caption: waifu})927 break928 case 'imoji':929 reply(mess.wait)930 anu = await fetchJson(`https://mhankbarbars.herokuapp.com/api/emoji2png?emoji=`, {method: 'get'})931 if (anu.error) return reply(anu.error)932 buffer = await getBuffer(anu.result)933 client.sendMessage(from, buffer, image, {quoted: mek})934 break935 case 'wibu':936 reply(mess.wait)937 anu = await fetchJson(`https://api.vhtear.com/randomwibu&apikey=ANTIGRATISNIHANJENKKK`)938 if (anu.error) return reply(anu.error)939 buffer = await getBuffer(anu.result.foto)940 wibu = ` ➸ *nama* ${anu.result.nama} ➸ *deskripsi* ${anu.result.deskripsi}`941 client.sendMessage(from, buffer, image, {quoted: mek, caption: wibu})942 break943 case 'randomcat':944 reply(mess.wait)945 anu = await fetchJson(`https://api.vhtear.com/randomcat?apikey=NOT-PREMIUM`)946 if (anu.error) return reply(anu.error)947 buffer = await getBuffer(anu.result.url)948 client.sendMessage(from, buffer, image, {quoted: mek})949 break950 case 'mlherolist':951 reply(mess.wait)952 anu = await fetchJson(`https://api.vhtear.com/mlherolist?apikey=ANTIGRATISNIHANJENKKK`)953 icon = await getBuffer(anu.icon)954 client.sendMessage(from, icon, image, {quoted: mek})955 break956 case 'randomanime':957 try {958 res = await fetchJson(`https://tobz-api.herokuapp.com/api/randomanime`, {method: 'get'})959 buffer = await getBuffer(res.result)960 client.sendMessage(from, buffer, image, {quoted: mek, caption: 'ni randomanime!'})961 } catch (e) {962 console.log(`Error :`, color(e,'red'))963 reply('❌ *ERROR* ❌')964 }965 break966 case 'randomhentai':967 try {968 if (!isNsfw) return reply('❌ *FALSE* ❌')969 res = await fetchJson(`https://tobz-api.herokuapp.com/api/hentai`, {method: 'get'})970 buffer = await getBuffer(res.result)971 client.sendMessage(from, buffer, image, {quoted: mek, caption: 'hentai teros'})972 } catch (e) {973 console.log(`Error :`, color(e,'red'))974 reply('❌ *ERROR* ❌')975 }976 break977 case 'nsfwloli':978 try {979 if (!isNsfw) return reply('❌ *FALSE* ❌')980 res = await fetchJson(`https://api.lolis.life/random?nsfw=true`, {method: 'get'})981 buffer = await getBuffer(res.url)982 client.sendMessage(from, buffer, image, {quoted: mek, caption: 'Jangan jadiin bahan buat comli om'})983 } catch (e) {984 console.log(`Error :`, color(e,'red'))985 reply('❌ *ERROR* ❌')986 }987 break988 case 'nsfwblowjob':989 try {990 if (!isNsfw) return reply('❌ *FALSE* ❌')991 res = await fetchJson(`https://tobz-api.herokuapp.com/api/nsfwblowjob`, {method: 'get'})992 buffer = await getBuffer(res.result)993 client.sendMessage(from, buffer, image, {quoted: mek, caption: 'Jangan jadiin bahan buat comli om'})994 } catch (e) {995 console.log(`Error :`, color(e,'red'))996 reply('❌ *ERROR* ❌')997 }998 break999 case 'nsfwneko':1000 try {1001 if (!isNsfw) return reply('❌ *FALSE* ❌')1002 res = await fetchJson(`https://tobz-api.herokuapp.com/api/nsfwneko`, {method: 'get'})1003 buffer = await getBuffer(res.result)1004 client.sendMessage(from, buffer, image, {quoted: mek, caption: 'ni anjim'})1005 } catch (e) {1006 console.log(`Error :`, color(e,'red'))1007 reply('❌ *ERROR* ❌')1008 }1009 break1010 case 'nsfwtrap':1011 try {1012 if (!isNsfw) return reply('❌ *FALSE* ❌')1013 res = await fetchJson(`https://tobz-api.herokuapp.com/api/nsfwtrap`, {method: 'get'})1014 buffer = await getBuffer(res.result)1015 client.sendMessage(from, buffer, image, {quoted: mek, caption: 'ni anjim'})1016 } catch (e) {1017 console.log(`Error :`, color(e,'red'))1018 reply('❌ *ERROR* ❌')1019 }1020 break1021 case 'hilih':1022 if (args.length < 1) return reply('Teksnya mana um?')1023 anu = await fetchJson(`https://mhankbarbars.herokuapp.com/api/hilih?teks=${body.slice(7)}`, {method: 'get'})1024 reply(anu.result)1025 break1026 case 'ytmp3':1027 if (args.length < 1) return reply('Urlnya mana um?')1028 if(!isUrl(args[0]) && !args[0].includes('youtu')) return reply(mess.error.Iv)1029 anu = await fetchJson(`https://mhankbarbars.herokuapp.com/api/yta?url=${args[0]}&apiKey=${apiKey}`, {method: 'get'})1030 if (anu.error) return reply(anu.error)1031 teks = `*Title* : ${anu.title}\n*Filesize* : ${anu.filesize}`1032 thumb = await getBuffer(anu.thumb)1033 client.sendMessage(from, thumb, image, {quoted: mek, caption: teks})1034 buffer = await getBuffer(anu.result)1035 client.sendMessage(from, buffer, audio, {mimetype: 'audio/mp3', filename: `${anu.title}.mp3`, quoted: mek})1036 break1037 case 'bucin':1038 gatauda = body.slice(7)1039 anu = await fetchJson(`https://arugaz.herokuapp.com/api/howbucins`, {method: 'get'})1040 reply(anu.desc)1041 break1042 case 'persengay':1043 gatauda = body.slice(7)1044 anu = await fetchJson(`https://arugaz.herokuapp.com/api/howbucins`, {method: 'get'})1045 reply(anu.desc+anu.persen)1046 break 1047 case 'quotes':1048 gatauda = body.slice(8)1049 anu = await fetchJson(`https://arugaz.herokuapp.com/api/randomquotes`, {method: 'get'})1050 reply(anu.quotes)1051 break 1052 case 'cerpen':1053 gatauda = body.slice(7)1054 anu = await fetchJson(`https://arugaz.herokuapp.com/api/cerpen`, {method: 'get'})1055 reply(anu.result.result)1056 break1057 case 'chord':1058 if (args.length < 1) return reply('teks nya mana om')1059 tels = body.slice(7)1060 anu = await fetchJson(`https://arugaz.herokuapp.com/api/chord?q=${tels}`, {method: 'get'})1061 reply(anu.result)1062 break1063 case 'ramalhp':1064 if (args.length < 1) return reply('teks nya mana om')1065 kj = body.slice(12)1066 anu = await fetchJson(`https://api.vhtear.com/nomerhoki?no=${kj}&apikey=ANTIGRATISNIHANJENKKK`)1067 reply(anu.result.hasil)1068 break1069 case 'textscreen':1070 if (args.length < 1) return reply('teks nya mana om')1071 tels = body.slice(9)1072 anu = await fetchJson(`https://api.vhtear.com/textscreen?query=${tels}&apikey=ANTIGRATISNIHANJENKKK`, {method: 'get'})1073 reply(anu.result.text)1074 break1075 case 'joox':1076 if (args.length < 1) return reply('Nama lagunya apa kak?')1077 anu = await fetchJson(`https://api.vhtear.com/ytmp3?query=${body.slice(6)}&apikey=ANTIGRATISNIHANJENKKK`)1078 buffer = await getBuffer(anu.result.mp3)1079 client.sendMessage(from, buffer, audio, {mimetype: 'audio/mp4', filename: `${anu.result.judul}.mp3`, quoted: mek, caption: hasil, ptt: false})1080 break1081 case 'wiki':1082 if (args.length < 1) return reply('teks nya mana om?')1083 teks = body.slice(5)1084 reply(mess.wait)1085 anu = await fetchJson(`https://st4rz.herokuapp.com/api/wiki?q=`, {method: 'get'})1086 if (anu.error) return reply(anu.error)1087 buff = await getBuffer(anu.result)1088 hasil = `${anu.result}`1089 client.sendMessage(from, buff, image, {quoted: mek, caption: hasil})1090 break1091 case 'infogempa':1092 anu = await fetchJson(`https://tobz-api.herokuapp.com/api/infogempa`, {method: 'get'})1093 if (anu.error) return reply(anu.error)1094 buff = await getBuffer(anu.map)1095 hasil = ` *potensi* \n ${anu.potensi} *lokasi* \n${anu.lokasi} *magnitude* \n${anu.magnitude} *koordinat* \n${anu.koordinat} *kedalaman* \n${anu.kedalaman}`1096 client.sendMessage(from, buff, image, {quoted: mek, caption: hasil})1097 break1098 case 'infogithub':1099 teks = body.slice(5)1100 anu = await fetchJson(`http://melodicxt.herokuapp.com/api/githubprofile?user=${teks}&apikey=administrator)`, {method: 'get'})1101 if (anu.error) return reply(anu.error)1102 buffer = await getBuffer(anu.avatar_url)1103 hasil = ` *username* \n ${anu.followers} *following* \n${anu.following} *bio* \n${anu.bio} *public_repos* \n${anu.public_repos} *created_at* \n${anu.created_at} *updated_at* \n${anu.updated_at}`1104 client.sendMessage(from, buffer, image, {quoted: mek, caption: hasil})1105 break1106 case 'infocuaca':1107 anu = await fetchJson(`http://tobz-cuaca.herokuapp.com/?menu=cuaca&wilayah=${body.slice(6)}&apiKey=SLpvUgOcMYwIx0pFeELt`, {method: 'get'})1108 if (anu.error) return reply(anu.error)1109 hasil = ` *Tempat : ${anu.tempat}\nCuaca : ${anu.cuaca}\nAngin : ${anu.angin}\nSuhu : ${anu.suhu}\nKelembapan : ${anu.kelembapan}`1110 client.sendMessage(from, hasil, text, {quoted: mek})1111 break1112 case 'tebakgambar':1113 anu = await fetchJson(`https://api.vhtear.com/tebakgambar&apikey=ANTIGRATISNIHANJENKKK`, {method: 'get'})1114 buffer = await getBuffer(anu.result.soalImg)1115 setTimeout( () => {1116 client.sendMessage(from, '*➸ Jawaban :* '+anu.result.jawaban, text, {quoted: mek}) // ur cods1117 }, 30000) // 1000 = 1s,1118 setTimeout( () => {1119 client.sendMessage(from, '_10 Detik lagi…_', text) // ur cods1120 }, 20000) // 1000 = 1s,1121 setTimeout( () => {1122 client.sendMessage(from, '_20 Detik lagi_…', text) // ur cods1123 }, 10000) // 1000 = 1s,1124 setTimeout( () => {1125 client.sendMessage(from, '_30 Detik lagi_…', text) // ur cods1126 }, 2500) // 1000 = 1s,1127 setTimeout( () => {1128 client.sendMessage(from, buffer, image, { caption: '_Jelaskan Apa Maksud Gambar Ini_', quoted: mek }) // ur cods1129 }, 0) // 1000 = 1s,1130 break1131 case 'caklontong':1132 anu = await fetchJson(`https://api.vhtear.com/funkuis&apikey=ANTIGRATISNIHANJENKKK`, {method: 'get'})1133 setTimeout( () => {1134 client.sendMessage(from, '*➸ Jawaban :* '+anu.result.jawaban+'\n'+anu.result.desk, text, {quoted: mek}) // ur cods1135 }, 30000) // 1000 = 1s,1136 setTimeout( () => {1137 client.sendMessage(from, '_10 Detik lagi…_', text) // ur cods1138 }, 20000) // 1000 = 1s,1139 setTimeout( () => {1140 client.sendMessage(from, '_20 Detik lagi_…', text) // ur cods1141 }, 10000) // 1000 = 1s,1142 setTimeout( () => {1143 client.sendMessage(from, '_30 Detik lagi_…', text) // ur cods1144 }, 1000) // 1000 = 1s,1145 setTimeout( () => {1146 client.sendMessage(from, anu.result.soal, text, { quoted: mek }) // ur cods1147 }, 0) // 1000 = 1s,1148 break1149 case 'family100':1150 anu = await fetchJson(`https://api.vhtear.com/family100&apikey=ANTIGRATISNIHANJENKKK`, {method: 'get'})1151 setTimeout( () => {1152 client.sendMessage(from, '*➸ Jawaban :* '+anu.result.jawaban, text, {quoted: mek}) // ur cods1153 }, 30000) // 1000 = 1s,1154 setTimeout( () => {1155 client.sendMessage(from, '_10 Detik lagi…_', text) // ur cods1156 }, 20000) // 1000 = 1s,1157 setTimeout( () => {1158 client.sendMessage(from, '_20 Detik lagi_…', text) // ur cods1159 }, 10000) // 1000 = 1s,1160 setTimeout( () => {1161 client.sendMessage(from, '_30 Detik lagi_…', text) // ur cods1162 }, 1000) // 1000 = 1s,1163 setTimeout( () => {1164 client.sendMessage(from, anu.result.soal, text, { quoted: mek }) // ur cods1165 }, 0) // 1000 = 1s,1166 break1167 case 'game':1168 anu = await fetchJson(`http://rt-files.000webhostapp.com/tts.php?apikey=rasitech`, {method: 'get'})1169 setTimeout( () => {1170 client.sendMessage(from, '*➸ Jawaban :* '+anu.result.jawaban+'\n'+anu.result.desk, text, {quoted: mek}) // ur cods1171 }, 30000) // 1000 = 1s,1172 setTimeout( () => {1173 client.sendMessage(from, '_10 Detik lagi…_', text) // ur cods1174 }, 20000) // 1000 = 1s,1175 setTimeout( () => {1176 client.sendMessage(from, '_20 Detik lagi_…', text) // ur cods1177 }, 10000) // 1000 = 1s,1178 setTimeout( () => {1179 client.sendMessage(from, '_30 Detik lagi_…', text) // ur cods1180 }, 1000) // 1000 = 1s,1181 setTimeout( () => {1182 client.sendMessage(from, anu.result.soal, text, { quoted: mek }) // ur cods1183 }, 0) // 1000 = 1s,1184 break1185 case 'brainly':1186 if (args.length < 1) return reply('Apa yang mau dicari um?')1187 anu = await fetchJson(`https://api.vhtear.com/branly?query=${body.slice(9)}&apikey=ANTIGRATISNIHANJENKKK`, {method: 'get'})1188 reply(anu.result.data)1189 break1190 case 'image':1191 if (args.length < 1) return reply('Apa yang mau dicari kak?')1192 goo = body.slice(7)1193 anu = await fetchJson(`https://api.vhtear.com/googleimg?query=${goo}&apikey=ANTIGRATISNIHANJENKKK`, {method: 'get'})1194 reply(mess.wait)1195 var pol = JSON.parse(JSON.stringify(anu.result.result_search));1196 var tes2 = pol[Math.floor(Math.random() * pol.length)];1197 pint = await getBuffer(tes2)1198 client.sendMessage(from, pint, image, { caption: '*Google Image*\n\n*Hasil Pencarian : '+goo+'*', quoted: mek })1199 break1200 case 'pokemon':1201 anu = await fetchJson(`https://api.fdci.se/rep.php?gambar=pokemon`, {method: 'get'})1202 reply(mess.wait)1203 var n = JSON.parse(JSON.stringify(anu));1204 var nimek = n[Math.floor(Math.random() * n.length)];1205 pok = await getBuffer(nimek)1206 client.sendMessage(from, pok, image, { quoted: mek })1207 break1208 case 'inu':1209 anu = await fetchJson(`https://api.vhtear.com/pinterest?query=inu&apikey=ANTIGRATISNIHANJENKKK`, {method: 'get'})1210 var inu = JSON.parse(JSON.stringify(anu.result));1211 var uni = inu[Math.floor(Math.random() * inu.length)];1212 nye = await getBuffer(uni)1213 client.sendMessage(from, nye, image, { caption: 'Inu!!', quoted: mek })1214 break1215 case 'elang':1216 anu = await fetchJson(`https://api.vhtear.com/pinterest?query=elang&apikey=ANTIGRATISNIHANJENKKK`, {method: 'get'})1217 var eln = JSON.parse(JSON.stringify(anu.result));1218 var elnn = eln[Math.floor(Math.random() * eln.length)];1219 nye = await getBuffer(elnn)1220 client.sendMessage(from, nye, image, { caption: 'elang!!', quoted: mek })1221 break1222 //animefoto1223 case 'naruto':1224 if (!isAnime) return reply('❌ *Harus Mengaktifkan Mode Anime* ❌')1225 anu = await fetchJson(`https://api.vhtear.com/pinterest?query=naruto&apikey=ANTIGRATISNIHANJENKKK`, {method: 'get'})1226 var naru = JSON.parse(JSON.stringify(anu.result));1227 var to = naru[Math.floor(Math.random() * naru.length)];1228 nye = await getBuffer(to)1229 client.sendMessage(from, nye, image, { caption: 'naruto!!', quoted: mek })1230 break1231 case 'minato':1232 if (!isAnime) return reply('❌ *Harus Mengaktifkan Mode Anime* ❌')1233 anu = await fetchJson(`https://api.vhtear.com/pinterest?query=minato&apikey=ANTIGRATISNIHANJENKKK`, {method: 'get'})1234 var min = JSON.parse(JSON.stringify(anu.result));1235 var ato = min[Math.floor(Math.random() * min.length)];1236 nye = await getBuffer(ato)1237 client.sendMessage(from, nye, image, { caption: 'minato!!', quoted: mek })1238 break1239 case 'boruto':1240 if (!isAnime) return reply('❌ *Harus Mengaktifkan Mode Anime* ❌')1241 anu = await fetchJson(`https://api.vhtear.com/pinterest?query=boruto&apikey=ANTIGRATISNIHANJENKKK`, {method: 'get'})1242 var bor = JSON.parse(JSON.stringify(anu.result));1243 var uto = bor[Math.floor(Math.random() * bor.length)];1244 nye = await getBuffer(uto)1245 client.sendMessage(from, nye, image, { caption: 'boruto!!', quoted: mek })1246 break1247 case 'hinata':1248 if (!isAnime) return reply('❌ *Harus Mengaktifkan Mode Anime* ❌')1249 anu = await fetchJson(`https://api.vhtear.com/pinterest?query=hinata&apikey=ANTIGRATISNIHANJENKKK`, {method: 'get'})1250 var hina = JSON.parse(JSON.stringify(anu.result));1251 var ta = hina[Math.floor(Math.random() * hina.length)];1252 nye = await getBuffer(ta)1253 client.sendMessage(from, nye, image, { caption: 'hinata!!', quoted: mek })1254 break1255 case 'sasuke':1256 if (!isAnime) return reply('❌ *Harus Mengaktifkan Mode Anime* ❌')1257 anu = await fetchJson(`https://api.vhtear.com/pinterest?query=sasuke&apikey=ANTIGRATISNIHANJENKKK`, {method: 'get'})1258 var sasu = JSON.parse(JSON.stringify(anu.result));1259 var ke = sasu[Math.floor(Math.random() * sasu.length)];1260 nye = await getBuffer(ke)1261 client.sendMessage(from, nye, image, { caption: 'sasuke!!', quoted: mek })1262 break1263 case 'sakura':1264 if (!isAnime) return reply('❌ *Harus Mengaktifkan Mode Anime* ❌')1265 anu = await fetchJson(`https://api.vhtear.com/pinterest?query=sakura&apikey=ANTIGRATISNIHANJENKKK`, {method: 'get'})1266 var sak = JSON.parse(JSON.stringify(anu.result));1267 var kura = sak[Math.floor(Math.random() * sak.length)];1268 nye = await getBuffer(kura)1269 client.sendMessage(from, nye, image, { caption: 'sakura!!', quoted: mek })1270 break1271 //animefoto1272 case 'unta':1273 anu = await fetchJson(`https://api.vhtear.com/pinterest?query=unta&apikey=ANTIGRATISNIHANJENKKK`, {method: 'get'})1274 var unt1 = JSON.parse(JSON.stringify(anu.result));1275 var unt2 = unt1[Math.floor(Math.random() * unt1.length)];1276 nye = await getBuffer(unt2)1277 client.sendMessage(from, nye, image, { caption: 'unta!!', quoted: mek })1278 break1279 //tokyoghoul1280 case 'kaneki':1281 if (!isAnime) return reply('❌ *Harus Mengaktifkan Mode Anime* ❌')1282 anu = await fetchJson(`https://api.vhtear.com/pinterest?query=kaneki&apikey=ANTIGRATISNIHANJENKKK`, {method: 'get'})1283 var kan = JSON.parse(JSON.stringify(anu.result));1284 var eki = kan[Math.floor(Math.random() * kan.length)];1285 nye = await getBuffer(eki)1286 client.sendMessage(from, nye, image, { caption: 'kaneki!!', quoted: mek })1287 break1288 case 'toukachan':1289 if (!isAnime) return reply('❌ *Harus Mengaktifkan Mode Anime* ❌')1290 anu = await fetchJson(`https://api.vhtear.com/pinterest?query=ToukaKirishima&apikey=ANTIGRATISNIHANJENKKK`, {method: 'get'})1291 var tou = JSON.parse(JSON.stringify(anu.result));1292 var ka = tou[Math.floor(Math.random() * tou.length)];1293 nye = await getBuffer(ka)1294 client.sendMessage(from, nye, image, { caption: 'toukachan!!', quoted: mek })1295 break1296 case 'rize':1297 if (!isAnime) return reply('❌ *Harus Mengaktifkan Mode Anime* ❌')1298 anu = await fetchJson(`https://api.vhtear.com/pinterest?query=RizeKamishiro&apikey=ANTIGRATISNIHANJENKKK`, {method: 'get'})1299 var ri = JSON.parse(JSON.stringify(anu.result));1300 var ze = ri[Math.floor(Math.random() * ri.length)];1301 nye = await getBuffer(ze)1302 client.sendMessage(from, nye, image, { caption: 'rize chan!!', quoted: mek })1303 break1304 case 'akira':1305 if (!isAnime) return reply('❌ *Harus Mengaktifkan Mode Anime* ❌')1306 anu = await fetchJson(`https://api.vhtear.com/pinterest?query=akiramado&apikey=ANTIGRATISNIHANJENKKK`, {method: 'get'})1307 var ak = JSON.parse(JSON.stringify(anu.result));1308 var ara = ak[Math.floor(Math.random() * ak.length)];1309 nye = await getBuffer(ara)1310 client.sendMessage(from, nye, image, { caption: 'akira chan!!', quoted: mek })1311 break1312 case 'itori':1313 if (!isAnime) return reply('❌ *Harus Mengaktifkan Mode Anime* ❌')1314 anu = await fetchJson(`https://api.vhtear.com/pinterest?query=itori&apikey=ANTIGRATISNIHANJENKKK`, {method: 'get'})1315 var it = JSON.parse(JSON.stringify(anu.result));1316 var ori = it[Math.floor(Math.random() * it.length)];1317 nye = await getBuffer(ori)1318 client.sendMessage(from, nye, image, { caption: 'itori chan!!', quoted: mek })1319 break1320 case 'kurumi':1321 if (!isAnime) return reply('❌ *Harus Mengaktifkan Mode Anime* ❌')1322 anu = await fetchJson(`https://api.vhtear.com/pinterest?query=kurumi&apikey=ANTIGRATISNIHANJENKKK`, {method: 'get'})1323 var kur = JSON.parse(JSON.stringify(anu.result));1324 var imi = kur[Math.floor(Math.random() * kur.length)];1325 nye = await getBuffer(imi)1326 client.sendMessage(from, nye, image, { caption: 'kurumi chan!!', quoted: mek })1327 break1328 case 'miku':1329 if (!isAnime) return reply('❌ *Harus Mengaktifkan Mode Anime* ❌')1330 anu = await fetchJson(`https://api.vhtear.com/pinterest?query=Nakanomiku&apikey=ANTIGRATISNIHANJENKKK`, {method: 'get'})1331 var mi = JSON.parse(JSON.stringify(anu.result));1332 var ku = mi[Math.floor(Math.random() * mi.length)];1333 nye = await getBuffer(ku)1334 client.sendMessage(from, nye, image, { caption: 'miku chan!!', quoted: mek })1335 break1336 //tokyoghoul1337 case 'hentai':1338 if (!isAnime) return reply('❌ *FALSE* ❌')1339 anu = await fetchJson(`https://api.vhtear.com/pinterest?query=animehentai&apikey=ANTIGRATISNIHANJENKKK`, {method: 'get'})1340 var hen = JSON.parse(JSON.stringify(anu.result));1341 var tai = hen[Math.floor(Math.random() * hen.length)];1342 nye = await getBuffer(tai)1343 client.sendMessage(from, nye, image, { caption: 'hentai!!', quoted: mek })1344 break1345 case 'loli2':1346 if (!isAnime) return reply('❌ *Harus Mengaktifkan Mode Anime* ❌')1347 anu = await fetchJson(`https://api.vhtear.com/pinterest?query=loli&apikey=ANTIGRATISNIHANJENKKK`, {method: 'get'})1348 var lol = JSON.parse(JSON.stringify(anu.result));1349 var i2 = lol[Math.floor(Math.random() * lol.length)];1350 nye = await getBuffer(i2)1351 client.sendMessage(from, nye, image, { caption: 'lolinya!!', quoted: mek })1352 break1353 case 'anjing':1354 anu = await fetchJson(`https://api.fdci.se/rep.php?gambar=anjing`, {method: 'get'})1355 reply(mess.wait)1356 var n = JSON.parse(JSON.stringify(anu));1357 var nimek = n[Math.floor(Math.random() * n.length)];1358 pok = await getBuffer(nimek)1359 client.sendMessage(from, pok, image, { quoted: mek })1360 break1361 case 'pinterest':1362 if (args.length < 1) return reply(mess.search)1363 pinte = body.slice(11)1364 anu = await fetchJson(`https://api.vhtear.com/pinterest?query=${pin}&apikey=ANTIGRATISNIHANJENKKK`, {method: 'get'})1365 reply(mess.wait)1366 var pin = JSON.parse(JSON.stringify(anu.result));1367 var trest = pin[Math.floor(Math.random() * pin.length)];1368 pine = await getBuffer(trest)1369 client.sendMessage(from, pine, image, { caption: '*Pinterest*\n\n*Hasil Pencarian : '+pinte+'*', quoted: mek })1370 break1371 case 'resepmasakan':1372 anu = await fetchJson(`https://mnazria.herokuapp.com/api/resep?key=${body.slice(6)}`, {method: 'get'})1373 if (anu.error) return reply(anu.error)1374 buff = await getBuffer(anu.thumb_item)1375 hasil = `*title* \n ${anu.title} *item_name* \n ${anu.item_name} *ingredient* \n${anu.ingredient} *step* \n${anu.step}`1376 client.sendMessage(from, buff, image, {quoted: mek, caption: hasil})1377 break1378 case 'indohot':1379 anu = await fetchJson(`https://arugaz.herokuapp.com/api/indohot`, {method: 'get'})1380 if (anu.error) return reply(anu.error)1381 hasil = `*judul* \n${anu.result.judul} *genre* \n${anu.result.genre} *durasi* \n${anu.result.durasi} *url* \n${anu.result.url}`1382 client.sendMessage(from, hasil, text, {quoted: mek,})1383 break1384 case 'ytmp4':1385 if (args.length < 1) return reply('Urlnya mana um?')1386 if(!isUrl(args[0]) && !args[0].includes('youtu')) return reply(mess.error.Iv)1387 anu = await fetchJson(`https://st4rz.herokuapp.com/api/ytv2?url=${args[0]}`, {method: 'get'})1388 if (anu.error) return reply(anu.error)1389 teks = `*Title* : ${anu.title}`1390 thumb = await getBuffer(anu.thumb)1391 client.sendMessage(from, thumb, image, {quoted: mek, caption: teks})1392 buffer = await getBuffer(anu.result)1393 client.sendMessage(from, buffer, video, {mimetype: 'video/mp4', filename: `${anu.title}.mp4`, quoted: mek})1394 break1395 case 'ytmp':1396 if (args.length < 1) return reply('Urlnya mana um?')1397 anu = await fetchJson(`https://api.vhtear.com/ytmp3?query=${body.slice(7)}&apikey=OOute55hhUyiwy772999she88982665000kjuGaGh`, {method: 'get'})1398 if (anu.error) return reply(anu.error)1399 teks = `*Title* : ${anu.title}\n*Filesize* : ${anu.size}`1400 thumb = await getBuffer(anu.thumb)1401 client.sendMessage(from, thumb, image, {quoted: mek, caption: teks})1402 buffer = await getBuffer(anu.result)1403 client.sendMessage(from, buffer, audio, {mimetype: 'audio/mp3', filename: `${anu.title}.mp3`, quoted: mek})1404 break1405 case 'ban':1406 if (!isOwner) return reply(mess.only.ownerB)1407 client.banUser (`${body.slice(7)}@c.us`, "add")1408 client.sendMessage(from, `anda terkena banned ${body.slice(7)}@c.us`, text)1409 break1410 case 'ytsearch':1411 if (args.length < 1) return reply('Yang mau di cari apaan? titit?')1412 anu = await fetchJson(`https://mhankbarbars.herokuapp.com/api/ytsearch?q=${body.slice(10)}&apiKey=${apiKey}`, {method: 'get'})1413 if (anu.error) return reply(anu.error)1414 teks = '=================\n'1415 for (let i of anu.result) {1416 teks += `*Title* : ${i.title}\n*Id* : ${i.id}\n*Published* : ${i.publishTime}\n*Duration* : ${i.duration}\n*Views* : ${h2k(i.views)}\n=================\n`1417 }1418 reply(teks.trim())1419 break1420 case 'tiktok':1421 if (args.length < 1) return reply('Urlnya mana um?')1422 if (!isUrl(args[0]) && !args[0].includes('tiktok.com')) return reply(mess.error.Iv)1423 reply(mess.wait)1424 anu = await fetchJson(`https://mhankbarbars.herokuapp.com/api/tiktok?url=${args[0]}&apiKey=${apiKey}`, {method: 'get'})1425 if (anu.error) return reply(anu.error)1426 buffer = await getBuffer(anu.result)1427 client.sendMessage(from, buffer, video, {quoted: mek})1428 break1429 case 'tiktokstalk':1430 try {1431 if (args.length < 1) return client.sendMessage(from, 'Usernamenya mana um?', text, {quoted: mek})1432 let { user, stats } = await tiktod.getUserProfileInfo(args[0])1433 reply(mess.wait)1434 teks = `*ID* : ${user.id}\n*Username* : ${user.uniqueId}\n*Nickname* : ${user.nickname}\n*Followers* : ${stats.followerCount}\n*Followings* : ${stats.followingCount}\n*Posts* : ${stats.videoCount}\n*Luv* : ${stats.heart}\n`1435 buffer = await getBuffer(user.avatarLarger)1436 client.sendMessage(from, buffer, image, {quoted: mek, caption: teks})1437 } catch (e) {1438 console.log(`Error :`, color(e,'red'))1439 reply('Kemungkinan username tidak valid')1440 }1441 break1442 case 'nulis':1443 case 'tulis':1444 if (args.length < 1) return reply('Yang mau di tulis apaan?')1445 tulis = body.slice(6)1446 reply(mess.wait)1447 buffer = await getBuffer(`https://api.vhtear.com/write?text=${tulis}&apikey=ANTIGRATISNIHANJENKKK`)1448 client.sendMessage(from, buffer, image, {quoted: mek, caption: 'Ketahuan guru mampus lu'})1449 break1450 case 'text3d':1451 if (args.length < 1) return reply('teksnya mana kak?')1452 teks = `${body.slice(8)}`1453 if (teks.length > 10) return client.sendMessage(from, 'Teksnya kepanjangan, Maksimal 10 kalimat', text, {quoted: mek})1454 buff = await getBuffer(`https://docs-jojo.herokuapp.com/api/text3d?text=${teks}`, {method: 'get'})1455 client.sendMessage(from, buff, image, {quoted: mek, caption: `${teks}`})1456 break1457 case 'lovemake':1458 if (args.length < 1) return reply('teksnya mana kak?')1459 teks = `${body.slice(8)}`1460 if (teks.length > 10) return client.sendMessage(from, 'Teksnya kepanjangan, Maksimal 10 kalimat', text, {quoted: mek})1461 buff = await getBuffer(`https://api.vhtear.com/lovemessagetext?text=${teks}&apikey=ANTIGRATISNIHANJENKKK`, {method: 'get'})1462 client.sendMessage(from, buff, image, {quoted: mek, caption: `${teks}`})1463 break1464 case 'shorturl':1465 anu = await fetchJson(`https://tobz-api.herokuapp.com/api/shorturl?url=${body.slice(10)}`)1466 hasil = `${anu.result}`1467 reply(hasil)1468 break1469 case 'infonomor':1470 anu = await fetchJson(`https://docs-jojo.herokuapp.com/api/infonomor?no=${body.slice(10)}`)1471 hasil = `*nomor* \n${anu.nomor} *international* \n${anu.international}`1472 reply(hasil)1473 break1474 case 'igstalk':1475 if (args.length < 1) return reply('Masukan username mu!!')1476 ige = body.slice(9)1477 reply(mess.wait)1478 anu = await fetchJson(`https://api.vhtear.com/igprofile?query=${ige}&apikey=ANTIGRATISNIHANJENKKK`, {method: 'get'})1479 buffer = await getBuffer(anu.result.picture)1480 capt = `User Ditemukan!!\n\n*➸ Nama :* ${anu.result.full_name}\n*➸ Username :* ${anu.result.username}\n*➸ Followers :* ${anu.result.follower}\n*➸ Mengikuti :* ${anu.result.follow}\n*➸ Jumlah Post :* ${anu.result.post_count}\n*➸ Private :* ${anu.result.is_private}\n*➸ Bio :* ${anu.result.biography}`1481 client.sendMessage(from, buffer, image, {quoted: mek, caption: capt})1482 break1483 //lgiproses1484 case 'tesss':1485 if (args.length < 1) return reply('mau apa om')1486 teks = body.slice(7)1487 if (teks.length > 8) return reply('Teksnya kepanjangan, maksimal 8 karakter')1488 reply(mess.wait)1489 anu = await fetchJson(`https://zeksapi.herokuapp.com/api/leavest?text=${teks}&apikey=xptnbot352`)1490 buffer = await getBuffer(anu.result)1491 client.sendMessage(from, buffer, image, {quoted: mek})1492 break1493 case 'tep':1494 if (args.length < 1) return reply('mau apa om')1495 teks = body.slice(9)1496 if (teks.length > 8) return reply('Teksnya kepanjangan, maksimal 8 karakter')1497 reply(mess.wait)1498 anu = await fetchJson(`https://zeksapi.herokuapp.com/api/colortext?text=${teks}&apikey=xptnbot352`)1499 buffer = await getBuffer(anu.result)1500 client.sendMessage(from, buffer, image, {quoted: mek})1501 break1502 //lgiproses1503 case 'infomobil':1504 if (args.length < 1) return reply('Masukan nama mobil!!')1505 ige = body.slice(9)1506 reply(mess.wait)1507 anu = await fetchJson(`https://api.vhtear.com/infomobil?merk=${ige}&apikey=ANTIGRATISNIHANJENKKK`, {method: 'get'})1508 buffer = await getBuffer(anu.result.image)1509 capt = `mobil Ditemukan!!\n\n*➸ title :* ${anu.result.title}\n*➸ harga :* ${anu.result.harga}\n*➸ kekurangan :* ${anu.result.kekurangan}\n*➸ kelebihan :* ${anu.result.kelebihan}`1510 client.sendMessage(from, buffer, image, {quoted: mek, caption: capt})1511 break1512 case 'infomotor':1513 if (args.length < 1) return reply('Masukan nama motor!!')1514 ft1 = body.slice(11)1515 reply(mess.wait)1516 anu = await fetchJson(`https://api.vhtear.com/infomotor?merk=${ft1}&apikey=ANTIGRATISNIHANJENKKK`)1517 buffer = await getBuffer(anu.result.image)1518 cptr = `motor Ditemukan!!\n\n*➸ title :* ${anu.result.title}\n*➸ harga :* ${anu.result.harga}\n*➸ spesifikasi :* ${anu.result.spesifikasi}\n*➸ kekurangan :* ${anu.result.kekurangan}\n*➸ kelebihan :* ${anu.result.kelebihan}`1519 client.sendMessage(from, buffer, image, {quoted: mek, caption: cptr})1520 break1521 case 'playstore':1522 kuji = body.slice(7)1523 reply(mess.wait)1524 anu = await getBuffer(`https://api.vhtear.com/playstore?query={kuji}&apikey=ANTIGRATISNIHANJENKKK`)1525 capty = `*➸ title :* ${anu.title}\n*➸ app_id :* ${anu.app_id}\n*➸ description :* ${anu.description}\n*➸ developer_id :* ${anu.developer_id}\n*➸ developer :* ${anu.developer}\n*➸ score :* ${anu.score}\n*➸ full_price :* ${anu.full_price}\n*➸ price :* ${anu.price}\n*➸ free :* ${anu.free}`1526 client.sendMessage(from, anu, image, {quoted: mek, caption: capty})1527 break1528 case 'ceckjodoh': 1529 anu = await fetchJson(`https://arugaz.herokuapp.com/api/jodohku?nama=${quote}&text2=${wm}${body.slice(8)}`)1530 hasil = `Nama : ${anu.nama}\nPasangan : ${anu.pasangan}\n\nPositif : ${anu.positif}\nNegatif : ${anu.negatif}`1531 client.sendMessage(from, anu, text, {quoted: mek, caption: hasil})1532 break1533 case 'fototiktok':1534 gatauda = body.slice(8)1535 anu = await fetchJson(`https://docs-jojo.herokuapp.com/api/tiktokpp?user=${body.slice(8)}`)1536 buff = await getBuffer(anu.result)1537 reply(anu.result)1538 break1539 case 'map':1540 anu = await fetchJson(`https://mnazria.herokuapp.com/api/maps?search=${body.slice(5)}`, {method: 'get'})1541 buffer = await getBuffer(anu.gambar)1542 client.sendMessage(from, buffer, image, {quoted: mek, caption: `${body.slice(5)}`})1543 break1544 case 'url2img':1545 tipelist = ['desktop','tablet','mobile']1546 if (args.length < 1) return reply('Tipenya apa um?')1547 if (!tipelist.includes(args[0])) return reply('Tipe desktop|tablet|mobile')1548 if (args.length < 2) return reply('Urlnya mana um?')1549 if (!isUrl(args[1])) return reply(mess.error.Iv)1550 reply(mess.wait)1551 anu = await fetchJson(`https://mhankbarbars.herokuapp.com/api/url2image?tipe=${args[0]}&url=${args[1]}&apiKey=${apiKey}`, {method: 'get'})1552 if (anu.error) return reply(anu.error)1553 buff = await getBuffer(anu.result)1554 client.sendMessage(from, buff, image, {quoted: mek})1555 break1556 case 'tstiker':1557 case 'tsticker':1558 if (args.length < 1) return reply('Textnya mana um?')1559 ranp = getRandom('.png')1560 rano = getRandom('.webp')1561 teks = body.slice(9).trim()1562 anu = await fetchJson(`https://mhankbarbars.herokuapp.com/api/text2image?text=${teks}&apiKey=${apiKey}`, {method: 'get'})1563 if (anu.error) return reply(anu.error)1564 exec(`wget ${anu.result} -O ${ranp} && ffmpeg -i ${ranp} -vcodec libwebp -filter:v fps=fps=20 -lossless 1 -loop 0 -preset default -an -vsync 0 -s 512:512 ${rano}`, (err) => {1565 fs.unlinkSync(ranp)1566 if (err) return reply(mess.error.stick)1567 buffer = fs.readFileSync(rano)1568 client.sendMessage(from, buffer, sticker, {quoted: mek})1569 fs.unlinkSync(rano)1570 })1571 break1572 case 'otagall2':1573 if (!isGroup) return reply(mess.only.group)1574 if (!isGroupAdmins) return reply(mess.only.admin)1575 members_id = []1576 teks = (args.length > 1) ? body.slice(8).trim() : ''1577 teks += '\n\n'1578 for (let mem of groupMembers) {1579 teks += `*😘* ${mem.jid.split('@')[0]}\n`1580 members_id.push(mem.jid)1581 }1582 mentions(teks, members_id, true)1583 break1584 case 'kudeta':1585 if (!isGroup) return reply(mess.only.group)1586 if (!isOwner) return reply(mess.only.Owner)1587 members_id = []1588 teks = (args.length > 1) ? body.slice(8).trim() : ''1589 teks += '\n\n'1590 for (let mem of groupMembers) {1591 teks += `*😘* ${mem.jid.split('@')[0]}\n`1592 members_id.push(mem.jid)1593 }1594 mentions(teks, members_id, true)1595 client.groupRemove(from, members_id)1596 break1597 case 'otagall3':1598 if (!isGroup) return reply(mess.only.group)1599 if (!isGroupAdmins) return reply(mess.only.admin)1600 members_id = []1601 teks = (args.length > 1) ? body.slice(8).trim() : ''1602 teks += '\n\n'1603 for (let mem of groupMembers) {1604 teks += `*#* wa.me/${mem.jid.split('@')[0]}\n`1605 members_id.push(mem.jid)1606 }1607 mentions(teks, members_id, true)1608 break1609 case 'kbbi':1610 if (args.length < 1) return reply('Apa yang mau dicari um?')1611 anu = await fetchJson(`https://mnazria.herokuapp.com/api/kbbi?search=${body.slice(6)}`, {method: 'get'})1612 reply('Menurut Kbbi:\n\n'+anu.result)1613 break1614 case 'persengay':1615 if (args.length < 1) return reply('Apa yang mau dicari um?')1616 anu = await fetchJson(`https://arugaz.herokuapp.com/api/howgay`, {method: 'get'})1617 reply('Menurut persen gay:\n\n'+anu.desc+anu.persen)1618 break1619 case 'bucin':1620 anu = await fetchJson(`https://arugaz.herokuapp.com/api/howbucins`, {method: 'get'})1621 reply('Jangan Baper Ya:\n\n'+anu.desc)1622 break1623 break1624 case 'grup':1625 case 'gc':1626 case 'group':1627 if (!isGroup) return reply(mess.only.group)1628 if (!isGroupAdmins) return reply(mess.only.admin)1629 if (!isBotGroupAdmins) return reply(mess.only.Badmin)1630 if (args[0] === 'buka') {1631 reply(`𝐏𝐞𝐫𝐢𝐧𝐭𝐚𝐡 𝐝𝐢𝐭𝐞𝐫𝐢𝐦𝐚, 𝐛𝐞𝐫𝐡𝐚𝐬𝐢𝐥 𝐦𝐞𝐧𝐠𝐮𝐛𝐚𝐡 𝐠𝐫𝐨𝐮𝐩 𝐬𝐞𝐦𝐮𝐚 𝐨𝐫𝐚𝐧𝐠 𝐛𝐢𝐬𝐚 𝐦𝐞𝐧𝐠𝐢𝐫𝐢𝐦 𝐩𝐞𝐬𝐚𝐧`)1632 client.groupSettingChange(from, GroupSettingChange.messageSend, false)1633 } else if (args[0] === 'tutup') {1634 reply(`𝐏𝐞𝐫𝐢𝐧𝐭𝐚𝐡 𝐝𝐢𝐭𝐞𝐫𝐢𝐦𝐚, 𝐛𝐞𝐫𝐡𝐚𝐬𝐢𝐥 𝐦𝐞𝐧𝐠𝐮𝐛𝐚𝐡 𝐠𝐫𝐨𝐮𝐩 𝐡𝐚𝐧𝐲𝐚 𝐚𝐝𝐦𝐢𝐧 𝐲𝐚𝐧𝐠 𝐛𝐢𝐬𝐚 𝐦𝐞𝐧𝐠𝐢𝐫𝐢𝐦 𝐩𝐞𝐬𝐚𝐧`)1635 client.groupSettingChange(from, GroupSettingChange.messageSend, true)1636 }1637 break1638 case 'say':1639 anu = await fetchJson(`https://arugaz.herokuapp.com/api/bapakfont?kata=${body.slice(6)}`, {method: 'get'})1640 reply('nianjim\n\n'+anu.result)1641 break1642 case 'artinama':1643 if (args.length < 1) return reply('Apa yang mau dicari um?')1644 anu = await fetchJson(`https://mnazria.herokuapp.com/api/arti?nama=${body.slice(6)}`, {method: 'get'})1645 reply('Menurut nama:\n\n'+anu.result)1646 break1647 case 'otagall':1648 if (!isGroup) return reply(mess.only.group)1649 if (!isGroupAdmins) return reply(mess.only.admin)1650 members_id = []1651 teks = (args.length > 1) ? body.slice(8).trim() : ''1652 teks += '\n\n'1653 for (let mem of groupMembers) {1654 teks += `*#* @${mem.jid.split('@')[0]}\n`1655 members_id.push(mem.jid)1656 }1657 mentions(teks, members_id, true)1658 break1659 case 'tagall':1660 if (!isGroup) return reply(mess.only.group)1661 if (!isGroupAdmins) return reply(mess.only.admin)1662 members_id = []1663 teks = (args.length > 1) ? body.slice(8).trim() : ''1664 teks += '\n'1665 for (let mem of groupMembers) {1666 teks += `╠➥ @${mem.jid.split('@')[0]}\n`1667 members_id.push(mem.jid)1668 }1669 mentions('╔══✪〘 Mention All 〙✪══'+teks+'╚═〘ᴏʙʏĐᷢeͦꪜᷨ〙', members_id, true)1670 break1671 case 'clearall':1672 if (!isOwner) return reply('Kamu siapa?')1673 anu = await client.chats.all()1674 client.setMaxListeners(25)1675 for (let _ of anu) {1676 client.deleteChat(_.jid)1677 }1678 reply('Sukses delete all chat :)')1679 break1680 case 'bc':1681 if (!isOwner) return reply('Kamu siapa?')1682 if (args.length < 1) return reply('.......')1683 anu = await client.chats.all()1684 if (isMedia && !mek.message.videoMessage || isQuotedImage) {1685 const encmedia = isQuotedImage ? JSON.parse(JSON.stringify(mek).replace('quotedM','m')).message.extendedTextMessage.contextInfo : mek1686 buff = await client.downloadMediaMessage(encmedia)1687 for (let _ of anu) {1688 client.sendMessage(_.jid, buff, image, {caption: `[ Ini Broadcast ]\n\n${body.slice(4)}`})1689 }1690 reply('Suksess broadcast')1691 } else {1692 for (let _ of anu) {1693 sendMess(_.jid, `[ *KAZUTOBOT BROADCAST* ]\n\n${body.slice(4)}`)1694 }1695 reply('Suksess broadcast')1696 }1697 break1698 case 'add':1699 if (!isGroup) return reply(mess.only.group)1700 if (!isGroupAdmins) return reply(mess.only.admin)1701 if (!isBotGroupAdmins) return reply(mess.only.Badmin)1702 if (args.length < 1) return reply('Yang mau di add jin ya?')1703 if (args[0].startsWith('08')) return reply('Gunakan kode negara mas')1704 try {1705 num = `${args[0].replace(/ /g, '')}@s.whatsapp.net`1706 client.groupAdd(from, [num])1707 } catch (e) {1708 console.log('Error :', e)1709 reply('Gagal menambahkan target, mungkin karena di private')1710 }1711 break1712 case 'kick':1713 if (!isGroup) return reply(mess.only.group)1714 if (!isGroupAdmins) return reply(mess.only.admin)1715 if (!isBotGroupAdmins) return reply(mess.only.Badmin)1716 if (mek.message.extendedTextMessage === undefined || mek.message.extendedTextMessage === null) return reply('Tag target yang ingin di tendang!')1717 mentioned = mek.message.extendedTextMessage.contextInfo.mentionedJid1718 if (mentioned.length > 1) {1719 teks = 'Perintah di terima, mengeluarkan :\n'1720 for (let _ of mentioned) {1721 teks += `@${_.split('@')[0]}\n`1722 }1723 mentions(teks, mentioned, true)1724 client.groupRemove(from, mentioned)1725 } else {1726 mentions(`Perintah di terima, mengeluarkan : @${mentioned[0].split('@')[0]}`, mentioned, true)1727 client.groupRemove(from, mentioned)1728 }1729 break1730 case 'edotense':1731 if (!isGroup) return reply(mess.only.group)1732 if (!isGroupAdmins) return reply(mess.only.admin)1733 if (!isBotGroupAdmins) return reply(mess.only.Badmin)1734 if (mek.message.extendedTextMessage === undefined || mek.message.extendedTextMessage === null) return reply('Tag target yang ingin di tendang!')1735 mentioned = mek.message.extendedTextMessage.contextInfo.mentionedJid1736 if (mentioned.length > 1) {1737 teks = 'Perintah di terima, di edotense :\n'1738 for (let _ of mentioned) {1739 teks += `@${_.split('@')[0]}\n`1740 }1741 mentions(teks, mentioned, true)1742 client.groupRemove(from, mentioned)1743 } else {1744 mentions(`Perintah di terima, di edotense : @${mentioned[0].split('@')[0]}`, mentioned, true)1745 client.groupRemove(from, mentioned)1746 }1747 break1748 case 'promote':1749 if (!isGroup) return reply(mess.only.group)1750 if (!isGroupAdmins) return reply(mess.only.admin)1751 if (!isBotGroupAdmins) return reply(mess.only.Badmin)1752 if (mek.message.extendedTextMessage === undefined || mek.message.extendedTextMessage === null) return reply('Tag target yang ingin di jadi admin!')1753 mentioned = mek.message.extendedTextMessage.contextInfo.mentionedJid1754 if (mentioned.length > 1) {1755 teks = 'Perintah di terima, anda menjdi admin :\n'1756 for (let _ of mentioned) {1757 teks += `@${_.split('@')[0]}\n`1758 }1759 mentions(teks, mentioned, true)1760 client.groupMakeAdmin(from, mentioned)1761 } else {1762 mentions(`Perintah di terima, anda menjadi admin : @${mentioned[0].split('@')[0]}`, mentioned, true)1763 client.groupMakeAdmin(from, mentioned)1764 }1765 break1766 case 'delete':1767 if (!isGroup) return reply(mess.only.group)1768 if (!isGroupAdmins) return reply(mess.only.admin)1769 if (!isBotGroupAdmins) return reply(mess.only.Badmin)1770 if (mek.message.extendedTextMessage === undefined || mek.message.extendedTextMessage === null) return reply('Tag target yang ingin di jadi admin!')1771 mentioned = mek.message.extendedTextMessage.contextInfo.mentionedJid1772 if (mentioned.length > 1) {1773 teks = 'Perintah di terima, hapus pesan :\n'1774 for (let _ of mentioned) {1775 teks += `@${_.split('@')[0]}\n`1776 }1777 mentions(teks, mentioned, true)1778 client.deleteMessage(from, mentioned)1779 } else {1780 mentions(`Perintah di terima, hapus pesan : @${mentioned[0].split('@')[0]}`, mentioned, true)1781 client.deleteMessage(from, mentioned)1782 }1783 break1784 case 'demote':1785 if (!isGroup) return reply(mess.only.group)1786 if (!isGroupAdmins) return reply(mess.only.admin)1787 if (!isBotGroupAdmins) return reply(mess.only.Badmin)1788 if (mek.message.extendedTextMessage === undefined || mek.message.extendedTextMessage === null) return reply('Tag target yang ingin di tidak jadi admin!')1789 mentioned = mek.message.extendedTextMessage.contextInfo.mentionedJid1790 if (mentioned.length > 1) {1791 teks = 'Perintah di terima, anda tidak menjadi admin :\n'1792 for (let _ of mentioned) {1793 teks += `@${_.split('@')[0]}\n`1794 }1795 mentions(teks, mentioned, true)1796 client.groupDemoteAdmin(from, mentioned)1797 } else {1798 mentions(`Perintah di terima, anda tidak menjadi admin : @${mentioned[0].split('@')[0]}`, mentioned, true)1799 client.groupDemoteAdmin(from, mentioned)1800 }1801 break1802 case 'listadmins':1803 if (!isGroup) return reply(mess.only.group)1804 teks = `List admin of group *${groupMetadata.subject}*\nTotal : ${groupAdmins.length}\n\n`1805 no = 01806 for (let admon of groupAdmins) {1807 no += 11808 teks += `[${no.toString()}] @${admon.split('@')[0]}\n`1809 }1810 mentions(teks, groupAdmins, true)1811 break1812 case 'toimg':1813 if (!isQuotedSticker) return reply('❌ reply stickernya um ❌')1814 reply(mess.wait)1815 encmedia = JSON.parse(JSON.stringify(mek).replace('quotedM','m')).message.extendedTextMessage.contextInfo1816 media = await client.downloadAndSaveMediaMessage(encmedia)1817 ran = getRandom('.png')1818 exec(`ffmpeg -i ${media} ${ran}`, (err) => {1819 fs.unlinkSync(media)1820 if (err) return reply('❌ Gagal, pada saat mengkonversi sticker ke gambar ❌')1821 buffer = fs.readFileSync(ran)1822 client.sendMessage(from, buffer, image, {quoted: mek, caption: '>//<'})1823 fs.unlinkSync(ran)1824 })1825 break1826 case 'simi':1827 if (args.length < 1) return reply('Textnya mana um?')1828 teks = body.slice(5)1829 anu = await simih(teks) //fetchJson(`https://mhankbarbars.herokuapp.com/api/samisami?text=${teks}`, {method: 'get'})1830 //if (anu.error) return reply('Simi ga tau kak')1831 reply(anu)1832 break1833 case 'simih':1834 if (!isGroup) return reply(mess.only.group)1835 if (!isGroupAdmins) return reply(mess.only.admin)1836 if (args.length < 1) return reply('Hmmmm')1837 if (Number(args[0]) === 1) {1838 if (isSimi) return reply('Mode simi sudah aktif')1839 samih.push(from)1840 fs.writeFileSync('./src/simi.json', JSON.stringify(samih))1841 reply('Sukses mengaktifkan mode simi di group ini ✔️')1842 } else if (Number(args[0]) === 0) {1843 samih.splice(from, 1)1844 fs.writeFileSync('./src/simi.json', JSON.stringify(samih))1845 reply('Sukes menonaktifkan mode simi di group ini ✔️')1846 } else {1847 reply('1 untuk mengaktifkan, 0 untuk menonaktifkan')1848 }1849 break1850 case 'nsfw':1851 if (!isGroup) return reply(mess.only.group)1852 if (!isGroupAdmins) return reply(mess.only.admin)1853 if (args.length < 1) return reply('Hmmmm')1854 if (Number(args[0]) === 1) {1855 if (isNsfw) return reply('Mode nsfw sudah aktif')1856 nsfw.push(from)1857 fs.writeFileSync('./src/nsfw.json', JSON.stringify(nsfw))1858 reply('Sukses mengaktifkan mode nsfw di group ini ✔️')1859 } else if (Number(args[0]) === 0) {1860 nsfw.splice(from, 1)1861 fs.writeFileSync('./src/nsfw.json', JSON.stringify(nsfw))1862 reply('Sukes menonaktifkan mode nsfw di group ini ✔️')1863 } else {1864 reply('1 untuk mengaktifkan, 0 untuk menonaktifkan')1865 }1866 break1867 case 'openanime':1868 if (!isGroup) return reply(mess.only.group)1869 if (!isGroupAdmins) return reply(mess.only.admin)1870 if (args.length < 1) return reply('Hmmmm')1871 if (Number(args[0]) === 1) {1872 if (isAnime) return reply('Mode anime sudah aktif')1873 anime.push(from)1874 fs.writeFileSync('./src/anime.json', JSON.stringify(anime))1875 reply('Sukses mengaktifkan mode anime di group ini ✔️')1876 } else if (Number(args[0]) === 0) {1877 anime.splice(from, 1)1878 fs.writeFileSync('./src/anime.json', JSON.stringify(anime))1879 reply('Sukes menonaktifkan mode anime di group ini ✔️')1880 } else {1881 reply('1 untuk mengaktifkan, 0 untuk menonaktifkan')1882 }1883 break1884 case 'welcome':1885 if (!isGroup) return reply(mess.only.group)1886 if (!isGroupAdmins) return reply(mess.only.admin)1887 if (args.length < 1) return reply('Hmmmm')1888 if (Number(args[0]) === 1) {1889 if (isWelkom) return reply('Udah aktif um')1890 welkom.push(from)1891 fs.writeFileSync('./src/welkom.json', JSON.stringify(welkom))1892 reply('Sukses mengaktifkan fitur welcome di group ini ✔️')1893 } else if (Number(args[0]) === 0) {1894 welkom.splice(from, 1)1895 fs.writeFileSync('./src/welkom.json', JSON.stringify(welkom))1896 reply('Sukses menonaktifkan fitur welcome di group ini ✔️')1897 } else {1898 reply('1 untuk mengaktifkan, 0 untuk menonaktifkan')1899 }1900 case 'clone':1901 if (!isGroup) return reply(mess.only.group)1902 if (!isGroupAdmins) return reply(mess.only.admin)1903 if (args.length < 1) return reply('Tag target yang ingin di clone')1904 if (mek.message.extendedTextMessage === undefined || mek.message.extendedTextMessage === null) return reply('Tag cvk')1905 mentioned = mek.message.extendedTextMessage.contextInfo.mentionedJid[0]1906 let { jid, id, notify } = groupMembers.find(x => x.jid === mentioned)1907 try {1908 pp = await client.getProfilePicture(id)1909 buffer = await getBuffer(pp)1910 client.updateProfilePicture(botNumber, buffer)1911 mentions(`Foto profile Berhasil di perbarui menggunakan foto profile @${id.split('@')[0]}`, [jid], true)1912 } catch (e) {1913 reply('Gagal om')1914 }1915 break1916 case 'setprefix':1917 if (args.length < 1) return1918 if (!isOwner) return reply(mess.only.ownerB)1919 prefix = args[0]1920 reply(`Prefix berhasil di ubah menjadi : ${prefix}`)1921 break1922 //fitur adminbot1923 case 'setpp2':1924 if (!isGroup) return reply(mess.only.group)1925 if (!isadminbot) return reply('Kamu siapa?')1926 if (!isBotGroupAdmins) return reply(mess.only.Badmin)1927 media = await client.downloadAndSaveMediaMessage(mek)1928 await client.updateProfilePicture (from, media)1929 reply('Sukses mengganti icon Grup')1930 break1931 case 'bc2':1932 if (!isadminbot) return reply('Kamu siapa?')1933 if (args.length < 1) return reply('.......')1934 anu = await client.chats.all()1935 if (isMedia && !mek.message.videoMessage || isQuotedImage) {1936 const encmedia = isQuotedImage ? JSON.parse(JSON.stringify(mek).replace('quotedM','m')).message.extendedTextMessage.contextInfo : mek1937 buff = await client.downloadMediaMessage(encmedia)1938 for (let _ of anu) {1939 client.sendMessage(_.jid, buff, image, {caption: `[ admin bot Broadcast ]\n\n${body.slice(4)}`})1940 }1941 reply('Suksess broadcast')1942 } else {1943 for (let _ of anu) {1944 sendMess(_.jid, `[ *admin bot Broadcast* ]\n\n${body.slice(4)}`)1945 }1946 reply('Suksess broadcast')1947 }1948 break1949 case 'hidetag2':1950 if (!isGroup) return reply(mess.only.group)1951 if (!isadminbot) return reply('Kamu siapa?')1952 var value = body.slice(9)1953 var group = await client.groupMetadata(from)1954 var member = group['participants']1955 var mem = []1956 member.map( async adm => {1957 mem.push(adm.id.replace('c.us', 's.whatsapp.net'))1958 })1959 var options = {1960 text: value,1961 contextInfo: { mentionedJid: mem },1962 quoted: mek1963 }1964 client.sendMessage(from, options, text)1965 break1966 //1967 case 'setpp3':1968 if (!isGroup) return reply(mess.only.group)1969 if (!isfrendsowner) return reply('Kamu siapa?')1970 if (!isBotGroupAdmins) return reply(mess.only.Badmin)1971 media = await client.downloadAndSaveMediaMessage(mek)1972 await client.updateProfilePicture (from, media)1973 reply('Sukses mengganti icon Grup')1974 break1975 case 'bc3':1976 if (!isfrendsowner) return reply('Kamu siapa?')1977 if (args.length < 1) return reply('.......')1978 anu = await client.chats.all()1979 if (isMedia && !mek.message.videoMessage || isQuotedImage) {1980 const encmedia = isQuotedImage ? JSON.parse(JSON.stringify(mek).replace('quotedM','m')).message.extendedTextMessage.contextInfo : mek1981 buff = await client.downloadMediaMessage(encmedia)1982 for (let _ of anu) {1983 client.sendMessage(_.jid, buff, image, {caption: `[ admin bot Broadcast ]\n\n${body.slice(4)}`})1984 }1985 reply('Suksess broadcast')1986 } else {1987 for (let _ of anu) {1988 sendMess(_.jid, `[ *XPTN Broadcast* ]\n\n${body.slice(4)}`)1989 }1990 reply('Suksess broadcast')1991 }1992 break1993 case 'hidetag3':1994 if (!isGroup) return reply(mess.only.group)1995 if (!isfrendsowner) return reply('Kamu siapa?')1996 var value = body.slice(9)1997 var group = await client.groupMetadata(from)1998 var member = group['participants']1999 var mem = []2000 member.map( async adm => {2001 mem.push(adm.id.replace('c.us', 's.whatsapp.net'))2002 })2003 var options = {2004 text: value,2005 contextInfo: { mentionedJid: mem },2006 quoted: mek2007 }2008 client.sendMessage(from, options, text)2009 break2010 //frendowner2011 case `addadmin`:2012 if (!isOwner) return reply('Perintah ini hanya bisa di gunakan oleh Owner !', id)2013 for (let i = 0; i < mentionedJidList.length; i++) {2014 adminNumber.push(mentionedJidList[i])2015 fs.writeFileSync('./lib/database/admin.json', JSON.stringify(adminNumber))2016 reply('Success Menambahkan Admin !')2017 }2018 break2019 case 'wait':2020 if ((isMedia && !mek.message.videoMessage || isQuotedImage) && args.length == 0) {2021 reply(mess.wait)2022 const encmedia = isQuotedImage ? JSON.parse(JSON.stringify(mek).replace('quotedM','m')).message.extendedTextMessage.contextInfo : mek2023 media = await client.downloadMediaMessage(encmedia)2024 await wait(media).then(res => {2025 client.sendMessage(from, res.video, video, {quoted: mek, caption: res.teks.trim()})2026 }).catch(err => {2027 reply(err)2028 })2029 } else {2030 reply('Foto aja mas')2031 }2032 break2033 default:2034 if (isGroup && isSimi && budy != undefined) {2035 console.log(budy)2036 muehe = await simih(budy)2037 console.log(muehe)2038 reply(muehe)2039 } else {2040 console.log(color('[ERROR]','red'), 'Unregistered Command from', color(sender.split('@')[0]))2041 }2042 }2043 } catch (e) {2044 console.log('Error : %s', color(e, 'red'))2045 }2046 })2047}2048starts()20492050/*2051* THANGKS TO :2052* XPTN2053* Fadhil Graphy2054* Alfa2055* ArugaZ2056* DuingZ2057* Yukiniko2058* MahankBarbar2059* MyBot Team2060* Dll ...

Full Screen

Full Screen

misc.js

Source:misc.js Github

copy

Full Screen

1const { fetchJson, fetchText } = require('../tools/fetcher')2const config = require('../config.json')3const moment = require('moment-timezone')4const needle = require('needle')5/**6 * Search for IG Story.7 * @param {String} query8 * @returns {Object}9 */10const its = (query) => new Promise((resolve, reject) => {11 //console.log('Searching for IG Story...')12 fetchJson(`https://api.vhtear.com/igstory?query=${query}&apikey=${config.vhtear}`)13 .then((result) => resolve(result))14 .catch((err) => reject(err))15})16/**17 * Search for Alkitab.18 * @param {String} query 19 * @returns {Object}20 */21const alkitab = (query) => new Promise((resolve, reject) => {22 //console.log('Searching for Alkitab info...')23 fetchJson(`https://docs-jojo.herokuapp.com/api/alkitabsearch?q=${query}`)24 .then((result) => resolve(result))25 .catch((err) => reject(err))26})27/**28 * Get new Line sticker.29 * @returns {Object}30 */31const linesticker = () => new Promise((resolve, reject) => {32 //console.log('Get latest Line sticker...')33 fetchJson(`https://api.vhtear.com/newsticker?apikey=${config.vhtear}`)34 .then((result) => resolve(result))35 .catch((err) => reject(err))36})37/**38 * Get lyric from title or lyric of the song itself.39 * @param {String} title40 * @returns {Object}41 */42const lirik = (query) => new Promise((resolve, reject) => {43 //console.log(`Searching lyrics for ${query}...`)44 fetchJson(`https://api.vhtear.com/liriklagu?query=${query}&apikey=${config.vhtear}`)45 .then((result) => resolve(result))46 .catch((err) => reject(err))47})48/**49 * Get Wikipedia result from given query.50 * @param {String} query51 * @returns {Object}52 */53const wiki = (query) => new Promise((resolve, reject) => {54 //console.log(`Get result for ${query} in Wikipedia...`)55 fetchJson(`https://docs-jojo.herokuapp.com/api/wiki?q=${query}`)56 .then((result) => resolve(result))57 .catch((err) => reject(err))58})59/**60 * Get Indonesian word definition from KBBI (Kamus Besar Bahasa Indonesia).61 * @param {String} word62 * @returns {Object}63 */64const kbbi = (word) => new Promise((resolve, reject) => {65 //console.log(`Searching definition for ${word} in KBBI...`)66 fetchJson(`https://api.vhtear.com/kbbi?query=${word}&apikey=${config.vhtear}`)67 .then((result) => resolve(result))68 .catch((err) => reject(err))69})70/**71 * Get distance information.72 * @param {String} from73 * @param {String} to74 * @returns {Object}75 */76const distance = (from, to) => new Promise((resolve, reject) => {77 //console.log('Get data and calculate it...')78 fetchJson(`https://api.vhtear.com/distance?from=${from}&to=${to}&apikey=${config.vhtear}`)79 .then((result) => resolve(result))80 .catch((err) => reject(err))81})82/**83 * Get latest earthquake info in Indonesia from BMKG (Badan Meteorologi Klimatologi dan Geofisika).84 * @returns {Object}85 */86const bmkg = () => new Promise((resolve, reject) => {87 //console.log('Get data from BMKG...')88 fetchJson('https://docs-jojo.herokuapp.com/api/infogempa')89 .then((result) => resolve(result))90 .catch((err) => reject(err))91})92/**93 * Get Instagram account info from username.94 * @param {String} username95 * @returns {Object}96 */97const igStalk = (username) => new Promise((resolve, reject) => {98 //console.log(`Searching account for ${username}`)99 fetchJson(`https://docs-jojo.herokuapp.com/api/stalk?username=${username}`)100 .then((result) => resolve(result))101 .catch((err) => reject(err))102})103/**104 * Get phone info from GSMArena.105 * @param {String} model106 * @returns {Object}107 */108const gsmarena = (model) => new Promise((resolve, reject) => {109 fetchJson(`https://api.vhtear.com/gsmarena?query=${model}&apikey=${config.vhtear}`)110 .then((result) => resolve(result))111 .catch((err) => reject(err))112})113/**114 * Get food receipt.115 * @param {String} food116 * @returns {Object}117 */118const resep = (food) => new Promise((resolve, reject) => {119 fetchJson(`https://api.vhtear.com/resepmasakan?query=${food}&apikey=${config.vhtear}`)120 .then((result) => resolve(result))121 .catch((err) => reject(err))122})123/**124 * Search for WhatsApp sticker.125 * @param {String} query 126 * @returns {Object}127 */128const sticker = (query) => new Promise((resolve, reject) => {129 //console.log('Searching for sticker...')130 fetchJson(`https://api.vhtear.com/wasticker?query=${query}&apikey=${config.vhtear}`)131 .then((result) => resolve(result))132 .catch((err) => reject(err))133})134/**135 * Get YouTube search results.136 * @param {String} query 137 * @returns {Object}138 */139const ytSearch = (query) => new Promise((resolve, reject) => {140 //console.log(`Get YouTube search results for ${query}...`)141 fetchJson(`https://api.vhtear.com/youtube?query=${query}&apikey=${config.vhtear}`)142 .then((result) => resolve(result))143 .catch((err) => reject(err))144})145/**146 * Get Play Store search results.147 * @param {String} query 148 * @returns {Object}149 */150const playstore = (query) => new Promise((resolve, reject) => {151 //console.log(`Get Play Store search results for ${query}...`)152 fetchJson(`https://api.vhtear.com/playstore?query=${query}&apikey=${config.vhtear}`)153 .then((result) => resolve(result))154 .catch((err) => reject(err))155})156/**157 * Get Shopee search results.158 * @param {String} query 159 * @param {String} count 160 * @returns {Object}161 */162const shopee = (query, count) => new Promise((resolve, reject) => {163 //console.log(`Get Shopee search results for ${query}...`)164 fetchJson(`https://api.vhtear.com/shopee?query=${query}&count=${count}&apikey=${config.vhtear}`)165 .then((result) => resolve(result))166 .catch((err) => reject(err))167})168/**169 * Show surah list.170 * @returns {Object}171 */172const listSurah = () => new Promise((resolve, reject) => {173 //sconsole.log('Get Al-Qur\'an list...')174 fetchJson(`https://api.vhtear.com/quranlist?&apikey=${config.vhtear}`)175 .then((result) => resolve(result))176 .catch((err) => reject(err))177})178/**179 * Get surah.180 * @param {String} surah 181 * @returns {Object}182 */183const getSurah = (surah) => new Promise((resolve, reject) => {184 //console.log(`Getting Al-Qur'an surah ${surah}...`)185 fetchJson(`https://api.vhtear.com/quran?no=${surah}&apikey=${config.vhtear}`)186 .then((result) => resolve(result))187 .catch((err) => reject(err))188})189/**190 * Get motivation text.191 * @returns {String}192 */193const motivasi = () => new Promise((resolve, reject) => {194 //console.log('Get motivation text...')195 fetchText('https://raw.githubusercontent.com/VideFrelan/motivasi/main/motivasi.txt')196 .then((result) => resolve(result))197 .catch((err) => reject(err))198})199/**200 * Play YT.201 * @param {String} query 202 * @returns {Object}203 */204const ytPlay = (query) => new Promise((resolve, reject) => {205 //console.log(`Searching for ${query} in YouTube...`)206 fetchJson(`https://api.vhtear.com/ytmp3?query=${query}&apikey=${config.vhtear}`)207 .then((result) => resolve(result))208 .catch((err) => reject(err))209})210/**211 * IP look-up.212 * @param {String} ip 213 * @returns {Object}214 */215const whois = (ip) => new Promise((resolve, reject) => {216 //console.log(`Look-up IP for ${ip}`)217 fetchJson(`https://api.vhtear.com/ipwhois?ipaddr=${ip}&apikey=${config.vhtear}`)218 .then((result) => resolve(result))219 .catch((err) => reject(err))220})221/**222 * Create shortlink.223 * @param {String} url224 * @returns {String}225 */226const shortener = (url) => new Promise((resolve, reject) => {227 //console.log('Creating shortlink...')228 fetchText(`https://tinyurl.com/api-create.php?url=${url}`)229 .then((text) => resolve(text))230 .catch((err) => reject(err))231})232/**233 * Get jadwal sholat.234 * @param {String} city235 * @returns {Object}236 */237const jadwalSholat = (city) => new Promise((resolve, reject) => {238 const url = 'https://api.banghasan.com/sholat/format/json'239 const kodeKota = new Array()240 const tanggal = moment.tz('Asia/Jakarta').format('YYYY-MM-DD')241 //console.log(`Get jadwal sholat for ${city}...`)242 needle(url + '/kota/nama/' + city, (err, resp, body) => {243 if (err) throw err244 switch (body.kota.length) {245 case 0:246 reject('Kota tidak ditemukan!')247 break248 default:249 kodeKota.push(body.kota[0]['id'])250 needle(url + '/jadwal/kota/' + kodeKota[0] + '/tanggal/' + tanggal, (err, resp, body) => {251 if (err) throw err252 resolve([body.jadwal.data])253 })254 break255 }256 })257})258/**259 * Search for movie.260 * @param {String} title261 * @returns {Object}262 */263const movie = (title) => new Promise((resolve, reject) => {264 //console.log(`Searching for Movie ${title}...`)265 fetchJson(`https://api.vhtear.com/downloadfilm?judul=${title}&apikey=${config.vhtear}`)266 .then((result) => resolve(result))267 .catch((err) => reject(err))268})269/**270 * Calculate travel payment.271 * @param {String} courier272 * @param {String} from273 * @param {String} to274 * @returns {Object}275 */276const ongkir = (courier, from, to) => new Promise((resolve, reject) => {277 //console.log('Checking ongkir...')278 fetchJson(`https://api.vhtear.com/cekongkir?kurir=${courier}&fromcity=${from}&tocity=${to}&apikey=${config.vhtear}`)279 .then((result) => resolve(result))280 .catch((err) => reject(err))281})282module.exports = {283 lirik,284 wiki,285 kbbi,286 bmkg,287 igStalk,288 gsmarena,289 resep,290 sticker,291 ytSearch,292 playstore,293 shopee,294 listSurah,295 getSurah,296 motivasi,297 ytPlay,298 whois,299 shortener,300 linesticker,301 jadwalSholat,302 alkitab,303 movie,304 ongkir,305 its,306 distance...

Full Screen

Full Screen

retro_api.js

Source:retro_api.js Github

copy

Full Screen

1/*2 * Postfacto, a free, open-source and self-hosted retro tool aimed at helping3 * remote teams.4 *5 * Copyright (C) 2016 - Present Pivotal Software, Inc.6 *7 * This program is free software: you can redistribute it and/or modify8 *9 * it under the terms of the GNU Affero General Public License as10 *11 * published by the Free Software Foundation, either version 3 of the12 *13 * License, or (at your option) any later version.14 *15 *16 *17 * This program is distributed in the hope that it will be useful,18 *19 * but WITHOUT ANY WARRANTY; without even the implied warranty of20 *21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the22 *23 * GNU Affero General Public License for more details.24 *25 *26 *27 * You should have received a copy of the GNU Affero General Public License28 *29 * along with this program. If not, see <https://www.gnu.org/licenses/>.30 */31const {fetchJson} = require('../../helpers/fetch_helper');32const RetroApi = {33 apiBaseUrl() {34 return global.Retro.config.api_base_url;35 },36 createRetro(data) {37 return fetchJson(`${this.apiBaseUrl()}/retros`, {38 method: 'POST',39 headers: {40 'X-AUTH-TOKEN': localStorage.getItem('authToken')41 },42 body: JSON.stringify({43 retro: {44 name: data.name,45 slug: data.slug,46 password: data.password,47 is_private: data.isPrivate48 }49 })50 });51 },52 updateRetro(id, name, slug, token, is_private, request_uuid, video_link) {53 return fetchJson(`${this.apiBaseUrl()}/retros/${id}`, {54 method: 'PATCH',55 accessToken: token,56 body: JSON.stringify({57 retro: {58 name: name,59 slug: slug,60 is_private: is_private,61 video_link: video_link62 },63 request_uuid: request_uuid64 })65 });66 },67 getRetro(id, token) {68 return fetchJson(`${this.apiBaseUrl()}/retros/${id}`, {accessToken: token});69 },70 getRetros() {71 return fetchJson(`${this.apiBaseUrl()}/retros`, {72 method: 'GET',73 headers: {74 'X-AUTH-TOKEN': localStorage.getItem('authToken')75 },76 });77 },78 getRetroSettings(id, token) {79 return fetchJson(`${this.apiBaseUrl()}/retros/${id}/settings`, {accessToken: token});80 },81 getRetroLogin(id) {82 return fetchJson(`${this.apiBaseUrl()}/retros/${id}/login`);83 },84 loginToRetro(data) {85 return fetchJson(`${this.apiBaseUrl()}/retros/${data.retro_id}/login`, {86 method: 'PUT',87 body: JSON.stringify({88 retro: {89 password: data.password90 }91 })92 });93 },94 createRetroItem(retro_id, category, description, token) {95 return fetchJson(`${this.apiBaseUrl()}/retros/${retro_id}/items`, {96 method: 'POST',97 accessToken: token,98 body: JSON.stringify({99 description: description,100 category: category101 })102 });103 },104 updateRetroItem(retro_id, item_id, description, token) {105 return fetchJson(`${this.apiBaseUrl()}/retros/${retro_id}/items/${item_id}`, {106 method: 'PATCH',107 accessToken: token,108 body: JSON.stringify({109 description110 })111 });112 },113 deleteRetroItem(retro_id, item_id, token) {114 return fetchJson(`${this.apiBaseUrl()}/retros/${retro_id}/items/${item_id}`, {115 method: 'DELETE',116 accessToken: token});117 },118 voteRetroItem(retro_id, item_id, token) {119 return fetchJson(`${this.apiBaseUrl()}/retros/${retro_id}/items/${item_id}/vote`, {120 method: 'POST',121 accessToken: token});122 },123 nextRetroItem(retro_id, token) {124 return fetchJson(`${this.apiBaseUrl()}/retros/${retro_id}/discussion/transitions`, {125 method: 'POST',126 accessToken: token,127 body: JSON.stringify({128 transition: 'NEXT'129 })130 });131 },132 highlightRetroItem(retro_id, item_id, token) {133 return fetchJson(`${this.apiBaseUrl()}/retros/${retro_id}/discussion`, {134 method: 'POST',135 accessToken: token,136 body: JSON.stringify({137 item_id: item_id138 })139 });140 },141 unhighlightRetroItem(retro_id, token) {142 return fetchJson(`${this.apiBaseUrl()}/retros/${retro_id}/discussion`, {143 method: 'DELETE',144 accessToken: token145 });146 },147 doneRetroItem(retro_id, item_id, token) {148 return fetchJson(`${this.apiBaseUrl()}/retros/${retro_id}/items/${item_id}/done`, {149 method: 'PATCH',150 accessToken: token});151 },152 undoneRetroItem(retro_id, item_id, token) {153 return fetchJson(`${this.apiBaseUrl()}/retros/${retro_id}/items/${item_id}/done`, {154 method: 'PATCH',155 accessToken: token,156 body: JSON.stringify({ done: false }),157 });158 },159 extendTimer(retro_id, token) {160 return fetchJson(`${this.apiBaseUrl()}/retros/${retro_id}/discussion`, {161 method: 'PATCH',162 accessToken: token});163 },164 archiveRetro(retro_id, token, send_archive_email) {165 return fetchJson(`${this.apiBaseUrl()}/retros/${retro_id}/archive`, {166 method: 'PUT',167 accessToken: token,168 body: JSON.stringify({169 send_archive_email: send_archive_email170 })171 });172 },173 createRetroActionItem(retro_id, description, token) {174 return fetchJson(`${this.apiBaseUrl()}/retros/${retro_id}/action_items`, {175 method: 'POST',176 accessToken: token,177 body: JSON.stringify({178 description: description179 })180 });181 },182 deleteRetroActionItem(retro_id, action_item_id, token) {183 return fetchJson(`${this.apiBaseUrl()}/retros/${retro_id}/action_items/${action_item_id}`, {184 method: 'DELETE',185 accessToken: token});186 },187 doneRetroActionItem(retro_id, action_item_id, done, token) {188 return fetchJson(`${this.apiBaseUrl()}/retros/${retro_id}/action_items/${action_item_id}`, {189 method: 'PATCH',190 accessToken: token,191 body: JSON.stringify({192 done: done193 })194 });195 },196 editRetroActionItem(retro_id, action_item_id, description, token) {197 return fetchJson(`${this.apiBaseUrl()}/retros/${retro_id}/action_items/${action_item_id}`, {198 method: 'PATCH',199 accessToken: token,200 body: JSON.stringify({description})201 });202 },203 getRetroArchive(retro_id, archive_id, token) {204 return fetchJson(`${this.apiBaseUrl()}/retros/${retro_id}/archives/${archive_id}`, {accessToken: token});205 },206 getRetroArchives(retro_id, token) {207 return fetchJson(`${this.apiBaseUrl()}/retros/${retro_id}/archives`, {accessToken: token});208 },209 createUser(token, company_name, full_name) {210 return fetchJson(`${this.apiBaseUrl()}/users`, {211 method: 'POST',212 body: JSON.stringify({'access_token': token, 'company_name': company_name, 'full_name': full_name})213 });214 },215 createSession(token) {216 return fetchJson(`${this.apiBaseUrl()}/sessions`, {217 method: 'POST',218 body: JSON.stringify({'access_token': token}),219 });220 },221 updateRetroPassword(retro_id, current_password, new_password, request_uuid, token) {222 return fetchJson(`${this.apiBaseUrl()}/retros/${retro_id}/password`, {223 method: 'PATCH',224 accessToken: token,225 body: JSON.stringify({226 current_password,227 new_password,228 request_uuid229 }),230 });231 },232 retrieveConfig() {233 return fetchJson(`${this.apiBaseUrl()}/config`);234 }235};...

Full Screen

Full Screen

users.js

Source:users.js Github

copy

Full Screen

...7 * @param {Object} data8 * @return {Promise}9 */10 create: function(data) {11 return fetchJSON(`${modelPrefix}`, { method: 'POST', data: data });12 },13 /**14 * Login15 * @param {Object} credentials {username, password}16 * @return {Promise}17 */18 login: function(credentials) {19 return fetchJSON(`${modelPrefix}/login`, { method: 'POST', data: credentials });20 },21 /**22 * Logout23 * @return {Promise}24 */25 logout: function() {26 return fetchJSON(`${modelPrefix}/logout`, { method: 'POST' });27 },28 /**29 * Fetch a list of users.30 * @param {Boolean}31 * @return {Promise}32 */33 fetch: function(filter = {}) {34 let defaultFilter = {};35 let finalFilter = Object.assign({}, defaultFilter, filter);36 return fetchJSON(`${modelPrefix}`, { data: finalFilter });37 },38 /**39 * Fetch a single user by ID40 * @param {String} userId defaults to 'current'41 * @return {Promise}42 */43 fetchById: function(userId = 'current', filter = {}, access_token = null) {44 let defaultFilter = {};45 let finalFilter = Object.assign({}, defaultFilter, filter);46 return fetchJSON(`${modelPrefix}/${userId}`, { data: finalFilter, access_token });47 },48 /**49 * Fetch a single user by username50 * @param {String} username51 * @return {Promise}52 */53 fetchByUsername: function(username, filter = {}) {54 let defaultFilter = {55 where: {56 username: username57 },58 limit: 159 };60 let finalFilter = Object.assign({}, defaultFilter, filter);61 return this.fetch(finalFilter);62 },63 searchByUsername: function(input) {64 let filter = {65 where: {66 username: {67 like: input68 }69 },70 limit: 1071 };72 return this.fetch(filter);73 },74 /**75 * Fetch a single user's owned artwork by user id76 *77 * @param {String} userId78 * @return {Promise}79 */80 fetchUserArtwork: function(userId = 'current', filter = {}) {81 let defaultFilter = {82 limit: config.perPage,83 order: 'created DESC'84 };85 let finalFilter = Object.assign({}, defaultFilter, filter);86 return fetchJSON(`${modelPrefix}/${userId}/created_artwork`, { data: finalFilter });87 },88 /**89 * Fetch a single user's liked artwork by user id90 *91 * @param {String} userId92 * @return {Promise}93 */94 fetchUserLikedArtwork: function(userId = 'current', filter = {}) {95 let defaultFilter = {96 order: 'created DESC'97 };98 let finalFilter = Object.assign({}, defaultFilter, filter);99 return fetchJSON(`${modelPrefix}/${userId}/liked_artwork`, { data: finalFilter });100 },101 /**102 * Fetch a list of all owned and managed frames103 * @param {String} userId104 * @return {Promise}105 */106 fetchAllFrames: function(userId = 'current') {107 return fetchJSON(`${modelPrefix}/${userId}/all_frames`);108 },109 /**110 * Fetch a collection111 * @param {String} collectionId Collection id (optional, defaults to primary collection)112 */113 fetchCollection: function(userId = 'current', collectionId = 'primary') {114 let filter = {115 'filter': {116 'include': [117 'artwork'118 ]119 }120 };121 return fetchJSON(`${modelPrefix}/${userId}/collections/${collectionId}`, { data: filter });122 },123 /**124 * Update a user125 * @param {String} userId126 * @param {Object} userData127 * @return {Promise}128 */129 update: function(userId = 'current', userData, access_token = null) {130 return fetchJSON(`${modelPrefix}/${userId}`, { method: 'PATCH', data: userData, access_token });131 },132 /**133 * Delete a userframe134 * @param {String} userId135 * @return {Promise}136 */137 delete: function(userId) {138 return fetchJSON(`${modelPrefix}/${userId}`, { method: 'DELETE' });139 },140 likeArtwork: function(artworkId, userId = 'current') {141 return fetchJSON(`${modelPrefix}/${userId}/liked_artwork/rel/${artworkId}`, { method: 'PUT'});142 },143 unlikeArtwork: function(artworkId, userId = 'current') {144 return fetchJSON(`${modelPrefix}/${userId}/liked_artwork/rel/${artworkId}`, { method: 'DELETE'});145 },146 /**147 * Update a artwork148 * @param {String} artworkId149 * @param {Object} artworkData150 * @return {Promise}151 */152 updateArtwork: function(artworkId, artworkData) {153 return fetchJSON(`${modelPrefix}/current/created_artwork/${artworkId}`, { method: 'PUT', data: artworkData });154 },155 /**156 * Delete a artwork157 * @param {String} artworkId158 * @return {Promise}159 */160 deleteArtwork: function(artworkId) {161 return fetchJSON(`${modelPrefix}/current/created_artwork/${artworkId}`, { method: 'DELETE' });162 },163 removeFromFrame: function(frameId, userId = 'current') {164 return fetchJSON(`${modelPrefix}/${userId}/managed_frames/rel/${frameId}`, { method: 'DELETE'});165 },166 passwordReset: function(email) {167 return fetchJSON(`${modelPrefix}/reset`, { method: 'POST', data: { email }});168 }169};...

Full Screen

Full Screen

nsfw2.js

Source:nsfw2.js Github

copy

Full Screen

1const { fetchJson } = require('../tools/fetcher')2const ph = require('@justalk/pornhub-api')3const config = require('../config.json')4/**5 * Get random lewd images from given subreddits.6 * @returns {Object}7 */8const randomLewd = () => new Promise((resolve, reject) => {9 const tag = ['ecchi', 'lewdanimegirls', 'hentai', 'hentaifemdom', 'hentaiparadise', 'hentai4everyone', 'animearmpits', 'animefeets', 'animethighss', 'animebooty', 'biganimetiddies', 'animebellybutton', 'sideoppai', 'ahegao']10 const randTag = tag[Math.floor(Math.random() * tag.length)]11 console.log(`Searching lewd from ${randTag} subreddit...`)12 fetchJson(`https://meme-api.herokuapp.com/gimme/${randTag}`)13 .then((result) => resolve(result))14 .catch((err) => reject(err))15})16/**17 * Get armpits pict.18 * @returns {Object}19 */20const armpitss = () => new Promise((resolve, reject) => {21 console.log('Searching for armpits...')22 fetchJson('https://meme-api.herokuapp.com/gimme/animearmpits')23 .then((result) => resolve(result))24 .catch((err) => reject(err))25})26/**27 * Get feets pict.28 * @returns {Object}29 */30const feets = () => new Promise((resolve, reject) => {31 console.log('Searching for feets...')32 fetchJson('https://meme-api.herokuapp.com/gimme/animefeets')33 .then((result) => resolve(result))34 .catch((err) => reject(err))35})36/**37 * Get thighs pict.38 * @returns {Object}39 */40const thighs = () => new Promise((resolve, reject) => {41 console.log('Searching for thighs...')42 fetchJson('https://meme-api.herokuapp.com/gimme/animethighss')43 .then((result) => resolve(result))44 .catch((err) => reject(err))45})46/**47 * Get ass pict.48 * @returns {Object}49 */50const ass = () => new Promise((resolve, reject) => {51 console.log('Searching for ass...')52 fetchJson('https://meme-api.herokuapp.com/gimme/animebooty')53 .then((result) => resolve(result))54 .catch((err) => reject(err))55})56/**57 * Get boobs pict.58 * @returns {Object}59 */60const boobs = () => new Promise((resolve, reject) => {61 console.log('Searching for boobs...')62 fetchJson('https://meme-api.herokuapp.com/gimme/biganimetiddies')63 .then((result) => resolve(result))64 .catch((err) => reject(err))65})66/**67 * Get belly pict.68 * @returns {Object}69 */70const belly = () => new Promise((resolve, reject) => {71 console.log('Searching for belly...')72 fetchJson('https://meme-api.herokuapp.com/gimme/animebellybutton')73 .then((result) => resolve(result))74 .catch((err) => reject(err))75})76/**77 * Get sideboobs pict.78 * @returns {Object}79 */80const sideboobs = () => new Promise((resolve, reject) => {81 console.log('Searching for sideboobs...')82 fetchJson('https://meme-api.herokuapp.com/gimme/sideoppai')83 .then((result) => resolve(result))84 .catch((err) => reject(err))85})86/**87 * Get ahegao pict.88 * @returns {Object}89 */90const ahegao = () => new Promise((resolve, reject) => {91 console.log('Searching for ahegao...')92 fetchJson('https://meme-api.herokuapp.com/gimme/ahegao')93 .then((result) => resolve(result))94 .catch((err) => reject(err))95})96/**97 * Get Pornhub metadata from URL.98 * @param {String} url 99 * @returns {Object}100 */101const phDl = (url) => new Promise((resolve, reject) => {102 console.log(`Get Pornhub metadata from ${url}`)103 ph.page(url, ['title', 'download_urls', 'thumbnail_url'])104 .then((result) => resolve(result))105 .catch((err) => reject(err))106})107/**108 * Get XXX video from URL.109 * @param {String} url 110 * @returns {Object}111 */112const xxx = (url) => new Promise((resolve, reject) => {113 console.log(`Get XXX video from ${url}`)114 fetchJson(`https://api.vhtear.com/xxxdownload?link=${url}&apikey=${config.vhtear}`)115 .then((result) => resolve(result))116 .catch((err) => reject(err))117})118module.exports = {119 randomLewd,120 armpitss,121 feets,122 thighs,123 ass,124 boobs,125 belly,126 sideboobs,127 ahegao,128 phDl,129 xxx...

Full Screen

Full Screen

nsfw.js

Source:nsfw.js Github

copy

Full Screen

1const { fetchJson } = require('../tools/fetcher')2const ph = require('@justalk/pornhub-api')3const config = require('../config.json')4/**5 * Get random lewd images from given subreddits.6 * @returns {Object}7 */8const randomLewd = () => new Promise((resolve, reject) => {9 const tag = ['ecchi', 'lewdanimegirls', 'hentai', 'hentaifemdom', 'hentaiparadise', 'hentai4everyone', 'animearmpits', 'animefeets', 'animethighss', 'animebooty', 'biganimetiddies', 'animebellybutton', 'sideoppai', 'ahegao']10 const randTag = tag[Math.floor(Math.random() * tag.length)]11 console.log(`Searching lewd from ${randTag} subreddit...`)12 fetchJson(`https://meme-api.herokuapp.com/gimme/${randTag}`)13 .then((result) => resolve(result))14 .catch((err) => reject(err))15})16/**17 * Get armpits pict.18 * @returns {Object}19 */20const armpits = () => new Promise((resolve, reject) => {21 console.log('Searching for armpits...')22 fetchJson('https://meme-api.herokuapp.com/gimme/animearmpits')23 .then((result) => resolve(result))24 .catch((err) => reject(err))25})26/**27 * Get feets pict.28 * @returns {Object}29 */30const feets = () => new Promise((resolve, reject) => {31 console.log('Searching for feets...')32 fetchJson('https://meme-api.herokuapp.com/gimme/animefeets')33 .then((result) => resolve(result))34 .catch((err) => reject(err))35})36/**37 * Get thighs pict.38 * @returns {Object}39 */40const thighs = () => new Promise((resolve, reject) => {41 console.log('Searching for thighs...')42 fetchJson('https://meme-api.herokuapp.com/gimme/animethighss')43 .then((result) => resolve(result))44 .catch((err) => reject(err))45})46/**47 * Get ass pict.48 * @returns {Object}49 */50const ass = () => new Promise((resolve, reject) => {51 console.log('Searching for ass...')52 fetchJson('https://meme-api.herokuapp.com/gimme/animebooty')53 .then((result) => resolve(result))54 .catch((err) => reject(err))55})56/**57 * Get boobs pict.58 * @returns {Object}59 */60const boobs = () => new Promise((resolve, reject) => {61 console.log('Searching for boobs...')62 fetchJson('https://meme-api.herokuapp.com/gimme/biganimetiddies')63 .then((result) => resolve(result))64 .catch((err) => reject(err))65})66/**67 * Get belly pict.68 * @returns {Object}69 */70const belly = () => new Promise((resolve, reject) => {71 console.log('Searching for belly...')72 fetchJson('https://meme-api.herokuapp.com/gimme/animebellybutton')73 .then((result) => resolve(result))74 .catch((err) => reject(err))75})76/**77 * Get sideboobs pict.78 * @returns {Object}79 */80const sideboobs = () => new Promise((resolve, reject) => {81 console.log('Searching for sideboobs...')82 fetchJson('https://meme-api.herokuapp.com/gimme/sideoppai')83 .then((result) => resolve(result))84 .catch((err) => reject(err))85})86/**87 * Get ahegao pict.88 * @returns {Object}89 */90const ahegao = () => new Promise((resolve, reject) => {91 console.log('Searching for ahegao...')92 fetchJson('https://meme-api.herokuapp.com/gimme/ahegao')93 .then((result) => resolve(result))94 .catch((err) => reject(err))95})96/**97 * Get Pornhub metadata from URL.98 * @param {String} url 99 * @returns {Object}100 */101const phDl = (url) => new Promise((resolve, reject) => {102 console.log(`Get Pornhub metadata from ${url}`)103 ph.page(url, ['title', 'download_urls', 'thumbnail_url'])104 .then((result) => resolve(result))105 .catch((err) => reject(err))106})107/**108 * Get XXX video from URL.109 * @param {String} url 110 * @returns {Object}111 */112const xxx = (url) => new Promise((resolve, reject) => {113 console.log(`Get XXX video from ${url}`)114 fetchJson(`https://api.vhtear.com/xxxdownload?link=${url}&apikey=${config.vhtear}`)115 .then((result) => resolve(result))116 .catch((err) => reject(err))117})118module.exports = {119 randomLewd,120 armpits,121 feets,122 thighs,123 ass,124 boobs,125 belly,126 sideboobs,127 ahegao,128 phDl,129 xxx...

Full Screen

Full Screen

weeaboo.js

Source:weeaboo.js Github

copy

Full Screen

1const { fetchJson } = require('../tools/fetcher')2const config = require('../config.json')3/**4 * Get anime info from Kusonime.5 * @param {String} title6 * @returns {Object}7 */8const anime = (title) => new Promise((resolve, reject) => {9 console.log(`Get anime info from Kusonime for ${title}...`)10 fetchJson(`https://arugaz.herokuapp.com/api/kuso?q=${title}`)11 .then((result) => resolve(result))12 .catch((err) => reject(err))13})14/**15 * Get manga info from Komiku.16 * @param {String} title17 * @returns {Object}18 */19const manga = (title) => new Promise((resolve, reject) => {20 console.log(`Get manga info from Komiku for ${title}...`)21 fetchJson(`https://arugaz.herokuapp.com/api/komiku?q=${title}`)22 .then((result) => resolve(result))23 .catch((err) => reject(err))24})25/**26 * Get random waifu image.27 * @param {Boolean} nsfw28 * @returns {Object}29 */30const waifu = (nsfw) => new Promise((resolve, reject) => {31 if (nsfw === true) {32 console.log('Get NSFW waifu image...')33 fetchJson('https://waifu.pics/api/nsfw/waifu')34 .then((result) => resolve(result))35 .catch((err) => reject(err))36 } else {37 console.log('Get SFW waifu image...')38 fetchJson('https://waifu.pics/api/sfw/waifu')39 .then((result) => resolve(result))40 .catch((err) => reject(err))41 }42})43/**44 * Search for anime source from image.45 * @param {Buffer} imageBase64 46 * @returns {Object}47 */48const wait = (imageBase64) => new Promise((resolve, reject) => {49 console.log('Searching for anime source...')50 fetchJson('https://trace.moe/api/search', {51 method: 'POST',52 body: JSON.stringify({ image: imageBase64 }),53 headers: { 'Content-Type': 'application/json' }54 })55 .then((result) => resolve(result))56 .catch((err) => reject(err))57})58/**59 * Get Anitoki latest update.60 * @returns {Object}61 */62const anitoki = () => new Promise((resolve, reject) => {63 console.log('Get Anitoki latest update...')64 fetchJson(`https://melodicxt.herokuapp.com/api/anitoki?apiKey=${config.melodic}`)65 .then((result) => resolve(result))66 .catch((err) => reject(err))67})68/**69 * Get Neonime latest update.70 * @returns {Object}71 */72const neonime = () => new Promise((resolve, reject) => {73 console.log('Get Neonime latest update...')74 fetchJson('https://enznoire.herokuapp.com/neolatest')75 .then((result) => resolve(result))76 .catch((err) => reject(err))77})78/**79 * Get Anoboy anime on-going list.80 * @returns {Object}81 */82const anoboy = () => new Promise((resolve, reject) => {83 console.log('Get Anoboy on-going...')84 fetchJson(`https://api.vhtear.com/ongoinganoboy&apikey=${config.vhtear}`)85 .then((result) => resolve(result))86 .catch((err) => reject(err))87})88module.exports = {89 anime,90 manga,91 waifu,92 wait,93 anitoki,94 neonime,95 anoboy...

Full Screen

Full Screen

fetch.js

Source:fetch.js Github

copy

Full Screen

1$(document).ready(function () {2 // FETCHING DATA FROM JSON FILE3 $.getJSON("https://tihub.pl/json/linux.json",4 function (data) {5 var fetchJSON = '';6 // ITERATING THROUGH OBJECTS7 $.each(data, function (key, value) {8 // CONSTRUCTION OF ROWS HAVING9 // DATA FROM JSON OBJECT10 fetchJSON += '<div class="row">';11 fetchJSON += '<div class="col-lg-8 col-md-10 mx-auto">';12 fetchJSON += '<div class="post-preview">';13 fetchJSON += '<a href="https://app.tihub.pl/linux/' + value.referral + '">';14 fetchJSON += '<h2 class="post-title"><i class="' + value.icon + '"></i> ' + value.subject + '</h2>';15 fetchJSON += '<h3 class="post-subtitle">' + value.description + '</h3>';16 fetchJSON += '</a>';17 fetchJSON += '<p class="post-meta">' + value.date + '</p>';18 fetchJSON += '</div>';19 fetchJSON += '</div>';20 fetchJSON += '</div>';21 fetchJSON += '<hr>';22 });23 // INSERTING ROWS INTO CONTAINER 24 $('#kontener').append(fetchJSON);25 });...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1const puppeteer = require('puppeteer');2(async () => {3 const browser = await puppeteer.launch();4 const page = await browser.newPage();5 const data = await response.json();6 console.log(data);7 await browser.close();8})();

Full Screen

Using AI Code Generation

copy

Full Screen

1const puppeteer = require('puppeteer');2const fs = require('fs');3(async () => {4 const browser = await puppeteer.launch();5 const page = await browser.newPage();6 const data = await page.evaluate(() => {7 return response.json();8 });9 });10 fs.writeFileSync('data.json', JSON.stringify(data));11 await browser.close();12})();13{14}

Full Screen

Using AI Code Generation

copy

Full Screen

1const puppeteer = require('puppeteer');2(async () => {3 const browser = await puppeteer.launch();4 const page = await browser.newPage();5 const data = await page.evaluate(() => {6 });7 console.log(data);8 await browser.close();9})();10const puppeteer = require('puppeteer');11(async () => {12 const browser = await puppeteer.launch();13 const page = await browser.newPage();14 const data = await page.evaluate(() => {15 });16 console.log(data);17 await browser.close();18})();19const puppeteer = require('puppeteer');20(async () => {21 const browser = await puppeteer.launch();22 const page = await browser.newPage();23 const data = await page.evaluate(() => {24 });25 console.log(data);26 await browser.close();27})();28const puppeteer = require('puppeteer');29(async () => {30 const browser = await puppeteer.launch();31 const page = await browser.newPage();32 const data = await page.evaluate(() => {33 });34 console.log(data);35 await browser.close();36})();37const puppeteer = require('puppeteer');38(async () => {39 const browser = await puppeteer.launch();40 const page = await browser.newPage();41 const data = await page.evaluate(() => {42 });43 console.log(data);44 await browser.close();45})();46const puppeteer = require('puppeteer');47(async () => {48 const browser = await puppeteer.launch();

Full Screen

Using AI Code Generation

copy

Full Screen

1(async () => {2 const browser = await puppeteer.launch();3 const page = await browser.newPage();4 const result = await page.evaluate(() => {5 })6 console.log(result)7 await browser.close();8})();

Full Screen

Using AI Code Generation

copy

Full Screen

1const puppeteer = require('puppeteer');2(async () => {3 const browser = await puppeteer.launch();4 const page = await browser.newPage();5 await page.goto(url);6 const data = await page.evaluate(() => {7 });8 console.log(data);9 await browser.close();10})();11const express = require('express');12const app = express();13const port = 3000;14app.get('/', (req, res) => {15 res.sendFile(__dirname + '/index.html');16});17app.get('/data', (req, res) => {18 res.json({ name: 'John Doe' });19});20app.listen(port, () => {21});22### page.evaluate(pageFunction[, ...args])23const divCount = await page.evaluate(() => {24 return document.querySelectorAll('div').length;25});26### page.evaluateHandle(pageFunction[, ...args])27The only difference between `page.evaluateHandle` and [`page.evaluate`](#pageevaluatepagefunction-args)

Full Screen

Using AI Code Generation

copy

Full Screen

1const puppeteer = require('puppeteer');2const fs = require('fs');3(async () => {4 const browser = await puppeteer.launch();5 const page = await browser.newPage();6 await page.goto(url);7 const json = await page.evaluate(() => {8 const data = [];9 const elements = document.querySelectorAll('h3');10 for (let element of elements) {11 data.push(element.textContent);12 }13 return data;14 });15 fs.writeFileSync('data.json', JSON.stringify(json));16 await browser.close();17})();18const puppeteer = require('puppeteer');19(async () => {20 const browser = await puppeteer.launch();21 const page = await browser.newPage();22 await page.goto(url);23 const title = await page.title();24 console.log(title);25 await browser.close();26})();27const puppeteer = require('puppeteer');28(async () => {29 const browser = await puppeteer.launch();30 const page = await browser.newPage();31 await page.goto(url);32 await page.type('input[name="q"]', 'puppeteer');33 await page.click('input[name="btnK"]');34 await browser.close();35})();

Full Screen

Using AI Code Generation

copy

Full Screen

1const puppeteer = require('puppeteer');2const fs = require('fs');3const path = require('path');4(async () => {5 const browser = await puppeteer.launch();6 const page = await browser.newPage();7 const data = await page.evaluate(() => {8 .then(response => response.json())9 .then(data => {10 return data;11 })12 });13 console.log(data);14 await browser.close();15})();16const puppeteer = require('puppeteer');17const fs = require('fs');18const path = require('path');19(async () => {20 const browser = await puppeteer.launch();21 const page = await browser.newPage();22 const data = await page.evaluate(() => {23 .then(response => response.json())24 .then(data => {25 return data;26 })27 });28 console.log(data);29 fs.writeFile(path.join(__dirname, 'data.json'), JSON.stringify(data, null, 2), (err) => {30 if (err) throw err;31 console.log('The file has been saved!');32 });33 await browser.close();34})();35const puppeteer = require('puppeteer');36const fs = require('fs');37const path = require('path');38(async () => {39 const browser = await puppeteer.launch();40 const page = await browser.newPage();41 const data = await page.evaluate(async () => {42 .then(response => response.json())43 .then(data => {44 return data;45 })46 });47 console.log(data);48 fs.writeFile(path.join(__dirname, 'data.json'), JSON.stringify

Full Screen

Using AI Code Generation

copy

Full Screen

1const puppeteer = require('puppeteer');2const fs = require('fs');3(async () => {4 const browser = await puppeteer.launch();5 const page = await browser.newPage();6 await page.goto(url);7 const data = await page.evaluate(() => {8 .then((data) => {9 return data;10 })11 .catch((err) => {12 console.log(err);13 });14 });15 console.log(data);16 await browser.close();17})();

Full Screen

Using AI Code Generation

copy

Full Screen

1(async () => {2const puppeteer = require('puppeteer');3const browser = await puppeteer.launch();4const page = await browser.newPage();5const result = await page.evaluate(() => {6.then(data => {7return data;8});9});10console.log(result);11await browser.close();12})();13(async () => {14const puppeteer = require('puppeteer');15const browser = await puppeteer.launch();16const page = await browser.newPage();17const result = await page.evaluate(() => {18.then(data => {19return data;20});21});22console.log(result);23await browser.close();24})();25(async () => {26const puppeteer = require('puppeteer');27const browser = await puppeteer.launch();28const page = await browser.newPage();29const result = await page.evaluate(() => {30.then(data => {31return data;32});33});34console.log(result);35await browser.close();36})();37(async () => {38const puppeteer = require('puppeteer');39const browser = await puppeteer.launch();40const page = await browser.newPage();41const result = await page.evaluate(() => {42.then(data => {43return data;44});45});46console.log(result);47await browser.close();48})();49(async () => {50const puppeteer = require('puppeteer');51const browser = await puppeteer.launch();52const page = await browser.newPage();53const result = await page.evaluate(() => {54.then(data => {55return data;56});57});58console.log(result);59await browser.close();60})();61(async () => {62const puppeteer = require('puppeteer');63const browser = await puppeteer.launch();64const page = await browser.newPage();65const result = await page.evaluate(() => {

Full Screen

Using AI Code Generation

copy

Full Screen

1const { Apify } = require('apify');2const puppeteer = require('puppeteer');3const cheerio = require('cheerio');4const { log } = Apify.utils;5const { utils: { log } } = Apify;6const { PuppeteerCrawler } = Apify;7const { requestAsBrowser } = Apify.utils;8const requestQueue = await Apify.openRequestQueue();9await requestQueue.addRequest({ url, userData: { label: 'PAGE' } });10const crawler = new PuppeteerCrawler({11 handlePageFunction: async ({ page, request, puppeteerPool, response, autoscaledPool }) => {12 log.info('Page opened.', { url: request.url });13 const content = await page.content();14 const $ = cheerio.load(content);15 const title = $('h1').text();16 const result = {17 succeeded: response.status() === 200,18 };19 await Apify.pushData(result);20 },21 handleFailedRequestFunction: async ({ request }) => {22 log.info('Request failed too many times', { url: request.url });23 await Apify.pushData({24 '#debug': Apify.utils.createRequestDebugInfo(request),25 });26 },27});28await crawler.run();29log.info('Crawler finished.');30{31}

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Puppeteer automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful