forked from DGDEEPAK/Zenitsu-Bot9
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
1 lines (1 loc) · 10.7 KB
/
index.js
1
const _0x2b6722=_0x3ebf;function _0x1ce7(){const _0x887561=['674XhBNFm','118344LWzqtd','36RhpSlC','node-cache','45258BOlmCD','api','--mobile','notify','pino','message','log','write','redBright','Please\x20type\x20your\x20WhatsApp\x20number\x20😍\x0aFor\x20example:\x20+917029257330\x20:\x20','APIs','settings','close','loadMessage','some','2809270XYrcpV','windows','Video','loggedOut','remoteJid','true','connectionReplaced','child_process','277QPFwDg','watchFile','bgGreen','output','split','3681064IUlhoB','awesome-phonenumber','keys','Restart\x20Required...','groups.update','user','Cannot\x20use\x20pairing\x20code\x20with\x20mobile\x20api','child','./session','Unknown\x20DisconnectReason\x20:\x20','connectionLost','Scan\x20again...','from','Currently,\x20We\x20Cannot\x20Receive\x20Calls\x20','length','read','cache','anticall','bind','Connection\x20Timed\x20Out,\x20Attempting\x20to\x20Reconnect...','Delete\x20Session\x20and\x20Scan\x20again...','stdin','sendContact','group-participants.update','@hapi/boom','@whiskeysockets/baileys','rejectCall','Close\x20current\x20Session\x20first...','creds.update','messages.upsert','path','status','startsWith','requestPairingCode','connectionClosed','Your\x20Pairing\x20Code\x20:\x20','store','Multidevicemismatch','./settings','parse','open','1130VZabCv','resolve','contacts','exit','stringify','logout','includes','argv','question','fatal','createInterface','silent','.\x0aIf\x20@','2667775fApjTQ','Start\x20with\x20country\x20code\x20of\x20your\x20WhatsApp\x20Number,\x20Example\x20:\x20+917029257330','creds','unwatchFile','--pairing-code','axios','./src/owner.json','replace','white','917029257330','join','./lib/function','greenBright','Update\x20','owner','APIKeys','readFileSync','match','\x20Need\x20Help,\x20Please\x20Contact\x20Owner\x20:)','Connection\x20closed,\x20Attempting\x20to\x20Reconnect...','bgBlack','registered','56yXXYrc','connection.update','authState','sendMessage','restartRequired','287DBohDP','readline','74340xuBkgn'];_0x1ce7=function(){return _0x887561;};return _0x1ce7();}(function(_0xe82a33,_0x3f2e28){const _0x46fe78=_0x3ebf,_0x81351b=_0xe82a33();while(!![]){try{const _0x561010=parseInt(_0x46fe78(0x115))/0x1*(parseInt(_0x46fe78(0x16e))/0x2)+-parseInt(_0x46fe78(0x16f))/0x3*(parseInt(_0x46fe78(0x166))/0x4)+-parseInt(_0x46fe78(0x10d))/0x5+parseInt(_0x46fe78(0x172))/0x6*(parseInt(_0x46fe78(0x16b))/0x7)+-parseInt(_0x46fe78(0x11a))/0x8+-parseInt(_0x46fe78(0x16d))/0x9*(-parseInt(_0x46fe78(0x143))/0xa)+-parseInt(_0x46fe78(0x150))/0xb*(-parseInt(_0x46fe78(0x170))/0xc);if(_0x561010===_0x3f2e28)break;else _0x81351b['push'](_0x81351b['shift']());}catch(_0x1b4601){_0x81351b['push'](_0x81351b['shift']());}}}(_0x1ce7,0x7775c),require(_0x2b6722(0x140)));const fs=require('fs'),pino=require(_0x2b6722(0x176)),path=require(_0x2b6722(0x138)),axios=require(_0x2b6722(0x155)),chalk=require('chalk'),readline=require(_0x2b6722(0x16c)),FileType=require('file-type'),{exec}=require(_0x2b6722(0x114)),{Boom}=require(_0x2b6722(0x132)),NodeCache=require(_0x2b6722(0x171)),PhoneNumber=require(_0x2b6722(0x11b)),{default:WAConnection,fetchLatestBaileysVersion,useMultiFileAuthState,Browsers,DisconnectReason,makeInMemoryStore,makeCacheableSignalKeyStore,fetchLatestWaWebVersion,proto,PHONENUMBER_MCC,getAggregateVotesInPollMessage}=require(_0x2b6722(0x133));let phoneNumber=_0x2b6722(0x159);const pairingCode=!!phoneNumber||process[_0x2b6722(0x14a)][_0x2b6722(0x149)](_0x2b6722(0x154)),useMobile=process[_0x2b6722(0x14a)][_0x2b6722(0x149)](_0x2b6722(0x174)),rl=readline[_0x2b6722(0x14d)]({'input':process[_0x2b6722(0x12f)],'output':process['stdout']}),store=makeInMemoryStore({'logger':pino()[_0x2b6722(0x121)]({'level':_0x2b6722(0x14e),'stream':_0x2b6722(0x13e)})}),question=_0x340ff7=>new Promise(_0x10a61d=>rl[_0x2b6722(0x14b)](_0x340ff7,_0x10a61d));let owner=JSON[_0x2b6722(0x141)](fs[_0x2b6722(0x160)](_0x2b6722(0x156)));const makeWASocket=require(_0x2b6722(0x133))['default'];global[_0x2b6722(0x173)]=(_0x5507a4,_0x4c8244='/',_0x53d76f={},_0x4ab87e)=>(_0x5507a4 in global[_0x2b6722(0x17c)]?global[_0x2b6722(0x17c)][_0x5507a4]:_0x5507a4)+_0x4c8244+(_0x53d76f||_0x4ab87e?'?'+new URLSearchParams(Object['entries']({..._0x53d76f,..._0x4ab87e?{[_0x4ab87e]:global[_0x2b6722(0x15f)][_0x5507a4 in global[_0x2b6722(0x17c)]?global[_0x2b6722(0x17c)][_0x5507a4]:_0x5507a4]}:{}})):'');const DataBase=require('./src/database'),database=new DataBase();((async()=>{const _0x1df277=_0x2b6722,_0x530245=await database[_0x1df277(0x129)]();_0x530245&&Object[_0x1df277(0x11c)](_0x530245)[_0x1df277(0x128)]===0x0?(global['db']={'sticker':{},'users':{},'groups':{},'database':{},'settings':{},'others':{},..._0x530245||{}},await database[_0x1df277(0x179)](global['db'])):global['db']=_0x530245,setInterval(async()=>{const _0x46ebcc=_0x1df277;if(global['db'])await database[_0x46ebcc(0x179)](global['db']);},0x7530);})());const {GroupUpdate,GroupParticipantsUpdate,MessagesUpsert,Solving}=require('./src/message'),{imageToWebp,videoToWebp,writeExifImg,writeExifVid}=require('./lib/exif'),{isUrl,generateMessageTag,getBuffer,getSizeMedia,fetchJson,await,sleep}=require(_0x2b6722(0x15b));async function startDeepakBot(){const _0x159bd1=_0x2b6722;let {version:_0x2f089f,isLatest:_0x41ff0c}=await fetchLatestBaileysVersion();const {state:_0x59fb7d,saveCreds:_0x2a29e1}=await useMultiFileAuthState(_0x159bd1(0x122)),_0x494e47=new NodeCache(),_0xc1495e=makeWASocket({'logger':pino({'level':_0x159bd1(0x14e)}),'printQRInTerminal':!pairingCode,'browser':Browsers[_0x159bd1(0x10e)]('Firefox'),'auth':{'creds':_0x59fb7d[_0x159bd1(0x152)],'keys':makeCacheableSignalKeyStore(_0x59fb7d[_0x159bd1(0x11c)],pino({'level':_0x159bd1(0x14c)})[_0x159bd1(0x121)]({'level':'fatal'}))},'markOnlineOnConnect':!![],'generateHighQualityLinkPreview':!![],'getMessage':async _0x3cebae=>{const _0x5f7425=_0x159bd1;let _0x149886=jidNormalizedUser(_0x3cebae[_0x5f7425(0x111)]),_0x395435=await store[_0x5f7425(0x17f)](_0x149886,_0x3cebae['id']);return _0x395435?.[_0x5f7425(0x177)]||'';},'msgRetryCounterCache':_0x494e47,'defaultQueryTimeoutMs':undefined});store[_0x159bd1(0x12c)](_0xc1495e['ev']);if(pairingCode&&!_0xc1495e[_0x159bd1(0x168)][_0x159bd1(0x152)][_0x159bd1(0x165)]){if(useMobile)throw new Error(_0x159bd1(0x120));let _0x44db5b;!!_0x44db5b?(_0x44db5b=_0x44db5b[_0x159bd1(0x157)](/[^0-9]/g,''),!Object[_0x159bd1(0x11c)](PHONENUMBER_MCC)[_0x159bd1(0x10c)](_0x1af5e9=>_0x44db5b[_0x159bd1(0x13a)](_0x1af5e9))&&(console[_0x159bd1(0x178)](chalk[_0x159bd1(0x164)](chalk[_0x159bd1(0x17a)](_0x159bd1(0x151)))),process[_0x159bd1(0x146)](0x0))):(_0x44db5b=await question(chalk[_0x159bd1(0x164)](chalk[_0x159bd1(0x15c)](_0x159bd1(0x17b)))),_0x44db5b=_0x44db5b[_0x159bd1(0x157)](/[^0-9]/g,''),!Object['keys'](PHONENUMBER_MCC)['some'](_0x1ae89d=>_0x44db5b[_0x159bd1(0x13a)](_0x1ae89d))&&(console[_0x159bd1(0x178)](chalk[_0x159bd1(0x164)](chalk[_0x159bd1(0x17a)](_0x159bd1(0x151)))),_0x44db5b=await question(chalk[_0x159bd1(0x164)](chalk['greenBright'](_0x159bd1(0x17b)))),_0x44db5b=_0x44db5b[_0x159bd1(0x157)](/[^0-9]/g,''),rl[_0x159bd1(0x17e)]())),setTimeout(async()=>{const _0x4a48f3=_0x159bd1;let _0x301803=await _0xc1495e[_0x4a48f3(0x13b)](_0x44db5b);_0x301803=_0x301803?.[_0x4a48f3(0x161)](/.{1,4}/g)?.[_0x4a48f3(0x15a)]('-')||_0x301803,console[_0x4a48f3(0x178)](chalk['black'](chalk[_0x4a48f3(0x117)](_0x4a48f3(0x13d))),chalk['black'](chalk[_0x4a48f3(0x158)](_0x301803)));},0xbb8);}return store[_0x159bd1(0x12c)](_0xc1495e['ev']),await Solving(_0xc1495e,store),_0xc1495e['ev']['on'](_0x159bd1(0x136),_0x2a29e1),_0xc1495e['ev']['on'](_0x159bd1(0x167),async _0x1326ea=>{const _0x229260=_0x159bd1,{connection:_0x3cb51e,lastDisconnect:_0x2bb83d,receivedPendingNotifications:_0x3ec73d}=_0x1326ea;if(_0x3cb51e===_0x229260(0x17e)){const _0x5029ea=new Boom(_0x2bb83d?.['error'])?.[_0x229260(0x118)]['statusCode'];if(_0x5029ea===DisconnectReason[_0x229260(0x124)])console['log']('Connection\x20to\x20Server\x20Lost,\x20Attempting\x20to\x20Reconnect...'),startDeepakBot();else{if(_0x5029ea===DisconnectReason[_0x229260(0x13c)])console[_0x229260(0x178)](_0x229260(0x163)),startDeepakBot();else{if(_0x5029ea===DisconnectReason[_0x229260(0x16a)])console[_0x229260(0x178)](_0x229260(0x11d)),startDeepakBot();else{if(_0x5029ea===DisconnectReason['timedOut'])console[_0x229260(0x178)](_0x229260(0x12d)),startDeepakBot();else{if(_0x5029ea===DisconnectReason['badSession'])console['log'](_0x229260(0x12e)),process['exit'](0x1);else{if(_0x5029ea===DisconnectReason[_0x229260(0x113)])console[_0x229260(0x178)](_0x229260(0x135)),_0xc1495e[_0x229260(0x148)]();else{if(_0x5029ea===DisconnectReason[_0x229260(0x110)])console[_0x229260(0x178)]('Scan\x20again\x20and\x20Run...');else _0x5029ea===DisconnectReason[_0x229260(0x13f)]?console[_0x229260(0x178)](_0x229260(0x125)):_0xc1495e['end'](_0x229260(0x123)+_0x5029ea+'|'+_0x3cb51e);}}}}}}}if(_0x3cb51e==_0x229260(0x142))console[_0x229260(0x178)]('Connected\x20to\x20:\x20'+JSON[_0x229260(0x147)](_0xc1495e[_0x229260(0x11f)],null,0x2));else _0x3ec73d==_0x229260(0x112)&&console['log']('Please\x20wait\x20About\x201\x20Minute...');}),_0xc1495e['ev']['on']('contacts.update',_0x1535db=>{const _0x479c5a=_0x159bd1;for(let _0x14c793 of _0x1535db){let _0x42478c=_0xc1495e['decodeJid'](_0x14c793['id']);if(store&&store[_0x479c5a(0x145)])store[_0x479c5a(0x145)][_0x42478c]={'id':_0x42478c,'name':_0x14c793[_0x479c5a(0x175)]};}}),_0xc1495e['ev']['on']('call',async _0xe9dc27=>{const _0x330e8e=_0x159bd1;let _0xbb7814=await _0xc1495e['decodeJid'](_0xc1495e[_0x330e8e(0x11f)]['id']),_0x305c3c=global['db'][_0x330e8e(0x17d)][_0xbb7814][_0x330e8e(0x12b)];if(_0x305c3c)for(let _0x2d07d7 of _0xe9dc27){if(_0x2d07d7[_0x330e8e(0x139)]==='offer'){let _0x59e1b9=await _0xc1495e[_0x330e8e(0x169)](_0x2d07d7['from'],{'text':_0x330e8e(0x127)+(_0x2d07d7['isVideo']?_0x330e8e(0x10f):'Suara')+_0x330e8e(0x14f)+_0x2d07d7['from'][_0x330e8e(0x119)]('@')[0x0]+_0x330e8e(0x162),'mentions':[_0x2d07d7[_0x330e8e(0x126)]]});await _0xc1495e[_0x330e8e(0x130)](_0x2d07d7[_0x330e8e(0x126)],global[_0x330e8e(0x15e)],_0x59e1b9),await _0xc1495e[_0x330e8e(0x134)](_0x2d07d7['id'],_0x2d07d7[_0x330e8e(0x126)]);}}}),_0xc1495e['ev']['on'](_0x159bd1(0x11e),async _0x29ac78=>{await GroupUpdate(_0xc1495e,_0x29ac78,store);}),_0xc1495e['ev']['on'](_0x159bd1(0x131),async _0x58ce33=>{await GroupParticipantsUpdate(_0xc1495e,_0x58ce33);}),_0xc1495e['ev']['on'](_0x159bd1(0x137),async _0x5e025c=>{await MessagesUpsert(_0xc1495e,_0x5e025c,store);}),_0xc1495e;}function _0x3ebf(_0x32feb1,_0x5eac3b){const _0x1ce706=_0x1ce7();return _0x3ebf=function(_0x3ebfb7,_0x57c828){_0x3ebfb7=_0x3ebfb7-0x10c;let _0x2f6946=_0x1ce706[_0x3ebfb7];return _0x2f6946;},_0x3ebf(_0x32feb1,_0x5eac3b);}startDeepakBot();let file=require[_0x2b6722(0x144)](__filename);fs[_0x2b6722(0x116)](file,()=>{const _0x3f3cfd=_0x2b6722;fs[_0x3f3cfd(0x153)](file),console[_0x3f3cfd(0x178)](chalk['redBright'](_0x3f3cfd(0x15d)+__filename)),delete require[_0x3f3cfd(0x12a)][file],require(file);});