├── lib ├── NSFW.json ├── welcome.json ├── color.js ├── fetcher.js ├── msgFilter.js ├── brainly.js ├── welcome.js ├── help.js ├── functions.js └── husbu.json ├── media ├── tts │ └── nope.txt └── img │ ├── nimek.jpg │ ├── tutod.jpg │ ├── Kaguya.png │ ├── before.jpg │ └── screenshot.jpeg ├── .gitignore ├── .github └── ISSUE_TEMPLATE │ └── feature_request.md ├── options.js ├── package.json ├── index.js ├── README.md ├── LICENSE └── msgHndlr.js /lib/NSFW.json: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /lib/welcome.json: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /media/tts/nope.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /media/img/nimek.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MhankBarBar/whatsapp-bot/HEAD/media/img/nimek.jpg -------------------------------------------------------------------------------- /media/img/tutod.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MhankBarBar/whatsapp-bot/HEAD/media/img/tutod.jpg -------------------------------------------------------------------------------- /media/img/Kaguya.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MhankBarBar/whatsapp-bot/HEAD/media/img/Kaguya.png -------------------------------------------------------------------------------- /media/img/before.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MhankBarBar/whatsapp-bot/HEAD/media/img/before.jpg -------------------------------------------------------------------------------- /media/img/screenshot.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MhankBarBar/whatsapp-bot/HEAD/media/img/screenshot.jpeg -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore node_modules folder 2 | node_modules 3 | 4 | # Ignore Session data 5 | *.data.json 6 | 7 | 8 | -------------------------------------------------------------------------------- /lib/color.js: -------------------------------------------------------------------------------- 1 | const chalk = require('chalk') 2 | 3 | module.exports = color = (text, color) => { 4 | return !color ? chalk.green(text) : chalk.keyword(color)(text) 5 | } -------------------------------------------------------------------------------- /lib/fetcher.js: -------------------------------------------------------------------------------- 1 | const fetch = require('node-fetch'); 2 | 3 | const getBase64 = async (url) => { 4 | const response = await fetch(url, { headers: { 'User-Agent': 'okhttp/4.5.0' } }); 5 | if (!response.ok) throw new Error(`unexpected response ${response.statusText}`); 6 | const buffer = await response.buffer(); 7 | const videoBase64 = `data:${response.headers.get('content-type')};base64,` + buffer.toString('base64'); 8 | if (buffer) 9 | return videoBase64; 10 | }; 11 | 12 | exports.getBase64 = getBase64; 13 | -------------------------------------------------------------------------------- /lib/msgFilter.js: -------------------------------------------------------------------------------- 1 | const usedCommandRecently = new Set() 2 | 3 | /** 4 | * Check is number filtered 5 | * @param {String} from 6 | */ 7 | const isFiltered = (from) => !!usedCommandRecently.has(from) 8 | 9 | /** 10 | * Add number to filter 11 | * @param {String} from 12 | */ 13 | const addFilter = (from) => { 14 | usedCommandRecently.add(from) 15 | setTimeout(() => usedCommandRecently.delete(from), 5000) // 5sec is delay before processing next command 16 | } 17 | 18 | module.exports = { 19 | isFiltered, 20 | addFilter 21 | } -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /options.js: -------------------------------------------------------------------------------- 1 | module.exports = options = (headless, start) => { 2 | const options = { 3 | sessionId: 'BarBar', 4 | headless: headless, 5 | qrTimeout: 0, 6 | authTimeout: 0, 7 | restartOnCrash: start, 8 | cacheEnabled: false, 9 | useChrome: true, 10 | killProcessOnBrowserClose: true, 11 | throwErrorOnTosBlock: false, 12 | chromiumArgs: [ 13 | '--no-sandbox', 14 | '--disable-setuid-sandbox', 15 | '--aggressive-cache-discard', 16 | '--disable-cache', 17 | '--disable-application-cache', 18 | '--disable-offline-load-stale-cache', 19 | '--disk-cache-size=0' 20 | ] 21 | } 22 | return options 23 | } 24 | -------------------------------------------------------------------------------- /lib/brainly.js: -------------------------------------------------------------------------------- 1 | const brainly = require('brainly-scraper') 2 | 3 | module.exports = BrainlySearch = (pertanyaan, jumlah, cb) => { 4 | brainly(pertanyaan.toString(),Number(jumlah)).then((res) => { 5 | let brainlyResult = [] 6 | res.data.forEach((ask) => { 7 | let opt = { 8 | pertanyaan: ask.pertanyaan, 9 | fotoPertanyaan: ask.questionMedia 10 | } 11 | ask.jawaban.forEach(answer => { 12 | opt.jawaban = { 13 | judulJawaban: answer.text, 14 | fotoJawaban: answer.media 15 | } 16 | }) 17 | brainlyResult.push(opt) 18 | }) 19 | return brainlyResult 20 | }).then(x => { 21 | cb(x) 22 | }).catch(err => { 23 | console.log(err.error) 24 | }) 25 | } 26 | -------------------------------------------------------------------------------- /lib/welcome.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs-extra') 2 | 3 | module.exports = welcome = async (client, event) => { 4 | //console.log(event.action) 5 | const welkom = JSON.parse(fs.readFileSync('./lib/welcome.json')) 6 | const isWelkom = welkom.includes(event.chat) 7 | try { 8 | if (event.action == 'add' && isWelkom) { 9 | const gChat = await client.getChatById(event.chat) 10 | const pChat = await client.getContact(event.who) 11 | const { contact, groupMetadata, name } = gChat 12 | const pepe = await client.getProfilePicFromServer(event.who) 13 | const capt = `Halo member baru👋, Welcome to group *${name}* selamat bergabung dan juga semoga betah disini.` 14 | if (pepe == '' || pepe == undefined) { 15 | await client.sendFileFromUrl(event.chat, 'https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcTQcODjk7AcA4wb_9OLzoeAdpGwmkJqOYxEBA&usqp=CAU', 'profile.jpg', capt) 16 | } else { 17 | await client.sendFileFromUrl(event.chat, pepe, 'profile.jpg', capt) 18 | } 19 | 20 | } 21 | } catch (err) { 22 | console.log(err) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "whatsapp-bot", 3 | "version": "2.0.0", 4 | "description": "Halo sesama pengguna, whatsapp-bot adalah skrip otomatisasi whatsapp atau lebih seperti bot yang merespons kata kunci tertentu dan beberapa fitur lain yang sedang kami kerjakan.", 5 | "main": "index.js", 6 | "scripts": { 7 | "start": "node index.js", 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "author": "Mhank BarBar", 11 | "license": "Apache-2.0", 12 | "dependencies": { 13 | "@open-wa/wa-automate": "^3.0.16", 14 | "@open-wa/wa-decrypt": "^2.0.1", 15 | "axios": "^0.21.1", 16 | "brainly-scraper": "^1.0.2", 17 | "emoji-regex": "^9.0.0", 18 | "chalk": "^4.1.0", 19 | "fs-extra": "^9.0.1", 20 | "got": "^11.7.0", 21 | "moment-timezone": "^0.5.31", 22 | "needle": "^2.5.2", 23 | "nhentai-api": "^3.0.2", 24 | "nhentai-js": "^4.0.0", 25 | "node-fetch": "^2.6.1", 26 | "node-gtts": "^2.0.2", 27 | "remove.bg": "^1.3.0", 28 | "request": "^2.88.2", 29 | "tiktok-scraper": "^1.3.4", 30 | "video-url-link": "^0.1.4" 31 | }, 32 | "directories": { 33 | "lib": "lib" 34 | }, 35 | "devDependencies": {}, 36 | "repository": { 37 | "type": "git", 38 | "url": "git+https://github.com/mhankbarbar/whatsapp-bot.git" 39 | }, 40 | "keywords": [ 41 | "Whatsapp-Bot" 42 | ], 43 | "bugs": { 44 | "url": "https://github.com/mhankbarbar/whatsapp-bot/issues" 45 | }, 46 | "homepage": "https://github.com/mhankbarbar/whatsapp-bot#readme" 47 | } 48 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | const { create, Client } = require('@open-wa/wa-automate') 2 | const welcome = require('./lib/welcome') 3 | const msgHandler = require('./msgHndlr') 4 | const options = require('./options') 5 | 6 | const start = async (client = new Client()) => { 7 | console.log('[SERVER] Server Started!') 8 | // Force it to keep the current session 9 | client.onStateChanged((state) => { 10 | console.log('[Client State]', state) 11 | if (state === 'CONFLICT' || state === 'UNLAUNCHED') client.forceRefocus() 12 | }) 13 | // listening on message 14 | client.onMessage((async (message) => { 15 | client.getAmountOfLoadedMessages() 16 | .then((msg) => { 17 | if (msg >= 3000) { 18 | client.cutMsgCache() 19 | } 20 | }) 21 | msgHandler(client, message) 22 | })) 23 | 24 | client.onGlobalParticipantsChanged((async (heuh) => { 25 | await welcome(client, heuh) 26 | //left(client, heuh) 27 | })) 28 | 29 | client.onAddedToGroup(((chat) => { 30 | let totalMem = chat.groupMetadata.participants.length 31 | if (totalMem < 30) { 32 | client.sendText(chat.id, `Cih member nya cuma ${totalMem}, Kalo mau invite bot, minimal jumlah mem ada 30`).then(() => client.leaveGroup(chat.id)).then(() => client.deleteChat(chat.id)) 33 | } else { 34 | client.sendText(chat.groupMetadata.id, `Halo warga grup *${chat.contact.name}* terimakasih sudah menginvite bot ini, untuk melihat menu silahkan kirim *!help*`) 35 | } 36 | })) 37 | 38 | /*client.onAck((x => { 39 | const { from, to, ack } = x 40 | if (x !== 3) client.sendSeen(to) 41 | }))*/ 42 | 43 | // listening on Incoming Call 44 | client.onIncomingCall(( async (call) => { 45 | await client.sendText(call.peerJid, 'Maaf, saya tidak bisa menerima panggilan. nelfon = block!') 46 | .then(() => client.contactBlock(call.peerJid)) 47 | })) 48 | } 49 | 50 | create(options(true, start)) 51 | .then(client => start(client)) 52 | .catch((error) => console.log(error)) 53 | -------------------------------------------------------------------------------- /lib/help.js: -------------------------------------------------------------------------------- 1 | function help() { 2 | return ` 3 | ┏ ❣ *SHINOMIYA KAGUYA BOT* ❣ 4 | ╿ 5 | ┷┯ ☾ Group Commands ☽ 6 | ╽ 7 | ┠❥ *!add 62858xxxxx* 8 | ┠❥ *!kick @tagmember* 9 | ┠❥ *!promote @tagmember* 10 | ┠❥ *!demote @tagadmin* 11 | ┠❥ *!mentionAll* 12 | ┠❥ *!adminList* 13 | ┠❥ *!ownerGroup* 14 | ┠❥ *!leave* 15 | ┠❥ *!linkGroup* 16 | ┠❥ *!delete [replyChatBot]* 17 | ┠❥ *!kickAll* 18 | ┠❥ *!NSFW [enable|disable]* 19 | ┠❥ *!welcome [enable|disable]* 20 | ╿ 21 | ┯┷ ☾ Downloader Commands ☽ 22 | ╽ 23 | ┠❥ *!ytmp3 [linkYt]* 24 | ┠❥ *!ytmp4 [linkYt]* 25 | ┠❥ *!ig [linkIg]* 26 | ┠❥ *!fb [linkFb]* 27 | ╿ 28 | ┷┯ ☾ Others Commands ☽ 29 | ╽ 30 | ┠❥ *!sticker* 31 | ┠❥ *!stickerGif* 32 | ┠❥ *!creator* 33 | ┠❥ *!neko* 34 | ┠❥ *!inu* 35 | ┠❥ *!jadwalShalat [daerah]* 36 | ┠❥ *!jadwalTv [channel]* 37 | ┠❥ *!cuaca [tempat]* 38 | ┠❥ *!tts [kode bhs] [teks]* 39 | ┠❥ *!igStalk [@username]* 40 | ┠❥ *!wiki [query]* 41 | ┠❥ *!anime [query]* 42 | ┠❥ *!brainly [pertanyaan] [.jumlah]* 43 | ┠❥ *!loli* 44 | ┠❥ *!waifu* 45 | ┠❥ *!husbu* 46 | ┠❥ *!randomNekoNime* 47 | ┠❥ *!randomTrapNime* 48 | ┠❥ *!randomAnime* 49 | ┠❥ *!info* 50 | ┠❥ *!infoGempa* 51 | ┠❥ *!meme* 52 | ┠❥ *!quotemaker [|teks|author|theme]* 53 | ┠❥ *!join [linkGroup]* 54 | ┠❥ *!quotes* 55 | ┠❥ *!quotesnime* 56 | ┠❥ *!wait* 57 | ┠❥ *!nulis [teks]* 58 | ┠❥ *!donasi* 59 | ┠❥ *!lirik [optional]* 60 | ┠❥ *!chord [query]* 61 | ╿ 62 | ╿ 63 | ╰╼❥ Kirim perintah *!readme* untuk mengetahui fungsi dan cara penggunaan perintah di atas, WAJIB BACA!!.` 64 | } 65 | exports.help = help() 66 | function readme() { 67 | return ` 68 | *[linkYt]* Diisi dengan link YouTube yang valid tanpa tanda “[” dan “]” 69 | Contoh : *!ytmp3 https://youtu.be/Bskehapzke8* 70 | 71 | *[linkYt]* Diisi dengan link YouTube yang valid tanpa tanda “[” dan “]” 72 | Contoh : *!ytmp4 https://youtu.be/Bskehapzke8* 73 | 74 | *[linkIg]* Diisi dengan link Instagram yang valid tanpa tanda “[” dan “]” 75 | Contoh : *!ig https://www.instagram.com/p/CFqRZTlluAi/?igshid=1gtxkbdqhnbbe* 76 | 77 | *[linkFb]* Diisi dengan link Facebook yang valid tanpa tanda “[” dan “]” 78 | Contoh : *!fb https://www.facebook.com/EpochTimesTrending/videos/310155606660409* 79 | 80 | *[daerah]* Diisi dengan daerah yang valid, tanpa tanda “[” dan “]” 81 | Contoh : *!jadwalShalat Tangerang* 82 | 83 | *[channel]* Diisi dengan channel televisi yang valid, tanpa tanda “[” dan “]” 84 | Contoh : *!jadwalTv Indosiar* 85 | 86 | *[tempat]* Diisi dengan tempat/lokasi yang valid, tanpa tanda “[” dan “]“ 87 | Contoh : *!cuaca tangerang* 88 | 89 | *[kode bhs]* Diisi dengan kode bahasa, contoh *id*, *en*, dll. Dan *[teks]* Diisi dengan teks yang ingin di jadikan voice, Masih sama seperti di atas tanpa tanda “[” dan “]” 90 | Contoh : *!tts id Test* 91 | Note : Max 250 huruf 92 | 93 | *[@username]* Diisi dengan username Instagram yang valid, tanpa tanda “[” dan “]” 94 | Contoh : *!igStalk @duar_amjay* 95 | 96 | *[|teks|author|theme]* Diisi dengan teks, author, dan theme, tanpa tanda “[” dan “]” 97 | Contoh : *!quotemaker |Odading|Mang Oleh|Shark* 98 | 99 | *[linkGroup]* Diisi dengan link group whatsapp yang valid, tanpa tanda “[” dan “]”. 100 | Contoh : *!join https://chat.whatsapp.com/Bhhw77d5t2gjao8* 101 | 102 | *[optional]* Diisi dengan teks|title lirik lagu, tanpa tanda “[” dan “]”. 103 | Contoh : *!lirik aku bukan boneka*` 104 | } 105 | exports.readme = readme() 106 | function info() { 107 | return `Bot ini di buat dengan bahasa pemrograman Node.js / JavaScript 108 | Source kode bot : https://github.com/mhankbarbar/whatsapp-bot 109 | Owner Bot : wa.me/6285892766102 110 | Author? : Ada pokoknya om, malas pasang nama doang 111 | 112 | Oh iya om, bot ini gratis ya, soalnya saya lihat banyak yang jual bot² kayak gini, tapi ini gratis kok.` 113 | } 114 | exports.info = info() 115 | function snk() { 116 | return `Syarat dan Ketentuan Bot *Shinomiya Kaguya* 117 | 1. Teks dan nama pengguna WhatsApp anda akan kami simpan di dalam server selama bot aktif 118 | 2. Data anda akan di hapus ketika bot Offline 119 | 3. Kami tidak menyimpan gambar, video, file, audio, dan dokumen yang anda kirim 120 | 4. Kami tidak akan pernah meminta anda untuk memberikan informasi pribadi 121 | 5. Jika menemukan Bug/Error silahkan langsung lapor ke Owner bot 122 | 6. Apapun yang anda perintah pada bot ini, KAMI TIDAK AKAN BERTANGGUNG JAWAB! 123 | 124 | Thanks !` 125 | } 126 | exports.snk = snk() 127 | function donate() { 128 | return `Ya halo om.. Mau donate? 129 | 130 | Kalo mau donate langsung ae ke : 131 | OVO/PULSA/GOPAY : 085892766102 132 | SAWERIA : https://saweria.co/donate/mhankbarbar 133 | 134 | Thanks !` 135 | } 136 | exports.donate = donate() 137 | function listChannel() { 138 | return `Daftar channel: 139 | 1. ANTV 140 | 2. GTV 141 | 3. Indosiar 142 | 4. iNewsTV 143 | 5. KompasTV 144 | 6. MNCTV 145 | 7. METROTV 146 | 8. NETTV 147 | 9. RCTI 148 | 10. SCTV 149 | 11. RTV 150 | 12. Trans7 151 | 13. TransTV` 152 | } 153 | exports.listChannel = listChannel() 154 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

