UNPKG

superchats

Version:

SuperChats is a premium library with unique features that control Whatsapp functions. With Superchats you can build service bots, multiservice chats or any system that uses whatsapp

1 lines 5.93 kB
'use strict';const a87_0x2189d3=a87_0x3a13;(function(_0x2bcbc9,_0x50a859){const _0x48f524=a87_0x3a13,_0x378ea6=_0x2bcbc9();while(!![]){try{const _0x4f8025=-parseInt(_0x48f524(0x155))/0x1*(parseInt(_0x48f524(0x16a))/0x2)+parseInt(_0x48f524(0x149))/0x3+-parseInt(_0x48f524(0x145))/0x4+-parseInt(_0x48f524(0x151))/0x5+parseInt(_0x48f524(0x150))/0x6+parseInt(_0x48f524(0x13a))/0x7*(parseInt(_0x48f524(0x16c))/0x8)+parseInt(_0x48f524(0x16b))/0x9*(-parseInt(_0x48f524(0x143))/0xa);if(_0x4f8025===_0x50a859)break;else _0x378ea6['push'](_0x378ea6['shift']());}catch(_0x51e13b){_0x378ea6['push'](_0x378ea6['shift']());}}}(a87_0x56c5,0xb7536));Object['defineProperty'](exports,a87_0x2189d3(0x13c),{'value':!![]}),exports[a87_0x2189d3(0x152)]=exports[a87_0x2189d3(0x14f)]=exports[a87_0x2189d3(0x139)]=exports['downloadHistory']=void 0x0;const util_1=require('util'),zlib_1=require(a87_0x2189d3(0x14b)),enc_1=require(a87_0x2189d3(0x15b)),Models_1=require(a87_0x2189d3(0x160)),Internal_1=require(a87_0x2189d3(0x169)),similary_1=require(a87_0x2189d3(0x15a)),msg_1=require(a87_0x2189d3(0x164)),mms_1=require('./mms'),inflatePromise=(0x0,util_1[a87_0x2189d3(0x156)])(zlib_1[a87_0x2189d3(0x154)]),downloadHistory=async(_0x2939c8,_0x13dffc)=>{const _0x3e3398=a87_0x2189d3,_0x5dfe54=await(0x0,mms_1[_0x3e3398(0x165)])(_0x2939c8,_0x3e3398(0x15d),{'options':_0x13dffc}),_0x308885=[];for await(const _0x4acd93 of _0x5dfe54){_0x308885[_0x3e3398(0x162)](_0x4acd93);}let _0x1aec17=Buffer[_0x3e3398(0x138)](_0x308885);_0x1aec17=await inflatePromise(_0x1aec17);const _0x27ff2a=enc_1[_0x3e3398(0x13e)]['HistorySync'][_0x3e3398(0x14c)](_0x1aec17);return _0x27ff2a;};exports['downloadHistory']=downloadHistory;const processHistoryMessage=(_0x141291,_0x3461ba)=>{const _0x7cb80b=a87_0x2189d3;var _0x473c5b,_0x5dc818,_0xe8872b;const _0x49bbe3=[],_0x5747e8=[],_0x5b860f=[];_0x3461ba[_0x7cb80b(0x13b)]('sync-progress',_0x141291[_0x7cb80b(0x161)]);switch(_0x141291[_0x7cb80b(0x171)]){case enc_1[_0x7cb80b(0x13e)][_0x7cb80b(0x16d)][_0x7cb80b(0x14e)][_0x7cb80b(0x16e)]:case enc_1[_0x7cb80b(0x13e)]['HistorySync']['HistorySyncType'][_0x7cb80b(0x157)]:case enc_1[_0x7cb80b(0x13e)][_0x7cb80b(0x16d)][_0x7cb80b(0x14e)][_0x7cb80b(0x158)]:for(const _0x4d60a0 of _0x141291['conversations']){_0x5747e8['push']({'id':_0x4d60a0['id'],'name':_0x4d60a0[_0x7cb80b(0x141)]||undefined});const _0x941e32=_0x4d60a0['messages']||[];delete _0x4d60a0['messages'],delete _0x4d60a0[_0x7cb80b(0x14d)],delete _0x4d60a0[_0x7cb80b(0x148)],delete _0x4d60a0['pinned'];for(const _0xface5 of _0x941e32){const _0x565e7d=_0xface5['message'];_0x49bbe3[_0x7cb80b(0x162)](_0x565e7d),!((_0x473c5b=_0x4d60a0[_0x7cb80b(0x163)])===null||_0x473c5b===void 0x0?void 0x0:_0x473c5b['length'])&&(_0x4d60a0[_0x7cb80b(0x163)]=[{'message':_0x565e7d}]),!_0x565e7d[_0x7cb80b(0x13f)][_0x7cb80b(0x147)]&&!_0x4d60a0['lastMessageRecvTimestamp']&&(_0x4d60a0[_0x7cb80b(0x14a)]=(0x0,similary_1[_0x7cb80b(0x167)])(_0x565e7d[_0x7cb80b(0x15f)])),(_0x565e7d[_0x7cb80b(0x168)]===Models_1[_0x7cb80b(0x13d)][_0x7cb80b(0x166)]||_0x565e7d[_0x7cb80b(0x168)]===Models_1[_0x7cb80b(0x13d)]['BIZ_PRIVACY_MODE_TO_FB'])&&((_0x5dc818=_0x565e7d[_0x7cb80b(0x140)])===null||_0x5dc818===void 0x0?void 0x0:_0x5dc818[0x0])&&_0x5747e8[_0x7cb80b(0x162)]({'id':_0x565e7d[_0x7cb80b(0x13f)][_0x7cb80b(0x144)]||_0x565e7d[_0x7cb80b(0x13f)][_0x7cb80b(0x146)],'verifiedName':(_0xe8872b=_0x565e7d['messageStubParameters'])===null||_0xe8872b===void 0x0?void 0x0:_0xe8872b[0x0]});}(0x0,Internal_1[_0x7cb80b(0x16f)])(_0x4d60a0['id'])&&_0x4d60a0[_0x7cb80b(0x142)]&&_0x4d60a0['archived']&&delete _0x4d60a0[_0x7cb80b(0x142)],_0x5b860f[_0x7cb80b(0x162)]({..._0x4d60a0});}break;case enc_1[_0x7cb80b(0x13e)][_0x7cb80b(0x16d)][_0x7cb80b(0x14e)][_0x7cb80b(0x15c)]:for(const _0x238cc6 of _0x141291[_0x7cb80b(0x159)]){_0x5747e8[_0x7cb80b(0x162)]({'id':_0x238cc6['id'],'notify':_0x238cc6['pushname'],'verifiedName':_0x238cc6[_0x7cb80b(0x141)]});}break;}return{'chats':_0x5b860f,'contacts':_0x5747e8,'messages':_0x49bbe3};};exports[a87_0x2189d3(0x139)]=processHistoryMessage;const downloadAndProcessHistorySyncNotification=async(_0x275c06,_0x5c6a19,_0x13da0a)=>{const _0x503eb0=a87_0x2189d3,_0x2eacdb=await(0x0,exports[_0x503eb0(0x153)])(_0x275c06,_0x5c6a19);return(0x0,exports[_0x503eb0(0x139)])(_0x2eacdb,_0x13da0a);};exports[a87_0x2189d3(0x14f)]=downloadAndProcessHistorySyncNotification;const getHistoryMsg=_0x2ab9cf=>{const _0x2b45b6=a87_0x2189d3;var _0xf08647;const _0x3b6275=!!_0x2ab9cf?(0x0,msg_1['normalizeMessageContent'])(_0x2ab9cf):undefined,_0xd6b9ce=(_0xf08647=_0x3b6275===null||_0x3b6275===void 0x0?void 0x0:_0x3b6275[_0x2b45b6(0x15e)])===null||_0xf08647===void 0x0?void 0x0:_0xf08647[_0x2b45b6(0x170)];return _0xd6b9ce;};function a87_0x56c5(){const _0x33fe13=['pushnames','../crypto/similary','../../Connection/enc','PUSH_NAME','md-msg-hist','protocolMessage','messageTimestamp','../../Models','progress','push','messages','./msg','downloadContentFromMessage','BIZ_PRIVACY_MODE_TO_BSP','toNumber','messageStubType','../../Internal','128ZRvhDf','26955aLHDUU','11279456tJFugq','HistorySync','INITIAL_BOOTSTRAP','isJidUser','historySyncNotification','syncType','concat','processHistoryMessage','7wBLleR','emit','__esModule','WAMessageStubType','proto','key','messageStubParameters','name','readOnly','1170QMwhUI','participant','4993180oNeMbJ','remoteJid','fromMe','muteEndTime','2331732cqCreq','lastMessageRecvTimestamp','zlib','decode','archived','HistorySyncType','downloadAndProcessHistorySyncNotification','7153320RraMdU','2275960hQOsHI','getHistoryMsg','downloadHistory','inflate','8978DBZyzG','promisify','RECENT','FULL'];a87_0x56c5=function(){return _0x33fe13;};return a87_0x56c5();}function a87_0x3a13(_0x2517e0,_0x17d8b1){const _0x56c533=a87_0x56c5();return a87_0x3a13=function(_0x3a1333,_0x4e8310){_0x3a1333=_0x3a1333-0x138;let _0x47d0e2=_0x56c533[_0x3a1333];return _0x47d0e2;},a87_0x3a13(_0x2517e0,_0x17d8b1);}exports[a87_0x2189d3(0x152)]=getHistoryMsg;