D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
etb1lp46s9ed
/
washeet.softurecs.com
/
server
/
controllers
/
Filename :
incomingMessage.js
back
Copy
(function (_0x339f0a, _0x37d477) { const _0x3b5739 = _0x29cb, _0x49f126 = _0x339f0a(); while (!![]) { try { const _0x58d839 = (parseInt(_0x3b5739(0xd7)) / 0x1) * (-parseInt(_0x3b5739(0xce)) / 0x2) + parseInt(_0x3b5739(0xcf)) / 0x3 + (parseInt(_0x3b5739(0xd2)) / 0x4) * (parseInt(_0x3b5739(0xd6)) / 0x5) + parseInt(_0x3b5739(0xe0)) / 0x6 + parseInt(_0x3b5739(0xbe)) / 0x7 + parseInt(_0x3b5739(0xdd)) / 0x8 + (parseInt(_0x3b5739(0xe7)) / 0x9) * (-parseInt(_0x3b5739(0xcb)) / 0xa); if (_0x58d839 === _0x37d477) break; else _0x49f126["push"](_0x49f126["shift"]()); } catch (_0x4ea48b) { _0x49f126["push"](_0x49f126["shift"]()); } } })(_0x5e17, 0xb1727); import { parseIncomingMessage, delayMsg } from "../lib/helper.js"; import { isExistsEqualCommand, isExistsContainCommand, getUrlWebhook, getDevice, } from "../database/model.js"; import { handleMediaReply, handleButtonReply, handleListReply, handleTextReply, getPpUrlFromSock, } from "../service/replyHandler.js"; import { sendWebhook } from "../service/webhook.js"; import { runPlugins } from "../plugins/pluginManager.js"; function _0x29cb(_0x25c774, _0x125940) { _0x25c774 = _0x25c774 - 0xbc; const _0x5e17e4 = _0x5e17(); let _0x29cb5b = _0x5e17e4[_0x25c774]; return _0x29cb5b; } import { isJidNewsletter } from "baileys"; function _0x5e17() { const _0xe5cc78 = [ "12391NjseJg", "value", "fulfilled", "quoted", "sections", "group", "7980968HaZCJl", "message", "length", "1616310CaKFyO", "type", "all", "wh_typing", "@g.us", "readMessages", "status", "126rQzHGN", "Personal", "handled", "replace", "keys", "reply_when", "562156mZQtVI", "pushName", "typeBot", "fromMe", "status@broadcast", "remoteJid", "senderKeyDistributionMessage", "text", "parse", "participant", "reply", "protocolMessage", "key", "742090VsTXxU", "wh_read", "allSettled", "120EqwBrG", "2353566FJCQTl", "All", "object", "1509492fyeMIF", "log", "notify", "includes", "5uQJfsm", ]; _0x5e17 = function () { return _0xe5cc78; }; return _0x5e17(); } const lastMessageMap = {}; let isFirstConnect = !![]; const IncomingMessage = async (_0x51c5fd, _0x156b1a, _0x305bc5) => { const _0x2b9502 = _0x29cb; for (const _0x4c9355 of _0x51c5fd) { if ( _0x156b1a !== _0x2b9502(0xd4) || !_0x4c9355?.[_0x2b9502(0xde)] || _0x4c9355[_0x2b9502(0xde)]?.[_0x2b9502(0xc9)] || _0x4c9355[_0x2b9502(0xde)][_0x2b9502(0xc4)] ) return; if (_0x4c9355[_0x2b9502(0xca)][_0x2b9502(0xc3)] === _0x2b9502(0xc2)) return; const _0x3aa985 = Object[_0x2b9502(0xbc)](_0x4c9355["message"])[0x0]; let _0x2134cf = _0x4c9355; if ( _0x2134cf[_0x2b9502(0xca)][_0x2b9502(0xc1)] || _0x2134cf[_0x2b9502(0xca)][_0x2b9502(0xc3)] === "status@broadcast" || isJidNewsletter(_0x2134cf[_0x2b9502(0xca)][_0x2b9502(0xc3)]) ) return; const _0x2d9430 = _0x2134cf?.[_0x2b9502(0xbf)] || "", _0x551d9d = _0x305bc5["user"]["id"]["split"](":")[0x0], { command: _0x9a0157, media: _0x19c301, from: _0x2c7573, } = await parseIncomingMessage(_0x2134cf, _0x305bc5), _0x1cc034 = _0x2134cf["key"][_0x2b9502(0xc7)], _0x403856 = await getDevice(_0x551d9d); let _0x561962 = ![]; _0x403856["length"] > 0x0 && _0x403856[0x0][_0x2b9502(0xcc)] === 0x1 && _0x305bc5[_0x2b9502(0xe5)]([_0x2134cf[_0x2b9502(0xca)]]); const _0x4b3319 = { msg: _0x2134cf, sock: _0x305bc5, command: _0x9a0157, from: _0x2c7573, senderName: _0x2d9430, numberWa: _0x551d9d, device: _0x403856, participant: _0x1cc034, media: _0x19c301, }, _0x574908 = (async () => { const _0x545131 = _0x2b9502, _0x348ae6 = await getUrlWebhook(_0x551d9d); if (!_0x348ae6) return null; const _0x5ea2c1 = await getPpUrlFromSock(_0x305bc5, _0x2134cf), _0x39acf8 = await sendWebhook({ device: _0x551d9d, command: _0x9a0157, media: _0x19c301, from: _0x2c7573, name: _0x2d9430, url: _0x348ae6, participant: _0x1cc034, ppUrl: _0x5ea2c1, }); return typeof _0x39acf8 === _0x545131(0xd1) ? _0x39acf8 : null; })(), _0x5b3010 = (async () => { const _0x17a733 = _0x2b9502; let _0x907855 = await isExistsEqualCommand(_0x9a0157, _0x551d9d); if (!_0x907855["length"]) _0x907855 = await isExistsContainCommand(_0x9a0157, _0x551d9d); if (!_0x907855[_0x17a733(0xdf)]) return null; const _0x75c7d0 = _0x907855[0x0], _0x1248c2 = _0x75c7d0[_0x17a733(0xbd)] === _0x17a733(0xd0) || (_0x75c7d0[_0x17a733(0xbd)] === "Group" && _0x2134cf[_0x17a733(0xca)][_0x17a733(0xc3)][_0x17a733(0xd5)]( "@g.us" )) || (_0x75c7d0[_0x17a733(0xbd)] === _0x17a733(0xe8) && !_0x2134cf[_0x17a733(0xca)][_0x17a733(0xc3)][_0x17a733(0xd5)]( "@g.us" )); console[_0x17a733(0xd3)]("ar\x20p", _0x1248c2); if (!_0x1248c2) return null; return typeof _0x75c7d0[_0x17a733(0xc8)] === "object" ? _0x75c7d0["reply"] : _0x75c7d0[_0x17a733(0xc8)]; })(), _0x269eab = runPlugins(_0x4b3319), [_0x38c79b, _0x8951b9, _0x240671] = await Promise[_0x2b9502(0xcd)]([ _0x574908, _0x5b3010, _0x269eab, ]); let _0x5ac113 = null; if (_0x8951b9[_0x2b9502(0xe6)] === _0x2b9502(0xd9) && _0x8951b9["value"]) _0x5ac113 = _0x8951b9[_0x2b9502(0xd8)]; else { if ( _0x38c79b[_0x2b9502(0xe6)] === _0x2b9502(0xd9) && _0x38c79b[_0x2b9502(0xd8)] ) (_0x5ac113 = _0x38c79b[_0x2b9502(0xd8)]), (_0x561962 = _0x38c79b["value"]?.["quoted"] || ![]); else { if ( _0x240671[_0x2b9502(0xe6)] === _0x2b9502(0xd9) && _0x240671[_0x2b9502(0xd8)]?.[_0x2b9502(0xe9)] ) { const _0xd5c17d = _0x240671[_0x2b9502(0xd8)][_0x2b9502(0xc0)] || _0x2b9502(0xe2), _0x43aac1 = _0x2134cf["key"][_0x2b9502(0xc3)][_0x2b9502(0xd5)]( _0x2b9502(0xe4) ), _0x2319dd = _0xd5c17d === _0x2b9502(0xe2) || (_0xd5c17d === _0x2b9502(0xdc) && _0x43aac1) || (_0xd5c17d === "personal" && !_0x43aac1); _0x2319dd && ((_0x5ac113 = _0x240671["value"][_0x2b9502(0xc8)]), (_0x561962 = _0x240671[_0x2b9502(0xd8)][_0x2b9502(0xda)] || ![])); } } } if (_0x5ac113) { _0x403856["length"] > 0x0 && _0x403856[0x0][_0x2b9502(0xe3)] === 0x1 && (await delayMsg( 0x2 * 0x3e8, _0x305bc5, _0x2134cf[_0x2b9502(0xca)][_0x2b9502(0xc3)], !![] )); if (typeof _0x5ac113 === "string") _0x5ac113 = JSON[_0x2b9502(0xc6)](_0x5ac113); typeof _0x5ac113 === _0x2b9502(0xd1) && _0x5ac113?.[_0x2b9502(0xc5)]?.[_0x2b9502(0xd5)]("{name}") && (_0x5ac113 = JSON[_0x2b9502(0xc6)]( JSON["stringify"](_0x5ac113)[_0x2b9502(0xea)](/{name}/g, _0x2d9430) )); if (_0x5ac113[_0x2b9502(0xe1)]) return await handleMediaReply( _0x5ac113, _0x305bc5, _0x2134cf, _0x561962 ); else { if (_0x5ac113["buttons"]) return await handleButtonReply(_0x5ac113, _0x305bc5, _0x2134cf); else return _0x5ac113[_0x2b9502(0xdb)] ? await handleListReply(_0x5ac113, _0x305bc5, _0x2134cf) : await handleTextReply(_0x5ac113, _0x305bc5, _0x2134cf, _0x561962); } } } }; export { IncomingMessage };