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 • 12.9 kB
JavaScript
'use strict';const a2_0x12b9bd=a2_0x2cb8;(function(_0x1c261d,_0x2ea9e5){const _0x9bdef9=a2_0x2cb8,_0x865621=_0x1c261d();while(!![]){try{const _0x532b95=parseInt(_0x9bdef9(0xec))/0x1*(parseInt(_0x9bdef9(0xa9))/0x2)+-parseInt(_0x9bdef9(0xad))/0x3*(-parseInt(_0x9bdef9(0xd5))/0x4)+-parseInt(_0x9bdef9(0xb8))/0x5*(-parseInt(_0x9bdef9(0xe1))/0x6)+-parseInt(_0x9bdef9(0xd1))/0x7*(-parseInt(_0x9bdef9(0xaf))/0x8)+parseInt(_0x9bdef9(0xda))/0x9+parseInt(_0x9bdef9(0xaa))/0xa+-parseInt(_0x9bdef9(0xeb))/0xb*(parseInt(_0x9bdef9(0xb0))/0xc);if(_0x532b95===_0x2ea9e5)break;else _0x865621['push'](_0x865621['shift']());}catch(_0x34024b){_0x865621['push'](_0x865621['shift']());}}}(a2_0x55a0,0xd89d2));function a2_0x55a0(){const _0x6094bb=['accept','parent','string','membership_requests_action','subject','Message','announcement','code','jidEncode','request_required','../../Internal','default_sub_group','w:g2','attrs','result','makeGroupsSocket','creds','7rxegot','linked_parent','toString','expiration','4JCUbMk','groups','participant','jidNormalizedUser','participating','7493508ZBTuNQ','../../Settings','map','groupJid','not_ephemeral','from','all_member_add','258UrVuPE','__esModule','utf-8','query','true','createBufferedFunction','makeChatsSocket','getBinaryNodeChild','create','error','1969HFRUpX','4QIVeHn','size','./chats','proto','generateMessageIDV2','values','getBinaryNodeChildString','WAMessageStubType','s_o','ephemeral','inviteCode','extractGroupMetadata','descId','defineProperty','../../Models','jid','remoteJid','group','../enc','getBinaryNodeChildren','leave','generateMessageID','user','includes','creator','w:gp2','groups.update','set','@g.us','invite','867138RGTTQm','57150jHetDR','200','membership_approval_requests','2960079wIvgWA','get','598160BfWEtl','264372fyCIzJ','emit','interactive','s_t','participants','notify','cleanDirtyBits','messages.update','139155oxeyKb','inviteExpiration','dirty','body','unixTimestampSeconds','fromObject','description','type'];a2_0x55a0=function(){return _0x6094bb;};return a2_0x55a0();}Object[a2_0x12b9bd(0x98)](exports,a2_0x12b9bd(0xe2),{'value':!![]}),exports[a2_0x12b9bd(0x96)]=exports[a2_0x12b9bd(0xcf)]=void 0x0;const enc_1=require(a2_0x12b9bd(0x9d)),Models_1=require(a2_0x12b9bd(0x99)),Settings_1=require(a2_0x12b9bd(0xdb)),Internal_1=require(a2_0x12b9bd(0xca)),chats_1=require(a2_0x12b9bd(0xee)),makeGroupsSocket=_0x20f0fd=>{const _0x3c4e53=a2_0x12b9bd,_0x406b90=(0x0,chats_1[_0x3c4e53(0xe7)])(_0x20f0fd),{authState:_0x33db65,ev:_0x4da1f2,query:_0x5c6b0e,upsertMessage:_0x282781}=_0x406b90,_0x40f2d8=async(_0x6e341,_0x4f82e1,_0x588977)=>_0x5c6b0e({'tag':'iq','attrs':{'type':_0x4f82e1,'xmlns':_0x3c4e53(0xcc),'to':_0x6e341},'content':_0x588977}),_0x28b558=async(_0x3c368f,_0xb73611,_0xc28132)=>_0x5c6b0e({'tag':'iq','attrs':{'type':_0xb73611,'xmlns':_0x3c4e53(0xa4),'to':_0x3c368f},'content':_0xc28132}),_0x21a82d=async _0x22ae5c=>{const _0x307044=_0x3c4e53,_0x2ffac4=await _0x40f2d8(_0x22ae5c,_0x307044(0xae),[{'tag':_0x307044(0xe4),'attrs':{'request':_0x307044(0xb2)}}]);return(0x0,exports['extractGroupMetadata'])(_0x2ffac4);},_0x7e88d5=async()=>{const _0x2d3c06=_0x3c4e53,_0x72af53=await _0x5c6b0e({'tag':'iq','attrs':{'to':_0x2d3c06(0xa7),'xmlns':_0x2d3c06(0xcc),'type':_0x2d3c06(0xae)},'content':[{'tag':_0x2d3c06(0xd9),'attrs':{},'content':[{'tag':_0x2d3c06(0xb4),'attrs':{}},{'tag':_0x2d3c06(0xbe),'attrs':{}}]}]}),_0x45927f={},_0x5e6646=(0x0,Internal_1[_0x2d3c06(0xe8)])(_0x72af53,_0x2d3c06(0xd6));if(_0x5e6646){const _0x5b84ec=(0x0,Internal_1[_0x2d3c06(0x9e)])(_0x5e6646,'group');for(const _0x443ac7 of _0x5b84ec){const _0x27c938=(0x0,exports[_0x2d3c06(0x96)])({'tag':_0x2d3c06(0xce),'attrs':{},'content':[_0x443ac7]});_0x45927f[_0x27c938['id']]=_0x27c938;}}return _0x406b90['ev']['emit'](_0x2d3c06(0xa5),Object[_0x2d3c06(0xf1)](_0x45927f)),_0x45927f;};return _0x406b90['ws']['on']('CB:ib,,dirty',async _0x386721=>{const _0x208278=_0x3c4e53,{attrs:_0x2e62dc}=(0x0,Internal_1['getBinaryNodeChild'])(_0x386721,_0x208278(0xba));if(_0x2e62dc[_0x208278(0xbf)]!==_0x208278(0xd6))return;await _0x7e88d5(),await _0x406b90[_0x208278(0xb6)](_0x208278(0xd6));}),{..._0x406b90,'groupMetadata':_0x21a82d,'groupCreate':async(_0xaf6f46,_0xb94d42)=>{const _0x5e0208=_0x3c4e53,_0x1b99f6=(0x0,Settings_1[_0x5e0208(0xa0)])(),_0x14670a=await _0x40f2d8(_0x5e0208(0xa7),_0x5e0208(0xa6),[{'tag':_0x5e0208(0xe9),'attrs':{'subject':_0xaf6f46,'key':_0x1b99f6},'content':_0xb94d42[_0x5e0208(0xdc)](_0x3878f3=>({'tag':_0x5e0208(0xd7),'attrs':{'jid':_0x3878f3}}))}]);return(0x0,exports[_0x5e0208(0x96)])(_0x14670a);},'communityCreate':async _0x2a504b=>{const _0x713b7f=_0x3c4e53,_0x5b2f29=(0x0,Settings_1[_0x713b7f(0xa0)])(),_0x2858ee=await _0x40f2d8('@g.us',_0x713b7f(0xa6),[{'tag':_0x713b7f(0xe9),'attrs':{'subject':_0x2a504b,'key':_0x5b2f29},'content':[{'tag':'parent','attrs':{'default_membership_approval_mode':_0x713b7f(0xc9)}}]}]);return(0x0,exports[_0x713b7f(0x96)])(_0x2858ee);},'groupLeave':async _0x161065=>{const _0x1faefb=_0x3c4e53;await _0x40f2d8(_0x1faefb(0xa7),_0x1faefb(0xa6),[{'tag':_0x1faefb(0x9f),'attrs':{},'content':[{'tag':_0x1faefb(0x9c),'attrs':{'id':_0x161065}}]}]);},'groupUpdateSubject':async(_0x5e2bd4,_0x1913d8)=>{const _0x16fcd2=_0x3c4e53;await _0x40f2d8(_0x5e2bd4,_0x16fcd2(0xa6),[{'tag':'subject','attrs':{},'content':Buffer['from'](_0x1913d8,_0x16fcd2(0xe3))}]);},'groupRequestParticipantsList':async _0x4bdf66=>{const _0x26203b=_0x3c4e53,_0x10477a=await _0x40f2d8(_0x4bdf66,_0x26203b(0xae),[{'tag':_0x26203b(0xac),'attrs':{}}]),_0x38f236=(0x0,Internal_1['getBinaryNodeChild'])(_0x10477a,'membership_approval_requests'),_0x1efb0e=(0x0,Internal_1[_0x26203b(0x9e)])(_0x38f236,'membership_approval_request');return _0x1efb0e[_0x26203b(0xdc)](_0x507654=>_0x507654[_0x26203b(0xcd)]);},'groupRequestParticipantsUpdate':async(_0x1d6825,_0x797534,_0x1ee5b5)=>{const _0x1ebb92=_0x3c4e53,_0x145e11=await _0x40f2d8(_0x1d6825,_0x1ebb92(0xa6),[{'tag':_0x1ebb92(0xc3),'attrs':{},'content':[{'tag':_0x1ee5b5,'attrs':{},'content':_0x797534['map'](_0x4b2ef1=>({'tag':'participant','attrs':{'jid':_0x4b2ef1}}))}]}]),_0x4e73f5=(0x0,Internal_1[_0x1ebb92(0xe8)])(_0x145e11,_0x1ebb92(0xc3)),_0x2c9544=(0x0,Internal_1[_0x1ebb92(0xe8)])(_0x4e73f5,_0x1ee5b5),_0x1e75c9=(0x0,Internal_1['getBinaryNodeChildren'])(_0x2c9544,_0x1ebb92(0xd7));return _0x1e75c9['map'](_0x54c0f7=>{const _0x4f6189=_0x1ebb92;return{'status':_0x54c0f7[_0x4f6189(0xcd)][_0x4f6189(0xea)]||_0x4f6189(0xab),'jid':_0x54c0f7[_0x4f6189(0xcd)][_0x4f6189(0x9a)]};});},'groupParticipantsUpdate':async(_0x437f1d,_0x315b5c,_0x57671c)=>{const _0x1e7f55=_0x3c4e53,_0x6dda6d=await _0x40f2d8(_0x437f1d,'set',[{'tag':_0x57671c,'attrs':{},'content':_0x315b5c['map'](_0x1cde07=>({'tag':_0x1e7f55(0xd7),'attrs':{'jid':_0x1cde07}}))}]),_0x471cd8=(0x0,Internal_1[_0x1e7f55(0xe8)])(_0x6dda6d,_0x57671c),_0x52ecdd=(0x0,Internal_1[_0x1e7f55(0x9e)])(_0x471cd8,'participant');return _0x52ecdd[_0x1e7f55(0xdc)](_0xc6810=>{const _0x3c06a1=_0x1e7f55;return{'status':_0xc6810[_0x3c06a1(0xcd)][_0x3c06a1(0xea)]||_0x3c06a1(0xab),'jid':_0xc6810['attrs'][_0x3c06a1(0x9a)],'content':_0xc6810};});},'groupUpdateDescription':async(_0x5329b0,_0x2e94af)=>{const _0x88a417=_0x3c4e53;var _0x53d20a;const _0x2b399a=await _0x21a82d(_0x5329b0),_0x49cb74=(_0x53d20a=_0x2b399a[_0x88a417(0x97)])!==null&&_0x53d20a!==void 0x0?_0x53d20a:null;await _0x40f2d8(_0x5329b0,'set',[{'tag':_0x88a417(0xbe),'attrs':{..._0x2e94af?{'id':(0x0,Settings_1[_0x88a417(0xa0)])()}:{'delete':_0x88a417(0xe5)},..._0x49cb74?{'prev':_0x49cb74}:{}},'content':_0x2e94af?[{'tag':'body','attrs':{},'content':Buffer['from'](_0x2e94af,_0x88a417(0xe3))}]:undefined}]);},'groupInviteCode':async _0x197046=>{const _0x5c272e=_0x3c4e53,_0x397dd5=await _0x40f2d8(_0x197046,_0x5c272e(0xae),[{'tag':_0x5c272e(0xa8),'attrs':{}}]),_0x37e1d8=(0x0,Internal_1[_0x5c272e(0xe8)])(_0x397dd5,_0x5c272e(0xa8));return _0x37e1d8===null||_0x37e1d8===void 0x0?void 0x0:_0x37e1d8[_0x5c272e(0xcd)]['code'];},'groupRevokeInvite':async _0x327a90=>{const _0x58cd62=_0x3c4e53,_0x1f371c=await _0x40f2d8(_0x327a90,_0x58cd62(0xa6),[{'tag':'invite','attrs':{}}]),_0xa8cd6b=(0x0,Internal_1[_0x58cd62(0xe8)])(_0x1f371c,'invite');return _0xa8cd6b===null||_0xa8cd6b===void 0x0?void 0x0:_0xa8cd6b['attrs'][_0x58cd62(0xc7)];},'groupAcceptInvite':async _0x4d8a39=>{const _0x48f752=_0x3c4e53,_0x436468=await _0x40f2d8('@g.us',_0x48f752(0xa6),[{'tag':_0x48f752(0xa8),'attrs':{'code':_0x4d8a39}}]),_0x55155d=(0x0,Internal_1[_0x48f752(0xe8)])(_0x436468,'group');return _0x55155d===null||_0x55155d===void 0x0?void 0x0:_0x55155d[_0x48f752(0xcd)]['jid'];},'groupAcceptInviteV4':_0x4da1f2[_0x3c4e53(0xe6)](async(_0x3b452b,_0x1a5fec)=>{const _0x32bcda=_0x3c4e53;var _0x172cf3;_0x3b452b=typeof _0x3b452b===_0x32bcda(0xc2)?{'remoteJid':_0x3b452b}:_0x3b452b;const _0x2c9733=await _0x40f2d8(_0x1a5fec[_0x32bcda(0xdd)],_0x32bcda(0xa6),[{'tag':_0x32bcda(0xc0),'attrs':{'code':_0x1a5fec[_0x32bcda(0x95)],'expiration':_0x1a5fec[_0x32bcda(0xb9)][_0x32bcda(0xd3)](),'admin':_0x3b452b['remoteJid']}}]);return _0x3b452b['id']&&(_0x1a5fec=enc_1[_0x32bcda(0xef)][_0x32bcda(0xc5)]['GroupInviteMessage'][_0x32bcda(0xbd)](_0x1a5fec),_0x1a5fec['inviteExpiration']=0x0,_0x1a5fec[_0x32bcda(0x95)]='',_0x4da1f2[_0x32bcda(0xb1)](_0x32bcda(0xb7),[{'key':_0x3b452b,'update':{'message':{'groupInviteMessage':_0x1a5fec}}}])),await _0x282781({'key':{'remoteJid':_0x1a5fec['groupJid'],'id':(0x0,Settings_1[_0x32bcda(0xf0)])((_0x172cf3=_0x406b90[_0x32bcda(0xa1)])===null||_0x172cf3===void 0x0?void 0x0:_0x172cf3['id']),'fromMe':![],'participant':_0x3b452b[_0x32bcda(0x9b)]},'messageStubType':Models_1[_0x32bcda(0xf3)]['GROUP_PARTICIPANT_ADD'],'messageStubParameters':[_0x33db65[_0x32bcda(0xd0)]['me']['id']],'participant':_0x3b452b[_0x32bcda(0x9b)],'messageTimestamp':(0x0,Settings_1[_0x32bcda(0xbc)])()},_0x32bcda(0xb5)),_0x2c9733['attrs'][_0x32bcda(0xdf)];}),'groupGetInviteInfo':async _0x8513d2=>{const _0x2be62f=_0x3c4e53,_0x2cde7d=await _0x40f2d8(_0x2be62f(0xa7),_0x2be62f(0xae),[{'tag':'invite','attrs':{'code':_0x8513d2}}]);return(0x0,exports[_0x2be62f(0x96)])(_0x2cde7d);},'groupToggleEphemeral':async(_0x3b15cd,_0x30aa01)=>{const _0x1e6867=_0x3c4e53,_0x305b43=_0x30aa01?{'tag':_0x1e6867(0xf5),'attrs':{'expiration':_0x30aa01[_0x1e6867(0xd3)]()}}:{'tag':_0x1e6867(0xde),'attrs':{}};await _0x40f2d8(_0x3b15cd,_0x1e6867(0xa6),[_0x305b43]);},'groupSettingUpdate':async(_0x380343,_0x3409b)=>{await _0x40f2d8(_0x380343,'set',[{'tag':_0x3409b,'attrs':{}}]);},'groupFetchAllParticipating':_0x7e88d5};};exports[a2_0x12b9bd(0xcf)]=makeGroupsSocket;function a2_0x2cb8(_0x58d12f,_0x50c7b5){const _0x55a073=a2_0x55a0();return a2_0x2cb8=function(_0x2cb87f,_0x8351d5){_0x2cb87f=_0x2cb87f-0x95;let _0x15713b=_0x55a073[_0x2cb87f];return _0x15713b;},a2_0x2cb8(_0x58d12f,_0x50c7b5);}const extractGroupMetadata=_0x16047d=>{const _0x2f8590=a2_0x12b9bd;var _0x2afb61,_0x190dc2;const _0x3db5ee=(0x0,Internal_1[_0x2f8590(0xe8)])(_0x16047d,_0x2f8590(0x9c)),_0x6bef83=(0x0,Internal_1['getBinaryNodeChild'])(_0x3db5ee,_0x2f8590(0xbe));let _0xdf11e,_0x5c8ac2;_0x6bef83&&(_0xdf11e=(0x0,Internal_1[_0x2f8590(0xf2)])(_0x6bef83,_0x2f8590(0xbb)),_0x5c8ac2=_0x6bef83['attrs']['id']);const _0x339839=_0x3db5ee['attrs']['id'][_0x2f8590(0xa2)]('@')?_0x3db5ee[_0x2f8590(0xcd)]['id']:(0x0,Internal_1[_0x2f8590(0xc8)])(_0x3db5ee[_0x2f8590(0xcd)]['id'],'g.us'),_0x2aede0=(_0x2afb61=(0x0,Internal_1[_0x2f8590(0xe8)])(_0x3db5ee,_0x2f8590(0xf5)))===null||_0x2afb61===void 0x0?void 0x0:_0x2afb61[_0x2f8590(0xcd)][_0x2f8590(0xd4)],_0x4408d9=(0x0,Internal_1[_0x2f8590(0xf2)])(_0x3db5ee,'member_add_mode')===_0x2f8590(0xe0),_0x3484ad={'id':_0x339839,'subject':_0x3db5ee['attrs'][_0x2f8590(0xc4)],'subjectOwner':_0x3db5ee['attrs'][_0x2f8590(0xf4)],'subjectTime':+_0x3db5ee[_0x2f8590(0xcd)][_0x2f8590(0xb3)],'size':+_0x3db5ee[_0x2f8590(0xcd)][_0x2f8590(0xed)],'creation':+_0x3db5ee[_0x2f8590(0xcd)]['creation'],'owner':_0x3db5ee['attrs'][_0x2f8590(0xa3)]?(0x0,Internal_1[_0x2f8590(0xd8)])(_0x3db5ee[_0x2f8590(0xcd)][_0x2f8590(0xa3)]):undefined,'desc':_0xdf11e,'descId':_0x5c8ac2,'linkedParent':((_0x190dc2=(0x0,Internal_1[_0x2f8590(0xe8)])(_0x3db5ee,_0x2f8590(0xd2)))===null||_0x190dc2===void 0x0?void 0x0:_0x190dc2[_0x2f8590(0xcd)][_0x2f8590(0x9a)])||undefined,'restrict':!!(0x0,Internal_1[_0x2f8590(0xe8)])(_0x3db5ee,'locked'),'announce':!!(0x0,Internal_1[_0x2f8590(0xe8)])(_0x3db5ee,_0x2f8590(0xc6)),'isCommunity':!!(0x0,Internal_1[_0x2f8590(0xe8)])(_0x3db5ee,_0x2f8590(0xc1)),'isCommunityAnnounce':!!(0x0,Internal_1['getBinaryNodeChild'])(_0x3db5ee,_0x2f8590(0xcb)),'memberAddMode':_0x4408d9,'participants':(0x0,Internal_1['getBinaryNodeChildren'])(_0x3db5ee,'participant')[_0x2f8590(0xdc)](({attrs:_0x14b545})=>{const _0x3f1e42=_0x2f8590;return{'id':_0x14b545['jid'],'admin':_0x14b545[_0x3f1e42(0xbf)]||null};}),'ephemeralDuration':_0x2aede0?+_0x2aede0:undefined};return _0x3484ad;};exports[a2_0x12b9bd(0x96)]=extractGroupMetadata;