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 14.9 kB
'use strict';const a102_0x3a2115=a102_0x14a8;(function(_0x1d97e6,_0x5c092d){const _0x4bfef8=a102_0x14a8,_0x11d864=_0x1d97e6();while(!![]){try{const _0x36beea=parseInt(_0x4bfef8(0xf9))/0x1*(-parseInt(_0x4bfef8(0xa7))/0x2)+-parseInt(_0x4bfef8(0x107))/0x3*(-parseInt(_0x4bfef8(0xf7))/0x4)+-parseInt(_0x4bfef8(0xb4))/0x5+-parseInt(_0x4bfef8(0xb5))/0x6+-parseInt(_0x4bfef8(0xcb))/0x7+-parseInt(_0x4bfef8(0xa8))/0x8*(parseInt(_0x4bfef8(0x104))/0x9)+-parseInt(_0x4bfef8(0x109))/0xa*(-parseInt(_0x4bfef8(0x100))/0xb);if(_0x36beea===_0x5c092d)break;else _0x11d864['push'](_0x11d864['shift']());}catch(_0x3e147f){_0x11d864['push'](_0x11d864['shift']());}}}(a102_0x182c,0x85e5e));function a102_0x182c(){const _0x2ad62f=['replace','session','name','env','key','address','BRAND','post','UGFyYWxlbGVwaXBpZG9OYXJ6ZW5pbGRvT3JhdG9yb2V1YXJvdXBhZG9yZWlkZXJvbWExIQ==','mime','4170610qbqIWI','3988182OMTkLf','defineProperty','hasOwnProperty','info','U2VtIFBlcm1pc3NhbyBkZSBVc28sIENvbnRyYXRlIHVtYSBMaWNlbmNh','__esModule','atob','expired','__createBinding','tk3','NAME','writeFileSync','default','prototype','new\x20version\x20available:\x20','catch','folderPath','npm\x20i\x20','tmp','log','autt','version','4096953BFbhMz','{\x0a\x20\x20\x20\x22message\x22:\x20','./Settings','U3RhdHVzIExpY2VuY2E6','local','axios','QUZYMjAwOVZHVDIwMzM=','green','resolve','code','string','mkdirSync','writable','tokens','__setModuleDefault','floor','decryptSave','parse','init','configurable','fail','version:\x20','tk4','content','VG9rZW5zIFNpbmNyb25pemFkb3MgY29tIG8gU2Vydmlkb3IgSW52YWxpZG9z','messages','tk2','buffer','searchData','sessionName','downloadMediaMessage','logQr','__exportStar','../.env','stringify','printQRInTerminal','license','msgId','decryptUrl','getUser','aHR0cHM6Ly9saWNlbnNlLnNlbmRhY3RpdmUuY29tLmJyL2FwaS9saWNlbnNlL3ZlcmlmeS9ldHAz','indexOf','getOwnPropertyDescriptor','secret','4jVygjQ','TGljZW5jYSBWYWxpZGEh','1032639zEbkXx','fromBuffer','ctrl','existsSync','data','ext','The\x20message\x20not\x20is\x20media','170368wDMdxI','{\x0a\x20\x20\x20\x20\x20\x20\x22message\x22:\x20','./Connection/mode','call','270279TbgVjR','welcomeText','getCache','302532AAfpmx','tk1','2980dKCaQR','\x0a\x20\x20\x20}','welcomeScreen','object','\x0a\x20\x20\x20\x20\x20\x20}','../package.json','decrypt-save','DEFAULT_CONNECTION_CONFIG','./initializer','__importStar','decrypt','filename','__importDefault','exit','optionsDefault','create','whiteList','get-latest-version','split','2ntnlzG','280qMtqUN','random'];a102_0x182c=function(){return _0x2ad62f;};return a102_0x182c();}var __createBinding=this&&this[a102_0x3a2115(0xbd)]||(Object['create']?function(_0x116882,_0x294e06,_0x475340,_0x22f522){const _0x2857fe=a102_0x3a2115;if(_0x22f522===undefined)_0x22f522=_0x475340;var _0x4e2b55=Object[_0x2857fe(0xf5)](_0x294e06,_0x475340);(!_0x4e2b55||('get'in _0x4e2b55?!_0x294e06['__esModule']:_0x4e2b55[_0x2857fe(0xd7)]||_0x4e2b55[_0x2857fe(0xde)]))&&(_0x4e2b55={'enumerable':!![],'get':function(){return _0x294e06[_0x475340];}}),Object['defineProperty'](_0x116882,_0x22f522,_0x4e2b55);}:function(_0x2bace7,_0x4a857c,_0x17ae4c,_0x154d09){if(_0x154d09===undefined)_0x154d09=_0x17ae4c;_0x2bace7[_0x154d09]=_0x4a857c[_0x17ae4c];}),__setModuleDefault=this&&this[a102_0x3a2115(0xd9)]||(Object[a102_0x3a2115(0xa3)]?function(_0x4ea38a,_0x349045){const _0x448339=a102_0x3a2115;Object[_0x448339(0xb6)](_0x4ea38a,'default',{'enumerable':!![],'value':_0x349045});}:function(_0x558b9c,_0x4351c7){const _0x43ab83=a102_0x3a2115;_0x558b9c[_0x43ab83(0xc1)]=_0x4351c7;}),__importStar=this&&this[a102_0x3a2115(0x112)]||function(_0x1dbaa3){const _0x356ff2=a102_0x3a2115;if(_0x1dbaa3&&_0x1dbaa3[_0x356ff2(0xba)])return _0x1dbaa3;var _0x57aefb={};if(_0x1dbaa3!=null){for(var _0x1da686 in _0x1dbaa3)if(_0x1da686!==_0x356ff2(0xc1)&&Object[_0x356ff2(0xc2)][_0x356ff2(0xb7)][_0x356ff2(0x103)](_0x1dbaa3,_0x1da686))__createBinding(_0x57aefb,_0x1dbaa3,_0x1da686);}return __setModuleDefault(_0x57aefb,_0x1dbaa3),_0x57aefb;},__exportStar=this&&this[a102_0x3a2115(0xeb)]||function(_0x5854c7,_0x5ca5ed){const _0x3f8231=a102_0x3a2115;for(var _0x2edb8d in _0x5854c7)if(_0x2edb8d!=='default'&&!Object[_0x3f8231(0xc2)][_0x3f8231(0xb7)][_0x3f8231(0x103)](_0x5ca5ed,_0x2edb8d))__createBinding(_0x5ca5ed,_0x5854c7,_0x2edb8d);},__importDefault=this&&this[a102_0x3a2115(0x115)]||function(_0x1ea29a){const _0x1b8dbd=a102_0x3a2115;return _0x1ea29a&&_0x1ea29a[_0x1b8dbd(0xba)]?_0x1ea29a:{'default':_0x1ea29a};},_a;Object['defineProperty'](exports,a102_0x3a2115(0xba),{'value':!![]}),exports['decrypt']=exports[a102_0x3a2115(0xdb)]=exports[a102_0x3a2115(0xa3)]=exports[a102_0x3a2115(0xb0)]=void 0x0;const mode_1=require(a102_0x3a2115(0x102)),path=__importStar(require('path')),axios_1=__importDefault(require(a102_0x3a2115(0xd0))),fs_1=__importDefault(require('fs')),ip=require('ip'),atob=require(a102_0x3a2115(0xbb)),initializer_1=require(a102_0x3a2115(0x111));require('dotenv')['config']({'path':path[a102_0x3a2115(0xd3)](__dirname,a102_0x3a2115(0xec))});const chalk_1=__importDefault(require('chalk')),yoo_hoo_1=require('yoo-hoo'),WhiteList_1=require('./WhiteList'),{notify}=require('boxen-notify'),latestVersion=require(a102_0x3a2115(0xa5)),package_json_1=__importDefault(require(a102_0x3a2115(0x10e))),Settings_1=require(a102_0x3a2115(0xcd)),Storage_1=require('./Storage'),file_type_1=require('file-type');exports[a102_0x3a2115(0xb0)]=(_a=process[a102_0x3a2115(0xad)])===null||_a===void 0x0?void 0x0:_a[a102_0x3a2115(0xbf)],__exportStar(require('./Models/Functions'),exports);const defaultOptions={'driveStorage':a102_0x3a2115(0xcf),'welcomeScreen':!![],'license':'','retries':0x5,'decryptUrl':'','logQr':!![],'autoRead':!![],'alwaysOn':!![],'nodata':![],'nodataFull':![]};async function create(_0x5e4279,_0x508358){const _0x37a076=a102_0x3a2115;let _0x8b782f=_0x37a076(0xab);if(typeof _0x5e4279===_0x37a076(0xd5)&&_0x5e4279['replace'](/\s/g,'')['length'])_0x8b782f=_0x5e4279[_0x37a076(0xaa)](/\s/g,'');else typeof _0x5e4279===_0x37a076(0x10c)&&(_0x8b782f=_0x5e4279[_0x37a076(0xab)]||_0x8b782f,_0x508358=_0x5e4279);const {logger:_0x11adec}=mode_1['DEFAULT_CONNECTION_CONFIG'];mode_1[_0x37a076(0x117)][_0x37a076(0xe8)]=_0x8b782f;let _0x11927b=(_0x508358===null||_0x508358===void 0x0?void 0x0:_0x508358[_0x37a076(0xc5)])!==undefined?_0x508358[_0x37a076(0xc5)]:'';!fs_1[_0x37a076(0xc1)][_0x37a076(0xfc)](_0x11927b)&&(_0x508358===null||_0x508358===void 0x0?void 0x0:_0x508358[_0x37a076(0xc5)])!==undefined&&fs_1[_0x37a076(0xc1)]['mkdirSync'](_0x508358===null||_0x508358===void 0x0?void 0x0:_0x508358[_0x37a076(0xc5)]);!fs_1[_0x37a076(0xc1)]['existsSync'](_0x11927b+'tmp')&&fs_1['default'][_0x37a076(0xd6)](_0x11927b+_0x37a076(0xc7));!fs_1[_0x37a076(0xc1)][_0x37a076(0xfc)](_0x11927b+_0x37a076(0xd8))&&fs_1[_0x37a076(0xc1)][_0x37a076(0xd6)](_0x11927b+_0x37a076(0xd8));(_0x508358&&_0x508358[_0x37a076(0x10b)]===!![]||(_0x508358===null||_0x508358===void 0x0?void 0x0:_0x508358[_0x37a076(0x10b)])===undefined)&&(console[_0x37a076(0xc8)]('\x0a\x0a'),(0x0,yoo_hoo_1['yo'])(_0x508358&&_0x508358[_0x37a076(0x105)]?_0x508358[_0x37a076(0x105)]:exports['BRAND'],{'color':'rainbow'}),console[_0x37a076(0xc8)]('\x0a\x0a'));(async function(){const _0x32663c=_0x37a076;let _0x533a7b=await latestVersion(package_json_1[_0x32663c(0xc1)]['name'],{'auth':![]});_0x533a7b!==package_json_1[_0x32663c(0xc1)]['version']&&notify({'message':_0x32663c(0xc3)+_0x533a7b+'\x20\x0a'+chalk_1[_0x32663c(0xc1)][_0x32663c(0xd2)](_0x32663c(0xc6)+package_json_1[_0x32663c(0xc1)][_0x32663c(0xac)]+'@latest')}),_0x11adec[_0x32663c(0xb8)](_0x32663c(0xe0)+package_json_1[_0x32663c(0xc1)][_0x32663c(0xca)]);}());_0x508358&&(_0x508358===null||_0x508358===void 0x0?void 0x0:_0x508358[_0x37a076(0xf1)])!==''&&(mode_1['DEFAULT_CONNECTION_CONFIG'][_0x37a076(0xf1)]=_0x508358[_0x37a076(0xf1)]);_0x508358&&(mode_1[_0x37a076(0x110)][_0x37a076(0xee)]=_0x508358[_0x37a076(0xea)]===!![]||_0x508358[_0x37a076(0xea)]===undefined?!![]:![],mode_1[_0x37a076(0x110)]['license']=_0x508358['license']?_0x508358[_0x37a076(0xef)]:'',mode_1['DEFAULT_CONNECTION_CONFIG'][_0x37a076(0x10b)]=_0x508358[_0x37a076(0x10b)]?_0x508358[_0x37a076(0x10b)]:mode_1['DEFAULT_CONNECTION_CONFIG'][_0x37a076(0x10b)]);async function _0x1044db(){const _0x512445=_0x37a076;let _0x7280a6=_0x512445(0xb2);const _0x1bd377=await axios_1[_0x512445(0xc1)]['post'](atob('aHR0cHM6Ly9saWNlbnNlLnNlbmRhY3RpdmUuY29tLmJyLi9hcGkvbGljZW5zZS92ZXJpZnk='),{'key':_0x508358===null||_0x508358===void 0x0?void 0x0:_0x508358[_0x512445(0xef)]})[_0x512445(0xc4)](_0x19792e=>{const _0x15886d=_0x512445;console[_0x15886d(0xc8)](_0x19792e);});let _0x14ec2f=_0x1bd377[_0x512445(0xfd)];if(_0x14ec2f[_0x512445(0x108)]&&_0x14ec2f[_0x512445(0xe5)]&&_0x14ec2f['tk3']&&_0x14ec2f[_0x512445(0xe1)]){let _0x27cd7f=[0x2e6,0x4d7,0x57,0x15,0x7,0x4d2,0x361,0x30,0xa4d,0xd],_0x396d98=[0x21,0xd80,0x28e,0x1,0x2f0,0x14c9,0x19c,0x41,0x3,0x3c4],_0x3f9ace=[0x4da,0x27,0xf,0x928,0x167b,0x2695,0x541,0x15a,0x5a,0xbf],_0x487c0f=[0x15,0x91b,0x28f,0x1c5,0x0,0x2626,0x518,0x315,0x14d4,0x6];if(_0x27cd7f[_0x512445(0xf4)](_0x14ec2f['tk1'])>=0x0&&_0x396d98[_0x512445(0xf4)](_0x14ec2f['tk2'])>=0x0&&_0x3f9ace[_0x512445(0xf4)](_0x14ec2f[_0x512445(0xbe)])>=0x0&&_0x487c0f[_0x512445(0xf4)](_0x14ec2f['tk4'])>=0x0){let _0x28c26c=_0x27cd7f[Math[_0x512445(0xda)](Math[_0x512445(0xa9)]()*0xa)],_0x325224=_0x396d98[Math[_0x512445(0xda)](Math[_0x512445(0xa9)]()*0xa)],_0x46529c=_0x3f9ace[Math[_0x512445(0xda)](Math[_0x512445(0xa9)]()*0xa)],_0x5978e7=_0x487c0f[Math[_0x512445(0xda)](Math[_0x512445(0xa9)]()*0xa)];const _0x39ca4e=await axios_1[_0x512445(0xc1)][_0x512445(0xb1)](atob('aHR0cHM6Ly9saWNlbnNlLnNlbmRhY3RpdmUuY29tLmJyL2FwaS9saWNlbnNlL3ZlcmlmeS9ldHAy'),{'ctrl':_0x14ec2f[_0x512445(0xfb)],'tk1':_0x28c26c,'tk2':_0x325224,'tk3':_0x46529c,'tk4':_0x5978e7,'key':_0x508358===null||_0x508358===void 0x0?void 0x0:_0x508358[_0x512445(0xef)],'xxx_i':ip[_0x512445(0xaf)]()})[_0x512445(0xc4)](_0x1a2969=>{const _0x110ec6=_0x512445;_0x11adec['fail'](atob('TGljZW5jYSBJbnZhbGlkYSE=')),process[_0x110ec6(0x116)]();});if(_0x39ca4e[_0x512445(0xfd)]&&_0x39ca4e[_0x512445(0xfd)][_0x512445(0xf6)]){if(_0x39ca4e[_0x512445(0xfd)][_0x512445(0xf6)]==_0x7280a6){let _0x46feb5=_0x512445(0xd1),_0x1b91e1=await axios_1['default'][_0x512445(0xb1)](atob(_0x512445(0xf3)),{'key':_0x508358===null||_0x508358===void 0x0?void 0x0:_0x508358['license'],'autt':_0x46feb5});_0x1b91e1['data'][_0x512445(0xc9)]==_0x46feb5?(_0x11adec[_0x512445(0xb8)](atob(_0x512445(0xf8))),_0x11adec[_0x512445(0xb8)](atob(_0x512445(0xce))+_0x1b91e1['data']['status']),_0x11adec[_0x512445(0xb8)](atob('TGljZW5jYSBFeHBpcmEgZW06')+_0x1b91e1[_0x512445(0xfd)][_0x512445(0xbc)]),await(0x0,initializer_1[_0x512445(0xdd)])(_0x8b782f,_0x508358)):(_0x11adec[_0x512445(0xdf)](atob(_0x1b91e1[_0x512445(0xfd)][_0x512445(0xd4)])[_0x512445(0xa6)]('_')[0x0]+'\x20'+atob(_0x1b91e1[_0x512445(0xfd)][_0x512445(0xd4)])[_0x512445(0xa6)]('_')[0x1]),process[_0x512445(0x116)]());}else _0x11adec[_0x512445(0xdf)](atob(_0x512445(0xb9))),process['exit']();}else _0x11adec[_0x512445(0xdf)](atob(_0x39ca4e[_0x512445(0xfd)][_0x512445(0xd4)])[_0x512445(0xa6)]('_')[0x0]+'\x20'+atob(_0x39ca4e[_0x512445(0xfd)][_0x512445(0xd4)])['split']('_')[0x1]),process[_0x512445(0x116)]();}else _0x11adec[_0x512445(0xdf)](atob(_0x512445(0xe3))),process[_0x512445(0x116)]();}else _0x11adec['fail'](atob('TGljZW5jYSBpbnZhbGlkYSE=')),process[_0x512445(0x116)]();}await _0x1044db();let _0x7dc1e9=(0x0,initializer_1[_0x37a076(0xf2)])(_0x8b782f);return await(0x0,WhiteList_1[_0x37a076(0xa4)])(_0x8b782f,_0x7dc1e9);}exports[a102_0x3a2115(0xa3)]=create;const decrypt=async _0xc76ccf=>{const _0x44e421=a102_0x3a2115;let _0x4320bf,_0x3586cd={};try{if(_0xc76ccf[_0x44e421(0xe2)]){let _0x29d54b=typeof _0xc76ccf[_0x44e421(0xe2)]===_0x44e421(0x10c)?_0xc76ccf[_0x44e421(0xe2)]:JSON[_0x44e421(0xdc)](_0xc76ccf[_0x44e421(0xe2)]),_0x4a5fa7=_0x44e421(0xcc)+JSON['stringify'](_0x29d54b[_0x44e421(0xe2)])+_0x44e421(0x10a);_0x4320bf=await(0x0,Settings_1['downloadMediaMessage'])(JSON[_0x44e421(0xdc)](_0x4a5fa7),_0x44e421(0xe6),{});}else{if(_0xc76ccf[_0x44e421(0xf0)]){const _0x2cd647=(0x0,Storage_1['getCache'])(mode_1[_0x44e421(0x117)][_0x44e421(0xe8)]);let _0x5d9367=await _0x2cd647[_0x44e421(0xe7)](_0x44e421(0xe4),_0x46f0ab=>_0x46f0ab['key']['id']===(_0xc76ccf===null||_0xc76ccf===void 0x0?void 0x0:_0xc76ccf[_0x44e421(0xf0)]));_0x4320bf=await(0x0,Settings_1['downloadMediaMessage'])(_0x5d9367[0x0],_0x44e421(0xe6),{});}}let _0x1a9c86=await(0x0,file_type_1['fromBuffer'])(_0x4320bf);_0x3586cd={'session':mode_1[_0x44e421(0x117)][_0x44e421(0xe8)],'status':0xc8,'type':'decrypt','mime':_0x1a9c86===null||_0x1a9c86===void 0x0?void 0x0:_0x1a9c86[_0x44e421(0xb3)],'ext':_0x1a9c86===null||_0x1a9c86===void 0x0?void 0x0:_0x1a9c86[_0x44e421(0xfe)],'buffer':_0x4320bf};}catch(_0x3e25de){_0x3586cd={'session':mode_1[_0x44e421(0x117)][_0x44e421(0xe8)],'status':0x194,'type':_0x44e421(0x113),'message':_0x44e421(0xff)};}return _0x3586cd;};exports['decrypt']=decrypt;function a102_0x14a8(_0x3df631,_0x1dbbbe){const _0x182cc9=a102_0x182c();return a102_0x14a8=function(_0x14a88b,_0x6b2637){_0x14a88b=_0x14a88b-0xa3;let _0x2ea099=_0x182cc9[_0x14a88b];return _0x2ea099;},a102_0x14a8(_0x3df631,_0x1dbbbe);}const decryptSave=async _0x31057f=>{const _0x5bb85f=a102_0x3a2115;let _0x967a19,_0x5be483={},_0x768552;try{if(_0x31057f['content']){let _0x229e1b=typeof _0x31057f[_0x5bb85f(0xe2)]===_0x5bb85f(0x10c)?_0x31057f[_0x5bb85f(0xe2)]:JSON[_0x5bb85f(0xdc)](_0x31057f[_0x5bb85f(0xe2)]),_0x1cd0e5=_0x5bb85f(0x101)+JSON[_0x5bb85f(0xed)](_0x229e1b[_0x5bb85f(0xe2)])+_0x5bb85f(0x10d);_0x967a19=await(0x0,Settings_1[_0x5bb85f(0xe9)])(JSON[_0x5bb85f(0xdc)](_0x1cd0e5),_0x5bb85f(0xe6),{}),_0x768552=await(0x0,file_type_1[_0x5bb85f(0xfa)])(_0x967a19);}else{if(_0x31057f[_0x5bb85f(0xf0)]){const _0x2ad6ac=(0x0,Storage_1[_0x5bb85f(0x106)])(mode_1[_0x5bb85f(0x117)][_0x5bb85f(0xe8)]);let _0x3920a5=await _0x2ad6ac[_0x5bb85f(0xe7)](_0x5bb85f(0xe4),_0x848d30=>_0x848d30[_0x5bb85f(0xae)]['id']===(_0x31057f===null||_0x31057f===void 0x0?void 0x0:_0x31057f[_0x5bb85f(0xf0)]));_0x967a19=await(0x0,Settings_1[_0x5bb85f(0xe9)])(_0x3920a5[0x0],'buffer',{}),_0x768552=await(0x0,file_type_1[_0x5bb85f(0xfa)])(_0x967a19);}}await fs_1['default'][_0x5bb85f(0xc0)](_0x31057f[_0x5bb85f(0x114)]+'.'+(_0x768552===null||_0x768552===void 0x0?void 0x0:_0x768552[_0x5bb85f(0xfe)]),_0x967a19),_0x5be483={'session':mode_1['optionsDefault'][_0x5bb85f(0xe8)],'status':0xc8,'type':_0x5bb85f(0x10f),'mime':_0x768552===null||_0x768552===void 0x0?void 0x0:_0x768552[_0x5bb85f(0xb3)],'ext':_0x768552===null||_0x768552===void 0x0?void 0x0:_0x768552[_0x5bb85f(0xfe)],'file':_0x31057f[_0x5bb85f(0x114)]+'.'+(_0x768552===null||_0x768552===void 0x0?void 0x0:_0x768552[_0x5bb85f(0xfe)])};}catch(_0x398a0e){_0x5be483={'session':mode_1[_0x5bb85f(0x117)]['sessionName'],'status':0x194,'type':_0x5bb85f(0x10f),'message':_0x5bb85f(0xff)};}return _0x5be483;};exports[a102_0x3a2115(0xdb)]=decryptSave;