Built motion from commit bf7fe19.|0.0.148
[motion.git] / server / config / automations / chat.js
index 9039aa5..c4a5561 100644 (file)
@@ -1 +1 @@
-var _0x8ee1=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x6D\x6F\x6D\x65\x6E\x74","\x41\x75\x74\x6F\x6D\x61\x74\x69\x6F\x6E","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x43\x68\x61\x74\x52\x6F\x6F\x6D","\x45\x78\x65\x63\x75\x74\x69\x6E\x67\x20\x43\x68\x61\x74\x20\x41\x75\x74\x6F\x6D\x61\x74\x69\x6F\x6E\x20","\x6C\x6F\x67","\x43\x68\x61\x74\x20\x41\x75\x74\x6F\x6D\x61\x74\x69\x6F\x6E\x20\x65\x78\x65\x63\x20\x65\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x69\x64","\x64\x61\x74\x61\x31","\x73\x74\x61\x74\x75\x73","\x61\x63\x74\x69\x6F\x6E","\x66\x6F\x72\x45\x61\x63\x68","\x41\x63\x74\x69\x6F\x6E\x73","\x74\x68\x65\x6E","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\x70\x75\x73\x68","\x41\x6C\x6C","\x41\x6E\x79","\x6C\x65\x6E\x67\x74\x68","\x24\x61\x6E\x64","\x77\x68\x65\x72\x65","\x24\x6F\x72","\x66\x69\x6E\x64\x41\x6C\x6C","\x66\x69\x6E\x64\x42\x79\x49\x64","\x61\x6C\x6C","\x73\x63\x6F\x70\x65","\x41\x75\x74\x6F\x6D\x61\x74\x69\x63\x20\x63\x68\x61\x74\x20\x73\x74\x61\x74\x75\x73\x20\x65\x72\x72\x6F\x72","\x75\x70\x64\x61\x74\x65","\x66\x69\x65\x6C\x64","\x76\x61\x6C\x75\x65","\x65\x71\x75\x61\x6C\x73","\x6E\x6F\x74\x5F\x65\x71\x75\x61\x6C\x73","\x6F\x70\x65\x72\x61\x74\x6F\x72","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D\x3A\x73\x73","\x66\x6F\x72\x6D\x61\x74","\x68\x6F\x75\x72\x73","\x73\x75\x62\x74\x72\x61\x63\x74","\x67\x72\x65\x61\x74\x65\x72","\x67\x72\x65\x61\x74\x65\x72\x5F\x6F\x72\x5F\x65\x71\x75\x61\x6C","\x6C\x65\x73\x73","\x6C\x65\x73\x73\x5F\x6F\x72\x5F\x65\x71\x75\x61\x6C","\x63\x72\x65\x61\x74\x65\x64\x41\x74","\x43\x68\x61\x74\x20\x41\x75\x74\x6F\x6D\x61\x74\x69\x6F\x6E\x20","\x20\x73\x65\x74\x20\x77\x69\x74\x68\x20\x74\x69\x6D\x65\x6F\x75\x74\x20","\x74\x69\x6D\x65\x6F\x75\x74","\x69\x6E\x74\x65\x72\x76\x61\x6C","\x65\x78\x70\x6F\x72\x74\x73","\x20\x63\x72\x65\x61\x74\x65\x64\x2C\x20\x74\x68\x65\x20\x73\x74\x61\x74\x75\x73\x20\x69\x73\x20","\x63\x68\x61\x6E\x6E\x65\x6C","\x63\x68\x61\x74","\x61\x66\x74\x65\x72\x43\x72\x65\x61\x74\x65","\x20\x75\x70\x64\x61\x74\x65\x64\x2C\x20\x74\x68\x65\x20\x73\x74\x61\x74\x75\x73\x20\x69\x73\x20","\x43\x68\x61\x74\x20\x61\x75\x74\x6F\x6D\x61\x74\x69\x6F\x6E\x20\x75\x6E\x73\x65\x74\x20","\x61\x66\x74\x65\x72\x55\x70\x64\x61\x74\x65","\x20\x64\x65\x6C\x65\x74\x65\x64","\x61\x66\x74\x65\x72\x44\x65\x6C\x65\x74\x65","\x43\x68\x61\x74\x20\x41\x75\x74\x6F\x6D\x61\x74\x69\x6F\x6E\x20\x69\x6E\x69\x74\x20\x65\x72\x72\x6F\x72"];_0x8ee1[0];var _=require(_0x8ee1[1]);var moment=require(_0x8ee1[2]);var Automation=require(_0x8ee1[4])[_0x8ee1[3]];var ChatRoom=require(_0x8ee1[4])[_0x8ee1[5]];var automationTimeout;var activeChatAutomations={};function executeAutomation(_0xcac4x8){console[_0x8ee1[7]](_0x8ee1[6],_0xcac4x8);var _0xcac4x9;return Automation[_0x8ee1[28]](_0x8ee1[27])[_0x8ee1[26]](_0xcac4x8)[_0x8ee1[16]](function(_0xcac4xe){_0xcac4x9= _0xcac4xe;var _0xcac4xf=[];var _0xcac4x10=[];var _0xcac4x11={where:{}};_0xcac4xe[_0x8ee1[19]][_0x8ee1[14]](function(_0xcac4x12){_0xcac4x10[_0x8ee1[18]](getCondition(_0xcac4x12[_0x8ee1[17]]))});_0xcac4xe[_0x8ee1[20]][_0x8ee1[14]](function(_0xcac4x12){_0xcac4xf[_0x8ee1[18]](getCondition(_0xcac4x12[_0x8ee1[17]]))});if(_0xcac4x10[_0x8ee1[21]]){_0xcac4x11[_0x8ee1[23]][_0x8ee1[22]]= _0xcac4x10};if(_0xcac4xf[_0x8ee1[21]]){_0xcac4x11[_0x8ee1[23]][_0x8ee1[24]]= _0xcac4xf};return ChatRoom[_0x8ee1[25]](_0xcac4x11)})[_0x8ee1[16]](function(_0xcac4xb){_0xcac4xb[_0x8ee1[14]](function(_0xcac4xc){_0xcac4x9[_0x8ee1[15]][_0x8ee1[14]](function(_0xcac4xd){switch(_0xcac4xd[_0x8ee1[13]]){case _0x8ee1[12]:setStatus(_0xcac4xc[_0x8ee1[10]],_0xcac4xd[_0x8ee1[11]]);break;default:}})})})[_0x8ee1[9]](function(_0xcac4xa){console[_0x8ee1[7]](_0x8ee1[8],_0xcac4xa)})}function setStatus(_0xcac4x14,_0xcac4x15){return ChatRoom[_0x8ee1[30]]({status:_0xcac4x15},{where:{id:_0xcac4x14}})[_0x8ee1[9]](function(_0xcac4xa){console[_0x8ee1[7]](_0x8ee1[29],_0xcac4xa)})}function getCondition(_0xcac4x12){var _0xcac4x17={};switch(_0xcac4x12[_0x8ee1[31]]){case _0x8ee1[12]:switch(_0xcac4x12[_0x8ee1[35]]){case _0x8ee1[33]:_0xcac4x17[_0xcac4x12[_0x8ee1[31]]]= _0xcac4x12[_0x8ee1[32]];break;case _0x8ee1[34]:_0xcac4x17[_0xcac4x12[_0x8ee1[31]]]= {$ne:_0xcac4x12[_0x8ee1[32]]};break;default:};break;case _0x8ee1[44]:var _0xcac4x18=moment()[_0x8ee1[39]](parseInt(_0xcac4x12[_0x8ee1[32]],10),_0x8ee1[38])[_0x8ee1[37]](_0x8ee1[36]);switch(_0xcac4x12[_0x8ee1[35]]){case _0x8ee1[40]:_0xcac4x17[_0xcac4x12[_0x8ee1[31]]]= {lt:_0xcac4x18};break;case _0x8ee1[41]:_0xcac4x17[_0xcac4x12[_0x8ee1[31]]]= {$lte:_0xcac4x18};break;case _0x8ee1[42]:_0xcac4x17[_0xcac4x12[_0x8ee1[31]]]= {$gt:_0xcac4x18};break;case _0x8ee1[43]:_0xcac4x17[_0xcac4x12[_0x8ee1[31]]]= {$gte:_0xcac4x18};break;default:};break;default:};return _0xcac4x17}function createInterval(_0xcac4xe){console[_0x8ee1[7]](_0x8ee1[45],_0xcac4xe[_0x8ee1[10]],_0x8ee1[46],_0xcac4xe[_0x8ee1[47]]* 60* 1000);activeChatAutomations[_0x8ee1[48]+ _0xcac4xe[_0x8ee1[10]]]= setInterval(function(){executeAutomation(_0xcac4xe[_0x8ee1[10]])},_0xcac4xe[_0x8ee1[47]]* 60* 1000)}module[_0x8ee1[49]]= function(){Automation[_0x8ee1[53]](function(_0xcac4x1a,_0xcac4x1b){console[_0x8ee1[7]](_0x8ee1[45],_0xcac4x1a[_0x8ee1[10]],_0x8ee1[50],_0xcac4x1a[_0x8ee1[12]]);if(_0xcac4x1a[_0x8ee1[12]]&& _0xcac4x1a[_0x8ee1[51]]=== _0x8ee1[52]){createInterval(_0xcac4x1a)}});Automation[_0x8ee1[56]](function(_0xcac4x1a,_0xcac4x1b){console[_0x8ee1[7]](_0x8ee1[45],_0xcac4x1a[_0x8ee1[10]],_0x8ee1[54],_0xcac4x1a[_0x8ee1[12]]);if(activeChatAutomations[_0x8ee1[48]+ _0xcac4x1a[_0x8ee1[10]]]){console[_0x8ee1[7]](_0x8ee1[55],_0xcac4x1a[_0x8ee1[10]]);clearInterval(activeChatAutomations[_0x8ee1[48]+ _0xcac4x1a[_0x8ee1[10]]]);delete activeChatAutomations[_0x8ee1[48]+ _0xcac4x1a[_0x8ee1[10]]]};if(_0xcac4x1a[_0x8ee1[12]]&& _0xcac4x1a[_0x8ee1[51]]=== _0x8ee1[52]){createInterval(_0xcac4x1a)}});Automation[_0x8ee1[58]](function(_0xcac4x1a,_0xcac4x1b){console[_0x8ee1[7]](_0x8ee1[45],_0xcac4x1a[_0x8ee1[10]],_0x8ee1[57]);if(activeChatAutomations[_0x8ee1[48]+ _0xcac4x1a[_0x8ee1[10]]]){console[_0x8ee1[7]](_0x8ee1[55],_0xcac4x1a[_0x8ee1[10]]);clearInterval(activeChatAutomations[_0x8ee1[48]+ _0xcac4x1a[_0x8ee1[10]]]);delete activeChatAutomations[_0x8ee1[48]+ _0xcac4x1a[_0x8ee1[10]]]}});return Automation[_0x8ee1[28]](_0x8ee1[27])[_0x8ee1[25]]({where:{status:true,channel:_0x8ee1[52]},attributes:[_0x8ee1[10],_0x8ee1[47]]})[_0x8ee1[16]](function(_0xcac4x1c){_0xcac4x1c[_0x8ee1[14]](function(_0xcac4xe){createInterval(_0xcac4xe)})})[_0x8ee1[9]](function(_0xcac4xa){console[_0x8ee1[7]](_0x8ee1[59],_0xcac4xa)})}
\ No newline at end of file
+var _0xf62e=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x6D\x6F\x6D\x65\x6E\x74","\x41\x75\x74\x6F\x6D\x61\x74\x69\x6F\x6E","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x43\x68\x61\x74\x52\x6F\x6F\x6D","\x5B\x41\x75\x74\x6F\x6D\x61\x74\x69\x6F\x6E\x5D\x20\x45\x78\x65\x63\x75\x74\x69\x6E\x67\x20\x43\x68\x61\x74","\x6C\x6F\x67","\x5B\x41\x75\x74\x6F\x6D\x61\x74\x69\x6F\x6E\x5D\x20\x45\x72\x72\x6F\x72\x20\x69\x6E\x20\x43\x68\x61\x74\x20\x65\x78\x65\x63","\x65\x72\x72\x6F\x72","\x5B\x41\x75\x74\x6F\x6D\x61\x74\x69\x6F\x6E\x5D\x20\x4D\x65\x73\x73\x61\x67\x65\x3A","\x6D\x65\x73\x73\x61\x67\x65","\x5B\x41\x75\x74\x6F\x6D\x61\x74\x69\x6F\x6E\x5D\x20\x53\x74\x61\x63\x6B\x3A","\x73\x74\x61\x63\x6B","\x63\x61\x74\x63\x68","\x69\x64","\x64\x61\x74\x61\x31","\x73\x74\x61\x74\x75\x73","\x61\x63\x74\x69\x6F\x6E","\x66\x6F\x72\x45\x61\x63\x68","\x41\x63\x74\x69\x6F\x6E\x73","\x74\x68\x65\x6E","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\x70\x75\x73\x68","\x41\x6C\x6C","\x41\x6E\x79","\x6C\x65\x6E\x67\x74\x68","\x24\x61\x6E\x64","\x77\x68\x65\x72\x65","\x24\x6F\x72","\x66\x69\x6E\x64\x41\x6C\x6C","\x66\x69\x6E\x64\x42\x79\x49\x64","\x61\x6C\x6C","\x73\x63\x6F\x70\x65","\x5B\x41\x75\x74\x6F\x6D\x61\x74\x69\x6F\x6E\x5D\x20\x45\x72\x72\x6F\x72\x20\x69\x6E\x20\x4D\x61\x69\x6C\x20\x73\x65\x74\x53\x74\x61\x74\x75\x73","\x75\x70\x64\x61\x74\x65","\x66\x69\x65\x6C\x64","\x76\x61\x6C\x75\x65","\x65\x71\x75\x61\x6C\x73","\x6E\x6F\x74\x5F\x65\x71\x75\x61\x6C\x73","\x6F\x70\x65\x72\x61\x74\x6F\x72","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D\x3A\x73\x73","\x66\x6F\x72\x6D\x61\x74","\x68\x6F\x75\x72\x73","\x73\x75\x62\x74\x72\x61\x63\x74","\x67\x72\x65\x61\x74\x65\x72","\x67\x72\x65\x61\x74\x65\x72\x5F\x6F\x72\x5F\x65\x71\x75\x61\x6C","\x6C\x65\x73\x73","\x6C\x65\x73\x73\x5F\x6F\x72\x5F\x65\x71\x75\x61\x6C","\x63\x72\x65\x61\x74\x65\x64\x41\x74","\x5B\x41\x75\x74\x6F\x6D\x61\x74\x69\x6F\x6E\x5D\x20\x4D\x61\x69\x6C","\x73\x65\x74\x20\x77\x69\x74\x68\x20\x74\x69\x6D\x65\x6F\x75\x74","\x74\x69\x6D\x65\x6F\x75\x74","\x69\x6E\x74\x65\x72\x76\x61\x6C","\x65\x78\x70\x6F\x72\x74\x73","\x5B\x41\x75\x74\x6F\x6D\x61\x74\x69\x6F\x6E\x5D\x20\x43\x68\x61\x74\x20\x73\x65\x72\x76\x69\x63\x65\x20\x73\x74\x61\x72\x74\x65\x64","\x63\x68\x61\x6E\x6E\x65\x6C","\x63\x68\x61\x74","\x5B\x41\x75\x74\x6F\x6D\x61\x74\x69\x6F\x6E\x5D\x20\x43\x68\x61\x74","\x63\x72\x65\x61\x74\x65\x64\x2C\x20\x74\x68\x65\x20\x73\x74\x61\x74\x75\x73\x20\x69\x73","\x61\x66\x74\x65\x72\x43\x72\x65\x61\x74\x65","\x75\x70\x64\x61\x74\x65\x64\x2C\x20\x74\x68\x65\x20\x73\x74\x61\x74\x75\x73\x20\x69\x73","\x5B\x41\x75\x74\x6F\x6D\x61\x74\x69\x6F\x6E\x5D\x20\x43\x68\x61\x74\x20\x75\x6E\x73\x65\x74\x20","\x61\x66\x74\x65\x72\x55\x70\x64\x61\x74\x65","\x20\x64\x65\x6C\x65\x74\x65\x64","\x61\x66\x74\x65\x72\x44\x65\x6C\x65\x74\x65","\x5B\x41\x75\x74\x6F\x6D\x61\x74\x69\x6F\x6E\x5D\x20\x45\x72\x72\x6F\x72\x20\x69\x6E\x20\x43\x68\x61\x74\x20\x69\x6E\x69\x74","\x5B\x41\x75\x74\x6F\x6D\x61\x74\x69\x6F\x6E\x5D\x20\x43\x68\x61\x74\x20\x61\x72\x65"];_0xf62e[0];var _=require(_0xf62e[1]);var moment=require(_0xf62e[2]);var Automation=require(_0xf62e[4])[_0xf62e[3]];var ChatRoom=require(_0xf62e[4])[_0xf62e[5]];var activeChatAutomations={};function executeAutomation(_0x72adx7){console[_0xf62e[7]](_0xf62e[6],_0x72adx7);var _0x72adx8;return Automation[_0xf62e[33]](_0xf62e[32])[_0xf62e[31]](_0x72adx7)[_0xf62e[21]](function(_0x72adxd){_0x72adx8= _0x72adxd;var _0x72adxe=[];var _0x72adxf=[];var _0x72adx10={where:{}};_0x72adxd[_0xf62e[24]][_0xf62e[19]](function(_0x72adx11){_0x72adxf[_0xf62e[23]](getCondition(_0x72adx11[_0xf62e[22]]))});_0x72adxd[_0xf62e[25]][_0xf62e[19]](function(_0x72adx11){_0x72adxe[_0xf62e[23]](getCondition(_0x72adx11[_0xf62e[22]]))});if(_0x72adxf[_0xf62e[26]]){_0x72adx10[_0xf62e[28]][_0xf62e[27]]= _0x72adxf};if(_0x72adxe[_0xf62e[26]]){_0x72adx10[_0xf62e[28]][_0xf62e[29]]= _0x72adxe};return ChatRoom[_0xf62e[30]](_0x72adx10)})[_0xf62e[21]](function(_0x72adxa){_0x72adxa[_0xf62e[19]](function(_0x72adxb){_0x72adx8[_0xf62e[20]][_0xf62e[19]](function(_0x72adxc){switch(_0x72adxc[_0xf62e[18]]){case _0xf62e[17]:setStatus(_0x72adxb[_0xf62e[15]],_0x72adxc[_0xf62e[16]]);break;default:}})})})[_0xf62e[14]](function(_0x72adx9){console[_0xf62e[9]](_0xf62e[8]);console[_0xf62e[9]](_0xf62e[10],_0x72adx9[_0xf62e[11]]);console[_0xf62e[9]](_0xf62e[12],_0x72adx9[_0xf62e[13]])})}function setStatus(_0x72adx13,_0x72adx14){return ChatRoom[_0xf62e[35]]({status:_0x72adx14},{where:{id:_0x72adx13}})[_0xf62e[14]](function(_0x72adx9){console[_0xf62e[9]](_0xf62e[34]);console[_0xf62e[9]](_0xf62e[10],_0x72adx9[_0xf62e[11]]);console[_0xf62e[9]](_0xf62e[12],_0x72adx9[_0xf62e[13]])})}function getCondition(_0x72adx11){var _0x72adx16={};switch(_0x72adx11[_0xf62e[36]]){case _0xf62e[17]:switch(_0x72adx11[_0xf62e[40]]){case _0xf62e[38]:_0x72adx16[_0x72adx11[_0xf62e[36]]]= _0x72adx11[_0xf62e[37]];break;case _0xf62e[39]:_0x72adx16[_0x72adx11[_0xf62e[36]]]= {$ne:_0x72adx11[_0xf62e[37]]};break;default:};break;case _0xf62e[49]:var _0x72adx17=moment()[_0xf62e[44]](parseInt(_0x72adx11[_0xf62e[37]],10),_0xf62e[43])[_0xf62e[42]](_0xf62e[41]);switch(_0x72adx11[_0xf62e[40]]){case _0xf62e[45]:_0x72adx16[_0x72adx11[_0xf62e[36]]]= {lt:_0x72adx17};break;case _0xf62e[46]:_0x72adx16[_0x72adx11[_0xf62e[36]]]= {$lte:_0x72adx17};break;case _0xf62e[47]:_0x72adx16[_0x72adx11[_0xf62e[36]]]= {$gt:_0x72adx17};break;case _0xf62e[48]:_0x72adx16[_0x72adx11[_0xf62e[36]]]= {$gte:_0x72adx17};break;default:};break;default:};return _0x72adx16}function createInterval(_0x72adxd){console[_0xf62e[7]](_0xf62e[50],_0x72adxd[_0xf62e[15]],_0xf62e[51],_0x72adxd[_0xf62e[52]]* 60* 1000);activeChatAutomations[_0xf62e[53]+ _0x72adxd[_0xf62e[15]]]= setInterval(function(){executeAutomation(_0x72adxd[_0xf62e[15]])},_0x72adxd[_0xf62e[52]]* 60* 1000)}module[_0xf62e[54]]= function(){console[_0xf62e[7]](_0xf62e[55]);Automation[_0xf62e[60]](function(_0x72adx19,_0x72adx1a){if(_0x72adx19[_0xf62e[56]]=== _0xf62e[57]){console[_0xf62e[7]](_0xf62e[58],_0x72adx19[_0xf62e[15]],_0xf62e[59],_0x72adx19[_0xf62e[17]]);if(_0x72adx19[_0xf62e[17]]){createInterval(_0x72adx19)}}});Automation[_0xf62e[63]](function(_0x72adx19,_0x72adx1a){if(_0x72adx19[_0xf62e[56]]=== _0xf62e[57]){console[_0xf62e[7]](_0xf62e[58],_0x72adx19[_0xf62e[15]],_0xf62e[61],_0x72adx19[_0xf62e[17]]);if(activeChatAutomations[_0xf62e[53]+ _0x72adx19[_0xf62e[15]]]){console[_0xf62e[7]](_0xf62e[62],_0x72adx19[_0xf62e[15]]);clearInterval(activeChatAutomations[_0xf62e[53]+ _0x72adx19[_0xf62e[15]]]);delete activeChatAutomations[_0xf62e[53]+ _0x72adx19[_0xf62e[15]]]};if(_0x72adx19[_0xf62e[17]]){createInterval(_0x72adx19)}}});Automation[_0xf62e[65]](function(_0x72adx19,_0x72adx1a){if(_0x72adx19[_0xf62e[56]]=== _0xf62e[57]){console[_0xf62e[7]](_0xf62e[58],_0x72adx19[_0xf62e[15]],_0xf62e[64]);if(activeChatAutomations[_0xf62e[53]+ _0x72adx19[_0xf62e[15]]]){console[_0xf62e[7]](_0xf62e[62],_0x72adx19[_0xf62e[15]]);clearInterval(activeChatAutomations[_0xf62e[53]+ _0x72adx19[_0xf62e[15]]]);delete activeChatAutomations[_0xf62e[53]+ _0x72adx19[_0xf62e[15]]]}}});return Automation[_0xf62e[33]](_0xf62e[32])[_0xf62e[30]]({where:{status:true,channel:_0xf62e[57]},attributes:[_0xf62e[15],_0xf62e[52]]})[_0xf62e[21]](function(_0x72adx1b){console[_0xf62e[7]](_0xf62e[67],_0x72adx1b[_0xf62e[26]]);_0x72adx1b[_0xf62e[19]](function(_0x72adxd){createInterval(_0x72adxd)})})[_0xf62e[14]](function(_0x72adx9){console[_0xf62e[9]](_0xf62e[66]);console[_0xf62e[9]](_0xf62e[10],_0x72adx9[_0xf62e[11]]);console[_0xf62e[9]](_0xf62e[12],_0x72adx9[_0xf62e[13]])})}
\ No newline at end of file