D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
etb1lp46s9ed
/
wcloud.whatzi.online
/
server
/
plugins
/
Filename :
pluginManager.js
back
Copy
const _0x530cbf=_0x582d;(function(_0x1c8c65,_0x15128f){const _0x129341=_0x582d,_0x6a7cb4=_0x1c8c65();while(!![]){try{const _0x5c666f=parseInt(_0x129341(0x117))/0x1+parseInt(_0x129341(0x124))/0x2+-parseInt(_0x129341(0x116))/0x3*(-parseInt(_0x129341(0x115))/0x4)+parseInt(_0x129341(0x12a))/0x5+parseInt(_0x129341(0x10b))/0x6+-parseInt(_0x129341(0x12d))/0x7+-parseInt(_0x129341(0x10a))/0x8;if(_0x5c666f===_0x15128f)break;else _0x6a7cb4['push'](_0x6a7cb4['shift']());}catch(_0x3c07d6){_0x6a7cb4['push'](_0x6a7cb4['shift']());}}}(_0x4425,0xc13b2));import{getActivePluginsByDevice}from'../database/model.js';import _0x2feb80 from'./botsticker.js';import _0x5752c5 from'./chatgpt.js';import _0x58d4fe from'./claudeai.js';import _0x50eeb4 from'./geminiAi.js';import{checkContact,saveContact,deleteMessageCache,removeContact}from'./pluginHelper.js';function _0x582d(_0x3d3218,_0x897579){const _0x44250c=_0x4425();return _0x582d=function(_0x582d50,_0x5680da){_0x582d50=_0x582d50-0x105;let _0x48dc86=_0x44250c[_0x582d50];return _0x48dc86;},_0x582d(_0x3d3218,_0x897579);}import _0x4e443f from'./spreadsheet.js';import _0x997bb6 from'./spreadsheet-savedata.js';const AI_PLUGIN_UUIDS=[_0x530cbf(0x121),_0x530cbf(0x11f),_0x530cbf(0x129)],pluginMap={'spreadsheet':_0x4e443f,'gemini':_0x50eeb4,'chatgpt':_0x5752c5,'sticker':_0x2feb80,'claude':_0x58d4fe,'spreadsheet-input':_0x997bb6},runPlugins=async _0x1c7952=>{const _0x1c8be7=_0x530cbf;try{const _0x13d1c1=_0x1c7952[_0x1c8be7(0x11b)],_0x3de484=await getActivePluginsByDevice(_0x1c7952[_0x1c8be7(0x110)]?.[0x0]?.['id']);if(!_0x3de484[_0x1c8be7(0x109)])return null;const _0x431207=_0x3de484[_0x1c8be7(0x105)](_0x57128e=>_0x57128e[_0x1c8be7(0x112)]===0x1),_0x7e9b79=_0x431207[_0x1c8be7(0x105)](_0x1ed017=>AI_PLUGIN_UUIDS['includes'](_0x1ed017[_0x1c8be7(0x11c)])),_0x15156e=_0x431207[_0x1c8be7(0x105)](_0x4109b4=>!AI_PLUGIN_UUIDS[_0x1c8be7(0x108)](_0x4109b4[_0x1c8be7(0x11c)]));let _0x5230d8=[];if(_0x7e9b79[_0x1c8be7(0x109)]>0x0){const _0x41aa2f=Math[_0x1c8be7(0x10f)](Math['random']()*_0x7e9b79[_0x1c8be7(0x109)]);_0x5230d8=[_0x7e9b79[_0x41aa2f]];}const _0x37454f=[..._0x15156e,..._0x5230d8];for(const _0x4a1be3 of _0x37454f){const _0x5bda80=pluginMap[_0x4a1be3[_0x1c8be7(0x11c)]];if(!_0x5bda80){console[_0x1c8be7(0x10c)](_0x1c8be7(0x12c)+_0x4a1be3[_0x1c8be7(0x11c)]);continue;}const _0x3339fe=_0x4a1be3?.[_0x1c8be7(0x107)],_0x1b714e=_0x3339fe['toLowerCase']()===_0x1c8be7(0x119)||_0x3339fe[_0x1c8be7(0x126)]()==='group'&&_0x13d1c1[_0x1c8be7(0x127)][_0x1c8be7(0x10d)][_0x1c8be7(0x108)](_0x1c8be7(0x113))||_0x3339fe['toLowerCase']()==='personal'&&!_0x13d1c1[_0x1c8be7(0x127)][_0x1c8be7(0x10d)][_0x1c8be7(0x108)](_0x1c8be7(0x113));if(!_0x1b714e)continue;if(AI_PLUGIN_UUIDS[_0x1c8be7(0x108)](_0x4a1be3[_0x1c8be7(0x11c)])){const _0x3eec69=await preprocessAIPlugin(_0x1c7952,_0x4a1be3);if(_0x3eec69===![])continue;if(typeof _0x3eec69===_0x1c8be7(0x106)&&_0x3eec69[_0x1c8be7(0x11e)])return _0x3eec69;}const _0x54e8d8={..._0x1c7952,'plugin':{'uuid':_0x4a1be3[_0x1c8be7(0x11c)],'name':_0x4a1be3[_0x1c8be7(0x12b)],'main_data':_0x4a1be3[_0x1c8be7(0x114)],'extra_data':_0x4a1be3['extra_data']}};try{const _0x410592=await _0x5bda80(_0x54e8d8);if(_0x410592&&_0x410592[_0x1c8be7(0x11e)]&&_0x410592[_0x1c8be7(0x123)])return{..._0x410592};}catch(_0x229d16){console['log'](_0x1c8be7(0x122)+_0x4a1be3[_0x1c8be7(0x11c)]+']',_0x229d16);}}}catch(_0x39c33b){console[_0x1c8be7(0x10c)](_0x1c8be7(0x12e),_0x39c33b);}return null;},preprocessAIPlugin=async(_0x4341f8,_0x36e5e9)=>{const _0x32bcc3=_0x530cbf,{command:_0x1dbfbe,from:_0x107e57,device:_0x56fc0e}=_0x4341f8,_0x4d611e=_0x56fc0e?.[0x0]?.[_0x32bcc3(0x10e)],_0x1fc252=typeof _0x36e5e9[_0x32bcc3(0x118)]===_0x32bcc3(0x11a)?JSON['parse'](_0x36e5e9[_0x32bcc3(0x118)]):_0x36e5e9[_0x32bcc3(0x118)],_0x19ff1c=_0x1fc252['command_start']?.[_0x32bcc3(0x11d)]()?.['toLowerCase'](),_0x2fc159=_0x1fc252[_0x32bcc3(0x125)]?.['trim']()?.[_0x32bcc3(0x126)](),_0x45ce18=_0x1dbfbe[_0x32bcc3(0x11d)]()[_0x32bcc3(0x126)]();if(_0x19ff1c&&_0x2fc159){const _0x5abb7a=await checkContact(_0x107e57,_0x4d611e);if(_0x45ce18===_0x19ff1c){if(!_0x5abb7a)await saveContact(_0x107e57,_0x4d611e);return{'handled':!![],'reply':{'text':_0x5abb7a?_0x32bcc3(0x111):_0x32bcc3(0x120)}};}if(_0x45ce18===_0x2fc159){if(_0x5abb7a)await removeContact(_0x107e57,_0x4d611e);return await deleteMessageCache(_0x4d611e,_0x107e57),{'handled':!![],'reply':{'text':_0x32bcc3(0x128)}};}if(!_0x5abb7a)return![];return!![];}return!![];};function _0x4425(){const _0x1b8f35=['length','11448256RVSCRv','4757328KbtPIQ','log','remoteJid','body','floor','device','AI\x20telah\x20diaktifkan\x20sebelumnya.','is_active','@g.us','main_data','100gvpPVd','1845SbEtOc','448221VceQig','extra_data','all','string','msg','uuid','trim','handled','chatgpt','✅\x20AI\x20aktif.\x20Selamat\x20menggunakan!','gemini','[Plugin\x20Error\x20-\x20','reply','2049692SlekFf','command_stop','toLowerCase','key','🛑\x20AI\x20berhenti.\x20Terima\x20kasih!','claude','806455ZelKva','name','[Plugin\x20Missing]\x20UUID\x20not\x20found:\x20','1540805qPsait','[runPlugins\x20Error]','filter','object','typeBot','includes'];_0x4425=function(){return _0x1b8f35;};return _0x4425();}export{runPlugins};