D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
etb1lp46s9ed
/
wcloud.whatzi.online
/
server
/
controllers
/
Filename :
incomingMessage.js
back
Copy
function _0x1d66(_0x2ccce1,_0xa978a){_0x2ccce1=_0x2ccce1-0x67;const _0x2671a8=_0x2671();let _0x1d66df=_0x2671a8[_0x2ccce1];return _0x1d66df;}(function(_0x5d5785,_0x3a5a2a){const _0x19ab8e=_0x1d66,_0x4741fc=_0x5d5785();while(!![]){try{const _0x553055=parseInt(_0x19ab8e(0x6d))/0x1*(parseInt(_0x19ab8e(0x95))/0x2)+-parseInt(_0x19ab8e(0x8e))/0x3*(parseInt(_0x19ab8e(0x89))/0x4)+-parseInt(_0x19ab8e(0x6b))/0x5*(-parseInt(_0x19ab8e(0x91))/0x6)+-parseInt(_0x19ab8e(0x97))/0x7*(parseInt(_0x19ab8e(0x6a))/0x8)+-parseInt(_0x19ab8e(0x74))/0x9+-parseInt(_0x19ab8e(0x76))/0xa*(parseInt(_0x19ab8e(0x7d))/0xb)+parseInt(_0x19ab8e(0x67))/0xc;if(_0x553055===_0x3a5a2a)break;else _0x4741fc['push'](_0x4741fc['shift']());}catch(_0x525770){_0x4741fc['push'](_0x4741fc['shift']());}}}(_0x2671,0xd25f2));import{parseIncomingMessage,delayMsg}from'../lib/helper.js';import{isExistsEqualCommand,isExistsContainCommand,getUrlWebhook,getDevice}from'../database/model.js';function _0x2671(){const _0x3522fe=['low','fromMe','reply','personal','reply_when','remoteJid','parse','toNumber','wh_read','message','4wLpwCW','allSettled','@g.us','wh_typing','all','3047979QVPTkY','messageTimestamp','stringify','18DuzHOc','includes','sections','object','2uSEzQJ','type','119rOEQXG','length','21509364udYScj','status@broadcast','value','673720XxXjFu','1446285xRtHRZ','split','1276942ZOHHKP','key','handled','number','quoted','high','Group','3640725FCQhmo','senderKeyDistributionMessage','10KioczQ','protocolMessage','readMessages','group','fulfilled','typeBot','status','2456355NwnGnI','notify'];_0x2671=function(){return _0x3522fe;};return _0x2671();}import{handleMediaReply,handleButtonReply,handleListReply,handleTextReply,getPpUrlFromSock}from'../service/replyHandler.js';import{sendWebhook}from'../service/webhook.js';import{runPlugins}from'../plugins/pluginManager.js';import{isJidNewsletter}from'baileys';const IncomingMessage=async(_0x4c84e5,_0x39f7a2,_0x250da6)=>{const _0x54463d=_0x1d66;for(const _0x1d4027 of _0x4c84e5){if(_0x39f7a2!==_0x54463d(0x7e)||!_0x1d4027?.[_0x54463d(0x88)]||_0x1d4027[_0x54463d(0x88)]?.[_0x54463d(0x77)]||_0x1d4027[_0x54463d(0x88)][_0x54463d(0x75)])return;let _0x4240c0=_0x1d4027?.[_0x54463d(0x8f)];if(_0x4240c0&&typeof _0x4240c0==='object'&&typeof _0x4240c0[_0x54463d(0x86)]==='function')_0x4240c0=_0x4240c0[_0x54463d(0x86)]();else{if(_0x4240c0&&typeof _0x4240c0===_0x54463d(0x94)&&_0x54463d(0x7f)in _0x4240c0&&_0x54463d(0x72)in _0x4240c0)_0x4240c0=Number(_0x4240c0[_0x54463d(0x7f)])||0x0;else typeof _0x4240c0!==_0x54463d(0x70)&&(_0x4240c0=0x0);}if(_0x1d4027[_0x54463d(0x6e)][_0x54463d(0x84)]===_0x54463d(0x68))return;let _0x2b778e=_0x1d4027;if(_0x2b778e['key'][_0x54463d(0x80)]||_0x2b778e[_0x54463d(0x6e)][_0x54463d(0x84)]==='status@broadcast'||isJidNewsletter(_0x2b778e[_0x54463d(0x6e)][_0x54463d(0x84)]))return;const _0x155a35=_0x2b778e?.['pushName']||'',_0x208545=_0x250da6['user']['id'][_0x54463d(0x6c)](':')[0x0],{command:_0x325575,media:_0x4b7707,from:_0x7a0360,participant:_0x482763}=await parseIncomingMessage(_0x2b778e,_0x250da6),_0x5926f6=await getDevice(_0x208545);let _0x1d037c=![];_0x5926f6['length']>0x0&&_0x5926f6[0x0][_0x54463d(0x87)]===0x1&&_0x250da6[_0x54463d(0x78)]([_0x2b778e[_0x54463d(0x6e)]]);const _0xd6e094={'msg':_0x2b778e,'sock':_0x250da6,'command':_0x325575,'from':_0x7a0360,'senderName':_0x155a35,'numberWa':_0x208545,'device':_0x5926f6,'participant':_0x482763,'media':_0x4b7707},_0x11aed0=((async()=>{const _0x2a2680=_0x54463d,_0x41902d=await getUrlWebhook(_0x208545);if(!_0x41902d)return null;const _0x44eeb6=await getPpUrlFromSock(_0x250da6,_0x2b778e),_0x726cdf=await sendWebhook({'device':_0x208545,'command':_0x325575,'media':_0x4b7707,'from':_0x7a0360,'name':_0x155a35,'url':_0x41902d,'participant':_0x482763,'ppUrl':_0x44eeb6});return typeof _0x726cdf===_0x2a2680(0x94)?_0x726cdf:null;})()),_0x49104b=((async()=>{const _0x4b04d9=_0x54463d;let _0x4961c7=await isExistsEqualCommand(_0x325575,_0x208545);if(!_0x4961c7['length'])_0x4961c7=await isExistsContainCommand(_0x325575,_0x208545);if(!_0x4961c7[_0x4b04d9(0x98)])return null;const _0x453a41=_0x4961c7[0x0],_0x503ea5=_0x453a41['reply_when']==='All'||_0x453a41[_0x4b04d9(0x83)]===_0x4b04d9(0x73)&&_0x2b778e[_0x4b04d9(0x6e)][_0x4b04d9(0x84)][_0x4b04d9(0x92)](_0x4b04d9(0x8b))||_0x453a41[_0x4b04d9(0x83)]==='Personal'&&!_0x2b778e[_0x4b04d9(0x6e)][_0x4b04d9(0x84)][_0x4b04d9(0x92)]('@g.us');if(!_0x503ea5)return null;return typeof _0x453a41[_0x4b04d9(0x81)]===_0x4b04d9(0x94)?_0x453a41['reply']:_0x453a41['reply'];})()),_0x2de2bd=runPlugins(_0xd6e094),[_0x43b6fd,_0x5b4a01,_0x13d84f]=await Promise[_0x54463d(0x8a)]([_0x11aed0,_0x49104b,_0x2de2bd]);let _0x1dd5ba=null;if(_0x5b4a01[_0x54463d(0x7c)]==='fulfilled'&&_0x5b4a01[_0x54463d(0x69)])_0x1dd5ba=_0x5b4a01[_0x54463d(0x69)];else{if(_0x43b6fd[_0x54463d(0x7c)]===_0x54463d(0x7a)&&_0x43b6fd['value'])_0x1dd5ba=_0x43b6fd[_0x54463d(0x69)],_0x1d037c=_0x43b6fd[_0x54463d(0x69)]?.[_0x54463d(0x71)]||![];else{if(_0x13d84f[_0x54463d(0x7c)]==='fulfilled'&&_0x13d84f[_0x54463d(0x69)]?.[_0x54463d(0x6f)]){const _0x579366=_0x13d84f[_0x54463d(0x69)][_0x54463d(0x7b)]||_0x54463d(0x8d),_0x378c2d=_0x2b778e[_0x54463d(0x6e)]['remoteJid'][_0x54463d(0x92)](_0x54463d(0x8b)),_0x28f9e5=_0x579366===_0x54463d(0x8d)||_0x579366===_0x54463d(0x79)&&_0x378c2d||_0x579366===_0x54463d(0x82)&&!_0x378c2d;_0x28f9e5&&(_0x1dd5ba=_0x13d84f[_0x54463d(0x69)]['reply'],_0x1d037c=_0x13d84f[_0x54463d(0x69)][_0x54463d(0x71)]||![]);}}}if(_0x1dd5ba){_0x5926f6[_0x54463d(0x98)]>0x0&&_0x5926f6[0x0][_0x54463d(0x8c)]===0x1&&await delayMsg(0x2*0x3e8,_0x250da6,_0x2b778e['key'][_0x54463d(0x84)],!![]);if(typeof _0x1dd5ba==='string')_0x1dd5ba=JSON[_0x54463d(0x85)](_0x1dd5ba);typeof _0x1dd5ba===_0x54463d(0x94)&&_0x1dd5ba?.['text']?.[_0x54463d(0x92)]('{name}')&&(_0x1dd5ba=JSON['parse'](JSON[_0x54463d(0x90)](_0x1dd5ba)['replace'](/{name}/g,_0x155a35)));if(_0x1dd5ba[_0x54463d(0x96)])return await handleMediaReply(_0x1dd5ba,_0x250da6,_0x2b778e,_0x1d037c);else{if(_0x1dd5ba['buttons'])return await handleButtonReply(_0x1dd5ba,_0x250da6,_0x2b778e);else return _0x1dd5ba[_0x54463d(0x93)]?await handleListReply(_0x1dd5ba,_0x250da6,_0x2b778e):await handleTextReply(_0x1dd5ba,_0x250da6,_0x2b778e,_0x1d037c);}}}};export{IncomingMessage};