├── .replit ├── Dockerfile ├── LICENSE ├── README.md ├── api ├── games │ ├── rasel │ └── sambung-kata.js ├── image │ └── rasel ├── random │ └── rasel ├── sticker │ ├── apaan.webp │ ├── galiat.webp │ ├── hehe.webp │ ├── hihi.webp │ ├── hm.webp │ ├── kyubi.webp │ ├── makan.webp │ ├── mana.webp │ ├── rasel │ ├── seduh.webp │ ├── smile.webp │ └── xixi.webp └── video │ └── rasel ├── config.js ├── handler.js ├── index.js ├── lib ├── cloudDBAdapter.js ├── cluster.js ├── colong.json ├── converter.js ├── database.js ├── exif.js ├── exif.json ├── gdrive.js ├── hack.js ├── levelling.js ├── logs.js ├── lowdb │ ├── Low.d.ts │ ├── Low.js │ ├── LowSync.d.ts │ ├── LowSync.js │ ├── MissingAdapterError.d.ts │ ├── MissingAdapterError.js │ ├── adapters │ │ ├── JSONFile.d.ts │ │ ├── JSONFile.js │ │ ├── JSONFileSync.d.ts │ │ ├── JSONFileSync.js │ │ ├── LocalStorage.d.ts │ │ ├── LocalStorage.js │ │ ├── Memory.d.ts │ │ ├── Memory.js │ │ ├── MemorySync.d.ts │ │ ├── MemorySync.js │ │ ├── TextFile.d.ts │ │ ├── TextFile.js │ │ ├── TextFileSync.d.ts │ │ ├── TextFileSync.js │ │ └── rasel │ ├── index.d.ts │ ├── index.js │ └── rasel ├── mongoDB.js ├── print.js ├── randomm.js ├── scrape.js ├── simple.js ├── sticker.js ├── store.js ├── stres.js ├── symbol.json ├── tictactoe.d.ts ├── tictactoe.js ├── uploadFile.js ├── uploadImage.js ├── wallq.js ├── webp.js ├── webp2mp4.js ├── welcome.js ├── wibu.js ├── wm.json └── y2mate.js ├── main.js ├── package.json ├── plugins ├── A-skata_lbb.js ├── _autoResponseAll.js ├── _buttonResponseAll.js ├── _fakeReplyAll.js ├── _gameAnswerAll.js ├── _quotedResponseAll.js ├── downloader-apks.js ├── downloader-hentai.js ├── downloader-play.js ├── downloader-tta.js ├── downloader-ttv.js ├── downloader-yta.js ├── downloader-ytv.js ├── game-list.js ├── game-math.js ├── game-skata.js ├── group-simulate.js ├── info-speedtest.js ├── main-menfess.js ├── maker-carbon.js ├── owner-archivechat.js ├── owner-deletechat.js ├── owner-exec.js ├── owner-exec2.js ├── owner-restart.js ├── owner-update.js ├── quotes_quotes.js ├── sticker-attp.js ├── sticker-media.js ├── sticker-meme.js └── sticker-ttp.js ├── replit.nix ├── server.js ├── speed.py ├── src ├── LICENSE ├── exif.json ├── font │ ├── .file │ ├── 212BabyGirl.otf │ ├── 212LeahleeSans.ttf │ ├── 99HandWritting.ttf │ ├── ACallingFontDby7NTypes.otf │ ├── ACasualHandwrittenPenNoncommercial.ttf │ ├── ADayinSeptember.otf │ ├── ASMelanieHandwritting.ttf │ ├── Alittlesunshine.ttf │ ├── And-This-Happened.ttf │ ├── AvenirCondensedHand.ttf │ ├── Avocados.ttf │ ├── BabyDoll.ttf │ ├── BattleOfKingsRegular.ttf │ ├── BrayNotes.ttf │ ├── Convered-By-Your-Grace.ttf │ ├── Edoms-Handwritting-Normal.ttf │ ├── Futura Bold Italic font.ttf │ ├── Futura Bold font.ttf │ ├── Futura Book Italic font.ttf │ ├── Futura Book font.ttf │ ├── Futura Extra Black font.ttf │ ├── Futura Heavy Italic font.ttf │ ├── Futura Heavy font.ttf │ ├── Futura Light Italic font.ttf │ ├── Futura Light font.ttf │ ├── Futura Medium Italic font.ttf │ ├── Futura XBlk BT.ttf │ ├── Futura-CondensedLight.otf │ ├── GloriaHallelujah-Regular.ttf │ ├── HandwritingCR-2.ttf │ ├── Kempton-Demo-Handwritting.ttf │ ├── MyHandsareHoldingYou.ttf │ ├── My_handwriting.ttf │ ├── Nadeznas-Handwritting.ttf │ ├── Roboto-Black.ttf │ ├── Roboto-BlackItalic.ttf │ ├── Roboto-Bold.ttf │ ├── Roboto-BoldItalic.ttf │ ├── Roboto-Italic.ttf │ ├── Roboto-Light.ttf │ ├── Roboto-LightItalic.ttf │ ├── Roboto-Medium.ttf │ ├── Roboto-MediumItalic.ttf │ ├── Roboto-Regular.ttf │ ├── Roboto-Thin.ttf │ ├── Roboto-ThinItalic.ttf │ ├── ShadowsIntoLight-Regular.ttf │ ├── Zahraaa.ttf │ ├── angelina.ttf │ ├── futur.ttf │ ├── futura light bt.ttf │ ├── futura medium bt.ttf │ ├── futura medium condensed bt.ttf │ └── michellehandwritting.ttf ├── moderator.json ├── owner.json ├── premium.json ├── symbol.json └── wm.json ├── test.js └── tmp └── rasel /.replit: -------------------------------------------------------------------------------- 1 | run = 'node index.js --server' 2 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:lts-buster 2 | 3 | RUN apt-get update && \ 4 | apt-get install -y \ 5 | ffmpeg \ 6 | imagemagick \ 7 | webp && \ 8 | apt-get upgrade -y && \ 9 | rm -rf /var/lib/apt/lists/* 10 | 11 | COPY package.json . 12 | 13 | RUN npm install 14 | 15 | COPY . . 16 | 17 | EXPOSE 5000 18 | 19 | CMD ["node", "index.js"] 20 | 21 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Rasel 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # My Bot MD 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | [![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/raselcomel/mymd) 15 | ## Join Group Diskusi WhatsApp BOT 16 | [![BOT GROUP DISCUSSION](https://img.shields.io/badge/WhatsApp%20Group-25D366?style=for-the-badge&logo=whatsapp&logoColor=white)](https://chat.whatsapp.com/BVmECclaym2KcMv9DTDmMa) 17 | 18 | ## UNTUK PENGGUNA WINDOWS/VPS/RDP 19 | 20 | * Unduh & Instal Git [`Klik Disini`](https://git-scm.com/downloads) 21 | * Unduh & Instal NodeJS [`Klik Disini`](https://nodejs.org/en/download) 22 | * Unduh & Instal FFmpeg [`Klik Disini`](https://ffmpeg.org/download.html) (**Jangan Lupa Tambahkan FFmpeg ke variabel lingkungan PATH**) 23 | * Unduh & Instal ImageMagick [`Klik Disini`](https://imagemagick.org/script/download.php) 24 | 25 | ```bash 26 | git clone https://github.com/raselcomel/mymd.git 27 | cd mymd 28 | npm i 29 | node . 30 | ``` 31 | 32 | --------- 33 | 34 | ## UNTUK PENGGUNA TERMUX 35 | 36 | * Download Termux [`Klik Disini`](https://github.com/termux/termux-app/releases/download/v0.118.0/termux-app_v0.118.0+github-debug_universal.apk) 37 | 38 | ``` 39 | $ pkg update && upgrade -y 40 | $ apt update && upgrade -y 41 | $ pkg install ffmpeg 42 | $ pkg install nodejs-lts 43 | $ pkg install git 44 | $ git clone https://github.com/raselcomel/mymd.git 45 | $ cd mymd 46 | $ npm i 47 | $ node . 48 | ``` 49 | --------- 50 | ## UNTUK PENGGUNA HEROKU 51 | 52 | ### Instal Buildpack 53 | * heroku/nodejs 54 | * https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest.git 55 | * https://github.com/mcollina/heroku-buildpack-imagemagick.git 56 | 57 | --------- 58 | 59 | ## Arguments `node . [--options] []` 60 | 61 | ### `--session ` 62 | 63 | menggunakan session dari nama file yang berbeda, default `session.data.json` 64 | 65 | contoh nama file `mymd.json` maka penggunaannya `node . --session 'mymd'` 66 | 67 | ### `--prefix ` 68 | 69 | * `prefixes` dipisahkan oleh masing-masing karakter 70 | Setel awalan 71 | 72 | ### `--server` 73 | 74 | Digunakan untuk [heroku](https://heroku.com/) atau pindai melalui situs web 75 | 76 | ### `--db ` 77 | 78 | menggunakan db eksternal alih-alih db lokal, **disarankan** menggunakan mongodb 79 | 80 | contoh server dengan mongodb `mongodb+srv://:@name-of-your-db.thhce.mongodb.net/myFirstDatabase?retryWrites=true&w=majority` 81 | 82 | contoh server dengan repl `https://json-server.nurutomo.repl.co/` 83 | 84 | kode: `https://repl.it/@Nurutomo/json-server` 85 | 86 | `node . --db 'https://json-server.nurutomo.repl.co/'` 87 | 88 | server harus memiliki spesifikasi seperti ini 89 | 90 | #### GET 91 | 92 | ```http 93 | GET / 94 | Accept: application/json 95 | ``` 96 | 97 | #### POST 98 | 99 | ```http 100 | POST / 101 | Content-Type: application/json 102 | 103 | { 104 | data: {} 105 | } 106 | ``` 107 | 108 | ### `--big-qr` 109 | 110 | Jika qr unicode kecil tidak mendukung 111 | 112 | ### `--img` 113 | 114 | Aktifkan pemeriksa gambar melalui terminal 115 | 116 | ### `--test` 117 | 118 | **Development** Testing Mode 119 | 120 | ### `--trace` 121 | 122 | ```js 123 | conn.logger.level = 'trace' 124 | ``` 125 | 126 | ### `--debug` 127 | 128 | ```js 129 | conn.logger.level = 'debug' 130 | ``` 131 | #### Thanks To 132 | **Allah SWT**, 133 | 134 | **Orang Tua**, 135 | 136 | **Semua yang selalu mendukung** 137 | 138 | 139 | ##### Special Thanks to 140 | [![Nurutomo](https://github.com/Nurutomo.png?size=100)](https://github.com/Nurutomo) 141 | [![BochilGaming](https://github.com/BochilGaming.png?size=100)](https://github.com/BochilGaming) 142 | 143 | ###### Contributor 144 | [![Rasel Comel](https://github.com/raselcomel.png?size=100)](https://github.com/raselcomel) 145 | -------------------------------------------------------------------------------- /api/games/rasel: -------------------------------------------------------------------------------- 1 | bit.ly/AcellComel -------------------------------------------------------------------------------- /api/image/rasel: -------------------------------------------------------------------------------- 1 | bit.ly/AcellComel -------------------------------------------------------------------------------- /api/random/rasel: -------------------------------------------------------------------------------- 1 | bit.ly/AcellComel -------------------------------------------------------------------------------- /api/sticker/apaan.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/api/sticker/apaan.webp -------------------------------------------------------------------------------- /api/sticker/galiat.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/api/sticker/galiat.webp -------------------------------------------------------------------------------- /api/sticker/hehe.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/api/sticker/hehe.webp -------------------------------------------------------------------------------- /api/sticker/hihi.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/api/sticker/hihi.webp -------------------------------------------------------------------------------- /api/sticker/hm.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/api/sticker/hm.webp -------------------------------------------------------------------------------- /api/sticker/kyubi.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/api/sticker/kyubi.webp -------------------------------------------------------------------------------- /api/sticker/makan.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/api/sticker/makan.webp -------------------------------------------------------------------------------- /api/sticker/mana.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/api/sticker/mana.webp -------------------------------------------------------------------------------- /api/sticker/rasel: -------------------------------------------------------------------------------- 1 | bit.ly/AcellComel -------------------------------------------------------------------------------- /api/sticker/seduh.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/api/sticker/seduh.webp -------------------------------------------------------------------------------- /api/sticker/smile.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/api/sticker/smile.webp -------------------------------------------------------------------------------- /api/sticker/xixi.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/api/sticker/xixi.webp -------------------------------------------------------------------------------- /api/video/rasel: -------------------------------------------------------------------------------- 1 | bit.ly/AcellComel -------------------------------------------------------------------------------- /config.js: -------------------------------------------------------------------------------- 1 | 2 | let fs = require('fs') 3 | let chalk = require('chalk') 4 | let yargs = require('yargs') 5 | let moment = require('moment-timezone') 6 | 7 | //=========== STICKER WM =============// 8 | const stick = JSON.parse(fs.readFileSync("src/exif.json")) 9 | if (stick.spackname == '' || stick.sauthor == '') { 10 | var sticker_name = 'Made with WeA Bot' 11 | var sticker_author = '𝖻𝗂𝗍.𝗅𝗒/𝖠𝖼𝖾𝗅𝗅𝖢𝗈𝗆𝖾𝗅' 12 | } else { 13 | var sticker_name = stick.spackname 14 | var sticker_author = stick.sauthor 15 | } 16 | const wm = JSON.parse(fs.readFileSync("src/wm.json")) 17 | if (wm.wm == '') { 18 | var hias_wm = 'ᴡᴇᴀ ʙᴏᴛ ʙʏ ʀᴀsᴇʟ ⌤' 19 | } else { 20 | var hias_wm = wm.wm 21 | } 22 | const symbol = JSON.parse(fs.readFileSync("src/symbol.json")) 23 | if (symbol.symbolA == '') { 24 | var hias_symA = '乂 ' 25 | var hias_symB = ' • ' 26 | } else { 27 | var hias_symA = symbol.symbolA 28 | var hias_symB = symbol.symbolB 29 | } 30 | let rpg = { 31 | emoticon(string) { 32 | string = string.toLowerCase() 33 | let emot = { 34 | name: '🐤', 35 | age: '🌴', 36 | premium: '🔥', 37 | tag: '🐋', 38 | number: '✨', 39 | wame: '🌹', 40 | rank: '🔱', 41 | before: '🕊', 42 | after: '🦅', 43 | atm: '🏧', 44 | warning: '⚠️', 45 | level: '🧬', 46 | limit: '🌌', 47 | health: '❤️', 48 | exp: '✉️', 49 | money: '💵', 50 | potion: '🥤', 51 | diamond: '💎', 52 | common: '📦', 53 | uncommon: '🎁', 54 | mythic: '🗳️', 55 | legendary: '🗃️', 56 | pet: '🎁', 57 | trash: '🗑', 58 | armor: '🥼', 59 | sword: '⚔️', 60 | wood: '🪵', 61 | rock: '🪨', 62 | string: '🕸️', 63 | horse: '🐎', 64 | cat: '🐈', 65 | dog: '🐕', 66 | fox: '🦊', 67 | petFood: '🍖', 68 | iron: '⛓️', 69 | gold: '👑', 70 | emerald: '💚' 71 | } 72 | let results = Object.keys(emot).map(v => [v, new RegExp(v, 'gi')]).filter(v => v[1].test(string)) 73 | if (!results.length) return '' 74 | else return emot[results[0][0]] 75 | } 76 | } 77 | 78 | // batas 79 | let genius = "https://flamingtext.com/net-fu/proxy_form.cgi?&imageoutput=true&script=genius-logo&fontsize=50&doScale=true&scaleWidth=300&scaleHeight=300&text=" 80 | let glow = "https://flamingtext.com/net-fu/proxy_form.cgi?&imageoutput=true&script=glow-logo&fontsize=50&doScale=true&scaleWidth=300&scaleHeight=300&text=" 81 | let jamm = moment.tz('Asia/Jakarta').format('HH') 82 | let flaTime 83 | if (jamm > 17) flaTime = genius 84 | else flaTime = glow 85 | const opts = new Object(yargs(process.argv.slice(2)).exitProcess(false).parse()) 86 | const prefix = new RegExp('^[' + (opts['prefix'] || 'xzXZ/i!#$%+£¢€¥^°=¶∆×÷π√✓©®:;?&.\\-').replace(/[|\\{}()[\]^$+*?.\-\^]/g, '\\$&') + ']') 87 | global.set = { 88 | //========={ SETTING HERE }=========// 89 | name: "My WeA Bot", 90 | version: "1.0.1", 91 | repo: 'https://github.com/raselcomel/mymd.git', 92 | browser: ['My-MD by rasel', 'Safari', '1.0.0'], 93 | wm: hias_wm, 94 | sa: hias_symA, 95 | sb: hias_symB, 96 | pack: sticker_name, 97 | auth: sticker_author, 98 | owner: [ 99 | ['6285346545126', 'Acel', true], 100 | // JSON.parse(readFileSync('./src/owner.json')) 101 | // ['number', 'name', dev?] 102 | ], 103 | //===================================// 104 | mods: [], //JSON.parse(readFileSync('./src/owner.json')), 105 | prems: [], //JSON.parse(readFileSync('./src/owner.json')), 106 | api: { 107 | name: { 108 | s: {// API Prefix 109 | // name: 'https://website' 110 | neoxr: 'https://api.neoxr.my.id', 111 | violet: 'https://violetics.pw', 112 | xteam: 'https://api.xteam.xyz', 113 | zahir: 'https://zahirr-web.herokuapp.com', 114 | } 115 | }, 116 | key: { 117 | s: {// APIKey Here 118 | // 'https://website': 'apikey' 119 | 'https://api.neoxr.my.id': '5VC9rvNx', 120 | 'https://violetics.pw': '0b55-fada-712f', 121 | 'https://api.xteam.xyz': 'd90a9e986e18778b', 122 | 'https://zahirr-web.herokuapp.com': 'zahirgans', 123 | } 124 | } 125 | }, 126 | opts: opts, 127 | prefix: prefix, 128 | timestamp: { 129 | start: new Date 130 | }, 131 | fla: flaTime, 132 | rpg: rpg, 133 | } 134 | // batas 135 | 136 | let file = require.resolve(__filename) 137 | fs.watchFile(file, () => { 138 | fs.unwatchFile(file) 139 | console.log(chalk.redBright("Update 'config.js'")) 140 | delete require.cache[file] 141 | require(file) 142 | }) 143 | 144 | let file_exif = "src/exif.json" 145 | fs.watchFile(file_exif, () => { 146 | fs.unwatchFile(file_exif) 147 | console.log(chalk.redBright("Update 'exif.json'")) 148 | delete require.cache[file_exif] 149 | require('./src/exif.json') 150 | }) 151 | 152 | let file_wm = "src/wm.json" 153 | fs.watchFile(file_wm, () => { 154 | fs.unwatchFile(file_wm) 155 | console.log(chalk.redBright("Update 'wm.json'")) 156 | delete require.cache[file_wm] 157 | require('./src/wm.json') 158 | }) 159 | 160 | let file_symbol = "src/symbol.json" 161 | fs.watchFile(file_symbol, () => { 162 | fs.unwatchFile(file_symbol) 163 | console.log(chalk.redBright("Update 'symbol.json'")) 164 | delete require.cache[file_symbol] 165 | require('./src/symbol.json') 166 | }) 167 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | console.log('Starting...') 2 | let cluster = require('cluster') 3 | let path = require('path') 4 | let fs = require('fs') 5 | let package = require('./package.json') 6 | const CFonts = require('cfonts') 7 | const Readline = require('readline') 8 | const yargs = require('yargs/yargs') 9 | const rl = Readline.createInterface(process.stdin, process.stdout) 10 | 11 | CFonts.say('My-MD', { 12 | colors: [pickRandom(["#FF0000","#FFFF00","#00FF00","#7F00FF","#FF007F"])], 13 | font: 'block', 14 | align: 'center', 15 | }) 16 | CFonts.say(`${package.name} Oleh @${package.author.name || package.author}`, { 17 | colors: [pickRandom(["#FF007F","#7F00FF","#00FF00","#FFFF00","#FF0000"])], 18 | font: 'console', 19 | align: 'center', 20 | }) 21 | 22 | 23 | var isRunning = false 24 | /** 25 | * Start a js file 26 | * @param {String} file `path/to/file` 27 | */ 28 | function start(file) { 29 | if (isRunning) return 30 | isRunning = true 31 | let args = [path.join(__dirname, file), ...process.argv.slice(2)] 32 | CFonts.say([process.argv[0], ...args].join(' '), { 33 | font: 'console', 34 | align: 'center', 35 | gradient: ['red', 'magenta'] 36 | }) 37 | cluster.setupMaster({ 38 | exec: path.join(__dirname, file), 39 | args: args.slice(1), 40 | }) 41 | let p = cluster.fork() 42 | p.on('message', data => { 43 | console.log('[RECEIVED]', data) 44 | switch (data) { 45 | case 'reset': 46 | p.kill() 47 | isRunning = false 48 | start.apply(this, arguments) 49 | break 50 | case 'uptime': 51 | p.send(process.uptime()) 52 | break 53 | } 54 | }) 55 | p.on('exit', code => { 56 | isRunning = false 57 | console.error('Exited with code:', code) 58 | if (code === 0) return 59 | fs.watchFile(args[0], () => { 60 | fs.unwatchFile(args[0]) 61 | start(file) 62 | }) 63 | }) 64 | let opts = new Object(yargs(process.argv.slice(2)).exitProcess(false).parse()) 65 | if (!opts['test']) 66 | if (!rl.listenerCount()) rl.on('line', line => { 67 | p.emit('message', line.trim()) 68 | }) 69 | // console.log(p) 70 | } 71 | 72 | start('main.js') 73 | 74 | function pickRandom(list) { 75 | return list[Math.floor(Math.random() * list.length)] 76 | } 77 | -------------------------------------------------------------------------------- /lib/cloudDBAdapter.js: -------------------------------------------------------------------------------- 1 | const got = require('got') 2 | 3 | const stringify = obj => JSON.stringify(obj, null, 2) 4 | const parse = str => JSON.parse(str, (_, v) => { 5 | if ( 6 | v !== null && 7 | typeof v === 'object' && 8 | 'type' in v && 9 | v.type === 'Buffer' && 10 | 'data' in v && 11 | Array.isArray(v.data)) { 12 | return Buffer.from(v.data) 13 | } 14 | return v 15 | }) 16 | class CloudDBAdapter { 17 | constructor(url, { 18 | serialize = stringify, 19 | deserialize = parse, 20 | fetchOptions = {} 21 | } = {}) { 22 | this.url = url 23 | this.serialize = serialize 24 | this.deserialize = deserialize 25 | this.fetchOptions = fetchOptions 26 | } 27 | 28 | async read() { 29 | try { 30 | let res = await got(this.url, { 31 | method: 'GET', 32 | headers: { 33 | 'Accept': 'application/json;q=0.9,text/plain' 34 | }, 35 | ...this.fetchOptions 36 | }) 37 | if (res.statusCode !== 200) throw res.statusMessage 38 | return this.deserialize(res.body) 39 | } catch (e) { 40 | return null 41 | } 42 | } 43 | 44 | async write(obj) { 45 | let res = await got(this.url, { 46 | method: 'POST', 47 | headers: { 48 | 'Content-Type': 'application/json' 49 | }, 50 | ...this.fetchOptions, 51 | body: this.serialize(obj) 52 | }) 53 | if (res.statusCode !== 200) throw res.statusMessage 54 | return res.body 55 | } 56 | } 57 | 58 | module.exports = CloudDBAdapter 59 | -------------------------------------------------------------------------------- /lib/cluster.js: -------------------------------------------------------------------------------- 1 | const cluster = require('cluster') 2 | const os = require('os') 3 | const path = require('path') 4 | const { connectionOptions } = require('../main') 5 | const { makeWASocket } = require('./simple') 6 | 7 | var conn 8 | module.exports = { 9 | Cluster() { 10 | if (cluster.isMaster || !cluster.isWorker) { 11 | if (!os.cpus().length <= 1) throw new Error(`Requires at least 1 cores, but you only have ${os.cpus().length} cores`) 12 | cluster.setupMaster({ 13 | exec: path.join(__dirname, './cluster.js') 14 | }) 15 | // for (let i = 0; i < 3; i++) 16 | cluster.fork() 17 | console.log(cluster.workers) 18 | } else { 19 | // console.log(cluster.workers) 20 | // if (cluster.worker.id == 1) this.baileys() 21 | } 22 | }, 23 | baileys() { 24 | conn = makeWASocket(connectionOptions) 25 | for (let event of Object.keys(conn.ev._events)) { 26 | conn.ev.on(event, (...updates) => { 27 | event, updates 28 | }) 29 | } 30 | }, 31 | convert() { 32 | 33 | } 34 | } 35 | 36 | if (cluster.isWorker) module.exports.Cluster() -------------------------------------------------------------------------------- /lib/colong.json: -------------------------------------------------------------------------------- 1 | { 2 | "cpackname": "", 3 | "cauthor": "" 4 | } 5 | -------------------------------------------------------------------------------- /lib/converter.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs') 2 | const path = require('path') 3 | const { spawn } = require('child_process') 4 | 5 | function ffmpeg(buffer, args = [], ext = '', ext2 = '') { 6 | return new Promise(async (resolve, reject) => { 7 | try { 8 | let tmp = path.join(__dirname, '../tmp', + new Date + '.' + ext) 9 | let out = tmp + '.' + ext2 10 | await fs.promises.writeFile(tmp, buffer) 11 | spawn('ffmpeg', [ 12 | '-y', 13 | '-i', tmp, 14 | ...args, 15 | out 16 | ]) 17 | .on('error', reject) 18 | .on('close', async (code) => { 19 | try { 20 | await fs.promises.unlink(tmp) 21 | if (code !== 0) return reject(code) 22 | resolve({ data: await fs.promises.readFile(out), filename: out }) 23 | // await fs.promises.unlink(out) 24 | } catch (e) { 25 | reject(e) 26 | } 27 | }) 28 | } catch (e) { 29 | reject(e) 30 | } 31 | }) 32 | } 33 | 34 | /** 35 | * Convert Audio to Playable WhatsApp Audio 36 | * @param {Buffer} buffer Audio Buffer 37 | * @param {String} ext File Extension 38 | */ 39 | function toPTT(buffer, ext) { 40 | return ffmpeg(buffer, [ 41 | '-vn', 42 | '-c:a', 'libopus', 43 | '-b:a', '128k', 44 | '-vbr', 'on', 45 | ], ext, 'ogg') 46 | } 47 | 48 | /** 49 | * Convert Audio to Playable WhatsApp PTT 50 | * @param {Buffer} buffer Audio Buffer 51 | * @param {String} ext File Extension 52 | */ 53 | function toAudio(buffer, ext) { 54 | return ffmpeg(buffer, [ 55 | '-vn', 56 | '-c:a', 'libopus', 57 | '-b:a', '128k', 58 | '-vbr', 'on', 59 | '-compression_level', '10' 60 | ], ext, 'opus') 61 | } 62 | 63 | /** 64 | * Convert Audio to Playable WhatsApp Video 65 | * @param {Buffer} buffer Video Buffer 66 | * @param {String} ext File Extension 67 | */ 68 | function toVideo(buffer, ext) { 69 | return ffmpeg(buffer, [ 70 | '-c:v', 'libx264', 71 | '-c:a', 'aac', 72 | '-ab', '128k', 73 | '-ar', '44100', 74 | '-crf', '32', 75 | '-preset', 'slow' 76 | ], ext, 'mp4') 77 | } 78 | 79 | module.exports = { 80 | toAudio, 81 | toPTT, 82 | toVideo, 83 | ffmpeg, 84 | } -------------------------------------------------------------------------------- /lib/database.js: -------------------------------------------------------------------------------- 1 | const path = require('path') 2 | const _fs = require('fs') 3 | const { promises: fs } = _fs 4 | 5 | class Database { 6 | /** 7 | * Create new Database 8 | * @param {String} filepath Path to specified json database 9 | * @param {...any} args JSON.stringify arguments 10 | */ 11 | constructor(filepath, ...args) { 12 | this.file = path.resolve(filepath) 13 | this.logger = console 14 | 15 | this._load() 16 | 17 | this._jsonargs = args 18 | this._state = false 19 | this._queue = [] 20 | this._interval = setInterval(async () => { 21 | if (!this._state && this._queue && this._queue[0]) { 22 | this._state = true 23 | await this[this._queue.shift()]().catch(this.logger.error) 24 | this._state = false 25 | } 26 | }, 1000) 27 | 28 | } 29 | 30 | get data() { 31 | return this._data 32 | } 33 | 34 | set data(value) { 35 | this._data = value 36 | this.save() 37 | } 38 | 39 | /** 40 | * Queue Load 41 | */ 42 | load() { 43 | this._queue.push('_load') 44 | } 45 | 46 | /** 47 | * Queue Save 48 | */ 49 | save() { 50 | this._queue.push('_save') 51 | } 52 | 53 | _load() { 54 | try { 55 | return this._data = _fs.existsSync(this.file) ? JSON.parse(_fs.readFileSync(this.file)) : {} 56 | } catch (e) { 57 | this.logger.error(e) 58 | return this._data = {} 59 | } 60 | } 61 | 62 | async _save() { 63 | let dirname = path.dirname(this.file) 64 | if (!_fs.existsSync(dirname)) await fs.mkdir(dirname, { recursive: true }) 65 | await fs.writeFile(this.file, JSON.stringify(this._data, ...this._jsonargs)) 66 | return this.file 67 | } 68 | } 69 | 70 | module.exports = Database 71 | 72 | -------------------------------------------------------------------------------- /lib/exif.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs') 2 | const { tmpdir } = require("os") 3 | const Crypto = require("crypto") 4 | const ff = require('fluent-ffmpeg') 5 | const webp = require("node-webpmux") 6 | const path = require("path") 7 | 8 | async function imageToWebp (media) { 9 | const tmpFileOut = path.join(tmpdir(), `${Crypto.randomBytes(6).readUIntLE(0, 6).toString(36)}.webp`) 10 | const tmpFileIn = path.join(tmpdir(), `${Crypto.randomBytes(6).readUIntLE(0, 6).toString(36)}.jpg`) 11 | fs.writeFileSync(tmpFileIn, media) 12 | await new Promise((resolve, reject) => { 13 | ff(tmpFileIn) 14 | .on("error", reject) 15 | .on("end", () => resolve(true)) 16 | .addOutputOptions([ 17 | "-vcodec", 18 | "libwebp", 19 | "-vf", 20 | "scale='min(320,iw)':min'(320,ih)':force_original_aspect_ratio=decrease,fps=15, pad=320:320:-1:-1:color=white@0.0, split [a][b]; [a] palettegen=reserve_transparent=on:transparency_color=ffffff [p]; [b][p] paletteuse" 21 | ]) 22 | .toFormat("webp") 23 | .save(tmpFileOut) 24 | }) 25 | const buff = fs.readFileSync(tmpFileOut) 26 | fs.unlinkSync(tmpFileOut) 27 | fs.unlinkSync(tmpFileIn) 28 | return buff 29 | } 30 | 31 | async function videoToWebp (media) { 32 | const tmpFileOut = path.join(tmpdir(), `${Crypto.randomBytes(6).readUIntLE(0, 6).toString(36)}.webp`) 33 | const tmpFileIn = path.join(tmpdir(), `${Crypto.randomBytes(6).readUIntLE(0, 6).toString(36)}.mp4`) 34 | fs.writeFileSync(tmpFileIn, media) 35 | await new Promise((resolve, reject) => { 36 | ff(tmpFileIn) 37 | .on("error", reject) 38 | .on("end", () => resolve(true)) 39 | .addOutputOptions([ 40 | "-vcodec", 41 | "libwebp", 42 | "-vf", 43 | "scale='min(320,iw)':min'(320,ih)':force_original_aspect_ratio=decrease,fps=15, pad=320:320:-1:-1:color=white@0.0, split [a][b]; [a] palettegen=reserve_transparent=on:transparency_color=ffffff [p]; [b][p] paletteuse", 44 | "-loop", 45 | "0", 46 | "-ss", 47 | "00:00:00", 48 | "-t", 49 | "00:00:05", 50 | "-preset", 51 | "default", 52 | "-an", 53 | "-vsync", 54 | "0" 55 | ]) 56 | .toFormat("webp") 57 | .save(tmpFileOut) 58 | }) 59 | const buff = fs.readFileSync(tmpFileOut) 60 | fs.unlinkSync(tmpFileOut) 61 | fs.unlinkSync(tmpFileIn) 62 | return buff 63 | } 64 | 65 | async function writeExifImg (media, metadata) { 66 | let wMedia = await imageToWebp(media) 67 | const tmpFileIn = path.join(tmpdir(), `${Crypto.randomBytes(6).readUIntLE(0, 6).toString(36)}.webp`) 68 | const tmpFileOut = path.join(tmpdir(), `${Crypto.randomBytes(6).readUIntLE(0, 6).toString(36)}.webp`) 69 | fs.writeFileSync(tmpFileIn, wMedia) 70 | if (metadata.packname || metadata.author) { 71 | 72 | const img = new webp.Image() 73 | const json = { "sticker-pack-id": `https://github.com/DikaArdnt/Hisoka-Morou`, "sticker-pack-name": metadata.packname, "sticker-pack-publisher": metadata.author, "emojis": metadata.categories ? metadata.categories : [""] } 74 | const exifAttr = Buffer.from([0x49, 0x49, 0x2A, 0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x41, 0x57, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00]) 75 | const jsonBuff = Buffer.from(JSON.stringify(json), "utf-8") 76 | const exif = Buffer.concat([exifAttr, jsonBuff]) 77 | exif.writeUIntLE(jsonBuff.length, 14, 4) 78 | await img.load(tmpFileIn) 79 | fs.unlinkSync(tmpFileIn) 80 | img.exif = exif 81 | await img.save(tmpFileOut) 82 | return tmpFileOut 83 | } 84 | } 85 | 86 | async function writeExifVid (media, metadata) { 87 | let wMedia = await videoToWebp(media) 88 | const tmpFileIn = path.join(tmpdir(), `${Crypto.randomBytes(6).readUIntLE(0, 6).toString(36)}.webp`) 89 | const tmpFileOut = path.join(tmpdir(), `${Crypto.randomBytes(6).readUIntLE(0, 6).toString(36)}.webp`) 90 | fs.writeFileSync(tmpFileIn, wMedia) 91 | if (metadata.packname || metadata.author) { 92 | const img = new webp.Image() 93 | const json = { "sticker-pack-id": `https://dikode-team.com`, "sticker-pack-name": metadata.packname, "sticker-pack-publisher": metadata.author, "emojis": metadata.categories ? metadata.categories : [""] } 94 | const exifAttr = Buffer.from([0x49, 0x49, 0x2A, 0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x41, 0x57, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00]) 95 | const jsonBuff = Buffer.from(JSON.stringify(json), "utf-8") 96 | const exif = Buffer.concat([exifAttr, jsonBuff]) 97 | 98 | exif.writeUIntLE(jsonBuff.length, 14, 4) 99 | await img.load(tmpFileIn) 100 | fs.unlinkSync(tmpFileIn) 101 | img.exif = exif 102 | await img.save(tmpFileOut) 103 | return tmpFileOut 104 | 105 | } 106 | } 107 | 108 | module.exports = { imageToWebp, videoToWebp, writeExifImg, writeExifVid } 109 | 110 | 111 | -------------------------------------------------------------------------------- /lib/exif.json: -------------------------------------------------------------------------------- 1 | { 2 | "spackname": "", 3 | "sauthor": "" 4 | } 5 | -------------------------------------------------------------------------------- /lib/gdrive.js: -------------------------------------------------------------------------------- 1 | let path = require('path') 2 | let fs = require('fs').promises 3 | let { promisify } = require('util') 4 | let { google } = require('googleapis') 5 | 6 | 7 | // If modifying these scopes, delete token.json. 8 | const SCOPES = ['https://www.googleapis.com/auth/drive.metadata.readonly'] 9 | // The file token.json stores the user's access and refresh tokens, and is 10 | // created automatically when the authorization flow completes for the first 11 | // time. 12 | const TOKEN_PATH = path.join(__dirname, '..', 'token.json') 13 | let 14 | 15 | class GoogleAuth extends EventEmitter { 16 | constructor() { 17 | super() 18 | } 19 | 20 | async authorize(credentials) { 21 | let token 22 | const { client_secret, client_id } = credentials 23 | const oAuth2Client = new google.auth.OAuth2(client_id, client_secret, `http://localhost:${port}`) 24 | try { 25 | token = JSON.parse(await fs.readFile(TOKEN_PATH)) 26 | } catch (e) { 27 | const authUrl = oAuth2Client.generateAuthUrl({ 28 | access_type: 'offline', 29 | scope: SCOPES 30 | }) 31 | this.emit('auth', authUrl) 32 | let code = await promisify(this.once).bind(this)('token') 33 | token = await oAuth2Client.getToken(code) 34 | await fs.writeFile(TOKEN_PATH, JSON.stringify(token)) 35 | } finally { 36 | await oAuth2Client.setCredentials(token) 37 | } 38 | } 39 | 40 | token(code) { 41 | this.emit('token', code) 42 | } 43 | } 44 | 45 | class GoogleDrive extends GoogleAuth { 46 | constructor() { 47 | super() 48 | this.path = '/drive/api' 49 | } 50 | 51 | async getFolderID(path) { 52 | 53 | } 54 | 55 | async infoFile(path) { 56 | 57 | } 58 | 59 | async folderList(path) { 60 | 61 | } 62 | 63 | async downloadFile(path) { 64 | 65 | } 66 | 67 | async uploadFile(path) { 68 | 69 | } 70 | } 71 | 72 | module.exports = { 73 | GoogleAuth, 74 | GoogleDrive, 75 | } 76 | -------------------------------------------------------------------------------- /lib/hack.js: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "money": "900000000" 4 | }, 5 | { 6 | "money": "980000000" 7 | }, 8 | { 9 | "money": "8298659" 10 | }, 11 | { 12 | "money": "29900299" 13 | }, 14 | { 15 | "money": "99999999999" 16 | }, 17 | { 18 | "money": "850000000" 19 | }, 20 | { 21 | "money": "2000000" 22 | }, 23 | { 24 | "money": "100000" 25 | }, 26 | { 27 | "money": "1000000" 28 | }, 29 | { 30 | "money": "2000000" 31 | }, 32 | { 33 | "money": "15000090" 34 | }, 35 | { 36 | "money": "99000000" 37 | }, 38 | { 39 | "money": "20" 40 | }, 41 | { 42 | "money": "1" 43 | }, 44 | { 45 | "money": "2" 46 | }, 47 | { 48 | "money": "2000" 49 | }, 50 | { 51 | "money": "3000000" 52 | }, 53 | { 54 | "money": "300000" 55 | }, 56 | { 57 | "money": "2230000" 58 | }, 59 | { 60 | "money": "2550000" 61 | }, 62 | { 63 | "money": "211006" 64 | }, 65 | { 66 | "money": "250" 67 | }, 68 | { 69 | "money": "300" 70 | }, 71 | { 72 | "money": "350" 73 | }, 74 | { 75 | "money": "400" 76 | }, 77 | { 78 | "money": "450" 79 | }, 80 | { 81 | "money": "500" 82 | }, 83 | { 84 | "money": "550" 85 | }, 86 | { 87 | "money": "600" 88 | }, 89 | { 90 | "money": "650" 91 | }, 92 | { 93 | "money": "700" 94 | }, 95 | { 96 | "money": "750" 97 | }, 98 | { 99 | "money": "800" 100 | }, 101 | { 102 | "money": "850" 103 | }, 104 | { 105 | "money": "900" 106 | }, 107 | { 108 | "money": "950" 109 | }, 110 | { 111 | "money": "1000" 112 | }, 113 | { 114 | "money": "1250" 115 | }, 116 | { 117 | "money": "1500" 118 | }, 119 | { 120 | "money": "1750" 121 | }, 122 | { 123 | "money": "2000" 124 | }, 125 | { 126 | "money": "2500" 127 | }, 128 | { 129 | "money": "3000" 130 | }, 131 | { 132 | "money": "3500" 133 | }, 134 | { 135 | "money": "4000" 136 | }, 137 | { 138 | "money": "4500" 139 | }, 140 | { 141 | "money": "5000" 142 | }, 143 | { 144 | "money": "5500" 145 | }, 146 | { 147 | "money": "6000" 148 | }, 149 | { 150 | "money": "6500" 151 | }, 152 | { 153 | "money": "7000" 154 | }, 155 | { 156 | "money": "7500" 157 | }, 158 | { 159 | "money": "8000" 160 | }, 161 | { 162 | "money": "8500" 163 | }, 164 | { 165 | "money": "9000" 166 | }, 167 | { 168 | "money": "9500" 169 | }, 170 | { 171 | "money": "10000" 172 | } 173 | ] 174 | -------------------------------------------------------------------------------- /lib/levelling.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | /** 3 | * Growth rate 4 | * `2.576652002695681` 5 | */ 6 | growth: Math.pow(Math.PI / Math.E, 1.618) * Math.E * .75, 7 | /** 8 | * get XP range at specified level 9 | * @param {Number} level 10 | * @param {Number} multiplier 11 | */ 12 | xpRange(level, multiplier = global.multiplier || 1) { 13 | if (level < 0) throw new TypeError('level cannot be negative value') 14 | level = Math.floor(level) 15 | let min = level === 0 ? 0 : Math.round(Math.pow(level, this.growth) * multiplier) + 1 16 | let max = Math.round(Math.pow(++level, this.growth) * multiplier) 17 | return { 18 | min, 19 | max, 20 | xp: max - min 21 | } 22 | }, 23 | /** 24 | * get level by xp 25 | * @param {Number} xp 26 | * @param {Number} multiplier 27 | */ 28 | findLevel(xp, multiplier = global.multiplier || 1) { 29 | if (xp === Infinity) return Infinity 30 | if (isNaN(xp)) return NaN 31 | if (xp <= 0) return -1 32 | let level = 0 33 | do level++ 34 | while (this.xpRange(level, multiplier).min <= xp) 35 | return --level 36 | }, 37 | /** 38 | * is able to level up? 39 | * @param {Number} level 40 | * @param {Number} xp 41 | * @param {Number} multiplier 42 | */ 43 | canLevelUp(level, xp, multiplier = global.multiplier || 1) { 44 | if (level < 0) return false 45 | if (xp === Infinity) return true 46 | if (isNaN(xp)) return false 47 | if (xp <= 0) return false 48 | return level < this.findLevel(xp, multiplier) 49 | } 50 | } -------------------------------------------------------------------------------- /lib/logs.js: -------------------------------------------------------------------------------- 1 | let stdouts = [] 2 | module.exports = (maxLength = 200) => { 3 | let oldWrite = process.stdout.write.bind(process.stdout) 4 | module.exports.disable = () => { 5 | module.exports.isModified = false 6 | return process.stdout.write = oldWrite 7 | } 8 | process.stdout.write = (chunk, encoding, callback) => { 9 | stdouts.push(Buffer.from(chunk, encoding)) 10 | oldWrite(chunk, encoding, callback) 11 | if (stdouts.length > maxLength) stdouts.shift() 12 | } 13 | module.exports.isModified = true 14 | return module.exports 15 | } 16 | 17 | module.exports.isModified = false 18 | module.exports.logs = () => Buffer.concat(stdouts) 19 | 20 | -------------------------------------------------------------------------------- /lib/lowdb/Low.d.ts: -------------------------------------------------------------------------------- 1 | export interface Adapter { 2 | read: () => Promise; 3 | write: (data: T) => Promise; 4 | } 5 | export declare class Low { 6 | adapter: Adapter; 7 | data: T | null; 8 | constructor(adapter: Adapter); 9 | read(): Promise; 10 | write(): Promise; 11 | } 12 | -------------------------------------------------------------------------------- /lib/lowdb/Low.js: -------------------------------------------------------------------------------- 1 | const { MissingAdapterError } = require('./MissingAdapterError.js'); 2 | class Low { 3 | constructor(adapter) { 4 | this.data = null; 5 | if (adapter) { 6 | this.adapter = adapter; 7 | } 8 | else { 9 | throw new MissingAdapterError(); 10 | } 11 | } 12 | async read() { 13 | this.data = await this.adapter.read(); 14 | } 15 | async write() { 16 | if (this.data) { 17 | await this.adapter.write(this.data); 18 | } 19 | } 20 | } 21 | module.exports = { Low }; 22 | -------------------------------------------------------------------------------- /lib/lowdb/LowSync.d.ts: -------------------------------------------------------------------------------- 1 | export interface SyncAdapter { 2 | read: () => T | null; 3 | write: (data: T) => void; 4 | } 5 | export declare class LowSync { 6 | adapter: SyncAdapter; 7 | data: T | null; 8 | constructor(adapter: SyncAdapter); 9 | read(): void; 10 | write(): void; 11 | } 12 | -------------------------------------------------------------------------------- /lib/lowdb/LowSync.js: -------------------------------------------------------------------------------- 1 | const { MissingAdapterError } = require('./MissingAdapterError.js'); 2 | class LowSync { 3 | constructor(adapter) { 4 | this.data = null; 5 | if (adapter) { 6 | this.adapter = adapter; 7 | } 8 | else { 9 | throw new MissingAdapterError(); 10 | } 11 | } 12 | read() { 13 | this.data = this.adapter.read(); 14 | } 15 | write() { 16 | if (this.data !== null) { 17 | this.adapter.write(this.data); 18 | } 19 | } 20 | } 21 | module.exports = { LowSync }; 22 | -------------------------------------------------------------------------------- /lib/lowdb/MissingAdapterError.d.ts: -------------------------------------------------------------------------------- 1 | export declare class MissingAdapterError extends Error { 2 | constructor(); 3 | } 4 | -------------------------------------------------------------------------------- /lib/lowdb/MissingAdapterError.js: -------------------------------------------------------------------------------- 1 | class MissingAdapterError extends Error { 2 | constructor() { 3 | super(); 4 | this.message = 'Missing Adapter'; 5 | } 6 | } 7 | module.exports = { MissingAdapterError }; 8 | -------------------------------------------------------------------------------- /lib/lowdb/adapters/JSONFile.d.ts: -------------------------------------------------------------------------------- 1 | import { Adapter } from '../Low.js'; 2 | export declare class JSONFile implements Adapter { 3 | private adapter; 4 | constructor(filename: string); 5 | read(): Promise; 6 | write(obj: T): Promise; 7 | } 8 | -------------------------------------------------------------------------------- /lib/lowdb/adapters/JSONFile.js: -------------------------------------------------------------------------------- 1 | const { TextFile } = require('./TextFile.js'); 2 | class JSONFile { 3 | constructor(filename) { 4 | this.adapter = new TextFile(filename); 5 | } 6 | async read() { 7 | const data = await this.adapter.read(); 8 | if (data === null) { 9 | return null; 10 | } 11 | else { 12 | return JSON.parse(data); 13 | } 14 | } 15 | write(obj) { 16 | return this.adapter.write(JSON.stringify(obj, null, 2)); 17 | } 18 | } 19 | module.exports = { JSONFile }; 20 | -------------------------------------------------------------------------------- /lib/lowdb/adapters/JSONFileSync.d.ts: -------------------------------------------------------------------------------- 1 | import { SyncAdapter } from '../LowSync.js'; 2 | export declare class JSONFileSync implements SyncAdapter { 3 | private adapter; 4 | constructor(filename: string); 5 | read(): T | null; 6 | write(obj: T): void; 7 | } 8 | -------------------------------------------------------------------------------- /lib/lowdb/adapters/JSONFileSync.js: -------------------------------------------------------------------------------- 1 | const { TextFileSync } = require('./TextFileSync.js'); 2 | class JSONFileSync { 3 | constructor(filename) { 4 | this.adapter = new TextFileSync(filename); 5 | } 6 | read() { 7 | const data = this.adapter.read(); 8 | if (data === null) { 9 | return null; 10 | } 11 | else { 12 | return JSON.parse(data); 13 | } 14 | } 15 | write(obj) { 16 | this.adapter.write(JSON.stringify(obj, null, 2)); 17 | } 18 | } 19 | module.exports = { JSONFileSync }; 20 | -------------------------------------------------------------------------------- /lib/lowdb/adapters/LocalStorage.d.ts: -------------------------------------------------------------------------------- 1 | import { SyncAdapter } from '../LowSync.js'; 2 | export declare class LocalStorage implements SyncAdapter { 3 | private key; 4 | constructor(key: string); 5 | read(): T | null; 6 | write(obj: T): void; 7 | } 8 | -------------------------------------------------------------------------------- /lib/lowdb/adapters/LocalStorage.js: -------------------------------------------------------------------------------- 1 | class LocalStorage { 2 | constructor(key) { 3 | this.key = key; 4 | } 5 | read() { 6 | const value = localStorage.getItem(this.key); 7 | if (value === null) { 8 | return null; 9 | } 10 | return JSON.parse(value); 11 | } 12 | write(obj) { 13 | localStorage.setItem(this.key, JSON.stringify(obj)); 14 | } 15 | } 16 | module.exports = { LocalStorage }; 17 | -------------------------------------------------------------------------------- /lib/lowdb/adapters/Memory.d.ts: -------------------------------------------------------------------------------- 1 | import { Adapter } from '../Low.js'; 2 | export declare class Memory implements Adapter { 3 | private data; 4 | read(): Promise; 5 | write(obj: T): Promise; 6 | } 7 | -------------------------------------------------------------------------------- /lib/lowdb/adapters/Memory.js: -------------------------------------------------------------------------------- 1 | class Memory { 2 | constructor() { 3 | this.data = null; 4 | } 5 | read() { 6 | return Promise.resolve(this.data); 7 | } 8 | write(obj) { 9 | this.data = obj; 10 | return Promise.resolve(); 11 | } 12 | } 13 | module.exports = { Memory }; 14 | -------------------------------------------------------------------------------- /lib/lowdb/adapters/MemorySync.d.ts: -------------------------------------------------------------------------------- 1 | import { SyncAdapter } from '../LowSync.js'; 2 | export declare class MemorySync implements SyncAdapter { 3 | private data; 4 | read(): T | null; 5 | write(obj: T): void; 6 | } 7 | -------------------------------------------------------------------------------- /lib/lowdb/adapters/MemorySync.js: -------------------------------------------------------------------------------- 1 | class MemorySync { 2 | constructor() { 3 | this.data = null; 4 | } 5 | read() { 6 | return this.data || null; 7 | } 8 | write(obj) { 9 | this.data = obj; 10 | } 11 | } 12 | module.exports = { MemorySync }; 13 | -------------------------------------------------------------------------------- /lib/lowdb/adapters/TextFile.d.ts: -------------------------------------------------------------------------------- 1 | import { Adapter } from '../Low.js'; 2 | export declare class TextFile implements Adapter { 3 | private filename; 4 | private writer; 5 | constructor(filename: string); 6 | read(): Promise; 7 | write(str: string): Promise; 8 | } 9 | -------------------------------------------------------------------------------- /lib/lowdb/adapters/TextFile.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const { Writer } = require('steno'); 3 | class TextFile { 4 | constructor(filename) { 5 | this.filename = filename; 6 | this.writer = new Writer(filename); 7 | } 8 | async read() { 9 | let data; 10 | try { 11 | data = await fs.promises.readFile(this.filename, 'utf-8'); 12 | } 13 | catch (e) { 14 | if (e.code === 'ENOENT') { 15 | return null; 16 | } 17 | throw e; 18 | } 19 | return data; 20 | } 21 | write(str) { 22 | return this.writer.write(str); 23 | } 24 | } 25 | module.exports = { TextFile }; -------------------------------------------------------------------------------- /lib/lowdb/adapters/TextFileSync.d.ts: -------------------------------------------------------------------------------- 1 | import { SyncAdapter } from '../LowSync.js'; 2 | export declare class TextFileSync implements SyncAdapter { 3 | private tempFilename; 4 | private filename; 5 | constructor(filename: string); 6 | read(): string | null; 7 | write(str: string): void; 8 | } 9 | -------------------------------------------------------------------------------- /lib/lowdb/adapters/TextFileSync.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const path = require('path'); 3 | class TextFileSync { 4 | constructor(filename) { 5 | this.filename = filename; 6 | this.tempFilename = path.join(path.dirname(filename), `.${path.basename(filename)}.tmp`); 7 | } 8 | read() { 9 | let data; 10 | try { 11 | data = fs.readFileSync(this.filename, 'utf-8'); 12 | } 13 | catch (e) { 14 | if (e.code === 'ENOENT') { 15 | return null; 16 | } 17 | throw e; 18 | } 19 | return data; 20 | } 21 | write(str) { 22 | fs.writeFileSync(this.tempFilename, str); 23 | fs.renameSync(this.tempFilename, this.filename); 24 | } 25 | } 26 | module.exports = { TextFileSync }; 27 | -------------------------------------------------------------------------------- /lib/lowdb/adapters/rasel: -------------------------------------------------------------------------------- 1 | https://github.com/raselcomel 2 | -------------------------------------------------------------------------------- /lib/lowdb/index.d.ts: -------------------------------------------------------------------------------- 1 | export * from './adapters/JSONFile.js'; 2 | export * from './adapters/JSONFileSync.js'; 3 | export * from './adapters/LocalStorage.js'; 4 | export * from './adapters/Memory.js'; 5 | export * from './adapters/MemorySync.js'; 6 | export * from './adapters/TextFile.js'; 7 | export * from './adapters/TextFileSync.js'; 8 | export * from './Low.js'; 9 | export * from './LowSync.js'; 10 | -------------------------------------------------------------------------------- /lib/lowdb/index.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | ...require('./adapters/JSONFile.js'), 3 | ...require('./adapters/JSONFileSync.js'), 4 | ...require('./adapters/LocalStorage.js'), 5 | ...require('./adapters/Memory.js'), 6 | ...require('./adapters/MemorySync.js'), 7 | ...require('./adapters/TextFile.js'), 8 | ...require('./adapters/TextFileSync.js'), 9 | ...require('./Low.js'), 10 | ...require('./LowSync.js'), 11 | } -------------------------------------------------------------------------------- /lib/lowdb/rasel: -------------------------------------------------------------------------------- 1 | https://github.com/raselcomel 2 | -------------------------------------------------------------------------------- /lib/mongoDB.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose') 2 | const { Schema } = mongoose 3 | 4 | module.exports = class mongoDB { 5 | constructor(url, options = { useNewUrlParser: true, useUnifiedTopology: true }) { 6 | this.url = url 7 | this.data = this._data = this._schema = this._model = {} 8 | this.db 9 | this.options = options 10 | } 11 | async read() { 12 | this.db = await mongoose.connect(this.url, { ...this.options }) 13 | this.connection = mongoose.connection 14 | let schema = this._schema = new Schema({ 15 | data: { 16 | type: Object, 17 | required: true, //depends on whether the field is mandatory or not 18 | default: {} 19 | } 20 | }) 21 | // this._model = mongoose.model('data', schema) 22 | try { this._model = mongoose.model('data', schema) } catch { this._model = mongoose.model('data') } 23 | this._data = await this._model.findOne({}) 24 | if (!this._data) { 25 | this.data = {} 26 | await this.write(this.data) 27 | this._data = await this._model.findOne({}) 28 | } else this.data = this._data.data 29 | return this.data 30 | } 31 | 32 | 33 | async write(data) { 34 | if (!data) return data 35 | if (!this._data) return (new this._model({ data })).save() 36 | this._model.findById(this._data._id, (err, docs) => { 37 | if (!err) { 38 | if (!docs.data) docs.data = {} 39 | docs.data = data 40 | return docs.save() 41 | } 42 | }) 43 | } 44 | } -------------------------------------------------------------------------------- /lib/print.js: -------------------------------------------------------------------------------- 1 | let { WAMessageStubType } = require('baileys') 2 | let urlRegex = require('url-regex-safe')({ strict: false }) 3 | let PhoneNumber = require('awesome-phonenumber') 4 | let terminalImage = set.opts['img'] ? require('terminal-image') : '' 5 | let chalk = require('chalk') 6 | let fs = require('fs') 7 | 8 | module.exports = async function (m, conn = { user: {} }) { 9 | let _name = await conn.getName(m.sender) 10 | let sender = PhoneNumber('+' + m.sender.replace('@s.whatsapp.net', '')).getNumber('international') + (_name ? ' ~' + _name : '') 11 | let chat = await conn.getName(m.chat) 12 | // let ansi = '\x1b[' 13 | let img 14 | try { 15 | if (set.opts['img']) 16 | img = /sticker|image/gi.test(m.mtype) ? await terminalImage.buffer(await m.download()) : false 17 | } catch (e) { 18 | console.error(e) 19 | } 20 | let filesize = (m.msg ? 21 | m.msg.vcard ? 22 | m.msg.vcard.length : 23 | m.msg.fileLength ? 24 | m.msg.fileLength.low || m.msg.fileLength : 25 | m.msg.axolotlSenderKeyDistributionMessage ? 26 | m.msg.axolotlSenderKeyDistributionMessage.length : 27 | m.text ? 28 | m.text.length : 29 | 0 30 | : m.text ? m.text.length : 0) || 0 31 | let user = global.db.data.users[m.sender] 32 | let me = PhoneNumber('+' + (conn.user && conn.user.jid).replace('@s.whatsapp.net', '')).getNumber('international') 33 | console.log(` 34 | ${chalk.redBright('%s')} ${chalk.black(chalk.bgYellow('%s'))} ${chalk.black(chalk.bgGreen('%s'))} ${chalk.magenta('%s [%s %sB]')} 35 | ${chalk.green('%s')} ${chalk.yellow('%s%s')} ${chalk.blueBright('to')} ${chalk.green('%s')} ${chalk.black(chalk.bgYellow('%s'))} 36 | `.trim(), 37 | me + ' ~' + conn.user.name, 38 | (m.messageTimestamp ? new Date(1000 * (m.messageTimestamp.low || m.messageTimestamp)) : new Date).toTimeString(), 39 | m.messageStubType ? WAMessageStubType[m.messageStubType] : '', 40 | filesize, 41 | filesize === 0 ? 0 : (filesize / 1009 ** Math.floor(Math.log(filesize) / Math.log(1000))).toFixed(1), 42 | ['', ...'KMGTP'][Math.floor(Math.log(filesize) / Math.log(1000))] || '', 43 | sender, 44 | m ? m.exp : '?', 45 | user ? '|' + user.exp + '|' + user.limit : '' + ('|' + user.level), 46 | m.chat + (chat ? ' ~' + chat : ''), 47 | m.mtype ? m.mtype.replace(/message$/i, '').replace('audio', m.msg.ptt ? 'PTT' : 'audio').replace(/^./, v => v.toUpperCase()) : '' 48 | ) 49 | if (img) console.log(img.trimEnd()) 50 | if (typeof m.text === 'string' && m.text) { 51 | let log = m.text.replace(/\u200e+/g, '') 52 | let mdRegex = /(?<=(?:^|[\s\n])\S?)(?:([*_~])(.+?)\1|```((?:.||[\n\r])+?)```)(?=\S?(?:[\s\n]|$))/g 53 | let mdFormat = (depth = 4) => (_, type, text, monospace) => { 54 | let types = { 55 | _: 'italic', 56 | '*': 'bold', 57 | '~': 'strikethrough' 58 | } 59 | text = text || monospace 60 | let formatted = !types[type] || depth < 1 ? text : chalk[types[type]](text.replace(mdRegex, mdFormat(depth - 1))) 61 | // console.log({ depth, type, formatted, text, monospace }, formatted) 62 | return formatted 63 | } 64 | if (log.length < 4096) 65 | log = log.replace(urlRegex, (url, i, text) => { 66 | let end = url.length + i 67 | return i === 0 || end === text.length || (/^\s$/.test(text[end]) && /^\s$/.test(text[i - 1])) ? chalk.blueBright(url) : url 68 | }) 69 | log = log.replace(mdRegex, mdFormat(4)) 70 | if (m.mentionedJid) for (let user of m.mentionedJid) log = log.replace('@' + user.split`@`[0], chalk.blueBright('@' + await conn.getName(user))) 71 | console.log(m.error != null ? chalk.red(log) : m.isCommand ? chalk.yellow(log) : log) 72 | } 73 | if (m.messageStubParameters) console.log(m.messageStubParameters.map(jid => { 74 | jid = conn.decodeJid(jid) 75 | let name = conn.getName(jid) 76 | return chalk.gray(PhoneNumber('+' + jid.replace('@s.whatsapp.net', '')).getNumber('international') + (name ? ' ~' + name : '')) 77 | }).join(', ')) 78 | if (/document/i.test(m.mtype)) console.log(`📄 ${m.msg.filename || m.msg.displayName || 'Document'}`) 79 | else if (/ContactsArray/i.test(m.mtype)) console.log(`👨‍👩‍👧‍👦 ${' ' || ''}`) 80 | else if (/contact/i.test(m.mtype)) console.log(`👨 ${m.msg.displayName || ''}`) 81 | else if (/audio/i.test(m.mtype)) (s = m.msg.seconds, console.log(`${m.msg.ptt ? '🎤 (PTT ' : '🎵 ('}AUDIO) ${Math.floor(s / 60).toString().padStart(2, 0)}:${(s % 60).toString().padStart(2, 0)}`)) 82 | 83 | console.log() 84 | // if (m.quoted) console.log(m.msg.contextInfo) 85 | } 86 | 87 | let file = require.resolve(__filename) 88 | fs.watchFile(file, () => { 89 | fs.unwatchFile(file) 90 | console.log(chalk.redBright("Update 'lib/print.js'")) 91 | delete require.cache[file] 92 | }) 93 | -------------------------------------------------------------------------------- /lib/randomm.js: -------------------------------------------------------------------------------- 1 | const fetch = require('node-fetch') 2 | 3 | function fetchRandomJson(url, options) { 4 | return new Promise(async (resolve, reject) => { 5 | fetch(url, options) 6 | .then(res => res.json()) 7 | .then(res => { 8 | const json = JSON.parse(JSON.stringify(res)) 9 | const index = Math.floor(Math.random() * json.length) 10 | const random = json[index] 11 | resolve(random) 12 | }) 13 | .catch((e) => { 14 | reject(e) 15 | }) 16 | }) 17 | } 18 | 19 | module.exports = { fetchRandomJson } 20 | -------------------------------------------------------------------------------- /lib/sticker.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs') const path = require('path') const crypto = require('crypto') const fetch = require('node-fetch') const { ffmpeg } = require('./converter') const { spawn } = require('child_process') const uploadFile = require('./uploadFile') const { fromBuffer } = require('file-type') const uploadImage = require('./uploadImage') const tmp = path.join(__dirname, '../tmp') /** * Image to Sticker * @param {Buffer} img Image Buffer * @param {String} url Image URL */ function sticker2(img, url) { return new Promise(async (resolve, reject) => { try { if (url) { let res = await fetch(url) if (res.status !== 200) throw await res.text() img = await res.buffer() } let inp = path.join(tmp, +new Date + '.jpeg') await fs.promises.writeFile(inp, img) let ff = spawn('ffmpeg', [ '-y', '-i', inp, '-vf', 'scale=512:512:flags=lanczos:force_original_aspect_ratio=decrease,format=rgba,pad=512:512:(ow-iw)/2:(oh-ih)/2:color=#00000000,setsar=1', '-f', 'png', '-' ]) ff.on('error', reject) ff.on('close', async () => { await fs.promises.unlink(inp) }) let bufs = [] const [_spawnprocess, ..._spawnargs] = [...(module.exports.support.gm ? ['gm'] : module.exports.magick ? ['magick'] : []), 'convert', 'png:-', 'webp:-'] let im = spawn(_spawnprocess, _spawnargs) im.on('error', e => conn.reply(m.chat, util.format(e), m)) im.stdout.on('data', chunk => bufs.push(chunk)) ff.stdout.pipe(im.stdin) im.on('exit', () => { resolve(Buffer.concat(bufs)) }) } catch (e) { reject(e) } }) } async function canvas(code, type = 'png', quality = 0.92) { let res = await fetch('https://nurutomo.herokuapp.com/api/canvas?' + queryURL({ type, quality }), { method: 'POST', headers: { 'Content-Type': 'text/plain', 'Content-Length': code.length }, body: code }) let image = await res.buffer() return image } function queryURL(queries) { return new URLSearchParams(Object.entries(queries)) } /** * Image to Sticker * @param {Buffer} img Image Buffer * @param {String} url Image URL */ async function sticker1(img, url) { url = url ? url : await uploadImage(img) let { mime } = url ? { mime: 'image/jpeg' } : await fromBuffer(img) let sc = `let im = await loadImg('data:${mime};base64,'+(await window.loadToDataURI('${url}'))) c.width = c.height = 512 let max = Math.max(im.width, im.height) let w = 512 * im.width / max let h = 512 * im.height / max ctx.drawImage(im, 256 - w / 2, 256 - h / 2, w, h) ` return await canvas(sc, 'webp') } /** * Image/Video to Sticker * @param {Buffer} img Image/Video Buffer * @param {String} url Image/Video URL * @param {String} packname EXIF Packname * @param {String} author EXIF Author */ async function sticker3(img, url, packname, author) { url = url ? url : await uploadFile(img) let res = await fetch('https://api.xteam.xyz/sticker/wm?' + new URLSearchParams(Object.entries({ url, packname, author }))) return await res.buffer() } /** * Image to Sticker * @param {Buffer} img Image/Video Buffer * @param {String} url Image/Video URL */ async function sticker4(img, url) { if (url) { let res = await fetch(url) if (res.status !== 200) throw await res.text() img = await res.buffer() } return await ffmpeg(img, [ '-vf', 'scale=512:512:flags=lanczos:force_original_aspect_ratio=decrease,format=rgba,pad=512:512:(ow-iw)/2:(oh-ih)/2:color=#00000000,setsar=1' ], 'jpeg', 'webp') } async function sticker5(img, url, packname, author, categories = ['']) { const WSF = require('wa-sticker-formatter') const stickerMetadata = { type: 'full', pack: packname, author, categories, } return await new WSF.Sticker(img ? img : url, stickerMetadata).build() } /** * Add WhatsApp JSON Exif Metadata * Taken from https://github.com/pedroslopez/whatsapp-web.js/pull/527/files * @param {Buffer} webpSticker * @param {String} packname * @param {String} author * @param {String} categories * @param {Object} extra * @returns */ async function addExif(webpSticker, packname, author, categories = [''], extra = {}) { const webp = require('node-webpmux') // Optional Feature const img = new webp.Image(); const stickerPackId = crypto.randomBytes(32).toString('hex'); const json = { 'sticker-pack-id': stickerPackId, 'sticker-pack-name': packname, 'sticker-pack-publisher': author, 'emojis': categories, ...extra }; let exifAttr = Buffer.from([0x49, 0x49, 0x2A, 0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x41, 0x57, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00]); let jsonBuffer = Buffer.from(JSON.stringify(json), 'utf8'); let exif = Buffer.concat([exifAttr, jsonBuffer]); exif.writeUIntLE(jsonBuffer.length, 14, 4); await img.load(webpSticker) img.exif = exif return await img.save(null) } module.exports = { /** * Image/Video to Sticker * @param {Buffer} img Image/Video Buffer * @param {String} url Image/Video URL * @param {...String} */ async sticker(img, url, ...args) { let lastError for (let func of [ sticker3, // sticker5, this.support.ffmpeg && this.support.ffmpegWebp && sticker4, this.support.ffmpeg && (this.support.convert || this.support.magick || this.support.gm) && sticker2, sticker1 ].filter(f => f)) { try { let stiker = await func(img, url, ...args) if (stiker.includes('RIFF')) { try { return await addExif(stiker, ...args) } catch (e) { return stiker } } throw stiker.toString() } catch (err) { lastError = err } } return lastError }, sticker1, sticker2, sticker3, sticker4, sticker5, addExif, support: { ffmpeg: true, ffprobe: true, ffmpegWebp: true, convert: true, magick: false, gm: false, find: false } } -------------------------------------------------------------------------------- /lib/stres.js: -------------------------------------------------------------------------------- 1 | //FOR STRESS GENERATOR 2 | const simp = async(name) => { 3 | return `Buruan, panggil gue SIMP, ato BAPERAN. ini MURNI PERASAAN GUE. Gue pengen genjot bareng ${name}. Ini seriusan, suaranya yang imut, mukanya yang cantik, apalagi badannya yang aduhai ningkatin gairah gue buat genjot ${name}. Setiap lapisan kulitnya pengen gue jilat. Saat gue mau crot, gue bakal moncrot sepenuh hati, bisa di perut, muka, badan, teteknya, sampai lubang burit pun bakal gue crot sampai puncak klimaks. Gue bakal meluk dia abis gue moncrot, lalu nanya gimana kabarnya, ngrasain enggas bareng saat telanjang. Dia bakal bilang kalau genjotan gue mantep dan nyatain perasaannya ke gue, bilang kalo dia cinta ama gue. Gue bakal bilang balik seberapa gue cinta ama dia, dan dia bakal kecup gue di pipi. Terus kita ganti pakaian dan ngabisin waktu nonton film, sambil pelukan ama makan hidangan favorit. Gue mau ${name} jadi pacar, pasangan, istri, dan idup gue. Gue cinta dia dan ingin dia jadi bagian tubuh gue. Lo kira ini copypasta? Kagak cok. Gue ngetik tiap kata nyatain prasaan gue. Setiap kali elo nanya dia siapa, denger ini baik-baik : DIA ISTRI GUE. Gue sayang ${name}, dan INI MURNI PIKIRAN DAN PERASAAN GUE.` 4 | } 5 | const nenen = async(name) => { 6 | return `NENEN NENEN KEPENGEN NENEN SAMA ${name}. TETEK GEDE NAN KENCANG MILIK ${name} MEMBUATKU KEPENGEN NENEN. DIBALUT PAKAIAN KETAT YANG ADUHAI CROOOOTOTOTOTOTOT ANJING SANGE GUA BANGSAT. ${name}, PLIS DENGERIN BAIK BAIK. TOLONG BUKA BAJU SEBENTAR SAJA PLISSS TOLOOONG BANGET, BIARKAN MULUT KERINGKU BISA MENGECAP NENEN ${name}. BIARKAN AKU MENGENYOT NENENMU ${name}. AKU RELA NGASIH SESEMBAHAN APA AJA BERAPAPUN ITU DUIT YANG AKU BAKAR KHUSUS TERKHUSUS BUATMU. TAPI TOLOOOONG BANGET BUKA BAJUMU AKU MAU NENEN. NENEN NENEEEEN NENEN ${name} WANGIIII` 7 | } 8 | const wangy = async(name) => { 9 | return `${name} ${name} ${name} ❤️ ❤️ ❤️ WANGI WANGI WANGI WANGI HU HA HU HA HU HA, aaaah baunya rambut ${name} wangi aku mau nyiumin aroma wanginya ${name} AAAAAAAAH ~ Rambutnya.... aaah rambutnya juga pengen aku elus-elus ~~ AAAAAH ${name} keluar pertama kali di anime juga manis ❤️ ❤️ ❤️ banget AAAAAAAAH ${name} AAAAA LUCCUUUUUUUUUUUUUUU............ ${name} AAAAAAAAAAAAAAAAAAAAGH ❤️ ❤️ ❤️apa ? ${name} itu gak nyata ? Cuma HALU katamu ? nggak, ngak ngak ngak ngak NGAAAAAAAAK GUA GAK PERCAYA ITU DIA NYATA NGAAAAAAAAAAAAAAAAAK PEDULI BANGSAAAAAT !! GUA GAK PEDULI SAMA KENYATAAN POKOKNYA GAK PEDULI. ❤️ ❤️ ❤️ ${name} gw ... ${name} di laptop ngeliatin gw, ${name} .. kamu percaya sama aku ? aaaaaaaaaaah syukur ${name} aku gak mau merelakan ${name} aaaaaah ❤️ ❤️ ❤️ YEAAAAAAAAAAAH GUA MASIH PUNYA ${name} SENDIRI PUN NGGAK SAMA AAAAAAAAAAAAAAH` 10 | } 11 | const sherk = async(name) => { 12 | return `Usiaku 22 tahun. Aku sangat mencintai ${name}, aku punya semua Figurine dan wallpapernya. Aku berdoa setiap malam dan berterima kasih atas segala hal yang telah ia berikan kepadaku. "${name} adalah cinta" aku bilang "${name} adalah Tujuan Hidupku". Temanku datang ke kamarku dan berkata "HALU LU ANJING !!". Aku tau dia cemburu atas kesetiaanku kepada ${name}. Lalu kukatakan padanya "BACOT NJING !!". Temanku menampol kepalaku dan menyuruhku untuk tidur. Kepalaku sakit dan aku menangis. Aku rebahan di kasur yang dingin, lalu ada sesuatu yang hangat menyentuhku. Ternyata ${name} datang ke dalam kamarku, Aku begitu senang bertemu ${name}. Dia membisikan ke telingaku, "Kamu adalah impianku" Dengan tangannya dia meraih diriku. Aku melebarkan pantatku keatas demi ${name}. Dia menusukan sesuatu kedalam Anggusku. begitu sakit, tapi kulakukan itu demi ${name}. Aku ingin memberikan kepuasan kepada ${name}. Dia meraum bagaikan singa, disaat dia melepaskan cintanya kedalam Anggusku. Temanku masuk kekamarku dan berkata "....... Anjing". ${name} melihat temanku dan berkata " Semua sudah berakhir" Dengan menggunakan kemampuannya Stellar Restoration ${name} pergi meninggalkan kamarku. "${name} itu cinta" "${name} itu kehidupan".` 13 | } 14 | const wangy2 = async(q) => { 15 | return `GW BENAR-BENAR PENGEN JILAT KAKI *${q.toUpperCase()}*,GW PENGEN BANGET MENJILAT SETIAP BAGIAN KAKINYA SAMPAI AIR LIUR GW BERCUCURAN KAYAK AIR KERINGAT LALU NGENTOD DENGAN NYA SETIAP HARI SAMPAI TUBUH KITA MATI RASA, YA TUHAN GW INGIN MEMBUAT ANAK ANAK DENGAN *${q.toUpperCase()}* SEBANYAK SATU TIM SEPAK BOLA DAN MEMBUAT SATU TIM SEPAK BOLA LAINYA UNTUK MELAWAN ANAK-ANAK TIM SEPAK BOLA PERTAMA GW YANG GW BUAT SAMA *${q.toUpperCase()}* GW PENGEN MASUK KE SETIAP LUBANG TUBUHNYA, MAU ITU LUBANG HIDUNG LUBANG MATA MAUPUN LUBANG BOOL, KEMUDIAN GW AKAN MANUSIA YANG TIDAK BISA HIDUP KALO GW GA ENTOD SETIAP HARI.` 16 | } 17 | 18 | module.exports = { wangy, nenen, simp, sherk, wangy2 } -------------------------------------------------------------------------------- /lib/symbol.json: -------------------------------------------------------------------------------- 1 | { 2 | "symbol": "" 3 | } 4 | -------------------------------------------------------------------------------- /lib/tictactoe.d.ts: -------------------------------------------------------------------------------- 1 | export declare class TicTacToe { 2 | /* X PlayerName */ 3 | playerX: string; 4 | /* Y PlayerName */ 5 | playerY: string; 6 | /* X if true, Y if false */ 7 | _currentTurn: boolean; 8 | _x: number; 9 | _y: number; 10 | _turns: number; 11 | constructor(playerX: string, playerY: string); 12 | get board(): number; 13 | turn(player, index: number): boolean; 14 | turn(player, x: number, y: number): boolean; 15 | } 16 | -------------------------------------------------------------------------------- /lib/tictactoe.js: -------------------------------------------------------------------------------- 1 | class TicTacToe { 2 | constructor(playerX = 'x', playerO = 'o') { 3 | this.playerX = playerX 4 | this.playerO = playerO 5 | this._currentTurn = false 6 | this._x = 0 7 | this._o = 0 8 | this.turns = 0 9 | } 10 | 11 | get board() { 12 | return this._x | this._o 13 | } 14 | 15 | get currentTurn() { 16 | return this._currentTurn ? this.playerO : this.playerX 17 | } 18 | 19 | get enemyTurn() { 20 | return this._currentTurn ? this.playerX : this.playerO 21 | } 22 | 23 | static check(state) { 24 | for (let combo of [7, 56, 73, 84, 146, 273, 292, 448]) 25 | if ((state & combo) === combo) 26 | return !0 27 | return !1 28 | } 29 | 30 | /** 31 | * ```js 32 | * TicTacToe.toBinary(1, 2) // 0b010000000 33 | * ``` 34 | */ 35 | static toBinary(x = 0, y = 0) { 36 | if (x < 0 || x > 2 || y < 0 || y > 2) throw new Error('invalid position') 37 | return 1 << x + (3 * y) 38 | } 39 | 40 | /** 41 | * @param player `0` is `X`, `1` is `O` 42 | * 43 | * - `-3` `Game Ended` 44 | * - `-2` `Invalid` 45 | * - `-1` `Invalid Position` 46 | * - ` 0` `Position Occupied` 47 | * - ` 1` `Sucess` 48 | * @returns {-3|-2|-1|0|1} 49 | */ 50 | turn(player = 0, x = 0, y) { 51 | if (this.board === 511) return -3 52 | let pos = 0 53 | if (y == null) { 54 | if (x < 0 || x > 8) return -1 55 | pos = 1 << x 56 | } else { 57 | if (x < 0 || x > 2 || y < 0 || y > 2) return -1 58 | pos = TicTacToe.toBinary(x, y) 59 | } 60 | if (this._currentTurn ^ player) return -2 61 | if (this.board & pos) return 0 62 | this[this._currentTurn ? '_o' : '_x'] |= pos 63 | this._currentTurn = !this._currentTurn 64 | this.turns++ 65 | return 1 66 | } 67 | 68 | /** 69 | * @returns {('X'|'O'|1|2|3|4|5|6|7|8|9)[]} 70 | */ 71 | static render(boardX = 0, boardO = 0) { 72 | let x = parseInt(boardX.toString(2), 4) 73 | let y = parseInt(boardO.toString(2), 4) * 2 74 | return [...(x + y).toString(4).padStart(9, '0')].reverse().map((value, index) => value == 1 ? 'X' : value == 2 ? 'O' : ++index) 75 | } 76 | 77 | /** 78 | * @returns {('X'|'O'|1|2|3|4|5|6|7|8|9)[]} 79 | */ 80 | render() { 81 | return TicTacToe.render(this._x, this._o) 82 | } 83 | 84 | get winner() { 85 | let x = TicTacToe.check(this._x) 86 | let o = TicTacToe.check(this._o) 87 | return x ? this.playerX : o ? this.playerO : false 88 | } 89 | } 90 | 91 | new TicTacToe().turn 92 | 93 | module.exports = TicTacToe -------------------------------------------------------------------------------- /lib/uploadFile.js: -------------------------------------------------------------------------------- 1 | const fetch = require('node-fetch') 2 | const FormData = require('form-data') 3 | const { fromBuffer } = require('file-type') 4 | 5 | /** 6 | * Upload epheremal file to file.io 7 | * `Expired in 1 day` 8 | * `100MB Max Filesize` 9 | * @param {Buffer} buffer File Buffer 10 | */ 11 | const fileIO = async buffer => { 12 | const { ext } = await fromBuffer(buffer) || {} 13 | let form = new FormData 14 | form.append('file', buffer, 'tmp.' + ext) 15 | let res = await fetch('https://file.io/?expires=1d', { // 1 Day Expiry Date 16 | method: 'POST', 17 | body: form 18 | }) 19 | let json = await res.json() 20 | if (!json.success) throw json 21 | return json.link 22 | } 23 | 24 | /** 25 | * Upload file to storage.restfulapi.my.id 26 | * @param {Buffer|ReadableStream|(Buffer|ReadableStream)[]} inp File Buffer/Stream or Array of them 27 | * @returns {string|null|(string|null)[]} 28 | */ 29 | const RESTfulAPI = async inp => { 30 | let form = new FormData 31 | let buffers = inp 32 | if (!Array.isArray(inp)) buffers = [inp] 33 | for (let buffer of buffers) { 34 | form.append('file', buffer) 35 | } 36 | let res = await fetch('https://storage.restfulapi.my.id/upload', { 37 | method: 'POST', 38 | body: form 39 | }) 40 | let json = await res.text() 41 | try { 42 | json = JSON.parse(json) 43 | if (!Array.isArray(inp)) return json.files[0].url 44 | return json.files.map(res => res.url) 45 | } catch (e) { 46 | throw json 47 | } 48 | } 49 | 50 | module.exports = async function (inp) { 51 | let err = false 52 | for (let upload of [RESTfulAPI, fileIO]) { 53 | try { 54 | return await upload(inp) 55 | } catch (e) { 56 | err = e 57 | } 58 | } 59 | if (err) throw err 60 | } -------------------------------------------------------------------------------- /lib/uploadImage.js: -------------------------------------------------------------------------------- 1 | const fetch = require('node-fetch') 2 | const FormData = require('form-data') 3 | const { fromBuffer } = require('file-type') 4 | 5 | /** 6 | * Upload image to telegra.ph 7 | * Supported mimetype: 8 | * - `image/jpeg` 9 | * - `image/jpg` 10 | * - `image/png`s 11 | * @param {Buffer} buffer Image Buffer 12 | */ 13 | module.exports = async buffer => { 14 | const { ext } = await fromBuffer(buffer) 15 | let form = new FormData 16 | form.append('file', buffer, 'tmp.' + ext) 17 | let res = await fetch('https://telegra.ph/upload', { 18 | method: 'POST', 19 | body: form 20 | }) 21 | let img = await res.json() 22 | if (img.error) throw img.error 23 | return 'https://telegra.ph' + img[0].src 24 | } 25 | 26 | -------------------------------------------------------------------------------- /lib/wallq.js: -------------------------------------------------------------------------------- 1 | // cewe yang ada di iklan royco bikin ange njing 2 | // pdhl cuma iklan :v 3 | 4 | const fetch = require('node-fetch') 5 | 6 | let handler = async (m, { conn, text }) => { 7 | if (!text) throw 'Nyari apa?' 8 | let res = await fetch(global.API('https://wall.alphacoders.com/api2.0','/get.php', { 9 | auth: '3e7756c85df54b78f934a284c11abe4e', 10 | method: 'search', 11 | term: text 12 | })) 13 | if (!res.ok) throw await res.text() 14 | let json = await res.json() 15 | let img = json.wallpapers[Math.floor(Math.random() * json.wallpapers.length)] 16 | await conn.sendFile(m.chat, img.url_image, 'wallpaper', 'Nih wallpaper!', m) 17 | } 18 | handler.help = ['wallpaperq '] 19 | handler.tags = ['internet'] 20 | handler.command = /^wall(paper)?q?$/i 21 | handler.limit = true 22 | 23 | module.exports = handler 24 | -------------------------------------------------------------------------------- /lib/webp2mp4.js: -------------------------------------------------------------------------------- 1 | const fetch = require('node-fetch') 2 | const FormData = require('form-data') 3 | const { JSDOM } = require('jsdom') 4 | 5 | async function webp2mp4(source) { 6 | let form = new FormData 7 | let isUrl = typeof source === 'string' && /https?:\/\//.test(source) 8 | form.append('new-image-url', isUrl ? source : '') 9 | form.append('new-image', isUrl ? '' : source, 'image.webp') 10 | let res = await fetch('https://s6.ezgif.com/webp-to-mp4', { 11 | method: 'POST', 12 | body: form 13 | }) 14 | let html = await res.text() 15 | let { document } = new JSDOM(html).window 16 | let form2 = new FormData 17 | let obj = {} 18 | for (let input of document.querySelectorAll('form input[name]')) { 19 | obj[input.name] = input.value 20 | form2.append(input.name, input.value) 21 | } 22 | let res2 = await fetch('https://ezgif.com/webp-to-mp4/' + obj.file, { 23 | method: 'POST', 24 | body: form2 25 | }) 26 | let html2 = await res2.text() 27 | let { document: document2 } = new JSDOM(html2).window 28 | return new URL(document2.querySelector('div#output > p.outfile > video > source').src, res2.url).toString() 29 | } 30 | 31 | async function webp2png(source) { 32 | let form = new FormData 33 | let isUrl = typeof source === 'string' && /https?:\/\//.test(source) 34 | form.append('new-image-url', isUrl ? source : '') 35 | form.append('new-image', isUrl ? '' : source, 'image.webp') 36 | let res = await fetch('https://s6.ezgif.com/webp-to-png', { 37 | method: 'POST', 38 | body: form 39 | }) 40 | let html = await res.text() 41 | let { document } = new JSDOM(html).window 42 | let form2 = new FormData 43 | let obj = {} 44 | for (let input of document.querySelectorAll('form input[name]')) { 45 | obj[input.name] = input.value 46 | form2.append(input.name, input.value) 47 | } 48 | let res2 = await fetch('https://ezgif.com/webp-to-png/' + obj.file, { 49 | method: 'POST', 50 | body: form2 51 | }) 52 | let html2 = await res2.text() 53 | let { document: document2 } = new JSDOM(html2).window 54 | return new URL(document2.querySelector('div#output > p.outfile > img').src, res2.url).toString() 55 | } 56 | 57 | if (require.main === module) { 58 | // TODO: Test 59 | webp2mp4('https://mathiasbynens.be/demo/animated-webp-supported.webp').then(console.error) 60 | webp2png('https://mathiasbynens.be/demo/animated-webp-supported.webp').then(console.error) 61 | } else { 62 | module.exports = { webp2mp4, webp2png } 63 | } 64 | -------------------------------------------------------------------------------- /lib/welcome.js: -------------------------------------------------------------------------------- 1 | const { DOMImplementation, XMLSerializer } = require('xmldom'); 2 | const JsBarcode = require('jsbarcode') 3 | const { JSDOM } = require('jsdom') 4 | const fs = require('fs') 5 | const path = require('path') 6 | const cp = require('child_process') 7 | 8 | const src = path.join(__dirname, '..', 'src') 9 | const _svg = fs.readFileSync(path.join(src, 'welcome.svg'), 'utf-8') 10 | const barcode = data => { 11 | const xmlSerializer = new XMLSerializer(); 12 | const document = new DOMImplementation().createDocument('http://www.w3.org/1999/xhtml', 'html', null); 13 | const svgNode = document.createElementNS('http://www.w3.org/2000/svg', 'svg'); 14 | 15 | JsBarcode(svgNode, data, { 16 | xmlDocument: document, 17 | }); 18 | 19 | return xmlSerializer.serializeToString(svgNode); 20 | } 21 | const imageSetter = (img, value) => img.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', value) 22 | const textSetter = (el, value) => el.textContent = value 23 | 24 | let { document: svg } = new JSDOM(_svg).window 25 | /** 26 | * Generate SVG Welcome 27 | * @param {object} param0 28 | * @param {string} param0.wid 29 | * @param {string} param0.pp 30 | * @param {string} param0.name 31 | * @param {string} param0.text 32 | * @param {string} param0.background 33 | * @returns {string} 34 | */ 35 | const genSVG = async ({ 36 | wid = '', 37 | pp = path.join(src, 'avatar_contact.png'), 38 | title = '', 39 | name = '', 40 | text = '', 41 | background = '' 42 | } = {}) => { 43 | let el = { 44 | code: ['#_1661899539392 > g:nth-child(6) > image', imageSetter, toBase64(await toImg(barcode(wid.replace(/[^0-9]/g, '')), 'png'), 'image/png')], 45 | pp: ['#_1661899539392 > g:nth-child(3) > image', imageSetter, pp], 46 | text: ['#_1661899539392 > text.fil1.fnt0', textSetter, text], 47 | title: ['#_1661899539392 > text.fil2.fnt1', textSetter, title], 48 | name: ['#_1661899539392 > text.fil2.fnt2', textSetter, name], 49 | bg: ['#_1661899539392 > g:nth-child(2) > image', imageSetter, background], 50 | } 51 | for (let [selector, set, value] of Object.values(el)) { 52 | set(svg.querySelector(selector), value) 53 | } 54 | return svg.body.innerHTML 55 | } 56 | 57 | const toImg = (svg, format = 'png') => new Promise((resolve, reject) => { 58 | if (!svg) return resolve(Buffer.alloc(0)) 59 | let bufs = [] 60 | let im = cp.spawn('magick', ['convert', 'svg:-', format + ':-']) 61 | im.on('error', e => reject(e)) 62 | im.stdout.on('data', chunk => bufs.push(chunk)) 63 | im.stdin.write(Buffer.from(svg)) 64 | im.stdin.end() 65 | im.on('close', code => { 66 | if (code !== 0) reject(code) 67 | resolve(Buffer.concat(bufs)) 68 | }) 69 | }) 70 | 71 | const toBase64 = (buffer, mime) => `data:${mime};base64,${buffer.toString('base64')}` 72 | 73 | /** 74 | * Render SVG Welcome 75 | * @param {object} param0 76 | * @param {string} param0.wid 77 | * @param {string} param0.pp 78 | * @param {string} param0.name 79 | * @param {string} param0.text 80 | * @param {string} param0.background 81 | * @returns {Promise} 82 | */ 83 | const render = async ({ 84 | wid = '', 85 | pp = toBase64(fs.readFileSync(path.join(src, 'avatar_contact.png')), 'image/png'), 86 | name = '', 87 | title = '', 88 | text = '', 89 | background = toBase64(fs.readFileSync(path.join(src, 'Aesthetic', 'Aesthetic_000.jpeg')), 'image/jpeg'), 90 | } = {}, format = 'png') => { 91 | let svg = await genSVG({ 92 | wid, pp, name, text, background, title 93 | }) 94 | return await toImg(svg, format) 95 | } 96 | 97 | if (require.main === module) { 98 | render({ 99 | wid: '1234567890', 100 | // pp: '', 101 | name: 'John Doe', 102 | text: 'Lorem ipsum\ndot sit color', 103 | title: 'grup testing' 104 | // background: '' 105 | }, 'jpg').then(result => { 106 | // console.log(result) 107 | process.stdout.write(result) 108 | }) 109 | // toImg(barcode('test')).then(result => { 110 | // // console.log(result) 111 | // process.stdout.write(result) 112 | 113 | // }) 114 | } else module.exports = render 115 | -------------------------------------------------------------------------------- /lib/wibu.js: -------------------------------------------------------------------------------- 1 | let axios = require('axios') 2 | let cheerio = require('cheerio') 3 | 4 | async function wibu(query) { 5 | const res = await axios.get(`https://nontonanimeid.com/?s=${encodeURI(query)}`) 6 | const $ = cheerio.load(res.data) 7 | let hasil = [] 8 | $('#wrap > main > div.result > ul > li').each(function(a, b) { 9 | let judul = $(b).find('a > div.top > h2').text() 10 | let desc = $(b).find('a > div.top > div > p').text() 11 | let gennr = [] 12 | $(b).find('span.genrebatas > span.genre').each(function(c, d) { 13 | gennr.push($(d).text()) 14 | }) 15 | let genre = `${gennr}`.replace(/,/gi, ', ') 16 | let rating = $(b).find('a > div.boxinfores > span.nilaiseries').text() 17 | let link = $(b).find('a').attr('href') 18 | let thumbnailawal = $(b).find('a > div.top > img').attr('data-src').slice(0,-3) 19 | let thumbnail = `${thumbnailawal}1000` 20 | hasil.push({judul,desc,genre,rating,link,thumbnail}) 21 | }) 22 | return hasil 23 | } 24 | 25 | module.exports = wibu -------------------------------------------------------------------------------- /lib/wm.json: -------------------------------------------------------------------------------- 1 | { 2 | "watermark": "" 3 | } 4 | -------------------------------------------------------------------------------- /lib/y2mate.js: -------------------------------------------------------------------------------- 1 | let fetch = require('node-fetch') 2 | let { JSDOM } = require('jsdom') 3 | 4 | function post(url, formdata) { 5 | return fetch(url, { 6 | method: 'POST', 7 | headers: { 8 | accept: "*/*", 9 | 'accept-language': "en-US,en;q=0.9", 10 | 'content-type': "application/x-www-form-urlencoded; charset=UTF-8" 11 | }, 12 | body: new URLSearchParams(Object.entries(formdata)) 13 | }) 14 | } 15 | const ytIdRegex = /(?:http(?:s|):\/\/|)(?:(?:www\.|)youtube(?:\-nocookie|)\.com\/(?:shorts\/)?(?:watch\?.*(?:|\&)v=|embed\/|v\/)|youtu\.be\/)([-_0-9A-Za-z]{11})/ 16 | 17 | /** 18 | * Download YouTube Video via y2mate 19 | * @param {String} url YouTube Video URL 20 | * @param {String} quality (avaiable: `144p`, `240p`, `360p`, `480p`, `720p`, `1080p`, `1440p`, `2160p`) 21 | * @param {String} type (avaiable: `mp3`, `mp4`) 22 | * @param {String} bitrate (avaiable for video: `144`, `240`, `360`, `480`, `720`, `1080`, `1440`, `2160`) 23 | * (avaiable for audio: `128`) 24 | * @param {String} server (avaiable: `id4`, `en60`, `en61`, `en68`) 25 | */ 26 | async function yt(url, quality, type, bitrate, server = 'en68') { 27 | if (!ytIdRegex.test(url)) throw 'Invalid URL' 28 | let ytId = ytIdRegex.exec(url) 29 | url = 'https://youtu.be/' + ytId[1] 30 | let res = await post(`https://www.y2mate.com/mates/${server}/analyze/ajax`, { 31 | url, 32 | q_auto: 0, 33 | ajax: 1 34 | }) 35 | let json = await res.json() 36 | let { document } = (new JSDOM(json.result)).window 37 | let tables = document.querySelectorAll('table') 38 | let table = tables[{ mp4: 0, mp3: 1 }[type] || 0] 39 | let list 40 | switch (type) { 41 | case 'mp4': 42 | list = Object.fromEntries([...table.querySelectorAll('td > a[href="#"]')].filter(v => !/\.3gp/.test(v.innerHTML)).map(v => [v.innerHTML.match(/.*?(?=\()/)[0].trim(), v.parentElement.nextSibling.nextSibling.innerHTML])) 43 | break 44 | case 'mp3': 45 | list = { 46 | '128kbps': table.querySelector('td > a[href="#"]').parentElement.nextSibling.nextSibling.innerHTML 47 | } 48 | break 49 | default: 50 | list = {} 51 | } 52 | let filesize = list[quality] 53 | let id = /var k__id = "(.*?)"/.exec(document.body.innerHTML) || ['', ''] 54 | let thumb = document.querySelector('img').src 55 | let title = document.querySelector('b').innerHTML 56 | let res2 = await post(`https://www.y2mate.com/mates/${server}/convert`, { 57 | type: 'youtube', 58 | _id: id[1], 59 | v_id: ytId[1], 60 | ajax: '1', 61 | token: '', 62 | ftype: type, 63 | fquality: bitrate 64 | }) 65 | let json2 = await res2.json() 66 | let KB = parseFloat(filesize) * (1000 * /MB$/.test(filesize)) 67 | return { 68 | dl_link: / { 2 | process.on('uncaughtException', console.error) 3 | process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = '0' 4 | require('./config') 5 | const { 6 | useMultiFileAuthState, 7 | useSingleFileAuthState, 8 | DisconnectReason 9 | } = require('baileys') 10 | const WebSocket = require('ws') 11 | const path = require('path') 12 | const fs = require('fs') 13 | const yargs = require('yargs/yargs') 14 | const cp = require('child_process') 15 | const _ = require('lodash') 16 | const syntaxerror = require('syntax-error') 17 | const P = require('pino') 18 | const os = require('os') 19 | const chalk = require('chalk') 20 | const simple = require('./lib/simple') 21 | const storeSystem = require('./lib/store.js') 22 | const store = storeSystem.makeInMemoryStore() 23 | const mongoDB = require('./lib/mongoDB') 24 | const { Low, JSONFile } = require('./lib/lowdb') 25 | const PORT = process.env.PORT || 3000 26 | 27 | simple.protoType() 28 | 29 | global.API = (name, path = '/', query = {}, apikeyqueryname) => (name in set.api.name.s ? set.api.name.s[name] : name) + path + (query || apikeyqueryname ? '?' + new URLSearchParams(Object.entries({ ...query, ...(apikeyqueryname ? { [apikeyqueryname]: set.api.key.s[name in set.api.name.s ? set.api.name.s[name] : name] } : {}) })) : '') 30 | global.set.timestamp = { start: new Date } 31 | // global.db = new Low(new mongoDB("url mongodb")) 32 | global.db = new Low( 33 | /https?:\/\//.test(set.opts['db'] || '') ? 34 | new cloudDBAdapter(set.opts['db']) : /mongodb/.test(set.opts['db']) ? 35 | new mongoDB(set.opts['db']) : 36 | new JSONFile(`${set.opts._[0] ? set.opts._[0] + '_' : 'rasel'}.db.json`) 37 | ) 38 | 39 | global.loadDatabase = async function loadDatabase() { 40 | if (global.db.READ) return new Promise((resolve) => setInterval(function () { (!global.db.READ ? (clearInterval(this), resolve(global.db.data == null ? global.loadDatabase() : global.db.data)) : null) }, 1 * 1000)) 41 | if (global.db.data !== null) return 42 | global.db.READ = true 43 | await global.db.read() 44 | global.db.READ = false 45 | global.db.data = { 46 | users: {}, 47 | chats: {}, 48 | stats: {}, 49 | msgs: {}, 50 | sticker: {}, 51 | settings: {}, 52 | list: {}, 53 | ...(global.db.data || {}) 54 | } 55 | global.db.chain = _.chain(global.db.data) 56 | } 57 | global.loadDatabase() 58 | 59 | const authF = set.opts['single'] ? `${set.opts._[0] || 'rasel'}.sessi.json` : 'sessions' 60 | const { state, saveState, saveCreds } = set.opts['single'] ? await useSingleFileAuthState(authF) : await storeSystem.useMultiFileAuthState(authF) 61 | 62 | const connectionOptions = { 63 | printQRInTerminal: true, 64 | auth: state, 65 | logger: P({ level: 'silent' }), 66 | getMessage: async (key) => (store.loadMessage(key.remoteJid, key.id) || store.loadMessage(key.id) || {}).message, //{ 'Please send messages again' } 67 | patchMessageBeforeSending: (message) => { 68 | const requiresPatch = !!( 69 | message.buttonsMessage 70 | || message.templateMessage 71 | || message.listMessage 72 | ) 73 | if (requiresPatch) { 74 | message = { 75 | viewOnceMessage: { 76 | message: { 77 | messageContextInfo: { 78 | deviceListMetadataVersion: 2, 79 | deviceListMetadata: {} 80 | }, 81 | ...message 82 | } 83 | } 84 | } 85 | } 86 | return message 87 | } 88 | } 89 | 90 | global.conn = simple.makeWASocket(connectionOptions) 91 | 92 | /* try { 93 | store.bind(conn.ev, { groupMetadata: conn.groupMetadata }) 94 | let rahma = `${set.opts._[0] || 'rasel'}.store.json` 95 | setInterval(() => { 96 | store.writeToFile(rahma) 97 | }, 60 * 1000) 98 | } catch { 99 | console.log(`[ EROR ] CAN'T WRITE STORE`) 100 | } */ 101 | 102 | if (!set.opts['test']) { 103 | if (global.db) setInterval(async () => { 104 | if (global.db.data) await global.db.write() 105 | if (!set.opts['tmp'] && (global.support || {}).find) (tmp = [os.tmpdir(), 'tmp'], tmp.forEach(filename => cp.spawn('find', [filename, '-amin', '3', '-type', 'f', '-delete']))) 106 | }, 60 * 1000) 107 | } 108 | 109 | if (set.opts['server']) require('./server')(global.conn, PORT) 110 | 111 | async function connectionUpdate(update) { 112 | console.log(update) 113 | const { receivedPendingNotifications, connection, lastDisconnect, isOnline, isNewLogin } = update 114 | if (isNewLogin) conn.isInit = true 115 | if (connection == 'connecting') console.log(chalk.redBright('⚡ Activate the Bot, please wait a moment...')) 116 | if (connection == 'open') console.log(chalk.green('✅ Connected')) 117 | if (isOnline == true) console.log(chalk.green('Status Online')) 118 | if (isOnline == false) console.log(chalk.red('Status Offline')) 119 | if (receivedPendingNotifications) console.log(chalk.yellow('Waiting New Messages')) 120 | if (connection == 'close') console.log(chalk.red('⏱️ Connection stopped and tried to reconnect...')) 121 | global.set.timestamp.connect = new Date 122 | if (lastDisconnect && lastDisconnect.error && lastDisconnect.error.output && lastDisconnect.error.output.statusCode !== DisconnectReason.loggedOut && conn.ws.readyState !== WebSocket.CONNECTING) { 123 | console.log(global.reloadHandler(true)) 124 | } 125 | if (global.db.data == null) await global.loadDatabase() 126 | } 127 | 128 | const imports = (path) => { 129 | path = require.resolve(path) 130 | let modules, retry = 0 131 | do { 132 | if (path in require.cache) delete require.cache[path] 133 | modules = require(path) 134 | retry++ 135 | } while ((!modules || (Array.isArray(modules) || modules instanceof String) ? !(modules || []).length : typeof modules == 'object' && !Buffer.isBuffer(modules) ? !(Object.keys(modules || {})).length : true) && retry <= 10) 136 | return modules 137 | } 138 | let isInit = true 139 | global.reloadHandler = function (restatConn) { 140 | let handler = imports('./handler') 141 | if (restatConn) { 142 | const oldChats = global.conn.chats 143 | try { global.conn.ws.close() } catch { } 144 | global.conn = { 145 | ...global.conn, ...simple.makeWASocket(connectionOptions, { chats: oldChats }) 146 | } 147 | } 148 | if (!isInit) { 149 | conn.ev.off('messages.upsert', conn.handler) 150 | conn.ev.off('group-participants.update', conn.participantsUpdate) 151 | conn.ev.off('groups.update', conn.groupsUpdate) 152 | conn.ev.off('message.delete', conn.onDelete) 153 | conn.ev.off('CB:call', conn.onCall) 154 | conn.ev.off('connection.update', conn.connectionUpdate) 155 | conn.ev.off('creds.update', conn.credsUpdate) 156 | } 157 | conn.welcome = `Hi, @user!\nWelcome in group @subject\n\n@desc` 158 | conn.bye = 'Goodbye @user!\n\nKalo balik lagi nitip seblak yaah!' 159 | conn.spromote = '@user is now Admin!' 160 | conn.sdemote = '@user is not an Admin!' 161 | conn.sDesc = 'Group description has been changed to\n@desc' 162 | conn.sSubject = 'Group name has been changed to\n@subject' 163 | conn.sIcon = 'Group icon has been changed!' 164 | conn.sRevoke = 'Group link has been changed to\n@revoke' 165 | conn.sAnnounceOn = 'The group has been closed, now only admins can send messages' 166 | conn.sAnnounceOff = 'The group has been opened, now all participants can send messages' 167 | conn.sRestrictOn = 'Edit Group Info changed to admin only!' 168 | conn.sRestrictOff = 'Edit Group Info changed to all participants' 169 | 170 | conn.handler = handler.handler.bind(conn) 171 | conn.participantsUpdate = handler.participantsUpdate.bind(conn) 172 | conn.groupsUpdate = handler.groupsUpdate.bind(conn) 173 | conn.onDelete = handler.delete.bind(conn) 174 | conn.onCall = handler.onCall.bind(conn) 175 | conn.connectionUpdate = connectionUpdate.bind(conn) 176 | conn.credsUpdate = set.opts['single'] ? saveState.bind(conn) : saveCreds.bind(conn) 177 | 178 | conn.ev.on('messages.upsert', conn.handler) 179 | conn.ev.on('group-participants.update', conn.participantsUpdate) 180 | conn.ev.on('groups.update', conn.groupsUpdate) 181 | conn.ev.on('message.delete', conn.onDelete) 182 | conn.ev.on('CB:call', conn.onCall) 183 | conn.ev.on('connection.update', conn.connectionUpdate) 184 | conn.ev.on('creds.update', conn.credsUpdate) 185 | isInit = false 186 | return true 187 | } 188 | 189 | let pluginFolder = path.join(__dirname, 'plugins') 190 | let pluginFilter = filename => /\.js$/.test(filename) 191 | global.plugins = {} 192 | for (let filename of fs.readdirSync(pluginFolder).filter(pluginFilter)) { 193 | try { 194 | global.plugins[filename] = require(path.join(pluginFolder, filename)) 195 | } catch (e) { 196 | conn.logger.error(e) 197 | delete global.plugins[filename] 198 | } 199 | } 200 | console.log(Object.keys(global.plugins)) 201 | global.reload = (_ev, filename) => { 202 | if (pluginFilter(filename)) { 203 | let dir = path.join(pluginFolder, filename) 204 | if (dir in require.cache) { 205 | delete require.cache[dir] 206 | if (fs.existsSync(dir)) conn.logger.info(`re - require plugin '${filename}'`) 207 | else { 208 | conn.logger.warn(`deleted plugin '${filename}'`) 209 | return delete global.plugins[filename] 210 | } 211 | } else conn.logger.info(`requiring new plugin '${filename}'`) 212 | let err = syntaxerror(fs.readFileSync(dir), filename) 213 | if (err) conn.logger.error(`syntax error while loading '${filename}'\n${err}`) 214 | else try { 215 | global.plugins[filename] = require(dir) 216 | } catch (e) { 217 | conn.logger.error(e) 218 | } finally { 219 | global.plugins = Object.fromEntries(Object.entries(global.plugins).sort(([a], [b]) => a.localeCompare(b))) 220 | } 221 | } 222 | } 223 | Object.freeze(global.reload) 224 | fs.watch(path.join(__dirname, 'plugins'), global.reload) 225 | global.reloadHandler() 226 | 227 | // Quick Test 228 | async function _quickTest() { 229 | let test = await Promise.all([ 230 | cp.spawn('ffmpeg'), 231 | cp.spawn('ffprobe'), 232 | cp.spawn('ffmpeg', ['-hide_banner', '-loglevel', 'error', '-filter_complex', 'color', '-frames:v', '1', '-f', 'webp', '-']), 233 | cp.spawn('convert'), 234 | cp.spawn('magick'), 235 | cp.spawn('gm'), 236 | cp.spawn('find', ['--version']) 237 | ].map(p => { 238 | return Promise.race([ 239 | new Promise(resolve => { 240 | p.on('close', code => { 241 | resolve(code !== 127) 242 | }) 243 | }), 244 | new Promise(resolve => { 245 | p.on('error', _ => resolve(false)) 246 | }) 247 | ]) 248 | })) 249 | let [ffmpeg, ffprobe, ffmpegWebp, convert, magick, gm, find] = test 250 | console.log(test) 251 | let s = global.support = { 252 | ffmpeg, 253 | ffprobe, 254 | ffmpegWebp, 255 | convert, 256 | magick, 257 | gm, 258 | find 259 | } 260 | require('./lib/sticker').support = s 261 | Object.freeze(global.support) 262 | 263 | if (!s.ffmpeg) conn.logger.warn('Please install ffmpeg for sending videos (pkg install ffmpeg)') 264 | if (s.ffmpeg && !s.ffmpegWebp) conn.logger.warn('Stickers may not animated without libwebp on ffmpeg (--enable-ibwebp while compiling ffmpeg)') 265 | if (!s.convert && !s.magick && !s.gm) conn.logger.warn('Stickers may not work without imagemagick if libwebp on ffmpeg doesnt isntalled (pkg install imagemagick)') 266 | } 267 | 268 | _quickTest() 269 | .then(() => conn.logger.info('Quick Test Done, Session : ', set.opts['single'] ? authF : 'Multi Sessions')) 270 | .catch(console.error) 271 | 272 | function clockString(ms) { 273 | let h = isNaN(ms) ? '--' : Math.floor(ms / 3600000) 274 | let m = isNaN(ms) ? '--' : Math.floor(ms / 60000) % 60 275 | let s = isNaN(ms) ? '--' : Math.floor(ms / 1000) % 60 276 | return [h, m, s].map(v => v.toString().padStart(2, 0)).join(':') 277 | } 278 | })() 279 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mymd", 3 | "version": "1.0.1", 4 | "description": "Simple WhatsApp Bot by bit.ly/AcellComel", 5 | "depecrated": false, 6 | "main": "index.js", 7 | "directories": { 8 | "lib": "lib", 9 | "src": "src", 10 | "plugins": "plugins" 11 | }, 12 | "scripts": { 13 | "start": "node index.js", 14 | "mongo": "node . --db 'url mongodb'", 15 | "test": "node test.js" 16 | }, 17 | "keywords": [ 18 | "termux-whatsapp-bot", 19 | "whatsapp-bot", 20 | "whatsapp", 21 | "js-whatsapp", 22 | "whatsapp", 23 | "mybot-md", 24 | "family-bot", 25 | "mymd", 26 | "shiraori-md", 27 | "stikerin", 28 | "wabot-aq" 29 | ], 30 | "homepage": "https://github.com/raselcomel/mymd.git", 31 | "author": { 32 | "name": "Acel" 33 | }, 34 | "repository": { 35 | "type": "git", 36 | "url": "https://github.com/raselcomel/mymd.git" 37 | }, 38 | "bugs": { 39 | "url": "https://github.com/raselcomel/mymd/issues" 40 | }, 41 | "license": "GPL-3.0-or-later", 42 | "dependencies": { 43 | "baileys": "^5.0.2", 44 | "@bochilteam/scraper": "^3.0.0", 45 | "awesome-phonenumber": "^2.69.0", 46 | "axios": "^0.26.0", 47 | "cfonts": "^2.10.0", 48 | "chalk": "^4.1.2", 49 | "cheerio": "^1.0.0-rc.10", 50 | "express": "^4.17.3", 51 | "file-type": "^16.5.3", 52 | "fluent-ffmpeg": "^2.1.2", 53 | "form-data": "^4.0.0", 54 | "human-readable": "^0.2.1", 55 | "jsdom": "^18.1.1", 56 | "lodash": "^4.17.21", 57 | "lowdb": "^2.1.0", 58 | "mongoose": "^6.2.1", 59 | "moment-timezone": "^0.5.34", 60 | "node-fetch": "^2.6.6", 61 | "node-gtts": "^2.0.2", 62 | "node-webpmux": "^3.1.0", 63 | "node-os-utils": "^1.3.6", 64 | "os": "^0.1.2", 65 | "perf_hooks": "^0.0.1", 66 | "qrcode": "^1.5.1", 67 | "qrcode-terminal": "^0.12.0", 68 | "readline": "^1.3.0", 69 | "similarity": "^1.2.1", 70 | "socket.io": "^4.4.1", 71 | "syntax-error": "^1.4.0", 72 | "terminal-image": "^2.0.0", 73 | "url-regex-safe": "^3.0.0", 74 | "yargs": "^17.2.1" 75 | }, 76 | "optionalDependencies": { 77 | "wa-sticker-formatter": "^4.3.2", 78 | "translate-google-api": "^1.0.4", 79 | "translate-google": "^1.5.0", 80 | "unofficial-carbon-now": "^1.0.6" 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /plugins/A-skata_lbb.js: -------------------------------------------------------------------------------- 1 | let handler = async (m, { conn, args, participants, command }) => { 2 | let mem = global.db.data.users 3 | let users = Object.entries(mem).map(([key, value]) => { 4 | return { ...value, jid: key } 5 | }).filter(v => v.skata) 6 | let isGC = /g(c|ro?up)/i.test(command) 7 | if (isGC) users = users.filter(v => participants.some(p => p.id == v.jid)) 8 | let sortedExp = users.map(toNumber('skata')).sort(sort('skata')) 9 | let usersExp = sortedExp.map(enumGetKey) 10 | let len = args[0] && args[0].length > 0 ? Math.min(100, Math.max(parseInt(args[0]), 15)) : Math.min(15, sortedExp.length) 11 | let text = ` 12 | *Sambung Kata Leaderboard ${isGC ? 'Group*' : `Top ${len}*`} 13 | Kamu: *${usersExp.indexOf(m.sender) + 1}* dari *${usersExp.length}* 14 | ${sortedExp.slice(0, len).map(({ jid, skata, name }, i) => `${i + 1}. ${participants.some(p => jid === p.id) ? `(${conn.getName(jid)}) wa.me/${jid.split`@`[0]}` : name} - ${skata} MMR`).join`\n`} 15 | `.trim() 16 | conn.sendButton(m.chat, text, set.wm, 0, [!isGC ? 'Top Sambungkata Group' : 'Sambung Kata', (!isGC ? '.topskatagc' : '.skata')], m, { 17 | contextInfo: { 18 | mentionedJid: [...usersExp.slice(0, len)].filter(v => !participants.some(p => v === p.id)) 19 | } 20 | }) 21 | } 22 | handler.help = ['topsambungkata'] 23 | handler.tags = ['xp'] 24 | handler.command = /^(tops(ambung)?kata(g(c|ro?up))?)$/i 25 | module.exports = handler 26 | 27 | function sort(property, ascending = true) { 28 | if (property) return (...args) => args[ascending & 1][property] - args[!ascending & 1][property] 29 | else return (...args) => args[ascending & 1] - args[!ascending & 1] 30 | } 31 | 32 | function toNumber(property, _default = 0) { 33 | if (property) return (a, i, b) => { 34 | return { ...b[i], [property]: a[property] === undefined ? _default : a[property] } 35 | } 36 | else return a => a === undefined ? _default : a 37 | } 38 | 39 | function enumGetKey(a) { 40 | return a.jid 41 | } 42 | -------------------------------------------------------------------------------- /plugins/_autoResponseAll.js: -------------------------------------------------------------------------------- 1 | let bs = require('@bochilteam/scraper') 2 | 3 | let handler = m => m 4 | handler.before = async function(m, { match, usedPrefix, command, conn }) { 5 | let setting = global.db.data.settings[conn.user.jid] 6 | let user = global.db.data.users[m.sender] 7 | let chat = global.db.data.chats[m.chat] 8 | //====================================================================================================================// 9 | 10 | // auto update status 11 | if (setting.statusUpdate) { 12 | let _uptime = process.uptime() * 1000; 13 | let uptime = _uptime.toTimeString(); 14 | conn.updateProfileStatus(`Uptime: ${uptime} | Mode: ${set.opts['self'] ? "Private" : "Publik"} | Database: ${Object.keys(db.data.users).length} user | Made with ♡ by ` + set.wm ).catch(_ => _); 15 | } 16 | // did you mean 17 | /* if ((usedPrefix = (match[0] || '')[0])) { 18 | try { 19 | let tek = m.text.toLowerCase().split(' ') 20 | let teks = tek[1] === usedPrefix ? tek[2] : tek[1] 21 | let noPrefix = (tek[0] === usedPrefix ? tek[1] : tek[0]).replace(usedPrefix, '') 22 | let help = Object.values(global.plugins).filter(v => v.help && !v.disabled).map(v => v.help).flat(1).map(v => v.split` `[0]) 23 | if (help.includes(noPrefix)) return 24 | let mean = await bs.didyoumean(noPrefix, help, { threshold: 0.6 }) // default 0.7 25 | let hasil = mean[0]?.query 26 | if (!hasil) return 27 | let akurasi = mean[0]?.score * 100 28 | let caption = `Hai @${parseInt(m.sender)} 👋\nCommand *${noPrefix}* tidak terdaftar di dalam *menu* apakah yang kamu maksud command ini?\n\n*${usedPrefix + hasil}* ( ${akurasi.toFixed(1)}% )` 29 | conn.sendButton(m.chat, caption, set.wm, null, [['Yes', usedPrefix + hasil + ' ' + teks], ['No', usedPrefix + 'menu']], m, { mentions: [m.sender] }) 30 | } catch { 31 | // console.log('Did you mean tidak bekerja') //(e) 32 | } 33 | } */ 34 | // auto get message 35 | if (setting.autoMessage) { 36 | if (m.isBaileys || m.key.remoteJid.endsWith('status@broadcast')) return 37 | if (chat.isBanned) return 38 | if (user.banned) return 39 | let msgs = global.db.data.msgs 40 | if (!(m.text.toLowerCase() in msgs)) return 41 | let _m = this.serializeM(JSON.parse(JSON.stringify(msgs[m.text.toLowerCase()]), (_, v) => { 42 | if ( 43 | v !== null && 44 | typeof v === 'object' && 45 | 'type' in v && 46 | v.type === 'Buffer' && 47 | 'data' in v && 48 | Array.isArray(v.data)) { 49 | return Buffer.from(v.data) 50 | } 51 | return v 52 | })) 53 | _m.copyNForward(m.chat) 54 | } 55 | //=====================================================================================================================// 56 | } 57 | handler.exp = 0 58 | module.exports = handler 59 | -------------------------------------------------------------------------------- /plugins/_buttonResponseAll.js: -------------------------------------------------------------------------------- 1 | const { 2 | proto, 3 | generateWAMessage, 4 | areJidsSameUser 5 | } = require('baileys') 6 | 7 | module.exports = { 8 | async all(m, chatUpdate) { 9 | if (m.isBaileys) return 10 | if (!m.message) return 11 | if (!(m.message.buttonsResponseMessage || m.message.templateButtonReplyMessage || m.message.listResponseMessage)) return 12 | let id = m.message.buttonsResponseMessage?.selectedButtonId || m.message.templateButtonReplyMessage?.selectedId || m.message.listResponseMessage?.singleSelectReply?.selectedRowId 13 | let text = m.message.buttonsResponseMessage?.selectedDisplayText || m.message.templateButtonReplyMessage?.selectedDisplayText || m.message.listResponseMessage?.title 14 | // cmd with media test 15 | let hash = db.data.sticker[m.msg.fileSha256?.toString('base64')] 16 | let isIdMessage = false, usedPrefix 17 | for (let name in global.plugins) { 18 | let plugin = global.plugins[name] 19 | if (!plugin) continue 20 | if (plugin.disabled) continue 21 | if (!global.set.opts['restrict']) if (plugin.tags && plugin.tags.includes('admin')) continue 22 | if (typeof plugin !== 'function') continue 23 | if (!plugin.command) continue 24 | const str2Regex = str => str.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&') 25 | let _prefix = plugin.customPrefix ? plugin.customPrefix : this.prefix ? this.prefix : set.prefix 26 | let match = (_prefix instanceof RegExp ? // RegExp Mode? 27 | [[_prefix.exec(id), _prefix]] : 28 | Array.isArray(_prefix) ? // Array? 29 | _prefix.map(p => { 30 | let re = p instanceof RegExp ? // RegExp in Array? 31 | p : 32 | new RegExp(str2Regex(p)) 33 | return [re.exec(id), re] 34 | }) : 35 | typeof _prefix === 'string' ? // String? 36 | [[new RegExp(str2Regex(_prefix)).exec(id), new RegExp(str2Regex(_prefix))]] : 37 | [[[], new RegExp]] 38 | ).find(p => p[1]) 39 | if ((usedPrefix = (match[0] || '')[0])) { 40 | let noPrefix = id.replace(usedPrefix, '') 41 | let [command, ...args] = noPrefix.trim().split` `.filter(v => v) 42 | command = (command || '').toLowerCase() 43 | let isId = plugin.command instanceof RegExp ? // RegExp Mode? 44 | plugin.command.test(command) : 45 | Array.isArray(plugin.command) ? // Array? 46 | plugin.command.some(cmd => cmd instanceof RegExp ? // RegExp in Array? 47 | cmd.test(command) : 48 | cmd === command 49 | ) : 50 | typeof plugin.command === 'string' ? // String? 51 | plugin.command === command : 52 | false 53 | if (!isId) continue 54 | console.log({ name, command: plugin.command, text: id }) 55 | isIdMessage = true 56 | } 57 | 58 | } 59 | let messages = await generateWAMessage(m.chat, { text: isIdMessage ? id : hash ? hash?.text : text, mentions: hash ? hash?.mentionedJid : m.mentionedJid }, { 60 | userJid: this.user.id, 61 | quoted: m.quoted && m.quoted.fakeObj 62 | }) 63 | messages.key.fromMe = areJidsSameUser(m.sender, this.user.id) 64 | messages.key.id = m.key.id 65 | messages.pushName = await m.name 66 | if (m.isGroup) messages.participant = m.sender 67 | let msg = { 68 | ...chatUpdate, 69 | messages: [proto.WebMessageInfo.fromObject(messages)], 70 | type: 'append' 71 | } 72 | this.ev.emit('messages.upsert', msg) 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /plugins/_fakeReplyAll.js: -------------------------------------------------------------------------------- 1 | let handler = m => m 2 | handler.before = async function(m, { conn }){ 3 | global.fake = { 4 | //===================================================================================================================== 5 | // audio / vn = true or false 6 | audio: (ptt = false, sec, par, rem) => ({ 7 | key: { 8 | fromMe: false, 9 | participant: par ? par.replace(/[^0-9]/g, '') + '@s.whatsapp.net' : par || `0@s.whatsapp.net`, 10 | remoteJid: rem || "status@broadcast" 11 | }, 12 | message: { 13 | audioMessage: { 14 | mimetype: "audio/ogg; codecs=opus", 15 | seconds: sec || 1222, 16 | ptt: ptt 17 | } 18 | } 19 | }), 20 | // kontak 21 | contact: (num, nam, par, rem) => ({ 22 | key: { 23 | fromMe: false, 24 | participant: par ? par.replace(/[^0-9]/g, '') + '@s.whatsapp.net' : par || `0@s.whatsapp.net`, 25 | remoteJid: rem || 'status@broadcast' 26 | }, 27 | message: { 28 | contactMessage: { 29 | displayName: nam || m.name, 30 | vcard: `BEGIN: VCARD\nVERSION:3.0\nN:;a,;;;\nFN:${'0@s.whatsapp.net'}\nitem1.TEL;waid=${parseInt(num) || parseInt(m.sender)}:${parseInt(num) || parseInt(m.sender)}\nitem1.X-ABLabel:Ponsel\nEND:VCARD` 31 | } 32 | } 33 | }), 34 | shop: async(tit, buff, par, rem) => ({ 35 | key: { 36 | fromMe: false, 37 | participant: par || `0@s.whatsapp.net`, 38 | remoteJid: rem || 'status@broadcast' 39 | }, 40 | message: { 41 | productMessage: { 42 | product: { 43 | productImage:{ 44 | mimetype: "image/jpeg", 45 | jpegThumbnail: buff // || await conn.resize("") 46 | }, 47 | title: set.wm + ' 2022'|| tit, //Kasih namalu 48 | description: "SELF BOT", 49 | currencyCode: ["AUD", "USD", "INR", "IDR", "XOF", "ZAR", "EUR", "MYR"].getRandom(), 50 | priceAmount1000: 2022, 51 | retailerId: "Ghost", 52 | productImageCount: 1 53 | }, 54 | businessOwnerJid: `0@s.whatsapp.net` 55 | } 56 | } 57 | }), 58 | text: (tek, par, rem) => ({ 59 | key: { 60 | fromMe: false, 61 | participant: par || '0@s.whatsapp.net', 62 | remoteJid: rem || "status@broadcast" 63 | }, 64 | message: { 65 | conversation: tek 66 | } 67 | 68 | }) 69 | //====================================================================================================================== 70 | } 71 | } 72 | handler.exp = 0 73 | module.exports = handler 74 | -------------------------------------------------------------------------------- /plugins/_gameAnswerAll.js: -------------------------------------------------------------------------------- 1 | const skata = require('../api/games/sambung-kata') 2 | const similarity = require('similarity') 3 | const threshold = 0.72 4 | let handler = m => m 5 | 6 | handler.before = async function(m, { conn }){ 7 | let rowGame = Object.values(plugins).filter(v => v.tags == "game").map(v => v.help).flat(1).map(v => v.split(' ')[0]) 8 | let setting = global.db.data.settings[conn.user.jid] 9 | let user = global.db.data.users[m.sender] 10 | let chat = global.db.data.chats[m.chat] 11 | let id = m.chat 12 | //======== 13 | 14 | 15 | // math 16 | conn.math = conn.math ? conn.math : {} 17 | if ((id in conn.math)) { 18 | if (!/^-?[0-9]+(\.[0-9]+)?$/.test(m.text)) return 19 | let math = JSON.parse(JSON.stringify(conn.math[id][1])) 20 | if (m.text == math.result) { 21 | user.exp += math.bonus 22 | clearTimeout(conn.math[id][3]) 23 | await conn.sendListM(m.chat, `${set.sa} C O N G R A T S\n`, `Selamat @${parseInt(m.sender)}\nJawaban *${m.text}* benar!\n\nBonus: *+${math.bonus}* XP `, set.wm, rowGame, m) 24 | delete conn.math[id] 25 | } else { 26 | if (--conn.math[id][2] == 0) { 27 | clearTimeout(conn.math[id][3]) 28 | await conn.sendListM(m.chat, `${set.sa} O P P O R T U N I T Y I S U P\n`, `Maaf @${parseInt(m.sender)}\nkesempatan menjawab sudah habis!\n\nJawaban: *${math.result}*`, set.wm, rowGame, m) 29 | delete conn.math[id] 30 | } else m.reply(`*Jawaban Salah!*\nMasih ada ${conn.math[id][2]} kesempatan`) 31 | } 32 | } 33 | // sambung kata 34 | this.skata = this.skata ? this.skata : {} 35 | if ((id in this.skata)) { 36 | let room = this.skata[id] 37 | let users = db.data.users 38 | let _kata = await genKata() 39 | let member = room.player 40 | let bonus = rwd(500, 600) 41 | let lose_skata 42 | let win_skata 43 | function mmr(apa = '', jid = '') { 44 | let user = db.data.users[jid] 45 | if (apa == 'win') { 46 | if (user.skata > 5000) win_skata = rwd(5, 9) 47 | else if (user.skata > 3000) win_skata = rwd(5, 10) 48 | else if (user.skata > 1500) win_skata = rwd(10, 15) 49 | else if (user.skata > 1000) win_skata = rwd(15, 20) 50 | else if (user.skata > 500) win_skata = rwd(20, 30) 51 | else win_skata = rwd(30, 50) 52 | } else { 53 | if (user.skata > 8000) lose_skata = rwd(35, 50) 54 | else if (user.skata > 5000) lose_skata = rwd(25, 30) 55 | else if (user.skata > 3000) lose_skata = rwd(20, 25) 56 | else if (user.skata > 1500) lose_skata = rwd(15, 19) 57 | else if (user.skata > 1000) lose_skata = rwd(10, 14) 58 | else if (user.skata > 500) lose_skata = rwd(5, 9) 59 | else lose_skata = rwd(1, 5) 60 | } 61 | if (apa == 'win') return win_skata 62 | else return lose_skata 63 | } 64 | let who 65 | if (room.new) { 66 | if (!/nextkata/i.test(m.text)) return 67 | room.new = false 68 | room.killer = false 69 | room.kata = _kata 70 | room.chat = await this.reply(m.chat, `Saatnya @${room.curr.split(`@`)[0]}\nMulai : *${(_kata).toUpperCase()}*\n*${room.filter(_kata).toUpperCase()}... ?*\n*Reply untuk menjawab!*\n"nyerah" untuk menyerah\nXP terkumpul: ${room.win_point}\nTersisa: \n${this.readmore + room.player.map((v, i) => i + 1 + '. ' + users[v].name).join('\n')}`, m, { mentions: [room.curr] }) 71 | } 72 | if (room.diam) { 73 | if (!/nextkata/i.test(m.text)) return !0 74 | room.diam = false 75 | room.waktu = setTimeout(() => { 76 | lose_skata = mmr('lose', room.curr) 77 | win_skata = (room.killer ? mmr('win', room.killer) : null) 78 | this.reply(m.chat, `Waktu jawab habis\n@${room.curr.split`@`[0]} tereliminasi -${lose_skata} MMR${room.killer ? `\n@${room.killer.split`@`[0]} +${win_skata} MMR` : ''}`, room.chat, { mentions: [room.curr, room.killer] }).then(_ => { 79 | room.eliminated.push(room.curr) 80 | if (room.killer) { 81 | users[room.killer].skata += win_skata 82 | users[room.curr].skata -= lose_skata 83 | } 84 | let index = member.indexOf(room.curr) 85 | member.splice(index, 1) 86 | if (index == member.length) room.curr = member[0] 87 | else room.curr = member[index] 88 | if (member.length == 1 && room.status == 'play') { 89 | this.sendButton(m.chat, `@${member[0].split`@`[0]} Berhasil bertahan`, `+${room.win_point}XP`, 0, [['Sambung Kata', '.skata'], ['Top Player', '.topskata']], room.chat, { mentions: member }).then(_ => { 90 | users[member[0]].exp += room.win_point 91 | delete this.skata[id] 92 | return 93 | }) 94 | } else { 95 | room.diam = true 96 | room.new = true 97 | who = room.curr 98 | this.preSudo('nextkata', who, m).then(_=> { 99 | this.ev.emit('messages.upsert', _) 100 | }) 101 | } 102 | }) 103 | }, 30000) 104 | } 105 | if (room.curr == m.sender) { 106 | if (/nyerah/i.test(m.text)) { 107 | lose_skata = mmr('lose', room.curr) 108 | win_skata = (room.killer ? mmr('win', room.killer) : null) 109 | clearTimeout(room.waktu) 110 | this.reply(m.chat, `@${room.curr.split`@`[0]} tereliminasi -${lose_skata} MMR${room.killer ? `\n@${room.killer.split`@`[0]} +${win_skata} MMR` : ''}`, room.chat, { mentions: [room.curr, room.killer] }) 111 | room.eliminated.push(room.curr) 112 | if (room.killer) { 113 | users[room.killer].skata += win_skata 114 | users[room.curr].skata -= lose_skata 115 | } 116 | let index = member.indexOf(room.curr) 117 | member.splice(index, 1) 118 | if (index == (member.length)) room.curr = member[0] 119 | else room.curr = member[index] 120 | if (member.length == 1 && room.status == 'play') { 121 | await this.sendButton(m.chat, `@${member[0].split`@`[0]} Berhasil bertahan`, `+${room.win_point}XP`, 2, ['Sambung Kata', '.skata', 'Top Player', '.topskata'], room.chat, { mentions: [member[0]] }) 122 | users[member[0]].skata += win_skata 123 | users[member[0]].exp += room.win_point 124 | delete this.skata[id] 125 | return 126 | } 127 | room.new = true 128 | room.diam = true 129 | who = room.curr 130 | let msg = await conn.preSudo('nextkata', who, m) 131 | this.ev.emit('messages.upsert', msg) 132 | } 133 | if (!m.quoted || !m.quoted.fromMe || !m.quoted.isBaileys || !/(Mulai|Tersisa) ?:/i.test(m.quoted.text)) return 134 | if (m.quoted.id == room.chat.id) { 135 | let answerF = (m.text.toLowerCase().split` `[0]).trim().replace(/[^a-z]/gi, '') 136 | let checkF = await skata.cKata(m.text.toLowerCase().split` `[0]) 137 | if (!answerF.startsWith(room.filter(room.kata))) { 138 | return m.reply(`👎🏻 *Salah!*\nJawaban harus dimulai dari kata *${room.filter(room.kata)}*`) 139 | } else if (!checkF.status) { 140 | return m.reply(`👎🏻 *Salah!*\nKata *${m.text.toUpperCase()}* tidak valid!`) 141 | } else if ((room.filter(room.kata)) == answerF) { 142 | return m.reply(`👎🏻 *Salah!*\nJawabanmu sama dengan soal, silahkan cari kata lain!`) 143 | } else if (room.basi.includes(answerF)) { 144 | return m.reply(`👎🏻 *Salah!*\nKata *${m.text.toUpperCase()}* sudah pernah digunakan!`) 145 | } 146 | clearTimeout(room.waktu) 147 | room.killer = room.curr 148 | users[m.sender].exp += bonus 149 | let waktunya = member.indexOf(room.curr) 150 | room.curr = member[waktunya + 1] 151 | if (waktunya + 1 >= member.length) room.curr = member[0] 152 | room.basi.push(answerF) 153 | room.win_point += 200 154 | room.chat = await this.reply(m.chat, `👍+${bonus}XP\nGiliran @${room.curr.split`@`[0]}\n*${room.filter(answerF).toUpperCase()}... ?*\n*Reply untuk menjawab!*\n"nyerah" untuk menyerah\nXP terkumpul: ${room.win_point}\nTersisa: \n${this.readmore + room.player.map((v, i) => i + 1 + '. ' + users[v].name).join('\n')}`, m, { mentions: [room.curr] }) 155 | room.diam = true 156 | room.kata = answerF 157 | who = room.curr 158 | let msg = await this.preSudo('nextkata', who, m) 159 | this.ev.emit('messages.upsert', msg) 160 | return 161 | } 162 | } else if (room.curr !== m.sender) { 163 | if (!m.quoted || !m.quoted.fromMe || !m.quoted.isBaileys || !/(Mulai|Tersisa) ?:/i.test(m.quoted.text)) return 164 | if (m.quoted.id == room.chat.id) { 165 | if (room.eliminated.includes(m.sender)) m.reply(`_Hei, kamu sudah tereliminasi, tunggu hingga game ini selesai_\n*Nice Try, next game*`) 166 | else if (room.player.includes(m.sender)) { 167 | m.reply(`_Bukan giliranmu.._`) 168 | } else m.reply(`_*Kamu tidak dapat menjawab soal itu*_\nKarena kamu tidak bergabung dalam game ini\n\nTunggu hingga game ini berakhir, kemudian ikutlah bermain!`) 169 | } else m.reply(`Soal itu sudah lewat`) 170 | } 171 | } 172 | // role user 173 | let role = (user.level <= 3) ? 'Warrior V' 174 | : ((user.level >= 3) && (user.level <= 6)) ? 'Warrior IV' 175 | : ((user.level >= 6) && (user.level <= 9)) ? 'Warrior III' 176 | : ((user.level >= 9) && (user.level <= 12)) ? 'Warrior II' 177 | : ((user.level >= 12) && (user.level <= 15)) ? 'Warrior I' 178 | : ((user.level >= 15) && (user.level <= 18)) ? 'Elite V' 179 | : ((user.level >= 18) && (user.level <= 21)) ? 'Elite IV' 180 | : ((user.level >= 21) && (user.level <= 24)) ? 'Elite III' 181 | : ((user.level >= 24) && (user.level <= 27)) ? 'Elite II' 182 | : ((user.level >= 27) && (user.level <= 30)) ? 'Elite I' 183 | : ((user.level >= 30) && (user.level <= 33)) ? 'Master V' 184 | : ((user.level >= 33) && (user.level <= 36)) ? 'Master IV' 185 | : ((user.level >= 36) && (user.level <= 39)) ? 'Master III' 186 | : ((user.level >= 39) && (user.level <= 42)) ? 'Master II' 187 | : ((user.level >= 42) && (user.level <= 45)) ? 'Master I' 188 | : ((user.level >= 45) && (user.level <= 48)) ? 'Grand Master V' 189 | : ((user.level >= 48) && (user.level <= 51)) ? 'Grand Master IV' 190 | : ((user.level >= 51) && (user.level <= 54)) ? 'Grand Master III' 191 | : ((user.level >= 54) && (user.level <= 57)) ? 'Grand Master II' 192 | : ((user.level >= 57) && (user.level <= 60)) ? 'Grand Master I' 193 | : ((user.level >= 60) && (user.level <= 63)) ? 'Epic V' 194 | : ((user.level >= 63) && (user.level <= 66)) ? 'Epic IV' 195 | : ((user.level >= 66) && (user.level <= 69)) ? 'Epic III' 196 | : ((user.level >= 69) && (user.level <= 71)) ? 'Epic II' 197 | : ((user.level >= 71) && (user.level <= 74)) ? 'Epic I' 198 | : ((user.level >= 74) && (user.level <= 77)) ? 'Legend V' 199 | : ((user.level >= 77) && (user.level <= 80)) ? 'Legend IV' 200 | : ((user.level >= 80) && (user.level <= 83)) ? 'Legend III' 201 | : ((user.level >= 83) && (user.level <= 86)) ? 'Legend II' 202 | : ((user.level >= 86) && (user.level <= 89)) ? 'Legend I' 203 | : ((user.level >= 89) && (user.level <= 91)) ? 'Mythic V' 204 | : ((user.level >= 91) && (user.level <= 94)) ? 'Mythic IV' 205 | : ((user.level >= 94) && (user.level <= 97)) ? 'Mythic III' 206 | : ((user.level >= 97) && (user.level <= 100)) ? 'Mythic II' 207 | : 'Mythic I' 208 | user.role = role 209 | //========= 210 | } 211 | handler.exp = 0 212 | module.exports = handler 213 | 214 | async function genKata() { 215 | let json = await skata.kata() 216 | let result = json.kata 217 | while (result.length < 3) { 218 | json = await skata.kata() 219 | result = json.kata 220 | } 221 | return result 222 | } 223 | 224 | function rwd(min, max) { 225 | min = Math.ceil(min) 226 | max = Math.floor(max) 227 | return Math.floor(Math.random() * (max - min + 1)) + min 228 | } 229 | 230 | -------------------------------------------------------------------------------- /plugins/_quotedResponseAll.js: -------------------------------------------------------------------------------- 1 | const { sticker, sticker1, sticker2, sticker3, sticker4, sticker5, sticker6 } = require('../lib/sticker.js') 2 | const { webp2png } = require('../lib/webp2mp4.js') 3 | const uploadImage = require('../lib/uploadImage.js') 4 | const scrape = require('../lib/scrape.js') 5 | const bocil = require('@bochilteam/scraper') 6 | const fetch = require('node-fetch') 7 | const Carbon = require('unofficial-carbon-now') 8 | 9 | let handler = m => m 10 | handler.before = async function(m, { conn, isOwner }) { 11 | if (!m.quoted || !m.quoted.fromMe || !m.quoted.isBaileys) return 12 | let setting = global.db.data.settings[conn.user.jid] 13 | let user = global.db.data.users[m.sender] 14 | let chat = global.db.data.chats[m.chat] 15 | let qq = m.quoted 16 | let q = qq.hydratedFourRowTemplate ? qq.hydratedFourRowTemplate.hydratedContentText : qq.text 17 | //======================================================================================================================// 18 | // report ans 19 | if (/(REPORT|REQUEST|INVITING|ERROR|MESSAGE)!/i.test(q)) { 20 | if (!m.text) return 21 | m.react('↖️') 22 | conn.fakeReply(m.quoted.mentionedJid[0], `*MESSAGE!*\n\nDari : ${!isOwner ? '@' + parseInt(m.sender) : conn.getName(m.sender)}\n\nPesan : ${m.text}\n\n_Gesek pesan ini kekanan untuk membalas_`, m.quoted.mentionedJid[0], `${m.quoted.text.split`Pesan :`[1]}`, null, { mentions: [m.sender], ephemeralExpiration: 86400 }) 23 | } 24 | // quotes 25 | if (q.endsWith('*quotes*_')) { 26 | if (!m.text) return 27 | m.react(['🍃', '🍂', '🍁', '🌿'].getRandom()) 28 | let res = await scrape.quotes(m.text) 29 | if (!res.status) return m.reply(`Quotes *${m.text}* tidak ditemukan!`) 30 | let rand = res.data.getRandom() 31 | let caption = `*${set.sa} Q U O T E S*\n\n${rand.quote}` 32 | conn.sendButton(m.chat, caption, set.wm, set.fla + "quotes", [`Quotes ${m.text}`, `.quotes ${m.text}`], m, { asLocation: true }) 33 | } 34 | // carbon 35 | if (q.endsWith('*carbon*_')) { 36 | if (!m.text) return 37 | m.react('⏱️') 38 | let buat = new Carbon.createCarbon().setCode(m.text) 39 | let hasil = await Carbon.generateCarbon(buat) 40 | conn.sendFile(m.chat, hasil, 'carbon.png', '', m) 41 | } 42 | // apk search 43 | if (q.endsWith('*aplikasi*_')) { 44 | if (!m.text) return 45 | m.react('⏱️') 46 | let res = await (await fetch(API('neoxr', '/api/apk', { q: m.text }, 'apikey'))).json() 47 | if (!res.status && res.msg) return m.reply(res.msg) // (`APK *${m.text}* tidak ditemukan!`) 48 | let row = [] 49 | for (const i of res.data) { 50 | row.push({ 51 | title: `${i.name}`, 52 | description: `[ Size: ${i.size} || Vesion: ${i.version} ]`, 53 | rowId: '.apkd ' + i.url 54 | }) 55 | } 56 | conn.sendListM(m.chat, `${set.sa} A P K S E A R C H\n`, `Silahkan download apk dibawah!`, set.wm, row, m) 57 | } 58 | // sticker 59 | if (q.endsWith('*sticker*_') || q.endsWith('meme*_')) { 60 | if (chat.stiker) return 61 | let mime = (m.msg || m).mimetype 62 | if (!/webp|video|image/.test(mime)) return 63 | m.react('⏱️') 64 | let media = await m.download() 65 | if (m.text) { 66 | let [atas, bawah] = m.text.split(/[,.|]/) 67 | let image 68 | if (/webp/.test(mime)) { 69 | let anu = await webp2png(media) 70 | image = await (await fetch(anu)).buffer() 71 | } else { 72 | image = media 73 | let url = await uploadImage(image) 74 | media = `https://api.memegen.link/images/custom/${encodeURIComponent(atas ? atas : '')}/${encodeURIComponent(bawah ? bawah : '')}.png?background=${url}` 75 | } 76 | } 77 | conn.sendSticker(m.chat, media, m, { packname: set.pack, author: set.auth, asSticker: /webp/g.test(mime) }) 78 | } 79 | // sticker attp 80 | if (q.endsWith("*attp*_")) { 81 | if (!m.text) return 82 | m.react('⏱️') 83 | let res = await (await fetch(API('xteam', '/attp', { file: '', text: m.text }))).buffer() 84 | let attp = await sticker5(false, res, set.pack, set.auth) 85 | conn.sendFile(m.chat, attp, 'attp.webp', '', m, false, { mentions: [m.sender], asSticker: true }) 86 | } 87 | // sticker ttp 88 | if (q.endsWith("*ttp*_")) { 89 | if (!m.text) return 90 | m.react('⏱️') 91 | let res = await (await fetch(API('xteam', '/ttp', { file: '', text: m.text }))).buffer() 92 | let ttp = await sticker5(false, res, set.pack, set.auth) 93 | conn.sendFile(m.chat, ttp, 'ttp.webp', '', m, false, { mentions: [m.sender], asSticker: true }) 94 | } 95 | // no back ground 96 | if (q.endsWith('*nobg*_')) { 97 | let mime = (m.msg || m).mimetype 98 | if (/video/.test(mime)) return 99 | let q = m 100 | let media 101 | try { 102 | let mime = (q.msg || q).mimetype || '' 103 | if (/webp/.test(mime)) { 104 | if (q.seconds) throw `Maaf media stiker gif tidak support` 105 | let webp = await q.download() 106 | media = await webp2png(webp) 107 | } else media = await q.download() 108 | } catch { 109 | if (isUrl(m.text.split(' ')[0])) media = m.text.split(' ')[0] 110 | else return 111 | } 112 | m.react('⏱️') 113 | let res = API('violet', '/api/media/removebg', { img: media }, 'apikey') 114 | conn.sendFile(m.chat, res, 'removebg.jpg', set.wm, m) 115 | } 116 | // menfess 117 | if (q.endsWith('menfess_')) { 118 | if (!m.text) return m.reply('Harap gunakan teks untuk membalas pesan rahasia!') 119 | m.react('💌') 120 | let med = ["https://telegra.ph/file/620bcc109157b23a656f3.jpg", "https://telegra.ph/file/3eb3c21b4d19626332284.jpg"].getRandom() 121 | let { data } = await conn.getFile(med) 122 | conn.reply(m.quoted.mentionedJid[0], `*MENFESSIN!*\n\nBalasan pesan menfess\n\nPesan : ${m.text}\n\n_Gesek pesan ini kekanan untuk mengirim balasan menfess_`, 0, { 123 | ephemeralExpiration: 86400, 124 | contextInfo: { 125 | mentionedJid: [m.sender], 126 | externalAdReply: { 127 | showAdAttribution: true, 128 | title: 'MENFESSIN', 129 | body: 'Follow instagram developer bot ツ', 130 | thumbnail: data, 131 | sourceUrl: 'https://instagram.com/rasel.ganz' 132 | } 133 | } 134 | }) 135 | } 136 | //=====================================================================================================================// 137 | } 138 | handler.exp = 0 139 | module.exports = handler 140 | 141 | function isUrl(text) { 142 | return text.match(new RegExp(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)(jpe?g|gif|png)/, 'gi')) 143 | } 144 | -------------------------------------------------------------------------------- /plugins/downloader-apks.js: -------------------------------------------------------------------------------- 1 | let fetch = require('node-fetch') 2 | 3 | let handler = async(m, { conn, usedPrefix, command, text }) => { 4 | if (!text) throw `${set.sb} *Example* : ${usedPrefix + command} whatsapp\n\n_Gesek pesan ini kekanan untuk mencari *aplikasi*_` 5 | m.react('⏱️') 6 | let res = await (await fetch(API('neoxr', '/api/apk', { q: text }, 'apikey'))).json() 7 | if (!res.status) throw `APK *${text}* tidak ditemukan!` 8 | let row = [] 9 | for (const i of res.data) { 10 | row.push({ 11 | title: `${i.name}`, 12 | description: `[ Size: ${i.size} || Vesion: ${i.version} ]`, 13 | rowId: usedPrefix + 'apkd ' + i.url 14 | }) 15 | } 16 | conn.sendListM(m.chat, `${set.sa} A P K S E A R C H\n`, `Silahkan pilih apk dibawah!`, set.wm, row, m) 17 | } 18 | handler.help = ['apk'].map(v => v + ' ') 19 | handler.tags = ['downloader'] 20 | handler.command = /^(apk)$/i 21 | handler.limit = true 22 | module.exports = handler 23 | -------------------------------------------------------------------------------- /plugins/downloader-hentai.js: -------------------------------------------------------------------------------- 1 | /* const { NHentai } = require('@shineiichijo/nhentai-ts') 2 | 3 | let handler = async (m, { conn, args, usedPrefix, command }) => { 4 | if (!args[0]) throw `${set.sb} *Example* : ${usedPrefix + command} 401998` 5 | const nhentai = new NHentai() 6 | const { images, title } = await nhentai.getDoujin(args[0]).catch(() => { throw "Invalid doujin ID" }) 7 | await conn.sendFile(m.chat, await images.PDF(), title + ".pdf", title, m, null, { 8 | mimetype: "application/pdf", 9 | asDocument: true, 10 | }) 11 | } 12 | handler.help = ['nhentai'].map(v => v + ' ') 13 | handler.tags = ['downloader'] 14 | handler.command = /^(nhentai)$/i 15 | module.exports = handler */ 16 | -------------------------------------------------------------------------------- /plugins/downloader-play.js: -------------------------------------------------------------------------------- 1 | let { youtubeSearch, youtubedl, youtubedlv2, youtubedlv3 } = require('@bochilteam/scraper') 2 | 3 | let handler = async (m, { conn, isOwner, isPrems, command, text, args, usedPrefix }) => { 4 | if(!text) throw `*Contoh:* ${usedPrefix + command} judul atau url` 5 | m.react('⏱️') 6 | let res = await youtubeSearch(text) 7 | let vid = res.video 8 | let vide 9 | if (/playrand(om)?$/i.test(command)) vide = pickRandom(vid) 10 | else vide = vid[0] 11 | if(!vide) return conn.sendButton(m.chat, 'Video/Audio Tidak ditemukan', wm, null, [[await conn.trans('Coba Lagi'), `.play ${text} lainnya`]], m) 12 | let { authorName, authorAvatar, title, description, url, thumbnail, videoId, durationH, viewH, publishedTime } = vide 13 | let caption = `${set.sa} *Y T P L A Y*\n 14 | ${set.sb} *Title* : ${title ? title : 'Not found'} 15 | ${set.sb} *Duration* : ${durationH ? durationH : 'Not found'} 16 | ${set.sb} *Viewers* : ${viewH ? viewH : 'Not found'} 17 | ${set.sb} *Uploaded* : ${publishedTime ? publishedTime : 'Not found'} 18 | ${set.sb} *Channel* : ${authorName ? authorName : 'Not found'} 19 | ${set.sb} *Source* : ${url ? url : 'Not found'} 20 | ${set.sb} *Description* : ${description ? description : 'Not found'} 21 | ` 22 | let td = pickRandom([ 23 | 'application/vnd.openxmlformats-officedocument.presentationml.presentation', 24 | 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 25 | 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 26 | 'application/pdf', 27 | 'text/rtf' 28 | ]) 29 | conn.sendButton(m.chat, caption, 'Select Audio/Video or Random Play', thumbnail, [['Audio', `${usedPrefix}yta ${url}`], ['Video', `${usedPrefix}ytv ${url}`], ['Play Random', `${usedPrefix}playrand ${text}`]], m, { 30 | document: { url: thumbnail }, 31 | fileName: 'Happy watching' + ` ${conn.chats[m.sender].name} 🤩`, mimetype: td, fileLength: 9999999999999, pageCount: 2022, 32 | mentions: [m.sender], 33 | contextInfo: { 34 | externalAdReply :{ 35 | mediaUrl: url, 36 | mediaType: 2, 37 | title: conn.user.name, 38 | body: set.wm, 39 | thumbnail: await conn.getBuffer(thumbnail), 40 | } 41 | } 42 | }) 43 | } 44 | handler.help = ['play'].map(v => v + ' ') 45 | handler.tags = ['downloader'] 46 | handler.command = /^play(rand(om)?)?$/i 47 | handler.desc = ['Mencari video dari Youtube, gunakan perintah *#play judul atau url* hilangkan tanda < >'] 48 | module.exports = handler 49 | 50 | function pickRandom (list) { 51 | return list[Math.floor(list.length * Math.random())] 52 | } 53 | 54 | // by bit.ly/AcellComel 55 | -------------------------------------------------------------------------------- /plugins/downloader-tta.js: -------------------------------------------------------------------------------- 1 | const { tiktokdl, savefrom } = require('@bochilteam/scraper') 2 | const { tiktok } = require('../lib/scrape.js') 3 | const { toAudio, toPTT } = require('../lib/converter.js') 4 | 5 | let handler = async (m, { conn, args, usedPrefix, command }) => { 6 | if (!args[0]) throw `${set.sb} *Example* : ${usedPrefix + command} url` 7 | if (!args[0].match(/((www|vt|vm).tiktok.com)/gi)) throw `Url salah, perintah ini untuk mengunduh Media Tiktok` 8 | m.react('⏱️') 9 | let doc = db.data.chats[m.chat].asDocument 10 | try { 11 | let res = await savefrom(args[0]) 12 | let { id, url, meta, thumb, video_quality, sd, hd, hosting } = res[0] //ntalah savefrom sih 13 | let v = url[0].url 14 | let a = await conn.getBuffer(v) 15 | let au = await toAudio(a, 'mp4') 16 | await conn.sendFile(m.chat, au.data, meta.title + '.mp3', '', m, /vn/.test(args[1]), { asDocument: doc, mentions: [m.sender] }) 17 | } catch { 18 | try { 19 | let res = await tiktokdl(args[0]) 20 | let { author: { nickname }, video, description } = res 21 | let v = video.no_watermark 22 | let a = await conn.getBuffer(v) 23 | let au = await toAudio(a, 'mp4') 24 | await conn.sendFile(m.chat, au.data, description + '.mp3', '', m, /vn/.test(args[1]), { asDocument: doc, mentions: [m.sender] }) 25 | } catch { 26 | try { 27 | let { nowm, wm, audio } = await tiktok(args[0]) 28 | let a = await conn.getBuffer(nowm) 29 | let au = await toAudio(a, 'mp4') 30 | await conn.sendFile(m.chat, au.data, 'tiktok.mp3', '', m, /vn/.test(args[1]), { asDocument: doc, mentions: [m.sender] }) 31 | } catch (e) { 32 | throw e 33 | } 34 | } 35 | } 36 | } 37 | handler.help = ['tiktokmpm3'].map(v => v + ' ') 38 | handler.tags = ['downloader'] 39 | handler.command = /^(t(ik)?t(ok)?(d(own)?l(oader)?)?(mp3|sound|musi(c|k)|a(udio)?))$/i 40 | handler.limit = true 41 | handler.desc = ['Mendownload media audio dari Tiktok, gunakan perintah *#tiktokmp3 url* hilangkan tanda < >'] 42 | module.exports = handler 43 | 44 | // by bit.ly/AcellComel 45 | 46 | -------------------------------------------------------------------------------- /plugins/downloader-ttv.js: -------------------------------------------------------------------------------- 1 | const { tiktokdl, savefrom } = require('@bochilteam/scraper') 2 | const { tiktok } = require('../lib/scrape.js') 3 | const { toAudio, toPTT } = require('../lib/converter.js') 4 | 5 | let handler = async (m, { conn, args, usedPrefix, command }) => { 6 | if (!args[0]) throw `${set.sb} *Example* : ${usedPrefix + command} url` 7 | if (!args[0].match(/((www|vt|vm).tiktok.com)/gi)) throw `Url salah, perintah ini untuk mengunduh Media Tiktok` 8 | m.react('⏱️') 9 | let hias = `${set.sa} *T I K T O K M P 4*\n\n` 10 | let doc = db.data.chats[m.chat].asDocument 11 | let gif = /gif/i.test(args[1]) 12 | try { 13 | let res = await savefrom(args[0]) 14 | let { id, url, meta, thumb, video_quality, sd, hd, hosting } = res[0] //ntalah savefrom sih 15 | let media = url[0].url 16 | let cap = `${hias}${set.sb} *Title* : ${meta.title}\n${set.sb} *Type* : Video\n${set.sb} *Ext* : mp4\n${set.sb} *Duration* : ${meta.duration}\n${set.sb} *Hosting* : ${hosting}\n${set.sb} *Source* : ${meta.source}\n` 17 | conn.sendFile(m.chat, media, meta.title, cap, m, /vn/.test([args[1]]), { asDocument: doc, mentions: [m.sender], gifPlayback: gif }) 18 | } catch { 19 | try { 20 | let res = await tiktokdl(args[0]) 21 | let { author: { nickname }, video, description } = res 22 | let cap = `${hias}${set.sb} *Title* : ${description}\n${set.sb} *Author* : ${nickname}\n${set.sb} *Source* : ${args[0]}\n` 23 | let media = video.no_watermark 24 | conn.sendFile(m.chat, media, description, cap, m, /vn/.test([args[1]]), { asDocument: doc, mentions: [m.sender], gifPlayback: gif }) 25 | } catch { 26 | try { 27 | let { nowm, wm, audio } = await tiktok(args[0]) 28 | let media = nowm || wm 29 | conn.sendFile(m.chat, media, '', '', m, /vn/.test([args[1]]), { asDocument: doc, mentions: [m.sender], gifPlayback: gif }) 30 | } catch (e) { 31 | throw e 32 | } 33 | } 34 | } 35 | } 36 | handler.help = ['tiktokmp4'].map(v => v + ' ') 37 | handler.tags = ['downloader'] 38 | handler.command = /^(t(ik)?t(ok)?(d(own)?l(oader)?)?(mp4|v(ideo)?)?)$/i 39 | handler.limit = true 40 | handler.desc = ['Mendownload media video dari Tiktok, gunakan perintah *#tiktokmp4 url* hilangkan tanda < >'] 41 | module.exports = handler 42 | 43 | // by bit.ly/AcellComel 44 | -------------------------------------------------------------------------------- /plugins/downloader-yta.js: -------------------------------------------------------------------------------- 1 | let { youtubedl, youtubedlv2, youtubedlv3 } = require('@bochilteam/scraper') 2 | let { servers, yta } = require('../lib/y2mate.js') 3 | let axios = require('axios') 4 | 5 | let handler = async (m, { conn, args, usedPrefix, command, isPrems, expiration }) => { 6 | if (!args[0]) throw `${set.sb} *Example* : ${usedPrefix + command} url` 7 | let ras = `Url salah, perintah ini untuk mengunduh audio youtube (watch/shorts)` 8 | if (!args[0].match(/(https|http):\/\/(www.youtube.com|www.youtube|www.youtu.be|youtube.com|youtu.be.com|youtu.be)\/(watch|shorts)?/gi)) throw ras 9 | m.react('⏱️') 10 | let limit = isPrems ? 300 : 100 11 | let doc = db.data.chats[m.chat].asDocument 12 | let qua = '128kbps' 13 | let isLimit 14 | try { 15 | let res = await youtubedl(args[0]) 16 | isLimit = limit * 1024 < res.audio[qua].fileSize 17 | } catch { 18 | try { 19 | let res = await youtubedlv2(args[0]) 20 | isLimit = limit * 1024 < res.audio[qua].fileSize 21 | } catch { 22 | try { 23 | let res = await youtubedlv3(args[0]) 24 | isLimit = limit * 1024 < res.audio[qua].fileSize 25 | } catch { 26 | let server = (args[1] || servers[0]).toLowerCase() 27 | let anu = await yta(args[0], servers.includes(server) ? server : servers[0]) 28 | isLimit = limit * 1024 < anu.filesize 29 | } 30 | } 31 | } 32 | let res = await youtubedl(args[0]) 33 | let media 34 | try { 35 | media = await res.audio[qua].download() 36 | } catch { 37 | console.log('yt1 eror mencoba yt2') 38 | try { 39 | let res2 = await youtubedlv2(args[0]) 40 | media = await res2.audio[qua].download() 41 | } catch { 42 | console.log('yt2 eror mencoba yt3') 43 | try { 44 | let res3 = await youtubedlv2(args[0]) 45 | media = await res3.audio[qua].download() 46 | } catch { 47 | console.log('yt1l3 eror mencoba yt4') 48 | let server = (args[1] || servers[0]).toLowerCase() 49 | let anu = await yta(args[0], servers.includes(server) ? server : servers[0]) 50 | media = anu.dl_link 51 | } 52 | } 53 | } 54 | let anu 55 | if (isLimit) anu = `_File size above average ${limit} MB download it yourself_\n${await(await axios.get(`https://tinyurl.com/api-create.php?url=${media}`)).data}` 56 | else anu = `_Wait for the audio to be sent it may take a few minutes!_` 57 | let capt = `${set.sa} *Y T M P 3* 58 | 59 | ${set.sb} *Title* : ${res.title ? res.title : 'Not found'} 60 | ${set.sb} *Size* : ${res.audio[qua]?.fileSizeH ? res.audio[qua]?.fileSizeH : 'Not found'} 61 | ${set.sb} *Quality* : ${res.audio[qua]?.quality ? res.audio[qua]?.quality : 'Not found'} 62 | 63 | ${anu} 64 | ` 65 | let sentMsg = await conn.reply(m.chat, capt, m, { 66 | ephemeralExpiration: expiration, 67 | contextInfo: { 68 | externalAdReply :{ 69 | mediaType: 1, 70 | title: set.wm, 71 | thumbnail: await conn.getBuffer(res.thumbnail), 72 | renderLargerThumbnail: true, 73 | } 74 | } 75 | }) 76 | if (!isLimit) conn.sendFile(m.chat, media, res.title + '.mp3', res.title, sentMsg, null, { asDocument: doc, mentions: [m.sender] }) 77 | } 78 | handler.help = ['ytmp3'].map(v => v + ' ') 79 | handler.tags = ['downloader'] 80 | handler.command = /(y(ou)?t(ube)?(a(udio)?|mpp?3|musik))$/i 81 | handler.limit = true 82 | handler.desc = ['Mendownload media audio dari Youtube, gunakan perintah *#ytmp3 url* hilangkan tanda < >'] 83 | module.exports = handler 84 | -------------------------------------------------------------------------------- /plugins/downloader-ytv.js: -------------------------------------------------------------------------------- 1 | let { youtubedl, youtubedlv2, youtubedlv3 } = require('@bochilteam/scraper') 2 | let { servers, ytv } = require('../lib/y2mate.js') 3 | let axios = require('axios') 4 | 5 | let handler = async (m, { conn, args, usedPrefix, command, isPrems, isOwner, expiration }) => { 6 | if (!args[0]) throw `${set.sb} *Example* : ${usedPrefix + command} url` 7 | let ras = `Url salah, perintah ini untuk mengunduh video youtube (watch/shorts)` 8 | if (!args[0].match(/(https|http):\/\/(www.youtube.com|www.youtube|www.youtu.be|youtube.com|youtu.be.com|youtu.be)\/(watch|shorts)?/gi)) throw ras 9 | m.react('⏱️') 10 | let limit = isPrems ? 300 : 100 11 | let doc = db.data.chats[m.chat].asDocument 12 | let qua 13 | if (/vid(eo)|yt(v?(ideo)?|mpp?4|v?short)(d(oc(ument)?)?)?1080p?$/i.test(command) || args[1] == '1080') { 14 | if (!isPrems) { 15 | set.dfail('premium', m, conn) 16 | throw false 17 | } 18 | qua = '1080p' 19 | } else if (/vid(eo)|yt(v?(ideo)?|mpp?4|v?short)(d(oc(ument)?)?)?720p?$/i.test(command) || args[1] == '720') { 20 | if (!isPrems) { 21 | set.dfail('premium', m, conn) 22 | throw false 23 | } 24 | qua = '720p' 25 | } else if (/vid(eo)|yt(v?(ideo)?|mpp?4|v?short)(d(oc(ument)?)?)?480p?$/i.test(command) || args[1] == '480') { 26 | qua = '480p' 27 | } else qua = '360p' 28 | let isLimit 29 | try { 30 | let res = await youtubedl(args[0]) 31 | isLimit = limit * 1024 < res.video[qua].fileSize 32 | } catch { 33 | console.log('yt1 eror mencoba yt2') 34 | try { 35 | let res = await youtubedlv2(args[0]) 36 | isLimit = limit * 1024 < res.video[qua].fileSize 37 | } catch { 38 | console.log('yt2 eror mencoba yt3') 39 | try { 40 | let res = await youtubedlv3(args[0]) 41 | isLimit = limit * 1024 < res.video[qua].fileSize 42 | } catch { 43 | console.log('yt3 eror mencoba yt4') 44 | let server = (args[1] || servers[0]).toLowerCase() 45 | let anu = await ytv(args[0], servers.includes(server) ? server : servers[0]) 46 | isLimit = limit * 1024 < anu.filesize 47 | } 48 | } 49 | } 50 | let res = await youtubedl(args[0]) 51 | let media 52 | try { 53 | media = await res.video[qua].download() 54 | } catch { 55 | console.log('yt1 eror mencoba yt2') 56 | try { 57 | let res2 = await youtubedlv2(args[0]) 58 | media = await res2.video[qua].download() 59 | } catch { 60 | console.log('yt2 eror mencoba yt3') 61 | try { 62 | let res3 = await youtubedlv2(args[0]) 63 | media = await res3.video[qua].download() 64 | } catch { 65 | console.log('yt3 eror mencoba yt4') 66 | let server = (args[1] || servers[0]).toLowerCase() 67 | let anu = await ytv(args[0], servers.includes(server) ? server : servers[0]) 68 | media = anu.dl_link 69 | } 70 | } 71 | } 72 | let anu 73 | if (isLimit) anu = `_File size above average ${limit} MB download it yourself_\n${await(await axios.get(`https://tinyurl.com/api-create.php?url=${media}`)).data}` 74 | else anu = `_Wait for the video to be sent it may take a few minutes!_` 75 | let capt = `${set.sa} *Y T M P 4* 76 | 77 | ${set.sb} *Title* : ${res.title ? res.title : 'Not found'} 78 | ${set.sb} *Size* : ${res.video[qua]?.fileSizeH ? res.video[qua]?.fileSizeH : 'Not found'} 79 | ${set.sb} *Quality* : ${res.video[qua]?.quality ? res.video[qua]?.quality : 'Not found'} 80 | 81 | ${anu} 82 | ` 83 | let sentMsg = await conn.reply(m.chat, capt, m, { 84 | ephemeralExpiration: expiration, 85 | contextInfo: { 86 | externalAdReply :{ 87 | mediaType: 1, 88 | title: set.wm, 89 | thumbnail: await conn.getBuffer(res.thumbnail), 90 | renderLargerThumbnail: true, 91 | } 92 | } 93 | }) 94 | if (!isLimit) conn.sendFile(m.chat, media, res.title + '.mp4', res.title, sentMsg, null, { asDocument: doc, mentions: [m.sender] }) 95 | } 96 | handler.help = ['ytmp4'].map(v => v + ' ') 97 | handler.tags = ['downloader'] 98 | handler.command = /(vid(eo)?|y(ou)?t(ube)?(short|v(ideo)?|mpp?4)?((480|720|1080)p?)?)$/i 99 | handler.limit = true 100 | handler.desc = ['Mendownload media video dari Youtube, gunakan perintah *#ytmp4 url* hilangkan tanda < >, untuk pilihan resolusi atau kualitas video gunakan perintah *#ytmp4 url resolusi* contoh *#ytmp4 url 480* pilihan resolusi (480, 720, 1080)'] 101 | module.exports = handler 102 | -------------------------------------------------------------------------------- /plugins/game-list.js: -------------------------------------------------------------------------------- 1 | let handler = async(m, { conn, usedPrefix }) => { 2 | let list = Object.values(plugins).filter(v => v.tags == "game").map(v => v.help).flat(1).map(v => v.split(' ')[0]) 3 | let row = [] 4 | for (const name of list) { 5 | row.push({ 6 | title: name.capitalize(), // jika list angka di awali huruf kecil otomatis kapital 7 | rowId: usedPrefix + name 8 | }) 9 | } 10 | conn.sendListM(m.chat, `${set.sa} G A M E S\n`, `Halo @${parseInt(m.sender)}\nSilah pilih game faforitmu dibawah!`, set.wm, row, m) 11 | } 12 | handler.help = ['game'] 13 | handler.tags = ['main'] 14 | handler.command = ['game', 'games', 'permainan'] 15 | handler.exp = 0 16 | module.exports = handler 17 | -------------------------------------------------------------------------------- /plugins/game-math.js: -------------------------------------------------------------------------------- 1 | let handler = async (m, { conn, args, usedPrefix, command }) => { 2 | conn.math = conn.math ? conn.math : {} 3 | let id = m.chat 4 | if (id in conn.math) return conn.reply(m.chat, 'Masih ada soal belum terjawab di chat ini', conn.math[id][0]) 5 | let mode = args[0] ? args[0].toLowerCase() : '' 6 | let jsonMode = Object.keys(modes) 7 | let row = [] 8 | for (let modenya of jsonMode) { 9 | row.push({ 10 | title: 'Math ' + modenya.capitalize(), 11 | rowId: `${usedPrefix + command} ${modenya}` 12 | }) 13 | } 14 | if (args.lenth < 1) return conn.sendListM(m.chat, `${se.sa} M A T H E M A T I C S\n`, `${set.sb} *Example* : ${usedPrefix + command} ${pickRandom(jsonMode)}`, set.wm, row, m) 15 | if (!(mode in modes)) return conn.sendListM(m.chat, `${set.sa} M A T H E M A T I C S\n`, `${set.sb} *Example* : ${usedPrefix + command} ${pickRandom(jsonMode)}`, set.wm, row, m) 16 | let math = genMath(mode) 17 | conn.math[id] = [ 18 | await conn.reply(m.chat, `Berapa hasil dari *${math.str}*?\n\nTimeout: ${(math.time / 1000).toFixed(0)} detik\nBonus Jawaban Benar: ${math.bonus} XP\n\nKesempatan menjawab 4X`, m), 19 | math, 4, 20 | setTimeout(async () => { 21 | if (conn.math[id]) conn.sendListM(m.chat, `${set.sa} T I M E O U T\n`, `Waktu habis!\nJawabannya adalah *${math.result}*`, set.wm, row, conn.math[id][0]) 22 | delete conn.math[id] 23 | }, math.time) 24 | ] 25 | } 26 | handler.help = ['math '] 27 | handler.tags = ['game'] 28 | handler.command = /^math/i 29 | module.exports = handler 30 | 31 | let modes = { 32 | noob: [-3, 3, -3, 3, '+-', 15000, 10], 33 | easy: [-10, 10, -10, 10, '*/+-', 20000, 40], 34 | medium: [-40, 40, -20, 20, '*/+-', 40000, 150], 35 | hard: [-100, 100, -70, 70, '*/+-', 60000, 350], 36 | extreme: [-999999, 999999, -999999, 999999, '*/', 99999, 9999], 37 | impossible: [-99999999999, 99999999999, -99999999999, 999999999999, '*/', 30000, 35000], 38 | impossible2: [-999999999999999, 999999999999999, -999, 999, '/', 30000, 50000] 39 | } 40 | 41 | let operators = { 42 | '+': '+', 43 | '-': '-', 44 | '*': '×', 45 | '/': '÷' 46 | } 47 | 48 | function genMath(mode) { 49 | let [a1, a2, b1, b2, ops, time, bonus] = modes[mode] 50 | let a = randomInt(a1, a2) 51 | let b = randomInt(b1, b2) 52 | let op = pickRandom([...ops]) 53 | let result = (new Function(`return ${a} ${op.replace('/', '*')} ${b < 0 ? `(${b})` : b}`))() 54 | if (op == '/') [a, result] = [result, a] 55 | return { 56 | str: `${a} ${operators[op]} ${b}`, 57 | mode, 58 | time, 59 | bonus, 60 | result 61 | } 62 | } 63 | 64 | function randomInt(from, to) { 65 | if (from > to) [from, to] = [to, from] 66 | from = Math.floor(from) 67 | to = Math.floor(to) 68 | return Math.floor((to - from) * Math.random() + from) 69 | } 70 | 71 | function pickRandom(list) { 72 | return list[Math.floor(Math.random() * list.length)] 73 | } 74 | -------------------------------------------------------------------------------- /plugins/game-skata.js: -------------------------------------------------------------------------------- 1 | const skata = require('../api/games/sambung-kata.js') 2 | const game = ` 3 | ╔══「 *Kata Bersambung* 」 4 | ╟ Game Kata Bersambung adalah 5 | ║ permainan yang dimana setiap 6 | ║ pemainnya diharuskan membuat 7 | ║ kata dari akhir kata yang 8 | ║ berasal dari kata sebelumnya. 9 | ╚═════`.trim() 10 | const rules = ` 11 | ╔══「 *PERATURAN* 」 12 | ╟ Jawaban merupakan kata dasar 13 | ║ yaitu tidak mengandung 14 | ║ spasi dan imbuhan (me-, -an, dll). 15 | ╟ Pemain yang bertahan akan 16 | ║ menang dan mendapatkan 17 | ║ 500xp X jumlah pemain 18 | ╟ .skata 19 | ║ untuk memulai 20 | ╚═════ 21 | Credit: 22 | Ariffb 23 | Syahrul`.trim() 24 | let poin = 500 25 | 26 | let handler = async (m, { conn, text, isPrems, isROwner, usedPrefix, command }) => { 27 | conn.skata = conn.skata ? conn.skata : {} 28 | let id = m.chat 29 | let kata = await genKata() 30 | let room_all = Object.values(conn.skata).find(room => room.id !== id && room.player.includes(m.sender)) 31 | if (room_all) throw `Kamu sedang bermain sambung kata di chat lain, selesaikan game kamu terlebih dahulu!` 32 | if (id in conn.skata) { 33 | let room = conn.skata[id] 34 | let member = room.player 35 | if (room.status == 'play') { 36 | if (!room.waktu._destroyed && !room.diam) return conn.reply(m.chat, `Hi @${parseInt(m.sender)}, Masih ada game berlangsung di chat ini\nTunggu hingga game berakhir\nLalu ikut bergabung`, room.chat, { mentions: [m.sender] }).catch(e => { console.log(e) })// ketika naileys err 37 | delete conn.skata[id] 38 | } 39 | if (text == 'start' && room.status == 'wait') { 40 | if (!member.includes(m.sender)) return conn.sendButton(m.chat, `Kamu belum ikut`, set.wm, 0, [['Join', `${usedPrefix + command}`]], m) 41 | if (member.length < 2) return conn.sendButton(m.chat, `Minimal 2 orang`, set.wm, 0, [['Join', `${usedPrefix + command}`]], m) 42 | room.curr = member[0] 43 | room.status = 'play' 44 | room.chat = await conn.reply(m.chat, `Saatnya @${parseInt(member[0])}\nMulai : *${(room.kata).toUpperCase()}*\n*${room.filter(room.kata).toUpperCase()}... ?*\n*Reply untuk menjawab!*\n"nyerah" untuk menyerah\nTotal: ${member.length} Player`, m, { mentions: [member[0]] }) 45 | room.win_point = 100 46 | for (let i of room.player) { 47 | let user = db.data.users[i] 48 | if (!('skata' in user)) user.skata = 0 49 | } 50 | clearTimeout(room.waktu_list) 51 | room.waktu = setTimeout(_=> { 52 | conn.reply(m.chat, `Waktu jawab habis\n@${parseInt(room.curr)} tereliminasi`, room.chat, { mentions: [room.curr] }).then(async _=> { 53 | room.eliminated.push(room.curr) 54 | let index = member.indexOf(room.curr) 55 | member.splice(index, 1) 56 | room.curr = member[0] 57 | if (room.player.length == 1 && room.status == 'play') { 58 | db.data.users[member[0]].exp += room.win_point 59 | conn.sendButton(m.chat, `@${member[0].split`@`[0]} Menang`, `+${room.win_point}XP`, 0, [['Sambung Kata', '.skata'], ['Top Player', '.topskata']], room.chat, { mentions: member }).then(_=> { 60 | delete conn.skata[id] 61 | return 62 | }) 63 | } 64 | room.diam = true 65 | room.new = true 66 | let who = room.curr 67 | conn.preSudo('nextkata', who, m).then(_=> { conn.ev.emit('messages.upsert', _) }) 68 | }) 69 | }, 45000) 70 | } else if (room.status == 'wait') { 71 | if (member.includes(m.sender)) return conn.sendButton(m.chat, `Kamu sudah ikut list`, set.wm, 0, [['Start', `${usedPrefix + command} start`], ['Join', `${usedPrefix + command}`]], m) 72 | member.push(m.sender) 73 | clearTimeout(room.waktu_list) 74 | room.waktu_list = setTimeout(() => { 75 | conn.sendButton(m.chat, `Kamu sudah ikut list`, set.wm, 0, [['Start', `${usedPrefix + command} start`], ['Join', `${usedPrefix + command}`]], room.chat).then(() => { delete conn.skata[id] }) 76 | }, 120000) 77 | let caption = ` 78 | ╔═〘 Daftar Player 〙 79 | ${member.map((v, i) => `╟ ${i + 1}. @${v.split`@`[0]}`).join('\n')} 80 | ╚════ 81 | Sambung kata akan dimainkan sesuai urutan player ( *Bergiliran* ) 82 | Dan hanya bisa dimainkan oleh player yang terdaftar`.trim() 83 | room.chat = await conn.sendButton(m.chat, caption, `Ketik\n*${usedPrefix + command}* untuk join/ikut\n*${usedPrefix + command} start* untuk memulai`, 0, [['Start', `${usedPrefix + command} start`], ['Join', `${usedPrefix + command}`]], m, { contextInfo: { mentionedJid: conn.parseMention(caption) } }) 84 | } 85 | } else { 86 | conn.skata[id] = { 87 | id, 88 | player: [], 89 | status: 'wait', 90 | eliminated: [], 91 | basi: [], 92 | diam: false, 93 | win_point: 0, 94 | curr: '', 95 | kata, 96 | filter, 97 | genKata, 98 | chat: conn.sendButton(m.chat, game, conn.readmore + rules, 0, [['Join', `${usedPrefix + command}`]], m), 99 | waktu: false 100 | } 101 | } 102 | } 103 | handler.help = ['sambungkata'] 104 | handler.tags = ['game'] 105 | handler.command = /^s(ambung)?kata(debug)?$/i 106 | handler.group = true 107 | handler.game = true 108 | module.exports = handler 109 | 110 | async function genKata() { 111 | let json = await skata.kata() 112 | let result = json.kata 113 | while (result.length < 3 || result.length > 7) { 114 | json = await skata.kata() 115 | result = json.kata 116 | } 117 | return result 118 | } 119 | function filter(text) { 120 | let mati = ["q", "w", "r", "t", "y", "p", "s", "d", "f", "g", "h", "j", "k", "l", "z", "x", "c", "v", "b", "n", "m"] 121 | let misah 122 | if (text.length < 3) return text 123 | // alarm 124 | if (/([qwrtypsdfghjklzxcvbnm][qwrtypsdfhjklzxcvbnm])$/.test(text)) { 125 | let mid = /([qwrtypsdfhjklzxcvbnm])$/.exec(text)[0] 126 | return mid 127 | } 128 | 129 | // mati + voc + ng {kijang, pisang, dalang, dll} 130 | 131 | if (/([qwrtypsdfghjklzxcvbnm][aiueo]ng)$/.test(text)) { 132 | let mid = /([qwrtypsdfghjklzxcvbnm][aiueo]ng)$/.exec(text)[0] 133 | return mid 134 | } 135 | // voc2x + mati(optional) {portofolio, manusia, tiup, dll} 136 | else if (/([aiueo][aiueo]([qwrtypsdfghjklzxcvbnm]|ng)?)$/i.test(text)) { 137 | if (/(ng)$/i.test(text)) return text.substring(text.length - 3) // ex tiang, riang, siang 138 | else if (/([qwrtypsdfghjklzxcvbnm])$/i.test(text)) return text.substring(text.length - 2) 139 | else return text.substring(text.length - 1) 140 | } 141 | // ng/ny + voc + mati { sinyal, langit, banyak, dll} 142 | else if (/n[gy]([aiueo]([qwrtypsdfghjklzxcvbnm])?)$/.test(text)) { 143 | let nyenye = /n[gy]/i.exec(text)[0] 144 | misah = text.split(nyenye) 145 | return nyenye + misah[misah.length - 1] 146 | } 147 | // mati { kuku, batu, kamu, aku, saya, dll} 148 | else { 149 | let res = Array.from(text).filter(v => mati.includes(v)) 150 | let resu = res[res.length - 1] 151 | for (let huruf of mati) { 152 | if (text.endsWith(huruf)) { 153 | resu = res[res.length - 2] 154 | } 155 | } 156 | misah = text.split(resu) 157 | if (text.endsWith(resu)) { 158 | return resu + misah[misah.length - 2] + resu 159 | } 160 | return resu + misah[misah.length - 1] 161 | } 162 | } 163 | -------------------------------------------------------------------------------- /plugins/group-simulate.js: -------------------------------------------------------------------------------- 1 | let handler = async (m, { conn, args: [event], text, usedPrefix, command }) => { 2 | let evn = `${m.isGroup ? 'Welcome\nBye\nDelete\nPromote\nDemote' : 'Delete'}` 3 | let ero = evn.split`\n` 4 | let row = [] 5 | for (let eror of ero) { 6 | row.push({ 7 | title: "Simulate " + eror, 8 | rowId: usedPrefix + command + ' ' + eror.toLowerCase(), 9 | }) 10 | } 11 | if (!event) return conn.sendListM(m.chat, `${set.sa} S I M U L A T E\n`, `${set.sb} *Example* : ${usedPrefix + command} ${ero.getRandom()}`, set.wm, row, m) 12 | let user = m.mentionedJid[0] ? m.mentionedJid[0] : m.quoted ? m.quoted.sender == conn.user.jid ? m.sender : m.quoted.sender : m.sender 13 | let participants = [user] 14 | let action = false 15 | switch (event.toLowerCase()) { 16 | case 'add': 17 | case 'invite': 18 | case 'welcome': 19 | action = 'add' 20 | break 21 | case 'bye': 22 | case 'kick': 23 | case 'leave': 24 | case 'remove': 25 | action = 'remove' 26 | break 27 | case 'promote': 28 | case 'admin': 29 | action = 'promote' 30 | break 31 | case 'demote': 32 | case 'unadmi ': 33 | action = 'demote' 34 | break 35 | case 'delete': 36 | case 'del': 37 | var deleted = m 38 | break 39 | default: 40 | return conn.sendListM(m.chat, `${set.sa} S I M U L A T E\n`, `${set.sb} *Example* : ${usedPrefix + command} ${ero.getRandom()}`, set.wm, row, m) 41 | } 42 | m.react('🔧') 43 | if (action) return conn.participantsUpdate({ 44 | id: m.chat, 45 | participants, 46 | action 47 | }) 48 | return conn.onDelete(deleted) 49 | } 50 | handler.help = ['simulate'].map(v => v + ' ') 51 | handler.tags = ['owner'] 52 | handler.command = ['simulate'] 53 | handler.desc = ['*S I M U L A T E*\n\nSimulasi event update chat\nPenggunaan : #simulate delete'] 54 | module.exports = handler 55 | -------------------------------------------------------------------------------- /plugins/info-speedtest.js: -------------------------------------------------------------------------------- 1 | let fetch = require('node-fetch') 2 | let cp = require('child_process') 3 | let { promisify } = require('util') 4 | let exec = promisify(cp.exec).bind(cp) 5 | 6 | let handler = async (m, { args, text, conn, usedPrefix, command }) => { 7 | m.react('⚡') 8 | let o 9 | try { 10 | try { 11 | o = await exec('speedtest') 12 | } catch (e) { 13 | o = e 14 | } finally { 15 | let { stdout, stderr } = o 16 | o = stdout ? stdout : stderr 17 | } 18 | } catch { 19 | try { 20 | o = await exec('python lib/speed.py') 21 | } catch (e) { 22 | o = e 23 | } finally { 24 | let { stdout, stderr } = o 25 | o = stdout ? stdout : stderr 26 | } 27 | } 28 | conn.reply(m.chat, o, m) 29 | } 30 | handler.help = ['speedtest'] 31 | handler.tags = ['info'] 32 | handler.command = /^(spdt|speedtest)$/i 33 | module.exports = handler 34 | -------------------------------------------------------------------------------- /plugins/main-menfess.js: -------------------------------------------------------------------------------- 1 | let handler = async(m, { conn, text, command, usedPrefix, isBotAdmin }) => { 2 | if (!text) throw `${set.sb} *Example* : ${usedPrefix + command} 628xxx|hi\n\nSimbol *|* untuk spasi atau gunakan simbol *( | , . )* untuk spasi` 3 | let [num, pesan] = text.split(/[,.|]/) 4 | let who = num.replace(/[^0-9]/g, '') + '@s.whatsapp.net' 5 | if (who == m.sender) throw 'Kirim menfess ke diri sendiri?\ngokil:v' 6 | m.react('💌') 7 | let sen = await conn.reply(who, `*MENFESSIN!*\n\nHalo *${conn.getName(who)}* ada pesan kecil dari seseorang yang tidak ingin disebut namanya 😇\n\nPesan : `+ pesan + `\n\n_Gesek pesan ini kekanan untuk mengirim balasan menfess_`, 0, { 8 | ephemeralExpiration: 86400, 9 | contextInfo: { 10 | mentionedJid: [m.sender], 11 | externalAdReply :{ 12 | showAdAttribution: true, 13 | title: 'MENFESSIN', 14 | body: 'Follow instagram developer bot ツ', 15 | thumbnail: await conn.getFile('https://telegra.ph/file/58c8b44e05443b1ea60ec.jpg').then(v => v.data), 16 | sourceUrl: 'https://instagram.com/rasel.ganz' 17 | } 18 | } 19 | }) 20 | if (m.isGroup && isBotAdmin) m.delete() 21 | if (sen) conn.reply(m.chat, `Sukses mengirim pesan rahasia ke ${m.isGroup ? conn.getName(who) : `@${parseInt(who)}`}`, m.isGroup ? null : m, { mentions: [who] }) 22 | else throw 'Harap gunakan nomor yang valid!' 23 | } 24 | handler.help = ['menfess'].map(v => v + ' ') 25 | handler.tags = ['main', 'fun'] 26 | handler.command = /^(menfess)$/i 27 | module.exports = handler 28 | -------------------------------------------------------------------------------- /plugins/maker-carbon.js: -------------------------------------------------------------------------------- 1 | let Carbon = require("unofficial-carbon-now") 2 | 3 | let handler = async(m, { conn, usedPrefix, command, text }) => { 4 | if (!m.quoted && !text) throw `${set.sb} *Example* : ${usedPrefix + command} text/reply\n\n_Gesek pesan ini kekanan untuk membuat gambar teks *carbon*_` 5 | m.react('⏱️') 6 | let buat = new Carbon.createCarbon().setCode(m.quoted ? m.quoted.text : text) 7 | let hasil = await Carbon.generateCarbon(buat) 8 | conn.sendMedia(m.chat, hasil, m) 9 | } 10 | handler.help = ['carbon'].map(v => v + ' ') 11 | handler.tags = ['maker'] 12 | handler.command = /^(code|carbon)$/i 13 | module.exports = handler 14 | -------------------------------------------------------------------------------- /plugins/owner-archivechat.js: -------------------------------------------------------------------------------- 1 | async function handler(m, { conn, command }) { 2 | m.react('⏱️') 3 | let anu = !/un/.test(command) 4 | conn.chatModify({ archive: anu, lastMessages: [{ key: m.key, messageTimestamp: m.messageTimestamp }] }, m.chat) 5 | let a = await m.reply(`Berhasil meng${anu ? '' : 'un'}archive chat ini!`) 6 | m.react('✅', a.key) 7 | } 8 | handler.help = ['archive', 'unarchive'].map(v => v + 'chat') 9 | handler.tags = ['owner'] 10 | handler.command = /^((un)?archive?c(hat)?)$/i 11 | handler.owner = true 12 | handler.desc = ['*A R C H I V E C H A T*\n\nArchive chat ya/tidak\nPenggunaan : #arc'] 13 | module.exports = handler 14 | -------------------------------------------------------------------------------- /plugins/owner-deletechat.js: -------------------------------------------------------------------------------- 1 | async function handler(m, { conn }) { 2 | m.react('⏱️') 3 | conn.chatModify({ delete: true, lastMessages: [{ key: m.key, messageTimestamp: m.messageTimestamp }] }, m.chat) 4 | let a = await m.reply("Berhasil menghapus chat ini!") 5 | m.react('✅', a.key) 6 | } 7 | handler.help = ['deletechat'], 8 | handler.tags = ['owner'], 9 | handler.command = /^(deletechat|delchat|dchat)$/i 10 | handler.owner = true 11 | handler.desc = ['*D E L E T E C H A T*\n\nMenghapus chat di chat ini\nPenggunaan : #delchat'] 12 | module.exports = handler 13 | -------------------------------------------------------------------------------- /plugins/owner-exec.js: -------------------------------------------------------------------------------- 1 | const syntaxerror = require('syntax-error') 2 | const util = require('util') 3 | const fetch = require('node-fetch') 4 | const axios = require('axios') 5 | const fs = require('fs') 6 | const bocil = require('@bochilteam/scraper') 7 | const scrape = require('../lib/scrape.js') 8 | 9 | let handler = async (m, _2) => { 10 | let { conn, usedPrefix, command, text, noPrefix, args, groupMetadata, participants, expiration } = _2 11 | let _return 12 | let _syntax = '' 13 | let _text = (/^~/.test(usedPrefix) ? 'return ' : '') + noPrefix 14 | let old = m.exp * 1 15 | try { 16 | let i = 15 17 | let f = { 18 | exports: {} 19 | } 20 | let exec = new (async () => {}).constructor('print', 'm', 'handler', 'require', 'conn', 'Array', 'process', 'args', 'groupMetadata', 'expiration', 'axios', 'fs', 'fetch', 'bail', 'bocil', 'scrape', 'module', 'exports', 'argument', _text) 21 | _return = await exec.call(conn, (...args) => { 22 | if (--i < 1) return 23 | console.log(...args) 24 | return conn.reply(m.chat, util.format(...args), m) 25 | }, m, handler, require, conn, CustomArray, process, args, groupMetadata, expiration, axios, fs, fetch, bocil, scrape, f, f.exports, [conn, _2]) 26 | } catch (e) { 27 | let err = await syntaxerror(_text, 'Execution Function', { 28 | allowReturnOutsideFunction: true, 29 | allowAwaitOutsideFunction: true 30 | }) 31 | if (err) _syntax = '```' + err + '```\n\n' 32 | _return = e 33 | } finally { 34 | conn.reply(m.chat, _syntax + util.format(_return), m) 35 | m.exp = old 36 | } 37 | } 38 | handler.help = ['>', '~>'] 39 | handler.tags = ['advanced'] 40 | handler.customPrefix = /^~?> / 41 | handler.command = /(?:)/i 42 | handler.rowner = true 43 | module.exports = handler 44 | 45 | class CustomArray extends Array { 46 | constructor(...args) { 47 | if (typeof args[0] == 'number') return super(Math.min(args[0], 10000)) 48 | else return super(...args) 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /plugins/owner-exec2.js: -------------------------------------------------------------------------------- 1 | let cp = require('child_process') 2 | let { promisify } = require('util') 3 | let exec = promisify(cp.exec).bind(cp) 4 | let readMore = String.fromCharCode(8206).repeat(4001) 5 | 6 | let handler = async (m, { conn, isOwner, command, text }) => { 7 | if (conn.user.jid != conn.user.jid) return 8 | await m.react('⚡') 9 | let o 10 | try { 11 | o = await exec(command.trimStart() + ' ' + text.trimEnd()) 12 | } catch (e) { 13 | o = e 14 | } finally { 15 | let { stdout, stderr } = o 16 | if (stdout.trim()) { 17 | let a = stdout.replace(/C:/gi, '').replace(/Users/gi, 'home').replace(/rdp/gi, 'usr').replace(/Desktop/gi, 'root') 18 | if (m.text.startsWith('$ node test')) return conn.sendButton(m.chat, readMore + a, "No eror, silahkan turu dulu 😪", null, [[`Restart`, `.restart`]], m) 19 | conn.reply(m.chat, a, m) 20 | } 21 | if (stderr.trim()) { 22 | let b = stderr.replace(/C:/gi, '').replace(/Users/gi, 'home').replace(/rdp/gi, 'usr').replace(/Desktop/gi, 'root') 23 | conn.reply(m.chat, m.text.startsWith('$ node test') ? readMore + b : b, m).then(_=> { 24 | if (m.text.startsWith('$ node test')) conn.sendButton(m.chat, "Eror don't restart bot, kocok lagi 😎", "", null, [[`Ok`, `.say semangat:v`]], m) 25 | }) 26 | } 27 | } 28 | } 29 | handler.help = ['$'] 30 | handler.tags = ['advanced'] 31 | handler.customPrefix = /^[$]/ 32 | handler.command = new RegExp 33 | handler.rowner = true 34 | module.exports = handler 35 | -------------------------------------------------------------------------------- /plugins/owner-restart.js: -------------------------------------------------------------------------------- 1 | async function handler(m, { conn, isROwner }) { 2 | if (!process.send) throw 'Dont: node main.js\nDo: node index.js' 3 | if (conn.user.jid == conn.user.jid) { 4 | conn.sendButton(m.chat, 'Mengaktifkan ulang bot...', set.wm, 0, [['Ping', '.ping']], m).then(_=> { 5 | process.send('reset') 6 | }) 7 | } else throw '_eeeeeiiittsssss..._' 8 | } 9 | handler.help = ['restart'] 10 | handler.tags = ['host'] 11 | handler.command = /^(res(tart)?)$/i 12 | handler.owner = true 13 | module.exports = handler 14 | -------------------------------------------------------------------------------- /plugins/owner-update.js: -------------------------------------------------------------------------------- 1 | const { execSync } = require('child_process') 2 | const { readdirSync } = require('fs') 3 | const { format } = require('util') 4 | 5 | let handler = async (m, { conn, text, isROwner }) => { 6 | try { 7 | let stdout = execSync('git remote set-url origin ' + set.repo + ' && git pull' + (isROwner && text ? ' ' + text : '')) 8 | if (isROwner) readdirSync('plugins').map(v => global.reload('', v)) 9 | let hasil = stdout.toString() 10 | m.react('⚡').then(_=> 11 | conn.sendButton(m.chat, hasil, ' Node Test or Restart Bot?', 0, [['Restart', '.restart'], ['Node Test', '$ node test']], m) 12 | ) 13 | } catch (e) { 14 | conn.reply(m.chat, format(e), m) 15 | } 16 | } 17 | handler.help = ['update'] 18 | handler.tags = ['host'] 19 | handler.command = /^(update|u)$/i //sedia payung sebelum hujan meteor 20 | handler.rowner = true 21 | module.exports = handler 22 | -------------------------------------------------------------------------------- /plugins/quotes_quotes.js: -------------------------------------------------------------------------------- 1 | let handler = async(m, { conn, usedPrefix, command, text, args }) => { 2 | if (!text) throw `${set.sb} *Example* : ${usedPrefix + command} rindu\n\n_Gesek pesan ini kekanan untuk mencari *quotes*_` 3 | m.react(('🌻 🌹 🥀 🌱 🌿 🌾 🍃').split(' ').getRandom()) 4 | let res = await require('../lib/scrape.js').quotes(text) 5 | if (!res.status) throw `Quotes *${text}* tidak ditemukan!` 6 | let rand = res.data.getRandom() 7 | let caption = `*${set.sa} Q U O T E S*\n\n${rand.quote}` 8 | conn.sendButton(m.chat, caption, set.wm, set.fla + "quotes", [`Quotes ${text}`, `${usedPrefix + command} ${text}`], m, { asLocation: true }) 9 | } 10 | handler.help = ['quotes'] 11 | handler.tags = ['quotes'] 12 | handler.command =/^(quotes?)$/i 13 | handler.limit = true 14 | module.exports = handler 15 | -------------------------------------------------------------------------------- /plugins/sticker-attp.js: -------------------------------------------------------------------------------- 1 | let { sticker5 } = require('../lib/sticker.js') 2 | let fetch = require('node-fetch') 3 | 4 | let handler = async(m, { text, conn, usedPrefix, command }) => { 5 | let err = `${set.sb} *Example* : ${usedPrefix + command} teks\n\n_Gesek pesan ini kekanan untuk membuat sticker *attp*_` 6 | if (!text && !m.quoted) throw err 7 | if (m.quoted?.buttons) throw err 8 | m.react('⏱️') 9 | let teks = m.quoted ? m.quoted.text : text 10 | try { 11 | let res = await (await fetch(API('xteam', '/attp', { file: '', text: teks }))).buffer() 12 | let attp = await sticker5(false, res, set.pack, set.auth) 13 | conn.sendFile(m.chat, attp, 'attp.webp', '', m, false, { mentions: [m.sender], asSticker: true }) 14 | } catch (e) { 15 | throw e 16 | } 17 | } 18 | handler.help = ['attp'].map(v => v + ' ') 19 | handler.tags = ['sticker'] 20 | handler.command = ['attp'] 21 | module.exports = handler 22 | -------------------------------------------------------------------------------- /plugins/sticker-media.js: -------------------------------------------------------------------------------- 1 | let handler = async (m, { conn, usedPrefix, command, text, args }) => { 2 | let err = `${set.sb} *Example* : ${usedPrefix + command} media/url\n\n_Gesek pesan ini kekanan untuk membuat *sticker*_` 3 | let q = m.quoted ? m.quoted : m 4 | let mime = (q.msg || q).mimetype || q.mediaType || '' 5 | let media 6 | try { 7 | media = await q.download() 8 | } catch { 9 | if (isUrl(args[0] || '')) media = args[0] 10 | else throw err 11 | } 12 | if (q.seconds && (q.seconds > 15)) throw `Video maksimal 10 detik!` 13 | m.react('⏱️') 14 | conn.sendSticker(m.chat, media, m, { packname: set.pack, author: set.auth, asSticker: /webp/g.test(mime) }) 15 | } 16 | handler.help = ['sticker'].map(v => v + ' ') 17 | handler.tags = ['sticker'] 18 | handler.command = /^(s(tic?k(er)?)?(gif)?(video)?)$/i 19 | handler.desc = ['Membuat stiker dengan media foto, video atau url'] 20 | module.exports = handler 21 | 22 | function isUrl(text) { 23 | return text.match(new RegExp(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)(jpe?g|gif|png)/, 'gi')) 24 | } 25 | -------------------------------------------------------------------------------- /plugins/sticker-meme.js: -------------------------------------------------------------------------------- 1 | let uploadImage = require('../lib/uploadImage.js') 2 | let { webp2png } = require('../lib/webp2mp4.js') 3 | let fetch = require('node-fetch') 4 | 5 | let handler = async (m, { conn, text, usedPrefix, command }) => { 6 | let [atas, bawah] = text.split(/[.,|]/) 7 | let q = m.quoted ? m.quoted : m 8 | let mime = (q.msg || q).mimetype || '' 9 | if (!text) throw `${set.sb} *Example* : ${usedPrefix + command} ${atas ? atas : 'teks1'}|${bawah ? bawah : 'teks2'}\n\n_Gesek pesan ini kekanan untuk membuat *sticker meme*_` 10 | if (!mime) throw `Balas medianya!` 11 | if (!/image\/(jpe?g|png)|webp/i.test(mime)) throw `_*Mime ${mime} tidak didukung!*_` 12 | m.react('⏱️') 13 | let media = await q.download() 14 | let image // = Buffer.alloc(0) 15 | if (/webp/.test(mime)) { 16 | let anu = await webp2png(media) 17 | image = await conn.getBuffer(anu) 18 | } else image = media 19 | let url = await uploadImage(image) 20 | let meme = `https://api.memegen.link/images/custom/${encodeURIComponent(atas ? atas : '')}/${encodeURIComponent(bawah ? bawah : '')}.png?background=${url}` 21 | conn.sendSticker(m.chat, meme, m, { packname: ' Sticker\n\n' + set.pack, author: 'Meme\n\n' + set.auth }) 22 | } 23 | handler.help = ['stickermeme'].map(v => v + ' ') 24 | handler.tags = ['sticker'] 25 | handler.command = /^(s(tic?ker)?me(me)?)$/i 26 | module.exports = handler 27 | -------------------------------------------------------------------------------- /plugins/sticker-ttp.js: -------------------------------------------------------------------------------- 1 | let { sticker5 } = require('../lib/sticker.js') 2 | let fetch = require('node-fetch') 3 | 4 | let handler = async(m, { text, conn, usedPrefix, command }) => { 5 | let err = `${set.sb} *Example* : ${usedPrefix + command} teks\n\n_Gesek pesan ini kekanan untuk membuat sticker *ttp*_` 6 | if (!text && !m.quoted) throw err 7 | if (m.quoted?.buttons) throw err 8 | m.react('⏱️') 9 | let teks = m.quoted ? m.quoted.text : text 10 | try { 11 | let res = await (await fetch(API('xteam', '/ttp', { file: '', text: teks }))).buffer() 12 | let ttp = await sticker5(false, res, set.pack, set.auth) 13 | conn.sendFile(m.chat, ttp, 'ttp.webp', '', m, false, { mentions: [m.sender], asSticker: true }) 14 | } catch (e) { 15 | throw e 16 | } 17 | } 18 | handler.help = ['ttp'].map(v => v + ' ') 19 | handler.tags = ['sticker'] 20 | handler.command = ['ttp'] 21 | module.exports = handler 22 | -------------------------------------------------------------------------------- /replit.nix: -------------------------------------------------------------------------------- 1 | { pkgs }: { 2 | deps = [ 3 | pkgs.nodejs 4 | pkgs.nodePackages.typescript 5 | pkgs.ffmpeg 6 | pkgs.imagemagick 7 | pkgs.git 8 | pkgs.speedtest-cli 9 | ]; 10 | } 11 | -------------------------------------------------------------------------------- /server.js: -------------------------------------------------------------------------------- 1 | let express = require('express') 2 | let path = require('path') 3 | let SocketIO = require('socket.io') 4 | let qrcode = require('qrcode') 5 | let fetch = require('node-fetch') 6 | let yargs = require('yargs') 7 | let opts = new Object(yargs(process.argv.slice(2)).exitProcess(false).parse()) 8 | 9 | function connect(conn, PORT) { 10 | let app = global.app = express() 11 | 12 | //app.use(express.static(path.join(__dirname, 'views'))) 13 | let _qr = 'invalid' 14 | 15 | conn.ev.on('connection.update', function appQR({ qr }) { 16 | if (qr) _qr = qr 17 | }) 18 | 19 | app.use(async (req, res) => { 20 | res.setHeader('content-type', 'image/png') 21 | res.end(await qrcode.toBuffer(_qr)) 22 | }) 23 | 24 | let server = app.listen(PORT, () => { 25 | console.log('Aplikasi berjalan di port', PORT) 26 | if (opts['keepalive']) keepAlive() 27 | }) 28 | 29 | let io = SocketIO(server) 30 | io.on('connection', socket => { 31 | let { unpipeEmit } = pipeEmit(conn, socket, 'conn-') 32 | socket.on('disconnect', unpipeEmit) 33 | }) 34 | } 35 | 36 | function pipeEmit(event, event2, prefix = '') { 37 | let old = event.emit 38 | event.emit = function (event, ...args) { 39 | old.emit(event, ...args) 40 | event2.emit(prefix + event, ...args) 41 | } 42 | return { 43 | unpipeEmit() { 44 | event.emit = old 45 | } 46 | } 47 | } 48 | 49 | function keepAlive() { 50 | const url = `https://${process.env.REPL_SLUG}.${process.env.REPL_OWNER}.repl.co` 51 | if (/(\/\/|\.)undefined\./.test(url)) return 52 | setInterval(()=> { 53 | fetch(url).catch(console.error) 54 | }, 5 * 1000 * 60) 55 | } 56 | 57 | module.exports = connect 58 | -------------------------------------------------------------------------------- /src/LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /src/exif.json: -------------------------------------------------------------------------------- 1 | { 2 | "spackname": "", 3 | "sauthor": "" 4 | } 5 | -------------------------------------------------------------------------------- /src/font/.file: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/font/212BabyGirl.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/src/font/212BabyGirl.otf -------------------------------------------------------------------------------- /src/font/212LeahleeSans.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/src/font/212LeahleeSans.ttf -------------------------------------------------------------------------------- /src/font/99HandWritting.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/src/font/99HandWritting.ttf -------------------------------------------------------------------------------- /src/font/ACallingFontDby7NTypes.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/src/font/ACallingFontDby7NTypes.otf -------------------------------------------------------------------------------- /src/font/ACasualHandwrittenPenNoncommercial.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/src/font/ACasualHandwrittenPenNoncommercial.ttf -------------------------------------------------------------------------------- /src/font/ADayinSeptember.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/src/font/ADayinSeptember.otf -------------------------------------------------------------------------------- /src/font/ASMelanieHandwritting.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/src/font/ASMelanieHandwritting.ttf -------------------------------------------------------------------------------- /src/font/Alittlesunshine.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/src/font/Alittlesunshine.ttf -------------------------------------------------------------------------------- /src/font/And-This-Happened.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/src/font/And-This-Happened.ttf -------------------------------------------------------------------------------- /src/font/AvenirCondensedHand.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/src/font/AvenirCondensedHand.ttf -------------------------------------------------------------------------------- /src/font/Avocados.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/src/font/Avocados.ttf -------------------------------------------------------------------------------- /src/font/BabyDoll.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/src/font/BabyDoll.ttf -------------------------------------------------------------------------------- /src/font/BattleOfKingsRegular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/src/font/BattleOfKingsRegular.ttf -------------------------------------------------------------------------------- /src/font/BrayNotes.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/src/font/BrayNotes.ttf -------------------------------------------------------------------------------- /src/font/Convered-By-Your-Grace.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/src/font/Convered-By-Your-Grace.ttf -------------------------------------------------------------------------------- /src/font/Edoms-Handwritting-Normal.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/src/font/Edoms-Handwritting-Normal.ttf -------------------------------------------------------------------------------- /src/font/Futura Bold Italic font.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/src/font/Futura Bold Italic font.ttf -------------------------------------------------------------------------------- /src/font/Futura Bold font.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/src/font/Futura Bold font.ttf -------------------------------------------------------------------------------- /src/font/Futura Book Italic font.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/src/font/Futura Book Italic font.ttf -------------------------------------------------------------------------------- /src/font/Futura Book font.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/src/font/Futura Book font.ttf -------------------------------------------------------------------------------- /src/font/Futura Extra Black font.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/src/font/Futura Extra Black font.ttf -------------------------------------------------------------------------------- /src/font/Futura Heavy Italic font.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/src/font/Futura Heavy Italic font.ttf -------------------------------------------------------------------------------- /src/font/Futura Heavy font.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/src/font/Futura Heavy font.ttf -------------------------------------------------------------------------------- /src/font/Futura Light Italic font.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/src/font/Futura Light Italic font.ttf -------------------------------------------------------------------------------- /src/font/Futura Light font.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/src/font/Futura Light font.ttf -------------------------------------------------------------------------------- /src/font/Futura Medium Italic font.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/src/font/Futura Medium Italic font.ttf -------------------------------------------------------------------------------- /src/font/Futura XBlk BT.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/src/font/Futura XBlk BT.ttf -------------------------------------------------------------------------------- /src/font/Futura-CondensedLight.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/src/font/Futura-CondensedLight.otf -------------------------------------------------------------------------------- /src/font/GloriaHallelujah-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/src/font/GloriaHallelujah-Regular.ttf -------------------------------------------------------------------------------- /src/font/HandwritingCR-2.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/src/font/HandwritingCR-2.ttf -------------------------------------------------------------------------------- /src/font/Kempton-Demo-Handwritting.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/src/font/Kempton-Demo-Handwritting.ttf -------------------------------------------------------------------------------- /src/font/MyHandsareHoldingYou.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/src/font/MyHandsareHoldingYou.ttf -------------------------------------------------------------------------------- /src/font/My_handwriting.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/src/font/My_handwriting.ttf -------------------------------------------------------------------------------- /src/font/Nadeznas-Handwritting.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/src/font/Nadeznas-Handwritting.ttf -------------------------------------------------------------------------------- /src/font/Roboto-Black.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/src/font/Roboto-Black.ttf -------------------------------------------------------------------------------- /src/font/Roboto-BlackItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/src/font/Roboto-BlackItalic.ttf -------------------------------------------------------------------------------- /src/font/Roboto-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/src/font/Roboto-Bold.ttf -------------------------------------------------------------------------------- /src/font/Roboto-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/src/font/Roboto-BoldItalic.ttf -------------------------------------------------------------------------------- /src/font/Roboto-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/src/font/Roboto-Italic.ttf -------------------------------------------------------------------------------- /src/font/Roboto-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/src/font/Roboto-Light.ttf -------------------------------------------------------------------------------- /src/font/Roboto-LightItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/src/font/Roboto-LightItalic.ttf -------------------------------------------------------------------------------- /src/font/Roboto-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/src/font/Roboto-Medium.ttf -------------------------------------------------------------------------------- /src/font/Roboto-MediumItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/src/font/Roboto-MediumItalic.ttf -------------------------------------------------------------------------------- /src/font/Roboto-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/src/font/Roboto-Regular.ttf -------------------------------------------------------------------------------- /src/font/Roboto-Thin.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/src/font/Roboto-Thin.ttf -------------------------------------------------------------------------------- /src/font/Roboto-ThinItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/src/font/Roboto-ThinItalic.ttf -------------------------------------------------------------------------------- /src/font/ShadowsIntoLight-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/src/font/ShadowsIntoLight-Regular.ttf -------------------------------------------------------------------------------- /src/font/Zahraaa.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/src/font/Zahraaa.ttf -------------------------------------------------------------------------------- /src/font/angelina.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/src/font/angelina.ttf -------------------------------------------------------------------------------- /src/font/futur.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/src/font/futur.ttf -------------------------------------------------------------------------------- /src/font/futura light bt.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/src/font/futura light bt.ttf -------------------------------------------------------------------------------- /src/font/futura medium bt.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/src/font/futura medium bt.ttf -------------------------------------------------------------------------------- /src/font/futura medium condensed bt.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/src/font/futura medium condensed bt.ttf -------------------------------------------------------------------------------- /src/font/michellehandwritting.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raseldev18/mymd/83cb1af601212079695b777acb718733f3fd0ce6/src/font/michellehandwritting.ttf -------------------------------------------------------------------------------- /src/moderator.json: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /src/owner.json: -------------------------------------------------------------------------------- 1 | ["6285346545126", "6282256048971"] 2 | -------------------------------------------------------------------------------- /src/premium.json: -------------------------------------------------------------------------------- 1 | ["0"] 2 | -------------------------------------------------------------------------------- /src/symbol.json: -------------------------------------------------------------------------------- 1 | { 2 | "symbolA": "", 3 | "symbolB": "" 4 | } 5 | -------------------------------------------------------------------------------- /src/wm.json: -------------------------------------------------------------------------------- 1 | { 2 | "wm": "" 3 | } 4 | -------------------------------------------------------------------------------- /test.js: -------------------------------------------------------------------------------- 1 | let fs = require('fs') 2 | let path = require('path') 3 | let assert = require('assert') 4 | let { spawn } = require('child_process') 5 | let folders = ['.', ...Object.keys(require('./package.json').directories)] 6 | let files = [] 7 | for (let folder of folders) 8 | for (let file of fs.readdirSync(folder).filter(v => v.endsWith('.js'))) 9 | files.push(path.resolve(path.join(folder, file))) 10 | for (let file of files) { 11 | if (file == path.join(__dirname, __filename)) continue 12 | console.error('Checking', file) 13 | spawn(process.argv0, ['-c', file]) 14 | .on('close', () => { 15 | assert.ok(file) 16 | console.log('Done', file) 17 | }) 18 | .stderr.on('data', chunk => assert.ok(chunk.length < 1, file + '\n\n' + chunk)) 19 | } 20 | -------------------------------------------------------------------------------- /tmp/rasel: -------------------------------------------------------------------------------- 1 | https://github.com/raselcomel/mymd 2 | --------------------------------------------------------------------------------