msgHndlr.js 53 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787
  1. /*
  2. * "Wahai orang-orang yang beriman, mengapakah kamu mengatakan sesuatu yang tidak kamu kerjakan?
  3. * Amat besar kebencian di sisi Allah bahwa kamu mengatakan apa-apa yang tidak kamu kerjakan."
  4. * (QS ash-Shaff: 2-3).
  5. */
  6. const { decryptMedia } = require('@open-wa/wa-decrypt')
  7. const fs = require('fs-extra')
  8. const axios = require('axios')
  9. const moment = require('moment-timezone')
  10. const get = require('got')
  11. const fetch = require('node-fetch')
  12. const color = require('./lib/color')
  13. const { spawn, exec } = require('child_process')
  14. const nhentai = require('nhentai-js')
  15. const { API } = require('nhentai-api')
  16. const { liriklagu, quotemaker, randomNimek, fb, sleep, jadwalTv, ss } = require('./lib/functions')
  17. const { help, snk, info, donate, readme, listChannel } = require('./lib/help')
  18. const { stdout } = require('process')
  19. const nsfw_ = JSON.parse(fs.readFileSync('./lib/NSFW.json'))
  20. const welkom = JSON.parse(fs.readFileSync('./lib/welcome.json'))
  21. const { RemoveBgResult, removeBackgroundFromImageBase64, removeBackgroundFromImageFile } = require('remove.bg')
  22. moment.tz.setDefault('Asia/Jakarta').locale('id')
  23. module.exports = msgHandler = async (client, message) => {
  24. try {
  25. const { type, id, from, t, sender, isGroupMsg, chat, caption, isMedia, mimetype, quotedMsg, quotedMsgObj, mentionedJidList } = message
  26. let { body } = message
  27. const { name, formattedTitle } = chat
  28. let { pushname, verifiedName } = sender
  29. pushname = pushname || verifiedName
  30. const commands = caption || body || ''
  31. const command = commands.toLowerCase().split(' ')[0] || ''
  32. const args = commands.split(' ')
  33. const msgs = (message) => {
  34. if (command.startsWith('!')) {
  35. if (message.length >= 10){
  36. return `${message.substr(0, 15)}`
  37. }else{
  38. return `${message}`
  39. }
  40. }
  41. }
  42. const mess = {
  43. wait: '[ WAIT ] Sedang di proses⏳ silahkan tunggu sebentar',
  44. error: {
  45. St: '[❗] Kirim gambar dengan caption *!sticker* atau tag gambar yang sudah dikirim',
  46. Qm: '[❗] Terjadi kesalahan, mungkin themenya tidak tersedia!',
  47. Yt3: '[❗] Terjadi kesalahan, tidak dapat meng konversi ke mp3!',
  48. Yt4: '[❗] Terjadi kesalahan, mungkin error di sebabkan oleh sistem.',
  49. Ig: '[❗] Terjadi kesalahan, mungkin karena akunnya private',
  50. Ki: '[❗] Bot tidak bisa mengeluarkan admin group!',
  51. Ad: '[❗] Tidak dapat menambahkan target, mungkin karena di private',
  52. Iv: '[❗] Link yang anda kirim tidak valid!'
  53. }
  54. }
  55. const apiKey = 'API-KEY' // apikey you can get it at https://mhankbarbars.herokuapp.com/api
  56. const time = moment(t * 1000).format('DD/MM HH:mm:ss')
  57. const botNumber = await client.getHostNumber()
  58. const blockNumber = await client.getBlockedIds()
  59. const groupId = isGroupMsg ? chat.groupMetadata.id : ''
  60. const groupAdmins = isGroupMsg ? await client.getGroupAdmins(groupId) : ''
  61. const isGroupAdmins = isGroupMsg ? groupAdmins.includes(sender.id) : false
  62. const isBotGroupAdmins = isGroupMsg ? groupAdmins.includes(botNumber + '@c.us') : false
  63. const ownerNumber = ["628xxx@c.us","55xxxxx"] // replace with your whatsapp number
  64. const isOwner = ownerNumber.includes(sender.id)
  65. const isBlocked = blockNumber.includes(sender.id)
  66. const isNsfw = isGroupMsg ? nsfw_.includes(chat.id) : false
  67. const uaOverride = 'WhatsApp/2.2029.4 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36'
  68. const isUrl = new RegExp(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)/gi)
  69. if (!isGroupMsg && command.startsWith('!')) console.log('\x1b[1;31m~\x1b[1;37m>', '[\x1b[1;32mEXEC\x1b[1;37m]', time, color(msgs(command)), 'from', color(pushname))
  70. if (isGroupMsg && command.startsWith('!')) console.log('\x1b[1;31m~\x1b[1;37m>', '[\x1b[1;32mEXEC\x1b[1;37m]', time, color(msgs(command)), 'from', color(pushname), 'in', color(formattedTitle))
  71. //if (!isGroupMsg && !command.startsWith('!')) console.log('\x1b[1;33m~\x1b[1;37m>', '[\x1b[1;31mMSG\x1b[1;37m]', time, color(body), 'from', color(pushname))
  72. //if (isGroupMsg && !command.startsWith('!')) console.log('\x1b[1;33m~\x1b[1;37m>', '[\x1b[1;31mMSG\x1b[1;37m]', time, color(body), 'from', color(pushname), 'in', color(formattedTitle))
  73. if (isBlocked) return
  74. //if (!isOwner) return
  75. switch(command) {
  76. case '!sticker':
  77. case '!stiker':
  78. if (isMedia && type === 'image') {
  79. const mediaData = await decryptMedia(message, uaOverride)
  80. const imageBase64 = `data:${mimetype};base64,${mediaData.toString('base64')}`
  81. await client.sendImageAsSticker(from, imageBase64)
  82. } else if (quotedMsg && quotedMsg.type == 'image') {
  83. const mediaData = await decryptMedia(quotedMsg, uaOverride)
  84. const imageBase64 = `data:${quotedMsg.mimetype};base64,${mediaData.toString('base64')}`
  85. await client.sendImageAsSticker(from, imageBase64)
  86. } else if (args.length === 2) {
  87. const url = args[1]
  88. if (url.match(isUrl)) {
  89. await client.sendStickerfromUrl(from, url, { method: 'get' })
  90. .catch(err => console.log('Caught exception: ', err))
  91. } else {
  92. client.reply(from, mess.error.Iv, id)
  93. }
  94. } else {
  95. client.reply(from, mess.error.St, id)
  96. }
  97. break
  98. case '!stickergif':
  99. case '!stikergif':
  100. case '!sgif':
  101. if (isMedia) {
  102. if (mimetype === 'video/mp4' && message.duration < 10 || mimetype === 'image/gif' && message.duration < 10) {
  103. const mediaData = await decryptMedia(message, uaOverride)
  104. client.reply(from, '[WAIT] Sedang di proses⏳ silahkan tunggu ± 1 min!', id)
  105. const filename = `./media/aswu.${mimetype.split('/')[1]}`
  106. await fs.writeFileSync(filename, mediaData)
  107. await exec(`gify ${filename} ./media/output.gif --fps=30 --scale=240:240`, async function (error, stdout, stderr) {
  108. const gif = await fs.readFileSync('./media/output.gif', { encoding: "base64" })
  109. await client.sendImageAsSticker(from, `data:image/gif;base64,${gif.toString('base64')}`)
  110. })
  111. } else (
  112. client.reply(from, '[❗] Kirim video dengan caption *!stickerGif* max 10 sec!', id)
  113. )
  114. }
  115. break
  116. case '!stickernobg':
  117. case '!stikernobg':
  118. if (isMedia) {
  119. try {
  120. var mediaData = await decryptMedia(message, uaOverride)
  121. var imageBase64 = `data:${mimetype};base64,${mediaData.toString('base64')}`
  122. var base64img = imageBase64
  123. var outFile = './media/img/noBg.png'
  124. // untuk api key kalian bisa dapatkan pada website remove.bg
  125. var result = await removeBackgroundFromImageBase64({ base64img, apiKey: 'API-KEY', size: 'auto', type: 'auto', outFile })
  126. await fs.writeFile(outFile, result.base64img)
  127. await client.sendImageAsSticker(from, `data:${mimetype};base64,${result.base64img}`)
  128. } catch(err) {
  129. console.log(err)
  130. }
  131. }
  132. break
  133. case '!donasi':
  134. case '!donate':
  135. client.sendLinkWithAutoPreview(from, 'https://saweria.co/donate/mhankbarbar', donate)
  136. break
  137. case '!tts':
  138. if (args.length === 1) return client.reply(from, 'Kirim perintah *!tts [id, en, jp, ar] [teks]*, contoh *!tts id halo semua*')
  139. const ttsId = require('node-gtts')('id')
  140. const ttsEn = require('node-gtts')('en')
  141. const ttsJp = require('node-gtts')('ja')
  142. const ttsAr = require('node-gtts')('ar')
  143. const dataText = body.slice(8)
  144. if (dataText === '') return client.reply(from, 'Baka?', id)
  145. if (dataText.length > 500) return client.reply(from, 'Teks terlalu panjang!', id)
  146. var dataBhs = body.slice(5, 7)
  147. if (dataBhs == 'id') {
  148. ttsId.save('./media/tts/resId.mp3', dataText, function () {
  149. client.sendPtt(from, './media/tts/resId.mp3', id)
  150. })
  151. } else if (dataBhs == 'en') {
  152. ttsEn.save('./media/tts/resEn.mp3', dataText, function () {
  153. client.sendPtt(from, './media/tts/resEn.mp3', id)
  154. })
  155. } else if (dataBhs == 'jp') {
  156. ttsJp.save('./media/tts/resJp.mp3', dataText, function () {
  157. client.sendPtt(from, './media/tts/resJp.mp3', id)
  158. })
  159. } else if (dataBhs == 'ar') {
  160. ttsAr.save('./media/tts/resAr.mp3', dataText, function () {
  161. client.sendPtt(from, './media/tts/resAr.mp3', id)
  162. })
  163. } else {
  164. client.reply(from, 'Masukkan data bahasa : [id] untuk indonesia, [en] untuk inggris, [jp] untuk jepang, dan [ar] untuk arab', id)
  165. }
  166. break
  167. case '!nulis':
  168. if (args.length === 1) return client.reply(from, 'Kirim perintah *!nulis [teks]*', id)
  169. const nulis = encodeURIComponent(body.slice(7))
  170. client.reply(from, mess.wait, id)
  171. let urlnulis = `https://mhankbarbars.herokuapp.com/nulis?text=${nulis}&apiKey=${apiKey}`
  172. await fetch(urlnulis, {method: "GET"})
  173. .then(res => res.json())
  174. .then(async (json) => {
  175. await client.sendFileFromUrl(from, json.result, 'Nulis.jpg', 'Nih anjim', id)
  176. }).catch(e => client.reply(from, "Error: "+ e));
  177. break
  178. case '!ytmp3':
  179. if (args.length === 1) return client.reply(from, 'Kirim perintah *!ytmp3 [linkYt]*, untuk contoh silahkan kirim perintah *!readme*')
  180. let isLinks = args[1].match(/(?:https?:\/{2})?(?:w{3}\.)?youtu(?:be)?\.(?:com|be)(?:\/watch\?v=|\/)([^\s&]+)/)
  181. if (!isLinks) return client.reply(from, mess.error.Iv, id)
  182. try {
  183. client.reply(from, mess.wait, id)
  184. const resp = await get.get(`https://mhankbarbars.herokuapp.com/api/yta?url=${args[1]}&apiKey=${apiKey}`).json()
  185. if (resp.error) {
  186. client.reply(from, resp.error, id)
  187. } else {
  188. const { title, thumb, filesize, result } = await resp
  189. if (Number(filesize.split(' MB')[0]) >= 30.00) return client.reply(from, 'Maaf durasi video sudah melebihi batas maksimal!', id)
  190. client.sendFileFromUrl(from, thumb, 'thumb.jpg', `➸ *Title* : ${title}\n➸ *Filesize* : ${filesize}\n\nSilahkan tunggu sebentar proses pengiriman file membutuhkan waktu beberapa menit.`, id)
  191. await client.sendFileFromUrl(from, result, `${title}.mp3`, '', id).catch(() => client.reply(from, mess.error.Yt3, id))
  192. //await client.sendAudio(from, result, id)
  193. }
  194. } catch (err) {
  195. client.sendText(ownerNumber[0], 'Error ytmp3 : '+ err)
  196. client.reply(from, mess.error.Yt3, id)
  197. }
  198. break
  199. case '!ytmp4':
  200. if (args.length === 1) return client.reply(from, 'Kirim perintah *!ytmp4 [linkYt]*, untuk contoh silahkan kirim perintah *!readme*')
  201. let isLin = args[1].match(/(?:https?:\/{2})?(?:w{3}\.)?youtu(?:be)?\.(?:com|be)(?:\/watch\?v=|\/)([^\s&]+)/)
  202. if (!isLin) return client.reply(from, mess.error.Iv, id)
  203. try {
  204. client.reply(from, mess.wait, id)
  205. const ytv = await get.get(`https://mhankbarbars.herokuapp.com/api/ytv?url=${args[1]}&apiKey=${apiKey}`).json()
  206. if (ytv.error) {
  207. client.reply(from, ytv.error, id)
  208. } else {
  209. if (Number(ytv.filesize.split(' MB')[0]) > 40.00) return client.reply(from, 'Maaf durasi video sudah melebihi batas maksimal!', id)
  210. client.sendFileFromUrl(from, ytv.thumb, 'thumb.jpg', `➸ *Title* : ${ytv.title}\n➸ *Filesize* : ${ytv.filesize}\n\nSilahkan tunggu sebentar proses pengiriman file membutuhkan waktu beberapa menit.`, id)
  211. await client.sendFileFromUrl(from, ytv.result, `${ytv.title}.mp4`, '', id).catch(() => client.reply(from, mess.error.Yt4, id))
  212. }
  213. } catch (er) {
  214. client.sendText(ownerNumber[0], 'Error ytmp4 : '+ er)
  215. client.reply(from, mess.error.Yt4, id)
  216. }
  217. break
  218. case '!wiki':
  219. if (args.length === 1) return client.reply(from, 'Kirim perintah *!wiki [query]*\nContoh : *!wiki asu*', id)
  220. const query_ = body.slice(6)
  221. const wiki = await get.get(`https://mhankbarbars.herokuapp.com/api/wiki?q=${query_}&lang=id&apiKey=${apiKey}`).json()
  222. if (wiki.error) {
  223. client.reply(from, wiki.error, id)
  224. } else {
  225. client.reply(from, `➸ *Query* : ${query_}\n\n➸ *Result* : ${wiki.result}`, id)
  226. }
  227. break
  228. case '!cuaca':
  229. if (args.length === 1) return client.reply(from, 'Kirim perintah *!cuaca [tempat]*\nContoh : *!cuaca tangerang', id)
  230. const tempat = body.slice(7)
  231. const weather = await get.get(`https://mhankbarbars.herokuapp.com/api/cuaca?q=${tempat}&apiKey=${apiKey}`).json()
  232. if (weather.error) {
  233. client.reply(from, weather.error, id)
  234. } else {
  235. client.reply(from, `➸ Tempat : ${weather.result.tempat}\n\n➸ Angin : ${weather.result.angin}\n➸ Cuaca : ${weather.result.cuaca}\n➸ Deskripsi : ${weather.result.desk}\n➸ Kelembapan : ${weather.result.kelembapan}\n➸ Suhu : ${weather.result.suhu}\n➸ Udara : ${weather.result.udara}`, id)
  236. }
  237. break
  238. case '!fb':
  239. if (args.length === 1) return client.reply(from, 'Kirim perintah *!fb [linkFb]* untuk contoh silahkan kirim perintah *!readme*', id)
  240. if (!args[1].includes('facebook.com')) return client.reply(from, mess.error.Iv, id)
  241. client.reply(from, mess.wait, id)
  242. const epbe = await get.get(`https://mhankbarbars.herokuapp.com/api/epbe?url=${args[1]}&apiKey=${apiKey}`).json()
  243. if (epbe.error) return client.reply(from, epbe.error, id)
  244. client.sendFileFromUrl(from, epbe.result, 'epbe.mp4', epbe.title, id)
  245. break
  246. case '!creator':
  247. client.sendContact(from, '6285892766102@c.us')
  248. break
  249. case '!ig':
  250. if (args.length === 1) return client.reply(from, 'Kirim perintah *!ig [linkIg]* untuk contoh silahkan kirim perintah *!readme*')
  251. if (!args[1].match(isUrl) && !args[1].includes('instagram.com')) return client.reply(from, mess.error.Iv, id)
  252. try {
  253. client.reply(from, mess.wait, id)
  254. const resp = await get.get(`https://mhankbarbars.herokuapp.com/api/ig?url=${args[1]}&apiKey=${apiKey}`).json()
  255. if (resp.result.includes('.mp4')) {
  256. var ext = '.mp4'
  257. } else {
  258. var ext = '.jpg'
  259. }
  260. await client.sendFileFromUrl(from, resp.result, `igeh${ext}`, '', id)
  261. } catch {
  262. client.reply(from, mess.error.Ig, id)
  263. }
  264. break
  265. case '!nsfw':
  266. if (!isGroupMsg) return client.reply(from, 'Perintah ini hanya bisa di gunakan dalam group!', id)
  267. if (!isGroupAdmins) return client.reply(from, 'Perintah ini hanya bisa di gunakan oleh Admin group!', id)
  268. if (args.length === 1) return client.reply(from, 'Pilih enable atau disable!', id)
  269. if (args[1].toLowerCase() === 'enable') {
  270. nsfw_.push(chat.id)
  271. fs.writeFileSync('./lib/NSFW.json', JSON.stringify(nsfw_))
  272. client.reply(from, 'NSWF Command berhasil di aktifkan di group ini! kirim perintah *!nsfwMenu* untuk mengetahui menu', id)
  273. } else if (args[1].toLowerCase() === 'disable') {
  274. nsfw_.splice(chat.id, 1)
  275. fs.writeFileSync('./lib/NSFW.json', JSON.stringify(nsfw_))
  276. client.reply(from, 'NSFW Command berhasil di nonaktifkan di group ini!', id)
  277. } else {
  278. client.reply(from, 'Pilih enable atau disable udin!', id)
  279. }
  280. break
  281. case '!welcome':
  282. if (!isGroupMsg) return client.reply(from, 'Perintah ini hanya bisa di gunakan dalam group!', id)
  283. if (!isGroupAdmins) return client.reply(from, 'Perintah ini hanya bisa di gunakan oleh Admin group!', id)
  284. if (args.length === 1) return client.reply(from, 'Pilih enable atau disable!', id)
  285. if (args[1].toLowerCase() === 'enable') {
  286. welkom.push(chat.id)
  287. fs.writeFileSync('./lib/welcome.json', JSON.stringify(welkom))
  288. client.reply(from, 'Fitur welcome berhasil di aktifkan di group ini!', id)
  289. } else if (args[1].toLowerCase() === 'disable') {
  290. welkom.splice(chat.id, 1)
  291. fs.writeFileSync('./lib/welcome.json', JSON.stringify(welkom))
  292. client.reply(from, 'Fitur welcome berhasil di nonaktifkan di group ini!', id)
  293. } else {
  294. client.reply(from, 'Pilih enable atau disable udin!', id)
  295. }
  296. break
  297. case '!nsfwmenu':
  298. if (!isNsfw) return
  299. client.reply(from, '1. !randomHentai\n2. !randomNsfwNeko', id)
  300. break
  301. case '!igstalk':
  302. if (args.length === 1) return client.reply(from, 'Kirim perintah *!igStalk @username*\nConntoh *!igStalk @duar_amjay*', id)
  303. const stalk = await get.get(`https://mhankbarbars.herokuapp.com/api/stalk?username=${args[1]}&apiKey=${apiKey}`).json()
  304. if (stalk.error) return client.reply(from, stalk.error, id)
  305. const { Biodata, Jumlah_Followers, Jumlah_Following, Jumlah_Post, Name, Username, Profile_pic } = stalk
  306. const caps = `➸ *Nama* : ${Name}\n➸ *Username* : ${Username}\n➸ *Jumlah Followers* : ${Jumlah_Followers}\n➸ *Jumlah Following* : ${Jumlah_Following}\n➸ *Jumlah Postingan* : ${Jumlah_Post}\n➸ *Biodata* : ${Biodata}`
  307. await client.sendFileFromUrl(from, Profile_pic, 'Profile.jpg', caps, id)
  308. break
  309. case '!infogempa':
  310. const bmkg = await get.get(`https://mhankbarbars.herokuapp.com/api/infogempa?apiKey=${apiKey}`).json()
  311. const { potensi, koordinat, lokasi, kedalaman, magnitude, waktu, map } = bmkg
  312. const hasil = `*${waktu}*\n📍 *Lokasi* : *${lokasi}*\n〽️ *Kedalaman* : *${kedalaman}*\n💢 *Magnitude* : *${magnitude}*\n🔘 *Potensi* : *${potensi}*\n📍 *Koordinat* : *${koordinat}*`
  313. client.sendFileFromUrl(from, map, 'shakemap.jpg', hasil, id)
  314. break
  315. case '!anime':
  316. if (args.length === 1) return client.reply(from, 'Kirim perintah *!anime [query]*\nContoh : *!anime darling in the franxx*', id)
  317. const animek = await get.get(`https://mhankbarbars.herokuapp.com/api/kuso?q=${body.slice(7)}&apiKey=${apiKey}`).json()
  318. if (animek.error) return client.reply(from, animek.error, id)
  319. const res_animek = `Title: *${animek.title}*\n\n${animek.info}\n\nSinopsis: ${animek.sinopsis}\n\nLink Download:\n${animek.link_dl}`
  320. client.sendFileFromUrl(from, animek.thumb, 'kusonime.jpg', res_animek, id)
  321. break
  322. case '!nh':
  323. //if (isGroupMsg) return client.reply(from, 'Sorry this command for private chat only!', id)
  324. if (args.length === 2) {
  325. const nuklir = body.split(' ')[1]
  326. client.reply(from, mess.wait, id)
  327. const cek = await nhentai.exists(nuklir)
  328. if (cek === true) {
  329. try {
  330. const api = new API()
  331. const pic = await api.getBook(nuklir).then(book => {
  332. return api.getImageURL(book.cover)
  333. })
  334. const dojin = await nhentai.getDoujin(nuklir)
  335. const { title, details, link } = dojin
  336. const { parodies, tags, artists, groups, languages, categories } = await details
  337. var teks = `*Title* : ${title}\n\n*Parodies* : ${parodies}\n\n*Tags* : ${tags.join(', ')}\n\n*Artists* : ${artists.join(', ')}\n\n*Groups* : ${groups.join(', ')}\n\n*Languages* : ${languages.join(', ')}\n\n*Categories* : ${categories}\n\n*Link* : ${link}`
  338. //exec('nhentai --id=' + nuklir + ` -P mantap.pdf -o ./hentong/${nuklir}.pdf --format `+ `${nuklir}.pdf`, (error, stdout, stderr) => {
  339. client.sendFileFromUrl(from, pic, 'hentod.jpg', teks, id)
  340. //client.sendFile(from, `./hentong/${nuklir}.pdf/${nuklir}.pdf.pdf`, then(() => `${title}.pdf`, '', id)).catch(() =>
  341. //client.sendFile(from, `./hentong/${nuklir}.pdf/${nuklir}.pdf.pdf`, `${title}.pdf`, '', id))
  342. /*if (error) {
  343. console.log('error : '+ error.message)
  344. return
  345. }
  346. if (stderr) {
  347. console.log('stderr : '+ stderr)
  348. return
  349. }
  350. console.log('stdout : '+ stdout)*/
  351. //})
  352. } catch (err) {
  353. client.reply(from, '[❗] Terjadi kesalahan, mungkin kode nuklir salah', id)
  354. }
  355. } else {
  356. client.reply(from, '[❗] Kode nuClear Salah!')
  357. }
  358. } else {
  359. client.reply(from, '[ WRONG ] Kirim perintah *!nh [nuClear]* untuk contoh kirim perintah *!readme*')
  360. }
  361. break
  362. case '!brainly':
  363. if (args.length >= 2){
  364. const BrainlySearch = require('./lib/brainly')
  365. let tanya = body.slice(9)
  366. let jum = Number(tanya.split('.')[1]) || 2
  367. if (jum > 10) return client.reply(from, 'Max 10!', id)
  368. if (Number(tanya[tanya.length-1])){
  369. tanya
  370. }
  371. client.reply(from, `➸ *Pertanyaan* : ${tanya.split('.')[0]}\n\n➸ *Jumlah jawaban* : ${Number(jum)}`, id)
  372. await BrainlySearch(tanya.split('.')[0],Number(jum), function(res){
  373. res.forEach(x=>{
  374. if (x.jawaban.fotoJawaban.length == 0) {
  375. client.reply(from, `➸ *Pertanyaan* : ${x.pertanyaan}\n\n➸ *Jawaban* : ${x.jawaban.judulJawaban}\n`, id)
  376. } else {
  377. client.reply(from, `➸ *Pertanyaan* : ${x.pertanyaan}\n\n➸ *Jawaban* : ${x.jawaban.judulJawaban}\n\n➸ *Link foto jawaban* : ${x.jawaban.fotoJawaban.join('\n')}`, id)
  378. }
  379. })
  380. })
  381. } else {
  382. client.reply(from, 'Usage :\n!brainly [pertanyaan] [.jumlah]\n\nEx : \n!brainly NKRI .2', id)
  383. }
  384. break
  385. case '!wait':
  386. if (isMedia && type === 'image' || quotedMsg && quotedMsg.type === 'image') {
  387. if (isMedia) {
  388. var mediaData = await decryptMedia(message, uaOverride)
  389. } else {
  390. var mediaData = await decryptMedia(quotedMsg, uaOverride)
  391. }
  392. const fetch = require('node-fetch')
  393. const imgBS4 = `data:${mimetype};base64,${mediaData.toString('base64')}`
  394. client.reply(from, 'Searching....', id)
  395. fetch('https://trace.moe/api/search', {
  396. method: 'POST',
  397. body: JSON.stringify({ image: imgBS4 }),
  398. headers: { "Content-Type": "application/json" }
  399. })
  400. .then(respon => respon.json())
  401. .then(resolt => {
  402. if (resolt.docs && resolt.docs.length <= 0) {
  403. client.reply(from, 'Maaf, saya tidak tau ini anime apa', id)
  404. }
  405. const { is_adult, title, title_chinese, title_romaji, title_english, episode, similarity, filename, at, tokenthumb, anilist_id } = resolt.docs[0]
  406. teks = ''
  407. if (similarity < 0.92) {
  408. teks = '*Saya memiliki keyakinan rendah dalam hal ini* :\n\n'
  409. }
  410. teks += `➸ *Title Japanese* : ${title}\n➸ *Title chinese* : ${title_chinese}\n➸ *Title Romaji* : ${title_romaji}\n➸ *Title English* : ${title_english}\n`
  411. teks += `➸ *Ecchi* : ${is_adult}\n`
  412. teks += `➸ *Eps* : ${episode.toString()}\n`
  413. teks += `➸ *Kesamaan* : ${(similarity * 100).toFixed(1)}%\n`
  414. var video = `https://media.trace.moe/video/${anilist_id}/${encodeURIComponent(filename)}?t=${at}&token=${tokenthumb}`;
  415. client.sendFileFromUrl(from, video, 'nimek.mp4', teks, id).catch(() => {
  416. client.reply(from, teks, id)
  417. })
  418. })
  419. .catch(() => {
  420. client.reply(from, 'Error !', id)
  421. })
  422. } else {
  423. client.sendFile(from, './media/img/tutod.jpg', 'Tutor.jpg', 'Neh contoh mhank!', id)
  424. }
  425. break
  426. case '!quotemaker':
  427. arg = body.trim().split('|')
  428. if (arg.length >= 4) {
  429. client.reply(from, mess.wait, id)
  430. const quotes = encodeURIComponent(arg[1])
  431. const author = encodeURIComponent(arg[2])
  432. const theme = encodeURIComponent(arg[3])
  433. await quotemaker(quotes, author, theme).then(amsu => {
  434. client.sendFile(from, amsu, 'quotesmaker.jpg','neh...').catch(() => {
  435. client.reply(from, mess.error.Qm, id)
  436. })
  437. })
  438. } else {
  439. client.reply(from, 'Usage: \n!quotemaker |teks|watermark|theme\n\nEx :\n!quotemaker |ini contoh|bicit|random', id)
  440. }
  441. break
  442. case '!linkgroup':
  443. if (!isBotGroupAdmins) return client.reply(from, 'Perintah ini hanya bisa di gunakan ketika bot menjadi admin', id)
  444. if (isGroupMsg) {
  445. const inviteLink = await client.getGroupInviteLink(groupId);
  446. client.sendLinkWithAutoPreview(from, inviteLink, `\nLink group *${name}*`)
  447. } else {
  448. client.reply(from, 'Perintah ini hanya bisa di gunakan dalam group!', id)
  449. }
  450. break
  451. case '!bc':
  452. if (!isOwner) return client.reply(from, 'Perintah ini hanya untuk Owner bot!', id)
  453. let msg = body.slice(4)
  454. const chatz = await client.getAllChatIds()
  455. for (let ids of chatz) {
  456. var cvk = await client.getChatById(ids)
  457. if (!cvk.isReadOnly) await client.sendText(ids, `[ Shinomiya Kaguya BOT Broadcast ]\n\n${msg}`)
  458. }
  459. client.reply(from, 'Broadcast Success!', id)
  460. break
  461. case '!adminlist':
  462. if (!isGroupMsg) return client.reply(from, 'Perintah ini hanya bisa di gunakan dalam group!', id)
  463. let mimin = ''
  464. for (let admon of groupAdmins) {
  465. mimin += `➸ @${admon.replace(/@c.us/g, '')}\n`
  466. }
  467. await client.sendTextWithMentions(from, mimin)
  468. break
  469. case '!ownergroup':
  470. if (!isGroupMsg) return client.reply(from, 'Perintah ini hanya bisa di gunakan dalam group!', id)
  471. const Owner_ = chat.groupMetadata.owner
  472. await client.sendTextWithMentions(from, `Owner Group : @${Owner_}`)
  473. break
  474. case '!mentionall':
  475. if (!isGroupMsg) return client.reply(from, 'Perintah ini hanya bisa di gunakan dalam group!', id)
  476. if (!isGroupAdmins) return client.reply(from, 'Perintah ini hanya bisa di gunakan oleh admin group', id)
  477. const groupMem = await client.getGroupMembers(groupId)
  478. let hehe = '╔══✪〘 Mention All 〙✪══\n'
  479. for (let i = 0; i < groupMem.length; i++) {
  480. hehe += '╠➥'
  481. hehe += ` @${groupMem[i].id.replace(/@c.us/g, '')}\n`
  482. }
  483. hehe += '╚═〘 Shinomiya Kaguya BOT 〙'
  484. await client.sendTextWithMentions(from, hehe)
  485. break
  486. case '!kickall':
  487. if (!isGroupMsg) return client.reply(from, 'Perintah ini hanya bisa di gunakan dalam group!', id)
  488. const isGroupOwner = sender.id === chat.groupMetadata.owner
  489. if (!isGroupOwner) return client.reply(from, 'Perintah ini hanya bisa di gunakan oleh Owner group', id)
  490. if (!isBotGroupAdmins) return client.reply(from, 'Perintah ini hanya bisa di gunakan ketika bot menjadi admin', id)
  491. const allMem = await client.getGroupMembers(groupId)
  492. for (let i = 0; i < allMem.length; i++) {
  493. if (groupAdmins.includes(allMem[i].id)) {
  494. console.log('Upss this is Admin group')
  495. } else {
  496. await client.removeParticipant(groupId, allMem[i].id)
  497. }
  498. }
  499. client.reply(from, 'Succes kick all member', id)
  500. break
  501. case '!leaveall':
  502. if (!isOwner) return client.reply(from, 'Perintah ini hanya untuk Owner bot', id)
  503. const allChats = await client.getAllChatIds()
  504. const allGroups = await client.getAllGroups()
  505. for (let gclist of allGroups) {
  506. await client.sendText(gclist.contact.id, `Maaf bot sedang pembersihan, total chat aktif : ${allChats.length}`)
  507. await client.leaveGroup(gclist.contact.id)
  508. }
  509. client.reply(from, 'Succes leave all group!', id)
  510. break
  511. case '!clearall':
  512. if (!isOwner) return client.reply(from, 'Perintah ini hanya untuk Owner bot', id)
  513. const allChatz = await client.getAllChats()
  514. for (let dchat of allChatz) {
  515. await client.deleteChat(dchat.id)
  516. }
  517. client.reply(from, 'Succes clear all chat!', id)
  518. break
  519. case '!add':
  520. const orang = args[1]
  521. if (!isGroupMsg) return client.reply(from, 'Fitur ini hanya bisa di gunakan dalam group', id)
  522. if (args.length === 1) return client.reply(from, 'Untuk menggunakan fitur ini, kirim perintah *!add* 628xxxxx', id)
  523. if (!isGroupAdmins) return client.reply(from, 'Perintah ini hanya bisa di gunakan oleh admin group', id)
  524. if (!isBotGroupAdmins) return client.reply(from, 'Perintah ini hanya bisa di gunakan ketika bot menjadi admin', id)
  525. try {
  526. await client.addParticipant(from,`${orang}@c.us`)
  527. } catch {
  528. client.reply(from, mess.error.Ad, id)
  529. }
  530. break
  531. case '!kick':
  532. if (!isGroupMsg) return client.reply(from, 'Fitur ini hanya bisa di gunakan dalam group', id)
  533. if (!isGroupAdmins) return client.reply(from, 'Perintah ini hanya bisa di gunakan oleh admin group', id)
  534. if (!isBotGroupAdmins) return client.reply(from, 'Perintah ini hanya bisa di gunakan ketika bot menjadi admin', id)
  535. if (mentionedJidList.length === 0) return client.reply(from, 'Untuk menggunakan Perintah ini, kirim perintah *!kick* @tagmember', id)
  536. await client.sendText(from, `Perintah diterima, mengeluarkan:\n${mentionedJidList.join('\n')}`)
  537. for (let i = 0; i < mentionedJidList.length; i++) {
  538. if (groupAdmins.includes(mentionedJidList[i])) return client.reply(from, mess.error.Ki, id)
  539. await client.removeParticipant(groupId, mentionedJidList[i])
  540. }
  541. break
  542. case '!leave':
  543. if (!isGroupMsg) return client.reply(from, 'Perintah ini hanya bisa di gunakan dalam group', id)
  544. if (!isGroupAdmins) return client.reply(from, 'Perintah ini hanya bisa di gunakan oleh admin group', id)
  545. await client.sendText(from,'Sayonara').then(() => client.leaveGroup(groupId))
  546. break
  547. case '!promote':
  548. if (!isGroupMsg) return client.reply(from, 'Fitur ini hanya bisa di gunakan dalam group', id)
  549. if (!isGroupAdmins) return client.reply(from, 'Fitur ini hanya bisa di gunakan oleh admin group', id)
  550. if (!isBotGroupAdmins) return client.reply(from, 'Fitur ini hanya bisa di gunakan ketika bot menjadi admin', id)
  551. if (mentionedJidList.length === 0) return client.reply(from, 'Untuk menggunakan fitur ini, kirim perintah *!promote* @tagmember', id)
  552. if (mentionedJidList.length >= 2) return client.reply(from, 'Maaf, perintah ini hanya dapat digunakan kepada 1 user.', id)
  553. if (groupAdmins.includes(mentionedJidList[0])) return client.reply(from, 'Maaf, user tersebut sudah menjadi admin.', id)
  554. await client.promoteParticipant(groupId, mentionedJidList[0])
  555. await client.sendTextWithMentions(from, `Perintah diterima, menambahkan @${mentionedJidList[0]} sebagai admin.`)
  556. break
  557. case '!demote':
  558. if (!isGroupMsg) return client.reply(from, 'Fitur ini hanya bisa di gunakan dalam group', id)
  559. if (!isGroupAdmins) return client.reply(from, 'Fitur ini hanya bisa di gunakan oleh admin group', id)
  560. if (!isBotGroupAdmins) return client.reply(from, 'Fitur ini hanya bisa di gunakan ketika bot menjadi admin', id)
  561. if (mentionedJidList.length === 0) return client.reply(from, 'Untuk menggunakan fitur ini, kirim perintah *!demote* @tagadmin', id)
  562. if (mentionedJidList.length >= 2) return client.reply(from, 'Maaf, perintah ini hanya dapat digunakan kepada 1 orang.', id)
  563. if (!groupAdmins.includes(mentionedJidList[0])) return client.reply(from, 'Maaf, user tersebut tidak menjadi admin.', id)
  564. await client.demoteParticipant(groupId, mentionedJidList[0])
  565. await client.sendTextWithMentions(from, `Perintah diterima, menghapus jabatan @${mentionedJidList[0]}.`)
  566. break
  567. case '!join':
  568. //return client.reply(from, 'Jika ingin meng-invite bot ke group anda, silahkan izin ke wa.me/6285892766102', id)
  569. if (args.length < 2) return client.reply(from, 'Kirim perintah *!join linkgroup key*\n\nEx:\n!join https://chat.whatsapp.com/blablablablablabla abcde\nuntuk key kamu bisa mendapatkannya hanya dengan donasi 5k', id)
  570. const link = args[1]
  571. const key = args[2]
  572. const tGr = await client.getAllGroups()
  573. const minMem = 30
  574. const isLink = link.match(/(https:\/\/chat.whatsapp.com)/gi)
  575. if (key !== 'lGjYt4zA5SQlTDx9z9Ca') return client.reply(from, '*key* salah! silahkan chat owner bot unruk mendapatkan key yang valid', id)
  576. const check = await client.inviteInfo(link)
  577. if (!isLink) return client.reply(from, 'Ini link? 👊🤬', id)
  578. if (tGr.length > 15) return client.reply(from, 'Maaf jumlah group sudah maksimal!', id)
  579. if (check.size < minMem) return client.reply(from, 'Member group tidak melebihi 30, bot tidak bisa masuk', id)
  580. if (check.status === 200) {
  581. await client.joinGroupViaLink(link).then(() => client.reply(from, 'Bot akan segera masuk!'))
  582. } else {
  583. client.reply(from, 'Link group tidak valid!', id)
  584. }
  585. break
  586. case '!delete':
  587. if (!isGroupMsg) return client.reply(from, 'Fitur ini hanya bisa di gunakan dalam group', id)
  588. if (!isGroupAdmins) return client.reply(from, 'Fitur ini hanya bisa di gunakan oleh admin group', id)
  589. if (!quotedMsg) return client.reply(from, 'Salah!!, kirim perintah *!delete [tagpesanbot]*', id)
  590. if (!quotedMsgObj.fromMe) return client.reply(from, 'Salah!!, Bot tidak bisa mengahpus chat user lain!', id)
  591. client.deleteMessage(quotedMsgObj.chatId, quotedMsgObj.id, false)
  592. break
  593. case '!getses':
  594. const sesPic = await client.getSnapshot()
  595. client.sendFile(from, sesPic, 'session.png', 'Neh...', id)
  596. break
  597. case '!lirik':
  598. if (args.length == 1) return client.reply(from, 'Kirim perintah *!lirik [optional]*, contoh *!lirik aku bukan boneka*', id)
  599. const lagu = body.slice(7)
  600. const lirik = await liriklagu(lagu)
  601. client.reply(from, lirik, id)
  602. break
  603. case '!chord':
  604. if (args.length === 1) return client.reply(from, 'Kirim perintah *!chord [query]*, contoh *!chord aku bukan boneka*', id)
  605. const query__ = body.slice(7)
  606. const chord = await get.get(`https://mhankbarbar.herokuapp.com/api/chord?q=${query__}&apiKey=${apiKey}`).json()
  607. if (chord.error) return client.reply(from, chord.error, id)
  608. client.reply(from, chord.result, id)
  609. break
  610. case '!listdaerah':
  611. const listDaerah = await get('https://mhankbarbar.herokuapp.com/daerah').json()
  612. client.reply(from, listDaerah.result, id)
  613. break
  614. case '!listblock':
  615. let hih = `This is list of blocked number\nTotal : ${blockNumber.length}\n`
  616. for (let i of blockNumber) {
  617. hih += `➸ @${i.replace(/@c.us/g,'')}\n`
  618. }
  619. client.sendTextWithMentions(from, hih, id)
  620. break
  621. case '!jadwalshalat':
  622. if (args.length === 1) return client.reply(from, '[❗] Kirim perintah *!jadwalShalat [daerah]*\ncontoh : *!jadwalShalat Tangerang*\nUntuk list daerah kirim perintah *!listDaerah*')
  623. const daerah = body.slice(14)
  624. const jadwalShalat = await get.get(`https://mhankbarbars.herokuapp.com/api/jadwalshalat?daerah=${daerah}&apiKey=${apiKey}`).json()
  625. if (jadwalShalat.error) return client.reply(from, jadwalShalat.error, id)
  626. const { Imsyak, Subuh, Dhuha, Dzuhur, Ashar, Maghrib, Isya } = await jadwalShalat
  627. arrbulan = ["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"];
  628. tgl = new Date().getDate()
  629. bln = new Date().getMonth()
  630. thn = new Date().getFullYear()
  631. const resultJadwal = `Jadwal shalat di ${daerah}, ${tgl}-${arrbulan[bln]}-${thn}\n\nImsyak : ${Imsyak}\nSubuh : ${Subuh}\nDhuha : ${Dhuha}\nDzuhur : ${Dzuhur}\nAshar : ${Ashar}\nMaghrib : ${Maghrib}\nIsya : ${Isya}`
  632. client.reply(from, resultJadwal, id)
  633. break
  634. case '!listchannel':
  635. client.reply(from, listChannel, id)
  636. break
  637. case '!jadwaltv':
  638. if (args.length === 1) return client.reply(from, 'Kirim perintah *!jadwalTv [channel]*', id)
  639. const query = body.slice(10).toLowerCase()
  640. const jadwal = await jadwalTv(query)
  641. client.reply(from, jadwal, id)
  642. break
  643. case '!jadwaltvnow':
  644. const jadwalNow = await get.get('https://api.haipbis.xyz/jadwaltvnow').json()
  645. client.reply(from, `Jam : ${jadwalNow.jam}\n\nJadwalTV : ${jadwalNow.jadwalTV}`, id)
  646. break
  647. case '!loli':
  648. const loli = await get.get('https://mhankbarbars.herokuapp.com/api/randomloli').json()
  649. client.sendFileFromUrl(from, loli.result, 'loli.jpeg', 'Lolinya om', id)
  650. break
  651. case '!waifu':
  652. const waifu = await get.get(`https://mhankbarbars.herokuapp.com/api/waifu?apiKey=${apiKey}`).json()
  653. client.sendFileFromUrl(from, waifu.image, 'Waifu.jpg', `➸ Name : ${waifu.name}\n➸ Description : ${waifu.desc}\n\n➸ Source : ${waifu.source}`, id)
  654. break
  655. case '!husbu':
  656. const diti = fs.readFileSync('./lib/husbu.json')
  657. const ditiJsin = JSON.parse(diti)
  658. const rindIndix = Math.floor(Math.random() * ditiJsin.length)
  659. const rindKiy = ditiJsin[rindIndix]
  660. client.sendFileFromUrl(from, rindKiy.image, 'Husbu.jpg', rindKiy.teks, id)
  661. break
  662. case '!randomhentai':
  663. if (isGroupMsg) {
  664. if (!isNsfw) return client.reply(from, 'Command/Perintah NSFW belum di aktifkan di group ini!', id)
  665. const hentai = await randomNimek('hentai')
  666. if (hentai.endsWith('.png')) {
  667. var ext = '.png'
  668. } else {
  669. var ext = '.jpg'
  670. }
  671. client.sendFileFromUrl(from, hentai, `Hentai${ext}`, 'Hentai!', id)
  672. break
  673. } else {
  674. const hentai = await randomNimek('hentai')
  675. if (hentai.endsWith('.png')) {
  676. var ext = '.png'
  677. } else {
  678. var ext = '.jpg'
  679. }
  680. client.sendFileFromUrl(from, hentai, `Hentai${ext}`, 'Hentai!', id)
  681. }
  682. case '!randomnsfwneko':
  683. if (isGroupMsg) {
  684. if (!isNsfw) return client.reply(from, 'Command/Perintah NSFW belum di aktifkan di group ini!', id)
  685. const nsfwneko = await randomNimek('nsfw')
  686. if (nsfwneko.endsWith('.png')) {
  687. var ext = '.png'
  688. } else {
  689. var ext = '.jpg'
  690. }
  691. client.sendFileFromUrl(from, nsfwneko, `nsfwNeko${ext}`, 'Nsfwneko!', id)
  692. } else {
  693. const nsfwneko = await randomNimek('nsfw')
  694. if (nsfwneko.endsWith('.png')) {
  695. var ext = '.png'
  696. } else {
  697. var ext = '.jpg'
  698. }
  699. client.sendFileFromUrl(from, nsfwneko, `nsfwNeko${ext}`, 'Nsfwneko!', id)
  700. }
  701. break
  702. case '!randomnekonime':
  703. const nekonime = await get.get('https://mhankbarbars.herokuapp.com/api/nekonime').json()
  704. if (nekonime.result.endsWith('.png')) {
  705. var ext = '.png'
  706. } else {
  707. var ext = '.jpg'
  708. }
  709. client.sendFileFromUrl(from, nekonime.result, `Nekonime${ext}`, 'Nekonime!', id)
  710. break
  711. case '!randomtrapnime':
  712. const trap = await randomNimek('trap')
  713. if (trap.endsWith('.png')) {
  714. var ext = '.png'
  715. } else {
  716. var ext = '.jpg'
  717. }
  718. client.sendFileFromUrl(from, trap, `trapnime${ext}`, 'Trapnime!', id)
  719. break
  720. case '!randomanime':
  721. const nime = await randomNimek('anime')
  722. if (nime.endsWith('.png')) {
  723. var ext = '.png'
  724. } else {
  725. var ext = '.jpg'
  726. }
  727. client.sendFileFromUrl(from, nime, `Randomanime${ext}`, 'Randomanime!', id)
  728. break
  729. case '!inu':
  730. const list = ["https://cdn.shibe.online/shibes/247d0ac978c9de9d9b66d72dbdc65f2dac64781d.jpg","https://cdn.shibe.online/shibes/1cf322acb7d74308995b04ea5eae7b520e0eae76.jpg","https://cdn.shibe.online/shibes/1ce955c3e49ae437dab68c09cf45297d68773adf.jpg","https://cdn.shibe.online/shibes/ec02bee661a797518d37098ab9ad0c02da0b05c3.jpg","https://cdn.shibe.online/shibes/1e6102253b51fbc116b887e3d3cde7b5c5083542.jpg","https://cdn.shibe.online/shibes/f0c07a7205d95577861eee382b4c8899ac620351.jpg","https://cdn.shibe.online/shibes/3eaf3b7427e2d375f09fc883f94fa8a6d4178a0a.jpg","https://cdn.shibe.online/shibes/c8b9fcfde23aee8d179c4c6f34d34fa41dfaffbf.jpg","https://cdn.shibe.online/shibes/55f298bc16017ed0aeae952031f0972b31c959cb.jpg","https://cdn.shibe.online/shibes/2d5dfe2b0170d5de6c8bc8a24b8ad72449fbf6f6.jpg","https://cdn.shibe.online/shibes/e9437de45e7cddd7d6c13299255e06f0f1d40918.jpg","https://cdn.shibe.online/shibes/6c32141a0d5d089971d99e51fd74207ff10751e7.jpg","https://cdn.shibe.online/shibes/028056c9f23ff40bc749a95cc7da7a4bb734e908.jpg","https://cdn.shibe.online/shibes/4fb0c8b74dbc7653e75ec1da597f0e7ac95fe788.jpg","https://cdn.shibe.online/shibes/125563d2ab4e520aaf27214483e765db9147dcb3.jpg","https://cdn.shibe.online/shibes/ea5258fad62cebe1fedcd8ec95776d6a9447698c.jpg","https://cdn.shibe.online/shibes/5ef2c83c2917e2f944910cb4a9a9b441d135f875.jpg","https://cdn.shibe.online/shibes/6d124364f02944300ae4f927b181733390edf64e.jpg","https://cdn.shibe.online/shibes/92213f0c406787acd4be252edb5e27c7e4f7a430.jpg","https://cdn.shibe.online/shibes/40fda0fd3d329be0d92dd7e436faa80db13c5017.jpg","https://cdn.shibe.online/shibes/e5c085fc427528fee7d4c3935ff4cd79af834a82.jpg","https://cdn.shibe.online/shibes/f83fa32c0da893163321b5cccab024172ddbade1.jpg","https://cdn.shibe.online/shibes/4aa2459b7f411919bf8df1991fa114e47b802957.jpg","https://cdn.shibe.online/shibes/2ef54e174f13e6aa21bb8be3c7aec2fdac6a442f.jpg","https://cdn.shibe.online/shibes/fa97547e670f23440608f333f8ec382a75ba5d94.jpg","https://cdn.shibe.online/shibes/fb1b7150ed8eb4ffa3b0e61ba47546dd6ee7d0dc.jpg","https://cdn.shibe.online/shibes/abf9fb41d914140a75d8bf8e05e4049e0a966c68.jpg","https://cdn.shibe.online/shibes/f63e3abe54c71cc0d0c567ebe8bce198589ae145.jpg","https://cdn.shibe.online/shibes/4c27b7b2395a5d051b00691cc4195ef286abf9e1.jpg","https://cdn.shibe.online/shibes/00df02e302eac0676bb03f41f4adf2b32418bac8.jpg","https://cdn.shibe.online/shibes/4deaac9baec39e8a93889a84257338ebb89eca50.jpg","https://cdn.shibe.online/shibes/199f8513d34901b0b20a33758e6ee2d768634ebb.jpg","https://cdn.shibe.online/shibes/f3efbf7a77e5797a72997869e8e2eaa9efcdceb5.jpg","https://cdn.shibe.online/shibes/39a20ccc9cdc17ea27f08643b019734453016e68.jpg","https://cdn.shibe.online/shibes/e67dea458b62cf3daa4b1e2b53a25405760af478.jpg","https://cdn.shibe.online/shibes/0a892f6554c18c8bcdab4ef7adec1387c76c6812.jpg","https://cdn.shibe.online/shibes/1b479987674c9b503f32e96e3a6aeca350a07ade.jpg","https://cdn.shibe.online/shibes/0c80fc00d82e09d593669d7cce9e273024ba7db9.jpg","https://cdn.shibe.online/shibes/bbc066183e87457b3143f71121fc9eebc40bf054.jpg","https://cdn.shibe.online/shibes/0932bf77f115057c7308ef70c3de1de7f8e7c646.jpg","https://cdn.shibe.online/shibes/9c87e6bb0f3dc938ce4c453eee176f24636440e0.jpg","https://cdn.shibe.online/shibes/0af1bcb0b13edf5e9b773e34e54dfceec8fa5849.jpg","https://cdn.shibe.online/shibes/32cf3f6eac4673d2e00f7360753c3f48ed53c650.jpg","https://cdn.shibe.online/shibes/af94d8eeb0f06a0fa06f090f404e3bbe86967949.jpg","https://cdn.shibe.online/shibes/4b55e826553b173c04c6f17aca8b0d2042d309fb.jpg","https://cdn.shibe.online/shibes/a0e53593393b6c724956f9abe0abb112f7506b7b.jpg","https://cdn.shibe.online/shibes/7eba25846f69b01ec04de1cae9fed4b45c203e87.jpg","https://cdn.shibe.online/shibes/fec6620d74bcb17b210e2cedca72547a332030d0.jpg","https://cdn.shibe.online/shibes/26cf6be03456a2609963d8fcf52cc3746fcb222c.jpg","https://cdn.shibe.online/shibes/c41b5da03ad74b08b7919afc6caf2dd345b3e591.jpg","https://cdn.shibe.online/shibes/7a9997f817ccdabac11d1f51fac563242658d654.jpg","https://cdn.shibe.online/shibes/7221241bad7da783c3c4d84cfedbeb21b9e4deea.jpg","https://cdn.shibe.online/shibes/283829584e6425421059c57d001c91b9dc86f33b.jpg","https://cdn.shibe.online/shibes/5145c9d3c3603c9e626585cce8cffdfcac081b31.jpg","https://cdn.shibe.online/shibes/b359c891e39994af83cf45738b28e499cb8ffe74.jpg","https://cdn.shibe.online/shibes/0b77f74a5d9afaa4b5094b28a6f3ee60efcb3874.jpg","https://cdn.shibe.online/shibes/adccfdf7d4d3332186c62ed8eb254a49b889c6f9.jpg","https://cdn.shibe.online/shibes/3aac69180f777512d5dabd33b09f531b7a845331.jpg","https://cdn.shibe.online/shibes/1d25e4f592db83039585fa480676687861498db8.jpg","https://cdn.shibe.online/shibes/d8349a2436420cf5a89a0010e91bf8dfbdd9d1cc.jpg","https://cdn.shibe.online/shibes/eb465ef1906dccd215e7a243b146c19e1af66c67.jpg","https://cdn.shibe.online/shibes/3d14e3c32863195869e7a8ba22229f457780008b.jpg","https://cdn.shibe.online/shibes/79cedc1a08302056f9819f39dcdf8eb4209551a3.jpg","https://cdn.shibe.online/shibes/4440aa827f88c04baa9c946f72fc688a34173581.jpg","https://cdn.shibe.online/shibes/94ea4a2d4b9cb852e9c1ff599f6a4acfa41a0c55.jpg","https://cdn.shibe.online/shibes/f4478196e441aef0ada61bbebe96ac9a573b2e5d.jpg","https://cdn.shibe.online/shibes/96d4db7c073526a35c626fc7518800586fd4ce67.jpg","https://cdn.shibe.online/shibes/196f3ed10ee98557328c7b5db98ac4a539224927.jpg","https://cdn.shibe.online/shibes/d12b07349029ca015d555849bcbd564d8b69fdbf.jpg","https://cdn.shibe.online/shibes/80fba84353000476400a9849da045611a590c79f.jpg","https://cdn.shibe.online/shibes/94cb90933e179375608c5c58b3d8658ef136ad3c.jpg","https://cdn.shibe.online/shibes/8447e67b5d622ef0593485316b0c87940a0ef435.jpg","https://cdn.shibe.online/shibes/c39a1d83ad44d2427fc8090298c1062d1d849f7e.jpg","https://cdn.shibe.online/shibes/6f38b9b5b8dbf187f6e3313d6e7583ec3b942472.jpg","https://cdn.shibe.online/shibes/81a2cbb9a91c6b1d55dcc702cd3f9cfd9a111cae.jpg","https://cdn.shibe.online/shibes/f1f6ed56c814bd939645138b8e195ff392dfd799.jpg","https://cdn.shibe.online/shibes/204a4c43cfad1cdc1b76cccb4b9a6dcb4a5246d8.jpg","https://cdn.shibe.online/shibes/9f34919b6154a88afc7d001c9d5f79b2e465806f.jpg","https://cdn.shibe.online/shibes/6f556a64a4885186331747c432c4ef4820620d14.jpg","https://cdn.shibe.online/shibes/bbd18ae7aaf976f745bc3dff46b49641313c26a9.jpg","https://cdn.shibe.online/shibes/6a2b286a28183267fca2200d7c677eba73b1217d.jpg","https://cdn.shibe.online/shibes/06767701966ed64fa7eff2d8d9e018e9f10487ee.jpg","https://cdn.shibe.online/shibes/7aafa4880b15b8f75d916b31485458b4a8d96815.jpg","https://cdn.shibe.online/shibes/b501169755bcf5c1eca874ab116a2802b6e51a2e.jpg","https://cdn.shibe.online/shibes/a8989bad101f35cf94213f17968c33c3031c16fc.jpg","https://cdn.shibe.online/shibes/f5d78feb3baa0835056f15ff9ced8e3c32bb07e8.jpg","https://cdn.shibe.online/shibes/75db0c76e86fbcf81d3946104c619a7950e62783.jpg","https://cdn.shibe.online/shibes/8ac387d1b252595bbd0723a1995f17405386b794.jpg","https://cdn.shibe.online/shibes/4379491ef4662faa178f791cc592b52653fb24b3.jpg","https://cdn.shibe.online/shibes/4caeee5f80add8c3db9990663a356e4eec12fc0a.jpg","https://cdn.shibe.online/shibes/99ef30ea8bb6064129da36e5673649e957cc76c0.jpg","https://cdn.shibe.online/shibes/aeac6a5b0a07a00fba0ba953af27734d2361fc10.jpg","https://cdn.shibe.online/shibes/9a217cfa377cc50dd8465d251731be05559b2142.jpg","https://cdn.shibe.online/shibes/65f6047d8e1d247af353532db018b08a928fd62a.jpg","https://cdn.shibe.online/shibes/fcead395cbf330b02978f9463ac125074ac87ab4.jpg","https://cdn.shibe.online/shibes/79451dc808a3a73f99c339f485c2bde833380af0.jpg","https://cdn.shibe.online/shibes/bedf90869797983017f764165a5d97a630b7054b.jpg","https://cdn.shibe.online/shibes/dd20e5801badd797513729a3645c502ae4629247.jpg","https://cdn.shibe.online/shibes/88361ee50b544cb1623cb259bcf07b9850183e65.jpg","https://cdn.shibe.online/shibes/0ebcfd98e8aa61c048968cb37f66a2b5d9d54d4b.jpg"]
  731. let kya = list[Math.floor(Math.random() * list.length)]
  732. client.sendFileFromUrl(from, kya, 'Dog.jpeg', 'Inu')
  733. break
  734. case '!neko':
  735. q2 = Math.floor(Math.random() * 900) + 300;
  736. q3 = Math.floor(Math.random() * 900) + 300;
  737. client.sendFileFromUrl(from, 'http://placekitten.com/'+q3+'/'+q2, 'neko.png','Neko ')
  738. break
  739. case '!sendto':
  740. client.sendFile(from, './msgHndlr.js', 'msgHndlr.js')
  741. break
  742. case '!url2img':
  743. const _query = body.slice(9)
  744. if (!_query.match(isUrl)) return client.reply(from, mess.error.Iv, id)
  745. if (args.length === 1) return client.reply(from, 'Kirim perintah *!url2img [web]*\nContoh *!url2img https://google.com*', id)
  746. const url2img = await get.get(`https://mhankbarbar.herokuapp.com/api/url2image?url=${_query}&apiKey=${apiKey}`).json()
  747. if (url2img.error) return client.reply(from, url2img.error, id)
  748. client.sendFileFromUrl(from, url2img.result, 'kyaa.jpg', null, id)
  749. break
  750. case '!quote':
  751. case '!quotes':
  752. const quotes = await get.get('https://mhankbarbars.herokuapp.com/api/randomquotes').json()
  753. client.reply(from, `➸ *Quotes* : ${quotes.quotes}\n➸ *Author* : ${quotes.author}`, id)
  754. break
  755. case '!quotesnime':
  756. const skya = await get.get('https://mhankbarbars.herokuapp.com/api/quotesnime/random').json()
  757. skya_ = skya.data
  758. client.reply(from, `➸ *Quotes* : ${skya_.quote}\n➸ *Character* : ${skya_.character}\n➸ *Anime* : ${skya_.anime}`, id)
  759. break
  760. case '!meme':
  761. const response = await axios.get('https://meme-api.herokuapp.com/gimme/wholesomeanimemes');
  762. const { postlink, title, subreddit, url, nsfw, spoiler } = response.data
  763. client.sendFileFromUrl(from, `${url}`, 'meme.jpg', `${title}`)
  764. break
  765. case '!help':
  766. client.sendText(from, help)
  767. break
  768. case '!readme':
  769. client.reply(from, readme, id)
  770. break
  771. case '!info':
  772. client.sendLinkWithAutoPreview(from, 'https://github.com/mhankbarbar/whatsapp-bot', info)
  773. break
  774. case '!snk':
  775. client.reply(from, snk, id)
  776. break
  777. }
  778. } catch (err) {
  779. console.log(color('[ERROR]', 'red'), err)
  780. //client.kill().then(a => console.log(a))
  781. }
  782. }