This repository is no longer maintained by the owner

2 | 3 |

4 | 5 |

6 |

7 | 8 |

9 |

10 | 11 |

12 |

13 | 14 | 15 | 16 | 17 | 18 |

19 | 20 | ## Clone this project 21 | 22 | ```bash 23 | > git clone https://github.com/MhankBarBar/whatsapp-bot 24 | ``` 25 | 26 | ## Install the dependencies: 27 | Before running the below command, make sure you're in the project directory that 28 | you've just cloned!! 29 | 30 | ```bash 31 | > npm install gify-cli -g 32 | > npm i 33 | ``` 34 | 35 | ### Usage 36 | Before running this script, first edit [this section](https://github.com/MhankBarBar/whatsapp-bot/blob/master/msgHndlr.js#L67) with your WhatsApp number, remember your WhatsApp number! Not a bot number, then 37 | ```bash 38 | > npm start 39 | ``` 40 | 41 | ## Features 42 | 43 | | Sticker Creator | Feature | 44 | | :-----------: | :--------------------------------: | 45 | | ✅ | Send Photo with Caption | 46 | | ✅ | Reply A Photo | 47 | | ✅ | Image Url | 48 | | ✅ | Send Video or GIF with Caption | 49 | 50 | 51 | | Downloader | Feature | 52 | | :------------: | :---------------------------------------------: | 53 | | ✅ | YouTube mp3/mp4 Downloader | 54 | | ❌ | Doujin Downloader | 55 | | ✅ | Instagram Video/Image Downloader | 56 | | ✅ | Facebook Video Downloader | 57 | 58 | 59 | | Other | Feature | 60 | | :------------: | :---------------------------------------------: | 61 | | ✅ | Get a random meme | 62 | | ✅ | Text to speech | 63 | | ✅ | Get a random waifu images | 64 | | ✅ | Get a random quotes | 65 | | ✅ | Get a random anime quotes | 66 | | ✅ | Get info gempa from BMKG | 67 | | ✅ | Weather's report's | 68 | | ✅ | Wikipedia | 69 | | ✅ | Anime searcher | 70 | | ✅ | Get a random cat images | 71 | | ✅ | Get a random dog images | 72 | | And | Others... | 73 | 74 | 75 | | Group Only | Feature | 76 | | :------------: | :---------------------------------------------: | 77 | | ✅ | Promote User | 78 | | ✅ | Demote User | 79 | | ✅ | Kick User | 80 | | ✅ | Add User | 81 | | ✅ | Mention All User | 82 | | ✅ | Get link group | 83 | | ✅ | Get Admin list | 84 | | ✅ | Get owner group | 85 | | ✅ | enable or disable nsfw command| 86 | | ✅ | enable or disable welcome feature| 87 | 88 | 89 | | Owner Group Only | Feature | 90 | | :------------: | :---------------------------------------------: | 91 | | ✅ | Kick All Member Group | 92 | 93 | | Owner Bot Only | Feature | 94 | | :------------: | :---------------------------------------------: | 95 | | ✅ | leave all group | 96 | | ✅ | clear all message | 97 | | ✅ | Broadcast | 98 | 99 | 100 | ### Troubleshooting 101 | Make sure all the necessary dependencies are installed. 102 | https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md 103 | 104 | Fix Stuck on linux, install google chrome stable: 105 | ```bash 106 | > wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb 107 | > sudo apt install ./google-chrome-stable_current_amd64.deb 108 | ``` 109 | ## Special Thanks to 110 | * [`open-wa/wa-automate-nodejs`](https://github.com/open-wa/wa-automate-nodejs) 111 | * [`YogaSakti/imageToSticker`](https://github.com/YogaSakti/imageToSticker) 112 | * [`SomnathDas/Whatsapp-Botto-Re`](https://github.com/SomnathDas/Whatsapp-Botto-Re) 113 | 114 | ### Donate 115 | * [`Saweria`](https://saweria.co/donate/mhankbarbar) 116 | -------------------------------------------------------------------------------- /lib/functions.js: -------------------------------------------------------------------------------- 1 | const { default: got } = require('got/dist/source'); 2 | const fetch = require('node-fetch') 3 | const { getBase64 } = require("./fetcher") 4 | const request = require('request') 5 | const emoji = require('emoji-regex') 6 | const fs = require('fs-extra') 7 | 8 | const liriklagu = async (lagu) => { 9 | const response = await fetch(`http://scrap.terhambar.com/lirik?word=${lagu}`) 10 | if (!response.ok) throw new Error(`unexpected response ${response.statusText}`); 11 | const json = await response.json() 12 | if (json.status === true) return `Lirik Lagu ${lagu}\n\n${json.result.lirik}` 13 | return `[ Error ] Lirik Lagu ${lagu} tidak di temukan!` 14 | } 15 | 16 | 17 | const quotemaker = async (quotes, author = 'EmditorBerkelas', type = 'random') => { 18 | var q = quotes.replace(/ /g, '%20').replace('\n','%5Cn') 19 | const response = await fetch(`https://terhambar.com/aw/qts/?kata=${q}&author=${author}&tipe=${type}`) 20 | if (!response.ok) throw new Error(`unexpected response ${response.statusText}`) 21 | const json = await response.json() 22 | if (json.status) { 23 | if (json.result !== '') { 24 | const base64 = await getBase64(json.result) 25 | return base64 26 | } 27 | } 28 | } 29 | 30 | const emojiStrip = (string) => { 31 | return string.replace(emoji, '') 32 | } 33 | const fb = async (url) => { 34 | const response = await fetch(`http://scrap.terhambar.com/fb?link=${url}`) 35 | if (!response.ok) throw new Error(`unexpected response ${response.statusText}`) 36 | const json = await response.json() 37 | if (json.status === true) return { 38 | 'capt': json.result.title, 'exts': '.mp4', 'url': json.result.linkVideo.sdQuality 39 | } 40 | return { 41 | 'capt': '[ ERROR ] Not found!', 'exts': '.jpg', 'url': 'https://c4.wallpaperflare.com/wallpaper/976/117/318/anime-girls-404-not-found-glowing-eyes-girls-frontline-wallpaper-preview.jpg' 42 | } 43 | } 44 | 45 | const ss = async(query) => { 46 | request({ 47 | url: "https://api.apiflash.com/v1/urltoimage", 48 | encoding: "binary", 49 | qs: { 50 | access_key: "2fc9726e595d40eebdf6792f0dd07380", 51 | url: query 52 | } 53 | }, (error, response, body) => { 54 | if (error) { 55 | console.log(error); 56 | } else { 57 | fs.writeFile("./media/img/screenshot.jpeg", body, "binary", error => { 58 | console.log(error); 59 | }) 60 | } 61 | }) 62 | } 63 | 64 | const randomNimek = async (type) => { 65 | var url = 'https://api.computerfreaker.cf/v1/' 66 | switch(type) { 67 | case 'nsfw': 68 | const nsfw = await fetch(url + 'nsfwneko') 69 | if (!nsfw.ok) throw new Error(`unexpected response ${nsfw.statusText}`) 70 | const resultNsfw = await nsfw.json() 71 | return resultNsfw.url 72 | break 73 | case 'hentai': 74 | const hentai = await fetch(url + 'hentai') 75 | if (!hentai.ok) throw new Error(`unexpected response ${hentai.statusText}`) 76 | const resultHentai = await hentai.json() 77 | return resultHentai.url 78 | break 79 | case 'anime': 80 | let anime = await fetch(url + 'anime') 81 | if (!anime.ok) throw new Error(`unexpected response ${anime.statusText}`) 82 | const resultNime = await anime.json() 83 | return resultNime.url 84 | break 85 | case 'neko': 86 | let neko = await fetch(url + 'neko') 87 | if (!neko.ok) throw new Error(`unexpected response ${neko.statusText}`) 88 | const resultNeko = await neko.json() 89 | return resultNeko.url 90 | break 91 | case 'trap': 92 | let trap = await fetch(url + 'trap') 93 | if (!trap.ok) throw new Error(`unexpected response ${trap.statusText}`) 94 | const resultTrap = await trap.json() 95 | return resultTrap.url 96 | break 97 | } 98 | } 99 | 100 | const sleep = async (ms) => { 101 | return new Promise(resolve => setTimeout(resolve, ms)); 102 | } 103 | 104 | const jadwalTv = async (query) => { 105 | const res = await got.get(`https://api.haipbis.xyz/jadwaltv/${query}`).json() 106 | if (res.error) return res.error 107 | switch(query) { 108 | case 'antv': 109 | return `\t\t[ ANTV ]\n${res.join('\n')}` 110 | break 111 | case 'gtv': 112 | return `\t\t[ GTV ]\n${res.join('\n')}` 113 | break 114 | case 'indosiar': 115 | return `\t\t[ INDOSIAR ]\n${res.join('\n')}` 116 | break 117 | case 'inewstv': 118 | return `\t\t[ iNewsTV ]\n${res.join('\n')}` 119 | break 120 | case 'kompastv': 121 | return `\t\t[ KompasTV ]\n${res.join('\n')}` 122 | break 123 | case 'mnctv': 124 | return `\t\t[ MNCTV ]\n${res.join('\n')}` 125 | break 126 | case 'metrotv': 127 | return `\t\t[ MetroTV ]\n${res.join('\n')}` 128 | break 129 | case 'nettv': 130 | return `\t\t[ NetTV ]\n${res.join('\n')}` 131 | break 132 | case 'rcti': 133 | return `\t\t[ RCTI ]\n${res.join('\n')}` 134 | break 135 | case 'sctv': 136 | return `\t\t[ SCTV ]\n${res.join('\n')}` 137 | break 138 | case 'rtv': 139 | return `\t\t[ RTV ]\n${res.join('\n')}` 140 | break 141 | case 'trans7': 142 | return `\t\t[ Trans7 ]\n${res.join('\n')}` 143 | break 144 | case 'transtv': 145 | return `\t\t[ TransTV ]\n${res.join('\n')}` 146 | break 147 | default: 148 | return '[ ERROR ] Channel TV salah! silahkan cek list channel dengan mengetik perintah *!listChannel*' 149 | break 150 | } 151 | } 152 | 153 | exports.liriklagu = liriklagu; 154 | exports.quotemaker = quotemaker; 155 | exports.randomNimek = randomNimek 156 | exports.fb = fb 157 | exports.emojiStrip = emojiStrip 158 | exports.sleep = sleep 159 | exports.jadwalTv = jadwalTv 160 | exports.ss = ss -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright [2020] [MhankBarBar] 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /lib/husbu.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "teks": "Mikoto Mikoshiba", 4 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2017/08/joi-mikorin-featured-700x394.jpg" 5 | }, 6 | { 7 | "teks": "(Top Leader) Mikazuki Augus", 8 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/12/joi-mikazuki-top5-700x394.jpg" 9 | }, 10 | { 11 | "teks": "Azusagawa Sakuta", 12 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/12/Sakuta_Azusagawa_Anime_-_Screenshot_1-700x394.png" 13 | }, 14 | { 15 | "teks": "Hideyuki Maya", 16 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2017/01/joi-maya-featured-700x458.jpg" 17 | }, 18 | { 19 | "teks": "Slaine Troyard", 20 | "image": "http://jurnalotaku.com/wp-content/uploads/2019/10/husbufri-slaine-joi2-1-e1570784701581-700x421.jpg?x21210" 21 | }, 22 | { 23 | "teks": "Willem Kmetsch", 24 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2019/02/Films-TV-15_02_2019-21_33_37-700x394.png" 25 | }, 26 | { 27 | "teks": "Slaine Troyard", 28 | "image": "http://jurnalotaku.com/wp-content/uploads/2019/10/husbufri-slaine-joi2-1-e1570784701581-700x421.jpg?x21210" 29 | }, 30 | { 31 | "teks": "(Top Leader) Mikazuki Augus", 32 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/12/joi-mikazuki-top5-700x394.jpg" 33 | }, 34 | { 35 | "teks": "Hideyuki Maya", 36 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2017/01/joi-maya-featured-700x458.jpg" 37 | }, 38 | { 39 | "teks": "Willem Kmetsch", 40 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2019/02/Films-TV-15_02_2019-21_33_37-700x394.png" 41 | }, 42 | { 43 | "teks": "Kinoshita Hideyoshi", 44 | "image": "http://jurnalotaku.com/wp-content/uploads/2020/04/hideyoshi_cover-700x409.jpg?x21210" 45 | }, 46 | { 47 | "teks": "Azusagawa Sakuta", 48 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/12/Sakuta_Azusagawa_Anime_-_Screenshot_1-700x394.png" 49 | }, 50 | { 51 | "teks": "Kinoshita Hideyoshi", 52 | "image": "http://jurnalotaku.com/wp-content/uploads/2020/04/hideyoshi_cover-700x409.jpg?x21210" 53 | }, 54 | { 55 | "teks": "(Top Leader) Mikazuki Augus", 56 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/12/joi-mikazuki-top5-700x394.jpg" 57 | }, 58 | { 59 | "teks": "Slaine Troyard", 60 | "image": "http://jurnalotaku.com/wp-content/uploads/2019/10/husbufri-slaine-joi2-1-e1570784701581-700x421.jpg?x21210" 61 | }, 62 | { 63 | "teks": "Hideyuki Maya", 64 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2017/01/joi-maya-featured-700x458.jpg" 65 | }, 66 | { 67 | "teks": "Kinoshita Hideyoshi", 68 | "image": "http://jurnalotaku.com/wp-content/uploads/2020/04/hideyoshi_cover-700x409.jpg?x21210" 69 | }, 70 | { 71 | "teks": "Kinoshita Hideyoshi", 72 | "image": "http://jurnalotaku.com/wp-content/uploads/2020/04/hideyoshi_cover-700x409.jpg?x21210" 73 | }, 74 | { 75 | "teks": "Bakugou Katsuki", 76 | "image": "http://jurnalotaku.com/wp-content/uploads/2020/07/kacchan_cover1-700x409.jpg?x21210" 77 | }, 78 | { 79 | "teks": "Takigawa Yoshino", 80 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2019/02/husbufri-yoshino-joi10-700x394.jpg" 81 | }, 82 | { 83 | "teks": "Slaine Troyard", 84 | "image": "http://jurnalotaku.com/wp-content/uploads/2019/10/husbufri-slaine-joi2-1-e1570784701581-700x421.jpg?x21210" 85 | }, 86 | { 87 | "teks": "Hideyuki Maya", 88 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2017/01/joi-maya-featured-700x458.jpg" 89 | }, 90 | { 91 | "teks": "(Top Leader) Mikazuki Augus", 92 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/12/joi-mikazuki-top5-700x394.jpg" 93 | }, 94 | { 95 | "teks": "(CEO) Orga Itsuka", 96 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/11/joi-ceo-orga-featured-700x394.jpg" 97 | }, 98 | { 99 | "teks": "Takigawa Yoshino", 100 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2019/02/husbufri-yoshino-joi10-700x394.jpg" 101 | }, 102 | { 103 | "teks": "Kinoshita Hideyoshi", 104 | "image": "http://jurnalotaku.com/wp-content/uploads/2020/04/hideyoshi_cover-700x409.jpg?x21210" 105 | }, 106 | { 107 | "teks": "Slaine Troyard", 108 | "image": "http://jurnalotaku.com/wp-content/uploads/2019/10/husbufri-slaine-joi2-1-e1570784701581-700x421.jpg?x21210" 109 | }, 110 | { 111 | "teks": "Haruitsuki Abeno", 112 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2016/12/joi-abeno-featured-700x394.jpg" 113 | }, 114 | { 115 | "teks": "Azusagawa Sakuta", 116 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/12/Sakuta_Azusagawa_Anime_-_Screenshot_1-700x394.png" 117 | }, 118 | { 119 | "teks": "Azusagawa Sakuta", 120 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/12/Sakuta_Azusagawa_Anime_-_Screenshot_1-700x394.png" 121 | }, 122 | { 123 | "teks": "Hideyuki Maya", 124 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2017/01/joi-maya-featured-700x458.jpg" 125 | }, 126 | { 127 | "teks": "Slaine Troyard", 128 | "image": "http://jurnalotaku.com/wp-content/uploads/2019/10/husbufri-slaine-joi2-1-e1570784701581-700x421.jpg?x21210" 129 | }, 130 | { 131 | "teks": "Willem Kmetsch", 132 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2019/02/Films-TV-15_02_2019-21_33_37-700x394.png" 133 | }, 134 | { 135 | "teks": "Mikoto Mikoshiba", 136 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2017/08/joi-mikorin-featured-700x394.jpg" 137 | }, 138 | { 139 | "teks": "Mikoto Mikoshiba", 140 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2017/08/joi-mikorin-featured-700x394.jpg" 141 | }, 142 | { 143 | "teks": "(Top Leader) Mikazuki Augus", 144 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/12/joi-mikazuki-top5-700x394.jpg" 145 | }, 146 | { 147 | "teks": "(CEO) Orga Itsuka", 148 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/11/joi-ceo-orga-featured-700x394.jpg" 149 | }, 150 | { 151 | "teks": "Willem Kmetsch", 152 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2019/02/Films-TV-15_02_2019-21_33_37-700x394.png" 153 | }, 154 | { 155 | "teks": "Bakugou Katsuki", 156 | "image": "http://jurnalotaku.com/wp-content/uploads/2020/07/kacchan_cover1-700x409.jpg?x21210" 157 | }, 158 | { 159 | "teks": "Slaine Troyard", 160 | "image": "http://jurnalotaku.com/wp-content/uploads/2019/10/husbufri-slaine-joi2-1-e1570784701581-700x421.jpg?x21210" 161 | }, 162 | { 163 | "teks": "(Top Leader) Mikazuki Augus", 164 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/12/joi-mikazuki-top5-700x394.jpg" 165 | }, 166 | { 167 | "teks": "Willem Kmetsch", 168 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2019/02/Films-TV-15_02_2019-21_33_37-700x394.png" 169 | }, 170 | { 171 | "teks": "Kinoshita Hideyoshi", 172 | "image": "http://jurnalotaku.com/wp-content/uploads/2020/04/hideyoshi_cover-700x409.jpg?x21210" 173 | }, 174 | { 175 | "teks": "Mikoto Mikoshiba", 176 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2017/08/joi-mikorin-featured-700x394.jpg" 177 | }, 178 | { 179 | "teks": "Willem Kmetsch", 180 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2019/02/Films-TV-15_02_2019-21_33_37-700x394.png" 181 | }, 182 | { 183 | "teks": "Bakugou Katsuki", 184 | "image": "http://jurnalotaku.com/wp-content/uploads/2020/07/kacchan_cover1-700x409.jpg?x21210" 185 | }, 186 | { 187 | "teks": "Haruitsuki Abeno", 188 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2016/12/joi-abeno-featured-700x394.jpg" 189 | }, 190 | { 191 | "teks": "Takigawa Yoshino", 192 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2019/02/husbufri-yoshino-joi10-700x394.jpg" 193 | }, 194 | { 195 | "teks": "(Top Leader) Mikazuki Augus", 196 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/12/joi-mikazuki-top5-700x394.jpg" 197 | }, 198 | { 199 | "teks": "Slaine Troyard", 200 | "image": "http://jurnalotaku.com/wp-content/uploads/2019/10/husbufri-slaine-joi2-1-e1570784701581-700x421.jpg?x21210" 201 | }, 202 | { 203 | "teks": "(Top Leader) Mikazuki Augus", 204 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/12/joi-mikazuki-top5-700x394.jpg" 205 | }, 206 | { 207 | "teks": "Kinoshita Hideyoshi", 208 | "image": "http://jurnalotaku.com/wp-content/uploads/2020/04/hideyoshi_cover-700x409.jpg?x21210" 209 | }, 210 | { 211 | "teks": "Willem Kmetsch", 212 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2019/02/Films-TV-15_02_2019-21_33_37-700x394.png" 213 | }, 214 | { 215 | "teks": "Takigawa Yoshino", 216 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2019/02/husbufri-yoshino-joi10-700x394.jpg" 217 | }, 218 | { 219 | "teks": "Hideyuki Maya", 220 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2017/01/joi-maya-featured-700x458.jpg" 221 | }, 222 | { 223 | "teks": "(CEO) Orga Itsuka", 224 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/11/joi-ceo-orga-featured-700x394.jpg" 225 | }, 226 | { 227 | "teks": "(CEO) Orga Itsuka", 228 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/11/joi-ceo-orga-featured-700x394.jpg" 229 | }, 230 | { 231 | "teks": "Slaine Troyard", 232 | "image": "http://jurnalotaku.com/wp-content/uploads/2019/10/husbufri-slaine-joi2-1-e1570784701581-700x421.jpg?x21210" 233 | }, 234 | { 235 | "teks": "Haruitsuki Abeno", 236 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2016/12/joi-abeno-featured-700x394.jpg" 237 | }, 238 | { 239 | "teks": "Bakugou Katsuki", 240 | "image": "http://jurnalotaku.com/wp-content/uploads/2020/07/kacchan_cover1-700x409.jpg?x21210" 241 | }, 242 | { 243 | "teks": "Takigawa Yoshino", 244 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2019/02/husbufri-yoshino-joi10-700x394.jpg" 245 | }, 246 | { 247 | "teks": "Mikoto Mikoshiba", 248 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2017/08/joi-mikorin-featured-700x394.jpg" 249 | }, 250 | { 251 | "teks": "(Top Leader) Mikazuki Augus", 252 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/12/joi-mikazuki-top5-700x394.jpg" 253 | }, 254 | { 255 | "teks": "(Top Leader) Mikazuki Augus", 256 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/12/joi-mikazuki-top5-700x394.jpg" 257 | }, 258 | { 259 | "teks": "Azusagawa Sakuta", 260 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/12/Sakuta_Azusagawa_Anime_-_Screenshot_1-700x394.png" 261 | }, 262 | { 263 | "teks": "Azusagawa Sakuta", 264 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/12/Sakuta_Azusagawa_Anime_-_Screenshot_1-700x394.png" 265 | }, 266 | { 267 | "teks": "Azusagawa Sakuta", 268 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/12/Sakuta_Azusagawa_Anime_-_Screenshot_1-700x394.png" 269 | }, 270 | { 271 | "teks": "Azusagawa Sakuta", 272 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/12/Sakuta_Azusagawa_Anime_-_Screenshot_1-700x394.png" 273 | }, 274 | { 275 | "teks": "Takigawa Yoshino", 276 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2019/02/husbufri-yoshino-joi10-700x394.jpg" 277 | }, 278 | { 279 | "teks": "(Top Leader) Mikazuki Augus", 280 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/12/joi-mikazuki-top5-700x394.jpg" 281 | }, 282 | { 283 | "teks": "(CEO) Orga Itsuka", 284 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/11/joi-ceo-orga-featured-700x394.jpg" 285 | }, 286 | { 287 | "teks": "Mikoto Mikoshiba", 288 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2017/08/joi-mikorin-featured-700x394.jpg" 289 | }, 290 | { 291 | "teks": "Takigawa Yoshino", 292 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2019/02/husbufri-yoshino-joi10-700x394.jpg" 293 | }, 294 | { 295 | "teks": "(CEO) Orga Itsuka", 296 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/11/joi-ceo-orga-featured-700x394.jpg" 297 | }, 298 | { 299 | "teks": "Slaine Troyard", 300 | "image": "http://jurnalotaku.com/wp-content/uploads/2019/10/husbufri-slaine-joi2-1-e1570784701581-700x421.jpg?x21210" 301 | }, 302 | { 303 | "teks": "Willem Kmetsch", 304 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2019/02/Films-TV-15_02_2019-21_33_37-700x394.png" 305 | }, 306 | { 307 | "teks": "(Top Leader) Mikazuki Augus", 308 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/12/joi-mikazuki-top5-700x394.jpg" 309 | }, 310 | { 311 | "teks": "Bakugou Katsuki", 312 | "image": "http://jurnalotaku.com/wp-content/uploads/2020/07/kacchan_cover1-700x409.jpg?x21210" 313 | }, 314 | { 315 | "teks": "(CEO) Orga Itsuka", 316 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/11/joi-ceo-orga-featured-700x394.jpg" 317 | }, 318 | { 319 | "teks": "Kinoshita Hideyoshi", 320 | "image": "http://jurnalotaku.com/wp-content/uploads/2020/04/hideyoshi_cover-700x409.jpg?x21210" 321 | }, 322 | { 323 | "teks": "Willem Kmetsch", 324 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2019/02/Films-TV-15_02_2019-21_33_37-700x394.png" 325 | }, 326 | { 327 | "teks": "(Top Leader) Mikazuki Augus", 328 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/12/joi-mikazuki-top5-700x394.jpg" 329 | }, 330 | { 331 | "teks": "Hideyuki Maya", 332 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2017/01/joi-maya-featured-700x458.jpg" 333 | }, 334 | { 335 | "teks": "Takigawa Yoshino", 336 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2019/02/husbufri-yoshino-joi10-700x394.jpg" 337 | }, 338 | { 339 | "teks": "Kinoshita Hideyoshi", 340 | "image": "http://jurnalotaku.com/wp-content/uploads/2020/04/hideyoshi_cover-700x409.jpg?x21210" 341 | }, 342 | { 343 | "teks": "Kinoshita Hideyoshi", 344 | "image": "http://jurnalotaku.com/wp-content/uploads/2020/04/hideyoshi_cover-700x409.jpg?x21210" 345 | }, 346 | { 347 | "teks": "Slaine Troyard", 348 | "image": "http://jurnalotaku.com/wp-content/uploads/2019/10/husbufri-slaine-joi2-1-e1570784701581-700x421.jpg?x21210" 349 | }, 350 | { 351 | "teks": "Bakugou Katsuki", 352 | "image": "http://jurnalotaku.com/wp-content/uploads/2020/07/kacchan_cover1-700x409.jpg?x21210" 353 | }, 354 | { 355 | "teks": "Kinoshita Hideyoshi", 356 | "image": "http://jurnalotaku.com/wp-content/uploads/2020/04/hideyoshi_cover-700x409.jpg?x21210" 357 | }, 358 | { 359 | "teks": "Takigawa Yoshino", 360 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2019/02/husbufri-yoshino-joi10-700x394.jpg" 361 | }, 362 | { 363 | "teks": "(Top Leader) Mikazuki Augus", 364 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/12/joi-mikazuki-top5-700x394.jpg" 365 | }, 366 | { 367 | "teks": "Hideyuki Maya", 368 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2017/01/joi-maya-featured-700x458.jpg" 369 | }, 370 | { 371 | "teks": "(CEO) Orga Itsuka", 372 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/11/joi-ceo-orga-featured-700x394.jpg" 373 | }, 374 | { 375 | "teks": "Bakugou Katsuki", 376 | "image": "http://jurnalotaku.com/wp-content/uploads/2020/07/kacchan_cover1-700x409.jpg?x21210" 377 | }, 378 | { 379 | "teks": "Slaine Troyard", 380 | "image": "http://jurnalotaku.com/wp-content/uploads/2019/10/husbufri-slaine-joi2-1-e1570784701581-700x421.jpg?x21210" 381 | }, 382 | { 383 | "teks": "Takigawa Yoshino", 384 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2019/02/husbufri-yoshino-joi10-700x394.jpg" 385 | }, 386 | { 387 | "teks": "Azusagawa Sakuta", 388 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/12/Sakuta_Azusagawa_Anime_-_Screenshot_1-700x394.png" 389 | }, 390 | { 391 | "teks": "Willem Kmetsch", 392 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2019/02/Films-TV-15_02_2019-21_33_37-700x394.png" 393 | }, 394 | { 395 | "teks": "(Top Leader) Mikazuki Augus", 396 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2018/12/joi-mikazuki-top5-700x394.jpg" 397 | }, 398 | { 399 | "teks": "Haruitsuki Abeno", 400 | "image": "http://storage.jurnalotaku.com/wp-content/uploads/2016/12/joi-abeno-featured-700x394.jpg" 401 | } 402 | ] -------------------------------------------------------------------------------- /msgHndlr.js: -------------------------------------------------------------------------------- 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 | 23 | moment.tz.setDefault('Asia/Jakarta').locale('id') 24 | 25 | module.exports = msgHandler = async (client, message) => { 26 | try { 27 | const { type, id, from, t, sender, isGroupMsg, chat, caption, isMedia, mimetype, quotedMsg, quotedMsgObj, mentionedJidList } = message 28 | let { body } = message 29 | const { name, formattedTitle } = chat 30 | let { pushname, verifiedName } = sender 31 | pushname = pushname || verifiedName 32 | const commands = caption || body || '' 33 | const command = commands.toLowerCase().split(' ')[0] || '' 34 | const args = commands.split(' ') 35 | 36 | const msgs = (message) => { 37 | if (command.startsWith('!')) { 38 | if (message.length >= 10){ 39 | return `${message.substr(0, 15)}` 40 | }else{ 41 | return `${message}` 42 | } 43 | } 44 | } 45 | 46 | const mess = { 47 | wait: '[ WAIT ] Sedang di proses⏳ silahkan tunggu sebentar', 48 | error: { 49 | St: '[❗] Kirim gambar dengan caption *!sticker* atau tag gambar yang sudah dikirim', 50 | Qm: '[❗] Terjadi kesalahan, mungkin themenya tidak tersedia!', 51 | Yt3: '[❗] Terjadi kesalahan, tidak dapat meng konversi ke mp3!', 52 | Yt4: '[❗] Terjadi kesalahan, mungkin error di sebabkan oleh sistem.', 53 | Ig: '[❗] Terjadi kesalahan, mungkin karena akunnya private', 54 | Ki: '[❗] Bot tidak bisa mengeluarkan admin group!', 55 | Ad: '[❗] Tidak dapat menambahkan target, mungkin karena di private', 56 | Iv: '[❗] Link yang anda kirim tidak valid!' 57 | } 58 | } 59 | const apiKey = 'API-KEY' // apikey you can get it at https://mhankbarbar.moe 60 | const time = moment(t * 1000).format('DD/MM HH:mm:ss') 61 | const botNumber = await client.getHostNumber() 62 | const blockNumber = await client.getBlockedIds() 63 | const groupId = isGroupMsg ? chat.groupMetadata.id : '' 64 | const groupAdmins = isGroupMsg ? await client.getGroupAdmins(groupId) : '' 65 | const isGroupAdmins = isGroupMsg ? groupAdmins.includes(sender.id) : false 66 | const isBotGroupAdmins = isGroupMsg ? groupAdmins.includes(botNumber + '@c.us') : false 67 | const ownerNumber = ["628xxx@c.us","55xxxxx"] // replace with your whatsapp number 68 | const isOwner = ownerNumber.includes(sender.id) 69 | const isBlocked = blockNumber.includes(sender.id) 70 | const isNsfw = isGroupMsg ? nsfw_.includes(chat.id) : false 71 | 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' 72 | const isUrl = new RegExp(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)/gi) 73 | 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)) 74 | 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)) 75 | //if (!isGroupMsg && !command.startsWith('!')) console.log('\x1b[1;33m~\x1b[1;37m>', '[\x1b[1;31mMSG\x1b[1;37m]', time, color(body), 'from', color(pushname)) 76 | //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)) 77 | if (isBlocked) return 78 | //if (!isOwner) return 79 | switch(command) { 80 | case '!sticker': 81 | case '!stiker': 82 | if (isMedia && type === 'image') { 83 | const mediaData = await decryptMedia(message, uaOverride) 84 | const imageBase64 = `data:${mimetype};base64,${mediaData.toString('base64')}` 85 | await client.sendImageAsSticker(from, imageBase64) 86 | } else if (quotedMsg && quotedMsg.type == 'image') { 87 | const mediaData = await decryptMedia(quotedMsg, uaOverride) 88 | const imageBase64 = `data:${quotedMsg.mimetype};base64,${mediaData.toString('base64')}` 89 | await client.sendImageAsSticker(from, imageBase64) 90 | } else if (args.length === 2) { 91 | const url = args[1] 92 | if (url.match(isUrl)) { 93 | await client.sendStickerfromUrl(from, url, { method: 'get' }) 94 | .catch(err => console.log('Caught exception: ', err)) 95 | } else { 96 | client.reply(from, mess.error.Iv, id) 97 | } 98 | } else { 99 | client.reply(from, mess.error.St, id) 100 | } 101 | break 102 | case '!stickergif': 103 | case '!stikergif': 104 | case '!sgif': 105 | if (isMedia) { 106 | if (mimetype === 'video/mp4' && message.duration < 10 || mimetype === 'image/gif' && message.duration < 10) { 107 | const mediaData = await decryptMedia(message, uaOverride) 108 | client.reply(from, '[WAIT] Sedang di proses⏳ silahkan tunggu ± 1 min!', id) 109 | const filename = `./media/aswu.${mimetype.split('/')[1]}` 110 | await fs.writeFileSync(filename, mediaData) 111 | await exec(`gify ${filename} ./media/output.gif --fps=30 --scale=240:240`, async function (error, stdout, stderr) { 112 | const gif = await fs.readFileSync('./media/output.gif', { encoding: "base64" }) 113 | await client.sendImageAsSticker(from, `data:image/gif;base64,${gif.toString('base64')}`) 114 | }) 115 | } else ( 116 | client.reply(from, '[❗] Kirim video dengan caption *!stickerGif* max 10 sec!', id) 117 | ) 118 | } 119 | break 120 | case '!stickernobg': 121 | case '!stikernobg': 122 | if (isMedia) { 123 | try { 124 | var mediaData = await decryptMedia(message, uaOverride) 125 | var imageBase64 = `data:${mimetype};base64,${mediaData.toString('base64')}` 126 | var base64img = imageBase64 127 | var outFile = './media/img/noBg.png' 128 | // untuk api key kalian bisa dapatkan pada website remove.bg 129 | var result = await removeBackgroundFromImageBase64({ base64img, apiKey: 'API-KEY', size: 'auto', type: 'auto', outFile }) 130 | await fs.writeFile(outFile, result.base64img) 131 | await client.sendImageAsSticker(from, `data:${mimetype};base64,${result.base64img}`) 132 | } catch(err) { 133 | console.log(err) 134 | } 135 | } 136 | break 137 | case '!donasi': 138 | case '!donate': 139 | client.sendLinkWithAutoPreview(from, 'https://saweria.co/donate/mhankbarbar', donate) 140 | break 141 | case '!tts': 142 | if (args.length === 1) return client.reply(from, 'Kirim perintah *!tts [id, en, jp, ar] [teks]*, contoh *!tts id halo semua*') 143 | const ttsId = require('node-gtts')('id') 144 | const ttsEn = require('node-gtts')('en') 145 | const ttsJp = require('node-gtts')('ja') 146 | const ttsAr = require('node-gtts')('ar') 147 | const dataText = body.slice(8) 148 | if (dataText === '') return client.reply(from, 'Baka?', id) 149 | if (dataText.length > 500) return client.reply(from, 'Teks terlalu panjang!', id) 150 | var dataBhs = body.slice(5, 7) 151 | if (dataBhs == 'id') { 152 | ttsId.save('./media/tts/resId.mp3', dataText, function () { 153 | client.sendPtt(from, './media/tts/resId.mp3', id) 154 | }) 155 | } else if (dataBhs == 'en') { 156 | ttsEn.save('./media/tts/resEn.mp3', dataText, function () { 157 | client.sendPtt(from, './media/tts/resEn.mp3', id) 158 | }) 159 | } else if (dataBhs == 'jp') { 160 | ttsJp.save('./media/tts/resJp.mp3', dataText, function () { 161 | client.sendPtt(from, './media/tts/resJp.mp3', id) 162 | }) 163 | } else if (dataBhs == 'ar') { 164 | ttsAr.save('./media/tts/resAr.mp3', dataText, function () { 165 | client.sendPtt(from, './media/tts/resAr.mp3', id) 166 | }) 167 | } else { 168 | client.reply(from, 'Masukkan data bahasa : [id] untuk indonesia, [en] untuk inggris, [jp] untuk jepang, dan [ar] untuk arab', id) 169 | } 170 | break 171 | case '!nulis': 172 | if (args.length === 1) return client.reply(from, 'Kirim perintah *!nulis [teks]*', id) 173 | const nulis = encodeURIComponent(body.slice(7)) 174 | client.reply(from, mess.wait, id) 175 | let urlnulis = `https://mhankbarbar.moe/api/nulis?font=1&buku=1&text=${nulis}&apiKey=${apiKey}` 176 | await fetch(urlnulis, {method: "GET"}) 177 | .then(res => res.json()) 178 | .then(async (json) => { 179 | await client.sendFileFromUrl(from, json.result, 'Nulis.jpg', 'Nih anjim', id) 180 | }).catch(e => client.reply(from, "Error: "+ e)); 181 | break 182 | case '!ytmp3': 183 | if (args.length === 1) return client.reply(from, 'Kirim perintah *!ytmp3 [linkYt]*, untuk contoh silahkan kirim perintah *!readme*') 184 | let isLinks = args[1].match(/(?:https?:\/{2})?(?:w{3}\.)?youtu(?:be)?\.(?:com|be)(?:\/watch\?v=|\/)([^\s&]+)/) 185 | if (!isLinks) return client.reply(from, mess.error.Iv, id) 186 | try { 187 | client.reply(from, mess.wait, id) 188 | const resp = await get.get(`https://mhankbarbar.moe/api/yta?url=${args[1]}&apiKey=${apiKey}`).json() 189 | if (resp.error) { 190 | client.reply(from, resp.error, id) 191 | } else { 192 | const { title, thumb, filesize, result } = await resp 193 | if (Number(filesize.split(' MB')[0]) >= 30.00) return client.reply(from, 'Maaf durasi video sudah melebihi batas maksimal!', id) 194 | client.sendFileFromUrl(from, thumb, 'thumb.jpg', `➸ *Title* : ${title}\n➸ *Filesize* : ${filesize}\n\nSilahkan tunggu sebentar proses pengiriman file membutuhkan waktu beberapa menit.`, id) 195 | await client.sendFileFromUrl(from, result, `${title}.mp3`, '', id).catch(() => client.reply(from, mess.error.Yt3, id)) 196 | //await client.sendAudio(from, result, id) 197 | } 198 | } catch (err) { 199 | client.sendText(ownerNumber[0], 'Error ytmp3 : '+ err) 200 | client.reply(from, mess.error.Yt3, id) 201 | } 202 | break 203 | case '!ytmp4': 204 | if (args.length === 1) return client.reply(from, 'Kirim perintah *!ytmp4 [linkYt]*, untuk contoh silahkan kirim perintah *!readme*') 205 | let isLin = args[1].match(/(?:https?:\/{2})?(?:w{3}\.)?youtu(?:be)?\.(?:com|be)(?:\/watch\?v=|\/)([^\s&]+)/) 206 | if (!isLin) return client.reply(from, mess.error.Iv, id) 207 | try { 208 | client.reply(from, mess.wait, id) 209 | const ytv = await get.get(`https://mhankbarbar.moe/api/ytv?url=${args[1]}&apiKey=${apiKey}`).json() 210 | if (ytv.error) { 211 | client.reply(from, ytv.error, id) 212 | } else { 213 | if (Number(ytv.filesize.split(' MB')[0]) > 40.00) return client.reply(from, 'Maaf durasi video sudah melebihi batas maksimal!', id) 214 | 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) 215 | await client.sendFileFromUrl(from, ytv.result, `${ytv.title}.mp4`, '', id).catch(() => client.reply(from, mess.error.Yt4, id)) 216 | } 217 | } catch (er) { 218 | client.sendText(ownerNumber[0], 'Error ytmp4 : '+ er) 219 | client.reply(from, mess.error.Yt4, id) 220 | } 221 | break 222 | case '!wiki': 223 | if (args.length === 1) return client.reply(from, 'Kirim perintah *!wiki [query]*\nContoh : *!wiki asu*', id) 224 | const query_ = body.slice(6) 225 | const wiki = await get.get(`https://mhankbarbar.moe/api/wiki?q=${query_}&lang=id&apiKey=${apiKey}`).json() 226 | if (wiki.error) { 227 | client.reply(from, wiki.error, id) 228 | } else { 229 | client.reply(from, `➸ *Query* : ${query_}\n\n➸ *Result* : ${wiki.result}`, id) 230 | } 231 | break 232 | case '!cuaca': 233 | if (args.length === 1) return client.reply(from, 'Kirim perintah *!cuaca [tempat]*\nContoh : *!cuaca tangerang', id) 234 | const tempat = body.slice(7) 235 | const weather = await get.get(`https://mhankbarbar.moe/api/weather?city=${tempat}&apiKey=${apiKey}`).json() 236 | if (weather.error) { 237 | client.reply(from, weather.error, id) 238 | } else { 239 | 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) 240 | } 241 | break 242 | case '!fb': 243 | if (args.length === 1) return client.reply(from, 'Kirim perintah *!fb [linkFb]* untuk contoh silahkan kirim perintah *!readme*', id) 244 | if (!args[1].includes('facebook.com')) return client.reply(from, mess.error.Iv, id) 245 | client.reply(from, mess.wait, id) 246 | const epbe = await get.get(`https://mhankbarbars.moe/api/epbe?url=${args[1]}&apiKey=${apiKey}`).json() 247 | if (epbe.error) return client.reply(from, epbe.error, id) 248 | client.sendFileFromUrl(from, epbe.result, 'epbe.mp4', epbe.title, id) 249 | break 250 | case '!creator': 251 | client.sendContact(from, '6285892766102@c.us') 252 | break 253 | case '!ig': 254 | if (args.length === 1) return client.reply(from, 'Kirim perintah *!ig [linkIg]* untuk contoh silahkan kirim perintah *!readme*') 255 | if (!args[1].match(isUrl) && !args[1].includes('instagram.com')) return client.reply(from, mess.error.Iv, id) 256 | try { 257 | client.reply(from, mess.wait, id) 258 | const resp = await get.get(`https://mhankbarbar.moe/api/ig?url=${args[1]}&apiKey=${apiKey}`).json() 259 | if (resp.result.includes('.mp4')) { 260 | var ext = '.mp4' 261 | } else { 262 | var ext = '.jpg' 263 | } 264 | await client.sendFileFromUrl(from, resp.result, `igeh${ext}`, '', id) 265 | } catch { 266 | client.reply(from, mess.error.Ig, id) 267 | } 268 | break 269 | case '!nsfw': 270 | if (!isGroupMsg) return client.reply(from, 'Perintah ini hanya bisa di gunakan dalam group!', id) 271 | if (!isGroupAdmins) return client.reply(from, 'Perintah ini hanya bisa di gunakan oleh Admin group!', id) 272 | if (args.length === 1) return client.reply(from, 'Pilih enable atau disable!', id) 273 | if (args[1].toLowerCase() === 'enable') { 274 | nsfw_.push(chat.id) 275 | fs.writeFileSync('./lib/NSFW.json', JSON.stringify(nsfw_)) 276 | client.reply(from, 'NSWF Command berhasil di aktifkan di group ini! kirim perintah *!nsfwMenu* untuk mengetahui menu', id) 277 | } else if (args[1].toLowerCase() === 'disable') { 278 | nsfw_.splice(chat.id, 1) 279 | fs.writeFileSync('./lib/NSFW.json', JSON.stringify(nsfw_)) 280 | client.reply(from, 'NSFW Command berhasil di nonaktifkan di group ini!', id) 281 | } else { 282 | client.reply(from, 'Pilih enable atau disable udin!', id) 283 | } 284 | break 285 | case '!welcome': 286 | if (!isGroupMsg) return client.reply(from, 'Perintah ini hanya bisa di gunakan dalam group!', id) 287 | if (!isGroupAdmins) return client.reply(from, 'Perintah ini hanya bisa di gunakan oleh Admin group!', id) 288 | if (args.length === 1) return client.reply(from, 'Pilih enable atau disable!', id) 289 | if (args[1].toLowerCase() === 'enable') { 290 | welkom.push(chat.id) 291 | fs.writeFileSync('./lib/welcome.json', JSON.stringify(welkom)) 292 | client.reply(from, 'Fitur welcome berhasil di aktifkan di group ini!', id) 293 | } else if (args[1].toLowerCase() === 'disable') { 294 | welkom.splice(chat.id, 1) 295 | fs.writeFileSync('./lib/welcome.json', JSON.stringify(welkom)) 296 | client.reply(from, 'Fitur welcome berhasil di nonaktifkan di group ini!', id) 297 | } else { 298 | client.reply(from, 'Pilih enable atau disable udin!', id) 299 | } 300 | break 301 | case '!nsfwmenu': 302 | if (!isNsfw) return 303 | client.reply(from, '1. !randomHentai\n2. !randomNsfwNeko', id) 304 | break 305 | case '!igstalk': 306 | if (args.length === 1) return client.reply(from, 'Kirim perintah *!igStalk @username*\nConntoh *!igStalk @duar_amjay*', id) 307 | const stalk = await get.get(`https://mhankbarbar.moe/api/igstalk?username=${args[1]}&apiKey=${apiKey}`).json() 308 | if (stalk.error) return client.reply(from, stalk.error, id) 309 | const { Biodata, Jumlah_Followers, Jumlah_Following, Jumlah_Post, Name, Username, Profile_pic } = stalk 310 | 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}` 311 | await client.sendFileFromUrl(from, Profile_pic, 'Profile.jpg', caps, id) 312 | break 313 | case '!infogempa': 314 | const bmkg = await get.get(`https://mhankbarbar.moe/api/infogempa?apiKey=${apiKey}`).json() 315 | const { potensi, koordinat, lokasi, kedalaman, magnitude, waktu, map } = bmkg 316 | const hasil = `*${waktu}*\n📍 *Lokasi* : *${lokasi}*\n〽️ *Kedalaman* : *${kedalaman}*\n💢 *Magnitude* : *${magnitude}*\n🔘 *Potensi* : *${potensi}*\n📍 *Koordinat* : *${koordinat}*` 317 | client.sendFileFromUrl(from, map, 'shakemap.jpg', hasil, id) 318 | break 319 | case '!anime': 320 | if (args.length === 1) return client.reply(from, 'Kirim perintah *!anime [query]*\nContoh : *!anime darling in the franxx*', id) 321 | const animek = await get.get(`https://mhankbarbar.moe/api/kuso?q=${body.slice(7)}&apiKey=${apiKey}`).json() 322 | if (animek.error) return client.reply(from, animek.error, id) 323 | const res_animek = `Title: *${animek.title}*\n\n${animek.info}\n\nSinopsis: ${animek.sinopsis}\n\nLink Download:\n${animek.link_dl}` 324 | client.sendFileFromUrl(from, animek.thumb, 'kusonime.jpg', res_animek, id) 325 | break 326 | case '!nh': 327 | //if (isGroupMsg) return client.reply(from, 'Sorry this command for private chat only!', id) 328 | if (args.length === 2) { 329 | const nuklir = body.split(' ')[1] 330 | client.reply(from, mess.wait, id) 331 | const cek = await nhentai.exists(nuklir) 332 | if (cek === true) { 333 | try { 334 | const api = new API() 335 | const pic = await api.getBook(nuklir).then(book => { 336 | return api.getImageURL(book.cover) 337 | }) 338 | const dojin = await nhentai.getDoujin(nuklir) 339 | const { title, details, link } = dojin 340 | const { parodies, tags, artists, groups, languages, categories } = await details 341 | 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}` 342 | //exec('nhentai --id=' + nuklir + ` -P mantap.pdf -o ./hentong/${nuklir}.pdf --format `+ `${nuklir}.pdf`, (error, stdout, stderr) => { 343 | client.sendFileFromUrl(from, pic, 'hentod.jpg', teks, id) 344 | //client.sendFile(from, `./hentong/${nuklir}.pdf/${nuklir}.pdf.pdf`, then(() => `${title}.pdf`, '', id)).catch(() => 345 | //client.sendFile(from, `./hentong/${nuklir}.pdf/${nuklir}.pdf.pdf`, `${title}.pdf`, '', id)) 346 | /*if (error) { 347 | console.log('error : '+ error.message) 348 | return 349 | } 350 | if (stderr) { 351 | console.log('stderr : '+ stderr) 352 | return 353 | } 354 | console.log('stdout : '+ stdout)*/ 355 | //}) 356 | } catch (err) { 357 | client.reply(from, '[❗] Terjadi kesalahan, mungkin kode nuklir salah', id) 358 | } 359 | } else { 360 | client.reply(from, '[❗] Kode nuClear Salah!') 361 | } 362 | } else { 363 | client.reply(from, '[ WRONG ] Kirim perintah *!nh [nuClear]* untuk contoh kirim perintah *!readme*') 364 | } 365 | break 366 | case '!brainly': 367 | if (args.length >= 2){ 368 | const BrainlySearch = require('./lib/brainly') 369 | let tanya = body.slice(9) 370 | let jum = Number(tanya.split('.')[1]) || 2 371 | if (jum > 10) return client.reply(from, 'Max 10!', id) 372 | if (Number(tanya[tanya.length-1])){ 373 | tanya 374 | } 375 | client.reply(from, `➸ *Pertanyaan* : ${tanya.split('.')[0]}\n\n➸ *Jumlah jawaban* : ${Number(jum)}`, id) 376 | await BrainlySearch(tanya.split('.')[0],Number(jum), function(res){ 377 | res.forEach(x=>{ 378 | if (x.jawaban.fotoJawaban.length == 0) { 379 | client.reply(from, `➸ *Pertanyaan* : ${x.pertanyaan}\n\n➸ *Jawaban* : ${x.jawaban.judulJawaban}\n`, id) 380 | } else { 381 | client.reply(from, `➸ *Pertanyaan* : ${x.pertanyaan}\n\n➸ *Jawaban* : ${x.jawaban.judulJawaban}\n\n➸ *Link foto jawaban* : ${x.jawaban.fotoJawaban.join('\n')}`, id) 382 | } 383 | }) 384 | }) 385 | } else { 386 | client.reply(from, 'Usage :\n!brainly [pertanyaan] [.jumlah]\n\nEx : \n!brainly NKRI .2', id) 387 | } 388 | break 389 | case '!wait': 390 | if (isMedia && type === 'image' || quotedMsg && quotedMsg.type === 'image') { 391 | if (isMedia) { 392 | var mediaData = await decryptMedia(message, uaOverride) 393 | } else { 394 | var mediaData = await decryptMedia(quotedMsg, uaOverride) 395 | } 396 | const fetch = require('node-fetch') 397 | const imgBS4 = `data:${mimetype};base64,${mediaData.toString('base64')}` 398 | client.reply(from, 'Searching....', id) 399 | fetch('https://trace.moe/api/search', { 400 | method: 'POST', 401 | body: JSON.stringify({ image: imgBS4 }), 402 | headers: { "Content-Type": "application/json" } 403 | }) 404 | .then(respon => respon.json()) 405 | .then(resolt => { 406 | if (resolt.docs && resolt.docs.length <= 0) { 407 | client.reply(from, 'Maaf, saya tidak tau ini anime apa', id) 408 | } 409 | const { is_adult, title, title_chinese, title_romaji, title_english, episode, similarity, filename, at, tokenthumb, anilist_id } = resolt.docs[0] 410 | teks = '' 411 | if (similarity < 0.92) { 412 | teks = '*Saya memiliki keyakinan rendah dalam hal ini* :\n\n' 413 | } 414 | teks += `➸ *Title Japanese* : ${title}\n➸ *Title chinese* : ${title_chinese}\n➸ *Title Romaji* : ${title_romaji}\n➸ *Title English* : ${title_english}\n` 415 | teks += `➸ *Ecchi* : ${is_adult}\n` 416 | teks += `➸ *Eps* : ${episode.toString()}\n` 417 | teks += `➸ *Kesamaan* : ${(similarity * 100).toFixed(1)}%\n` 418 | var video = `https://media.trace.moe/video/${anilist_id}/${encodeURIComponent(filename)}?t=${at}&token=${tokenthumb}`; 419 | client.sendFileFromUrl(from, video, 'nimek.mp4', teks, id).catch(() => { 420 | client.reply(from, teks, id) 421 | }) 422 | }) 423 | .catch(() => { 424 | client.reply(from, 'Error !', id) 425 | }) 426 | } else { 427 | client.sendFile(from, './media/img/tutod.jpg', 'Tutor.jpg', 'Neh contoh mhank!', id) 428 | } 429 | break 430 | case '!quotemaker': 431 | arg = body.trim().split('|') 432 | if (arg.length >= 4) { 433 | client.reply(from, mess.wait, id) 434 | const quotes = encodeURIComponent(arg[1]) 435 | const author = encodeURIComponent(arg[2]) 436 | const theme = encodeURIComponent(arg[3]) 437 | await quotemaker(quotes, author, theme).then(amsu => { 438 | client.sendFile(from, amsu, 'quotesmaker.jpg','neh...').catch(() => { 439 | client.reply(from, mess.error.Qm, id) 440 | }) 441 | }) 442 | } else { 443 | client.reply(from, 'Usage: \n!quotemaker |teks|watermark|theme\n\nEx :\n!quotemaker |ini contoh|bicit|random', id) 444 | } 445 | break 446 | case '!linkgroup': 447 | if (!isBotGroupAdmins) return client.reply(from, 'Perintah ini hanya bisa di gunakan ketika bot menjadi admin', id) 448 | if (isGroupMsg) { 449 | const inviteLink = await client.getGroupInviteLink(groupId); 450 | client.sendLinkWithAutoPreview(from, inviteLink, `\nLink group *${name}*`) 451 | } else { 452 | client.reply(from, 'Perintah ini hanya bisa di gunakan dalam group!', id) 453 | } 454 | break 455 | case '!bc': 456 | if (!isOwner) return client.reply(from, 'Perintah ini hanya untuk Owner bot!', id) 457 | let msg = body.slice(4) 458 | const chatz = await client.getAllChatIds() 459 | for (let ids of chatz) { 460 | var cvk = await client.getChatById(ids) 461 | if (!cvk.isReadOnly) await client.sendText(ids, `[ Shinomiya Kaguya BOT Broadcast ]\n\n${msg}`) 462 | } 463 | client.reply(from, 'Broadcast Success!', id) 464 | break 465 | case '!adminlist': 466 | if (!isGroupMsg) return client.reply(from, 'Perintah ini hanya bisa di gunakan dalam group!', id) 467 | let mimin = '' 468 | for (let admon of groupAdmins) { 469 | mimin += `➸ @${admon.replace(/@c.us/g, '')}\n` 470 | } 471 | await client.sendTextWithMentions(from, mimin) 472 | break 473 | case '!ownergroup': 474 | if (!isGroupMsg) return client.reply(from, 'Perintah ini hanya bisa di gunakan dalam group!', id) 475 | const Owner_ = chat.groupMetadata.owner 476 | await client.sendTextWithMentions(from, `Owner Group : @${Owner_}`) 477 | break 478 | case '!mentionall': 479 | if (!isGroupMsg) return client.reply(from, 'Perintah ini hanya bisa di gunakan dalam group!', id) 480 | if (!isGroupAdmins) return client.reply(from, 'Perintah ini hanya bisa di gunakan oleh admin group', id) 481 | const groupMem = await client.getGroupMembers(groupId) 482 | let hehe = '╔══✪〘 Mention All 〙✪══\n' 483 | for (let i = 0; i < groupMem.length; i++) { 484 | hehe += '╠➥' 485 | hehe += ` @${groupMem[i].id.replace(/@c.us/g, '')}\n` 486 | } 487 | hehe += '╚═〘 Shinomiya Kaguya BOT 〙' 488 | await client.sendTextWithMentions(from, hehe) 489 | break 490 | case '!kickall': 491 | if (!isGroupMsg) return client.reply(from, 'Perintah ini hanya bisa di gunakan dalam group!', id) 492 | const isGroupOwner = sender.id === chat.groupMetadata.owner 493 | if (!isGroupOwner) return client.reply(from, 'Perintah ini hanya bisa di gunakan oleh Owner group', id) 494 | if (!isBotGroupAdmins) return client.reply(from, 'Perintah ini hanya bisa di gunakan ketika bot menjadi admin', id) 495 | const allMem = await client.getGroupMembers(groupId) 496 | for (let i = 0; i < allMem.length; i++) { 497 | if (groupAdmins.includes(allMem[i].id)) { 498 | console.log('Upss this is Admin group') 499 | } else { 500 | await client.removeParticipant(groupId, allMem[i].id) 501 | } 502 | } 503 | client.reply(from, 'Succes kick all member', id) 504 | break 505 | case '!leaveall': 506 | if (!isOwner) return client.reply(from, 'Perintah ini hanya untuk Owner bot', id) 507 | const allChats = await client.getAllChatIds() 508 | const allGroups = await client.getAllGroups() 509 | for (let gclist of allGroups) { 510 | await client.sendText(gclist.contact.id, `Maaf bot sedang pembersihan, total chat aktif : ${allChats.length}`) 511 | await client.leaveGroup(gclist.contact.id) 512 | } 513 | client.reply(from, 'Succes leave all group!', id) 514 | break 515 | case '!clearall': 516 | if (!isOwner) return client.reply(from, 'Perintah ini hanya untuk Owner bot', id) 517 | const allChatz = await client.getAllChats() 518 | for (let dchat of allChatz) { 519 | await client.deleteChat(dchat.id) 520 | } 521 | client.reply(from, 'Succes clear all chat!', id) 522 | break 523 | case '!add': 524 | const orang = args[1] 525 | if (!isGroupMsg) return client.reply(from, 'Fitur ini hanya bisa di gunakan dalam group', id) 526 | if (args.length === 1) return client.reply(from, 'Untuk menggunakan fitur ini, kirim perintah *!add* 628xxxxx', id) 527 | if (!isGroupAdmins) return client.reply(from, 'Perintah ini hanya bisa di gunakan oleh admin group', id) 528 | if (!isBotGroupAdmins) return client.reply(from, 'Perintah ini hanya bisa di gunakan ketika bot menjadi admin', id) 529 | try { 530 | await client.addParticipant(from,`${orang}@c.us`) 531 | } catch { 532 | client.reply(from, mess.error.Ad, id) 533 | } 534 | break 535 | case '!kick': 536 | if (!isGroupMsg) return client.reply(from, 'Fitur ini hanya bisa di gunakan dalam group', id) 537 | if (!isGroupAdmins) return client.reply(from, 'Perintah ini hanya bisa di gunakan oleh admin group', id) 538 | if (!isBotGroupAdmins) return client.reply(from, 'Perintah ini hanya bisa di gunakan ketika bot menjadi admin', id) 539 | if (mentionedJidList.length === 0) return client.reply(from, 'Untuk menggunakan Perintah ini, kirim perintah *!kick* @tagmember', id) 540 | await client.sendText(from, `Perintah diterima, mengeluarkan:\n${mentionedJidList.join('\n')}`) 541 | for (let i = 0; i < mentionedJidList.length; i++) { 542 | if (groupAdmins.includes(mentionedJidList[i])) return client.reply(from, mess.error.Ki, id) 543 | await client.removeParticipant(groupId, mentionedJidList[i]) 544 | } 545 | break 546 | case '!leave': 547 | if (!isGroupMsg) return client.reply(from, 'Perintah ini hanya bisa di gunakan dalam group', id) 548 | if (!isGroupAdmins) return client.reply(from, 'Perintah ini hanya bisa di gunakan oleh admin group', id) 549 | await client.sendText(from,'Sayonara').then(() => client.leaveGroup(groupId)) 550 | break 551 | case '!promote': 552 | if (!isGroupMsg) return client.reply(from, 'Fitur ini hanya bisa di gunakan dalam group', id) 553 | if (!isGroupAdmins) return client.reply(from, 'Fitur ini hanya bisa di gunakan oleh admin group', id) 554 | if (!isBotGroupAdmins) return client.reply(from, 'Fitur ini hanya bisa di gunakan ketika bot menjadi admin', id) 555 | if (mentionedJidList.length === 0) return client.reply(from, 'Untuk menggunakan fitur ini, kirim perintah *!promote* @tagmember', id) 556 | if (mentionedJidList.length >= 2) return client.reply(from, 'Maaf, perintah ini hanya dapat digunakan kepada 1 user.', id) 557 | if (groupAdmins.includes(mentionedJidList[0])) return client.reply(from, 'Maaf, user tersebut sudah menjadi admin.', id) 558 | await client.promoteParticipant(groupId, mentionedJidList[0]) 559 | await client.sendTextWithMentions(from, `Perintah diterima, menambahkan @${mentionedJidList[0]} sebagai admin.`) 560 | break 561 | case '!demote': 562 | if (!isGroupMsg) return client.reply(from, 'Fitur ini hanya bisa di gunakan dalam group', id) 563 | if (!isGroupAdmins) return client.reply(from, 'Fitur ini hanya bisa di gunakan oleh admin group', id) 564 | if (!isBotGroupAdmins) return client.reply(from, 'Fitur ini hanya bisa di gunakan ketika bot menjadi admin', id) 565 | if (mentionedJidList.length === 0) return client.reply(from, 'Untuk menggunakan fitur ini, kirim perintah *!demote* @tagadmin', id) 566 | if (mentionedJidList.length >= 2) return client.reply(from, 'Maaf, perintah ini hanya dapat digunakan kepada 1 orang.', id) 567 | if (!groupAdmins.includes(mentionedJidList[0])) return client.reply(from, 'Maaf, user tersebut tidak menjadi admin.', id) 568 | await client.demoteParticipant(groupId, mentionedJidList[0]) 569 | await client.sendTextWithMentions(from, `Perintah diterima, menghapus jabatan @${mentionedJidList[0]}.`) 570 | break 571 | case '!join': 572 | //return client.reply(from, 'Jika ingin meng-invite bot ke group anda, silahkan izin ke wa.me/6285892766102', id) 573 | 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) 574 | const link = args[1] 575 | const key = args[2] 576 | const tGr = await client.getAllGroups() 577 | const minMem = 30 578 | const isLink = link.match(/(https:\/\/chat.whatsapp.com)/gi) 579 | if (key !== 'lGjYt4zA5SQlTDx9z9Ca') return client.reply(from, '*key* salah! silahkan chat owner bot unruk mendapatkan key yang valid', id) 580 | const check = await client.inviteInfo(link) 581 | if (!isLink) return client.reply(from, 'Ini link? 👊🤬', id) 582 | if (tGr.length > 15) return client.reply(from, 'Maaf jumlah group sudah maksimal!', id) 583 | if (check.size < minMem) return client.reply(from, 'Member group tidak melebihi 30, bot tidak bisa masuk', id) 584 | if (check.status === 200) { 585 | await client.joinGroupViaLink(link).then(() => client.reply(from, 'Bot akan segera masuk!')) 586 | } else { 587 | client.reply(from, 'Link group tidak valid!', id) 588 | } 589 | break 590 | case '!delete': 591 | if (!isGroupMsg) return client.reply(from, 'Fitur ini hanya bisa di gunakan dalam group', id) 592 | if (!isGroupAdmins) return client.reply(from, 'Fitur ini hanya bisa di gunakan oleh admin group', id) 593 | if (!quotedMsg) return client.reply(from, 'Salah!!, kirim perintah *!delete [tagpesanbot]*', id) 594 | if (!quotedMsgObj.fromMe) return client.reply(from, 'Salah!!, Bot tidak bisa mengahpus chat user lain!', id) 595 | client.deleteMessage(quotedMsgObj.chatId, quotedMsgObj.id, false) 596 | break 597 | case '!getses': 598 | const sesPic = await client.getSnapshot() 599 | client.sendFile(from, sesPic, 'session.png', 'Neh...', id) 600 | break 601 | case '!lirik': 602 | if (args.length == 1) return client.reply(from, 'Kirim perintah *!lirik [optional]*, contoh *!lirik aku bukan boneka*', id) 603 | const lagu = body.slice(7) 604 | const lirik = await liriklagu(lagu) 605 | client.reply(from, lirik, id) 606 | break 607 | case '!chord': 608 | if (args.length === 1) return client.reply(from, 'Kirim perintah *!chord [query]*, contoh *!chord aku bukan boneka*', id) 609 | const query__ = body.slice(7) 610 | const chord = await get.get(`https://mhankbarbar.moe/api/chord?q=${query__}&apiKey=${apiKey}`).json() 611 | if (chord.error) return client.reply(from, chord.error, id) 612 | client.reply(from, chord.result, id) 613 | break 614 | case '!listdaerah': 615 | const listDaerah = await get('https://mhankbarbar.tech/daerah').json() 616 | client.reply(from, listDaerah.result, id) 617 | break 618 | case '!listblock': 619 | let hih = `This is list of blocked number\nTotal : ${blockNumber.length}\n` 620 | for (let i of blockNumber) { 621 | hih += `➸ @${i.replace(/@c.us/g,'')}\n` 622 | } 623 | client.sendTextWithMentions(from, hih, id) 624 | break 625 | case '!jadwalshalat': 626 | if (args.length === 1) return client.reply(from, '[❗] Kirim perintah *!jadwalShalat [daerah]*\ncontoh : *!jadwalShalat Tangerang*\nUntuk list daerah kirim perintah *!listDaerah*') 627 | const daerah = body.slice(14) 628 | const jadwalShalat = await get.get(`https://mhankbarbar.moe/api/jshalat?daerah=${daerah}&apiKey=${apiKey}`).json() 629 | if (jadwalShalat.error) return client.reply(from, jadwalShalat.error, id) 630 | const { Imsyak, Subuh, Dhuha, Dzuhur, Ashar, Maghrib, Isya } = await jadwalShalat 631 | arrbulan = ["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"]; 632 | tgl = new Date().getDate() 633 | bln = new Date().getMonth() 634 | thn = new Date().getFullYear() 635 | 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}` 636 | client.reply(from, resultJadwal, id) 637 | break 638 | case '!listchannel': 639 | client.reply(from, listChannel, id) 640 | break 641 | case '!jadwaltv': 642 | if (args.length === 1) return client.reply(from, 'Kirim perintah *!jadwalTv [channel]*', id) 643 | const query = body.slice(10).toLowerCase() 644 | const jadwal = await jadwalTv(query) 645 | client.reply(from, jadwal, id) 646 | break 647 | case '!jadwaltvnow': 648 | const jadwalNow = await get.get('https://api.haipbis.xyz/jadwaltvnow').json() 649 | client.reply(from, `Jam : ${jadwalNow.jam}\n\nJadwalTV : ${jadwalNow.jadwalTV}`, id) 650 | break 651 | case '!loli': 652 | const loli = await get.get(`https://mhankbarbar.tech/api/randomloli?apiKey=${apiKey}`).json() 653 | client.sendFileFromUrl(from, loli.result, 'loli.jpeg', 'Lolinya om', id) 654 | break 655 | case '!waifu': 656 | const waifu = await get.get(`https://mhankbarbar.tech/api/waifu?apiKey=${apiKey}`).json() 657 | client.sendFileFromUrl(from, waifu.image, 'Waifu.jpg', `➸ Name : ${waifu.name}\n➸ Description : ${waifu.desc}\n\n➸ Source : ${waifu.source}`, id) 658 | break 659 | case '!husbu': 660 | const diti = fs.readFileSync('./lib/husbu.json') 661 | const ditiJsin = JSON.parse(diti) 662 | const rindIndix = Math.floor(Math.random() * ditiJsin.length) 663 | const rindKiy = ditiJsin[rindIndix] 664 | client.sendFileFromUrl(from, rindKiy.image, 'Husbu.jpg', rindKiy.teks, id) 665 | break 666 | case '!randomhentai': 667 | if (isGroupMsg) { 668 | if (!isNsfw) return client.reply(from, 'Command/Perintah NSFW belum di aktifkan di group ini!', id) 669 | const hentai = await randomNimek('hentai') 670 | if (hentai.endsWith('.png')) { 671 | var ext = '.png' 672 | } else { 673 | var ext = '.jpg' 674 | } 675 | client.sendFileFromUrl(from, hentai, `Hentai${ext}`, 'Hentai!', id) 676 | break 677 | } else { 678 | const hentai = await randomNimek('hentai') 679 | if (hentai.endsWith('.png')) { 680 | var ext = '.png' 681 | } else { 682 | var ext = '.jpg' 683 | } 684 | client.sendFileFromUrl(from, hentai, `Hentai${ext}`, 'Hentai!', id) 685 | } 686 | case '!randomnsfwneko': 687 | if (isGroupMsg) { 688 | if (!isNsfw) return client.reply(from, 'Command/Perintah NSFW belum di aktifkan di group ini!', id) 689 | const nsfwneko = await randomNimek('nsfw') 690 | if (nsfwneko.endsWith('.png')) { 691 | var ext = '.png' 692 | } else { 693 | var ext = '.jpg' 694 | } 695 | client.sendFileFromUrl(from, nsfwneko, `nsfwNeko${ext}`, 'Nsfwneko!', id) 696 | } else { 697 | const nsfwneko = await randomNimek('nsfw') 698 | if (nsfwneko.endsWith('.png')) { 699 | var ext = '.png' 700 | } else { 701 | var ext = '.jpg' 702 | } 703 | client.sendFileFromUrl(from, nsfwneko, `nsfwNeko${ext}`, 'Nsfwneko!', id) 704 | } 705 | break 706 | case '!randomnekonime': 707 | const nekonime = await get.get('https://mhankbarbars.herokuapp.com/api/nekonime').json() 708 | if (nekonime.result.endsWith('.png')) { 709 | var ext = '.png' 710 | } else { 711 | var ext = '.jpg' 712 | } 713 | client.sendFileFromUrl(from, nekonime.result, `Nekonime${ext}`, 'Nekonime!', id) 714 | break 715 | case '!randomtrapnime': 716 | const trap = await randomNimek('trap') 717 | if (trap.endsWith('.png')) { 718 | var ext = '.png' 719 | } else { 720 | var ext = '.jpg' 721 | } 722 | client.sendFileFromUrl(from, trap, `trapnime${ext}`, 'Trapnime!', id) 723 | break 724 | case '!randomanime': 725 | const nime = await randomNimek('anime') 726 | if (nime.endsWith('.png')) { 727 | var ext = '.png' 728 | } else { 729 | var ext = '.jpg' 730 | } 731 | client.sendFileFromUrl(from, nime, `Randomanime${ext}`, 'Randomanime!', id) 732 | break 733 | case '!inu': 734 | 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"] 735 | let kya = list[Math.floor(Math.random() * list.length)] 736 | client.sendFileFromUrl(from, kya, 'Dog.jpeg', 'Inu') 737 | break 738 | case '!neko': 739 | q2 = Math.floor(Math.random() * 900) + 300; 740 | q3 = Math.floor(Math.random() * 900) + 300; 741 | client.sendFileFromUrl(from, 'http://placekitten.com/'+q3+'/'+q2, 'neko.png','Neko ') 742 | break 743 | /*case '!sendto': 744 | client.sendFile(from, './msgHndlr.js', 'msgHndlr.js') 745 | break*/ 746 | case '!url2img': 747 | const _query = body.slice(9) 748 | if (!_query.match(isUrl)) return client.reply(from, mess.error.Iv, id) 749 | if (args.length === 1) return client.reply(from, 'Kirim perintah *!url2img [web]*\nContoh *!url2img https://google.com*', id) 750 | const url2img = await get.get(`https://mhankbarbar.moe/api/url2image?url=${_query}&tipe=mobile&apiKey=${apiKey}`).json() 751 | if (url2img.error) return client.reply(from, url2img.error, id) 752 | client.sendFileFromUrl(from, url2img.result, 'kyaa.jpg', null, id) 753 | break 754 | case '!quote': 755 | case '!quotes': 756 | const quotes = await get.get('https://mhankbarbar.tech/api/randomquotes').json() 757 | client.reply(from, `➸ *Quotes* : ${quotes.quotes}\n➸ *Author* : ${quotes.author}`, id) 758 | break 759 | case '!quotesnime': 760 | const skya = await get.get('https://mhankbarbar.tech/api/quotesnime/random').json() 761 | skya_ = skya.data 762 | client.reply(from, `➸ *Quotes* : ${skya_.quote}\n➸ *Character* : ${skya_.character}\n➸ *Anime* : ${skya_.anime}`, id) 763 | break 764 | case '!meme': 765 | const response = await axios.get('https://meme-api.herokuapp.com/gimme/wholesomeanimemes'); 766 | const { postlink, title, subreddit, url, nsfw, spoiler } = response.data 767 | client.sendFileFromUrl(from, `${url}`, 'meme.jpg', `${title}`) 768 | break 769 | case '!help': 770 | client.sendText(from, help) 771 | break 772 | case '!readme': 773 | client.reply(from, readme, id) 774 | break 775 | case '!info': 776 | client.sendLinkWithAutoPreview(from, 'https://github.com/mhankbarbar/whatsapp-bot', info) 777 | break 778 | case '!snk': 779 | client.reply(from, snk, id) 780 | break 781 | } 782 | } catch (err) { 783 | console.log(color('[ERROR]', 'red'), err) 784 | //client.kill().then(a => console.log(a)) 785 | } 786 | } 787 | --------------------------------------------------------------------------------