Built motion from commit 0dbf6b8.|0.0.131
[motion.git] / server / config / automations / chat.js
index a1a77b5..d67c987 100644 (file)
@@ -1 +1 @@
-var _0x35e7=["\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"];_0x35e7[0];var _=require(_0x35e7[1]);var moment=require(_0x35e7[2]);var Automation=require(_0x35e7[4])[_0x35e7[3]];var ChatRoom=require(_0x35e7[4])[_0x35e7[5]];var automationTimeout;var activeChatAutomations={};function executeAutomation(_0x196ex8){console[_0x35e7[7]](_0x35e7[6],_0x196ex8);var _0x196ex9;return Automation[_0x35e7[28]](_0x35e7[27])[_0x35e7[26]](_0x196ex8)[_0x35e7[16]](function(_0x196exe){_0x196ex9= _0x196exe;var _0x196exf=[];var _0x196ex10=[];var _0x196ex11={where:{}};_0x196exe[_0x35e7[19]][_0x35e7[14]](function(_0x196ex12){_0x196ex10[_0x35e7[18]](getCondition(_0x196ex12[_0x35e7[17]]))});_0x196exe[_0x35e7[20]][_0x35e7[14]](function(_0x196ex12){_0x196exf[_0x35e7[18]](getCondition(_0x196ex12[_0x35e7[17]]))});if(_0x196ex10[_0x35e7[21]]){_0x196ex11[_0x35e7[23]][_0x35e7[22]]= _0x196ex10};if(_0x196exf[_0x35e7[21]]){_0x196ex11[_0x35e7[23]][_0x35e7[24]]= _0x196exf};return ChatRoom[_0x35e7[25]](_0x196ex11)})[_0x35e7[16]](function(_0x196exb){_0x196exb[_0x35e7[14]](function(_0x196exc){_0x196ex9[_0x35e7[15]][_0x35e7[14]](function(_0x196exd){switch(_0x196exd[_0x35e7[13]]){case _0x35e7[12]:setStatus(_0x196exc[_0x35e7[10]],_0x196exd[_0x35e7[11]]);break;default:}})})})[_0x35e7[9]](function(_0x196exa){console[_0x35e7[7]](_0x35e7[8],_0x196exa)})}function setStatus(_0x196ex14,_0x196ex15){return ChatRoom[_0x35e7[30]]({status:_0x196ex15},{where:{id:_0x196ex14}})[_0x35e7[9]](function(_0x196exa){console[_0x35e7[7]](_0x35e7[29],_0x196exa)})}function getCondition(_0x196ex12){var _0x196ex17={};switch(_0x196ex12[_0x35e7[31]]){case _0x35e7[12]:switch(_0x196ex12[_0x35e7[35]]){case _0x35e7[33]:_0x196ex17[_0x196ex12[_0x35e7[31]]]= _0x196ex12[_0x35e7[32]];break;case _0x35e7[34]:_0x196ex17[_0x196ex12[_0x35e7[31]]]= {$ne:_0x196ex12[_0x35e7[32]]};break;default:};break;case _0x35e7[44]:var _0x196ex18=moment()[_0x35e7[39]](parseInt(_0x196ex12[_0x35e7[32]],10),_0x35e7[38])[_0x35e7[37]](_0x35e7[36]);switch(_0x196ex12[_0x35e7[35]]){case _0x35e7[40]:_0x196ex17[_0x196ex12[_0x35e7[31]]]= {lt:_0x196ex18};break;case _0x35e7[41]:_0x196ex17[_0x196ex12[_0x35e7[31]]]= {$lte:_0x196ex18};break;case _0x35e7[42]:_0x196ex17[_0x196ex12[_0x35e7[31]]]= {$gt:_0x196ex18};break;case _0x35e7[43]:_0x196ex17[_0x196ex12[_0x35e7[31]]]= {$gte:_0x196ex18};break;default:};break;default:};return _0x196ex17}function createInterval(_0x196exe){console[_0x35e7[7]](_0x35e7[45],_0x196exe[_0x35e7[10]],_0x35e7[46],_0x196exe[_0x35e7[47]]* 60* 1000);activeChatAutomations[_0x35e7[48]+ _0x196exe[_0x35e7[10]]]= setInterval(function(){executeAutomation(_0x196exe[_0x35e7[10]])},_0x196exe[_0x35e7[47]]* 60* 1000)}module[_0x35e7[49]]= function(){Automation[_0x35e7[53]](function(_0x196ex1a,_0x196ex1b){console[_0x35e7[7]](_0x35e7[45],_0x196ex1a[_0x35e7[10]],_0x35e7[50],_0x196ex1a[_0x35e7[12]]);if(_0x196ex1a[_0x35e7[12]]&& _0x196ex1a[_0x35e7[51]]=== _0x35e7[52]){createInterval(_0x196ex1a)}});Automation[_0x35e7[56]](function(_0x196ex1a,_0x196ex1b){console[_0x35e7[7]](_0x35e7[45],_0x196ex1a[_0x35e7[10]],_0x35e7[54],_0x196ex1a[_0x35e7[12]]);if(activeChatAutomations[_0x35e7[48]+ _0x196ex1a[_0x35e7[10]]]){console[_0x35e7[7]](_0x35e7[55],_0x196ex1a[_0x35e7[10]]);clearInterval(activeChatAutomations[_0x35e7[48]+ _0x196ex1a[_0x35e7[10]]]);delete activeChatAutomations[_0x35e7[48]+ _0x196ex1a[_0x35e7[10]]]};if(_0x196ex1a[_0x35e7[12]]&& _0x196ex1a[_0x35e7[51]]=== _0x35e7[52]){createInterval(_0x196ex1a)}});Automation[_0x35e7[58]](function(_0x196ex1a,_0x196ex1b){console[_0x35e7[7]](_0x35e7[45],_0x196ex1a[_0x35e7[10]],_0x35e7[57]);if(activeChatAutomations[_0x35e7[48]+ _0x196ex1a[_0x35e7[10]]]){console[_0x35e7[7]](_0x35e7[55],_0x196ex1a[_0x35e7[10]]);clearInterval(activeChatAutomations[_0x35e7[48]+ _0x196ex1a[_0x35e7[10]]]);delete activeChatAutomations[_0x35e7[48]+ _0x196ex1a[_0x35e7[10]]]}});return Automation[_0x35e7[28]](_0x35e7[27])[_0x35e7[25]]({where:{status:true,channel:_0x35e7[52]},attributes:[_0x35e7[10],_0x35e7[47]]})[_0x35e7[16]](function(_0x196ex1c){_0x196ex1c[_0x35e7[14]](function(_0x196exe){createInterval(_0x196exe)})})[_0x35e7[9]](function(_0x196exa){console[_0x35e7[7]](_0x35e7[59],_0x196exa)})}
\ No newline at end of file
+var _0xebe6=["\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"];_0xebe6[0];var _=require(_0xebe6[1]);var moment=require(_0xebe6[2]);var Automation=require(_0xebe6[4])[_0xebe6[3]];var ChatRoom=require(_0xebe6[4])[_0xebe6[5]];var automationTimeout;var activeChatAutomations={};function executeAutomation(_0x1c3bx8){console[_0xebe6[7]](_0xebe6[6],_0x1c3bx8);var _0x1c3bx9;return Automation[_0xebe6[28]](_0xebe6[27])[_0xebe6[26]](_0x1c3bx8)[_0xebe6[16]](function(_0x1c3bxe){_0x1c3bx9= _0x1c3bxe;var _0x1c3bxf=[];var _0x1c3bx10=[];var _0x1c3bx11={where:{}};_0x1c3bxe[_0xebe6[19]][_0xebe6[14]](function(_0x1c3bx12){_0x1c3bx10[_0xebe6[18]](getCondition(_0x1c3bx12[_0xebe6[17]]))});_0x1c3bxe[_0xebe6[20]][_0xebe6[14]](function(_0x1c3bx12){_0x1c3bxf[_0xebe6[18]](getCondition(_0x1c3bx12[_0xebe6[17]]))});if(_0x1c3bx10[_0xebe6[21]]){_0x1c3bx11[_0xebe6[23]][_0xebe6[22]]= _0x1c3bx10};if(_0x1c3bxf[_0xebe6[21]]){_0x1c3bx11[_0xebe6[23]][_0xebe6[24]]= _0x1c3bxf};return ChatRoom[_0xebe6[25]](_0x1c3bx11)})[_0xebe6[16]](function(_0x1c3bxb){_0x1c3bxb[_0xebe6[14]](function(_0x1c3bxc){_0x1c3bx9[_0xebe6[15]][_0xebe6[14]](function(_0x1c3bxd){switch(_0x1c3bxd[_0xebe6[13]]){case _0xebe6[12]:setStatus(_0x1c3bxc[_0xebe6[10]],_0x1c3bxd[_0xebe6[11]]);break;default:}})})})[_0xebe6[9]](function(_0x1c3bxa){console[_0xebe6[7]](_0xebe6[8],_0x1c3bxa)})}function setStatus(_0x1c3bx14,_0x1c3bx15){return ChatRoom[_0xebe6[30]]({status:_0x1c3bx15},{where:{id:_0x1c3bx14}})[_0xebe6[9]](function(_0x1c3bxa){console[_0xebe6[7]](_0xebe6[29],_0x1c3bxa)})}function getCondition(_0x1c3bx12){var _0x1c3bx17={};switch(_0x1c3bx12[_0xebe6[31]]){case _0xebe6[12]:switch(_0x1c3bx12[_0xebe6[35]]){case _0xebe6[33]:_0x1c3bx17[_0x1c3bx12[_0xebe6[31]]]= _0x1c3bx12[_0xebe6[32]];break;case _0xebe6[34]:_0x1c3bx17[_0x1c3bx12[_0xebe6[31]]]= {$ne:_0x1c3bx12[_0xebe6[32]]};break;default:};break;case _0xebe6[44]:var _0x1c3bx18=moment()[_0xebe6[39]](parseInt(_0x1c3bx12[_0xebe6[32]],10),_0xebe6[38])[_0xebe6[37]](_0xebe6[36]);switch(_0x1c3bx12[_0xebe6[35]]){case _0xebe6[40]:_0x1c3bx17[_0x1c3bx12[_0xebe6[31]]]= {lt:_0x1c3bx18};break;case _0xebe6[41]:_0x1c3bx17[_0x1c3bx12[_0xebe6[31]]]= {$lte:_0x1c3bx18};break;case _0xebe6[42]:_0x1c3bx17[_0x1c3bx12[_0xebe6[31]]]= {$gt:_0x1c3bx18};break;case _0xebe6[43]:_0x1c3bx17[_0x1c3bx12[_0xebe6[31]]]= {$gte:_0x1c3bx18};break;default:};break;default:};return _0x1c3bx17}function createInterval(_0x1c3bxe){console[_0xebe6[7]](_0xebe6[45],_0x1c3bxe[_0xebe6[10]],_0xebe6[46],_0x1c3bxe[_0xebe6[47]]* 60* 1000);activeChatAutomations[_0xebe6[48]+ _0x1c3bxe[_0xebe6[10]]]= setInterval(function(){executeAutomation(_0x1c3bxe[_0xebe6[10]])},_0x1c3bxe[_0xebe6[47]]* 60* 1000)}module[_0xebe6[49]]= function(){Automation[_0xebe6[53]](function(_0x1c3bx1a,_0x1c3bx1b){console[_0xebe6[7]](_0xebe6[45],_0x1c3bx1a[_0xebe6[10]],_0xebe6[50],_0x1c3bx1a[_0xebe6[12]]);if(_0x1c3bx1a[_0xebe6[12]]&& _0x1c3bx1a[_0xebe6[51]]=== _0xebe6[52]){createInterval(_0x1c3bx1a)}});Automation[_0xebe6[56]](function(_0x1c3bx1a,_0x1c3bx1b){console[_0xebe6[7]](_0xebe6[45],_0x1c3bx1a[_0xebe6[10]],_0xebe6[54],_0x1c3bx1a[_0xebe6[12]]);if(activeChatAutomations[_0xebe6[48]+ _0x1c3bx1a[_0xebe6[10]]]){console[_0xebe6[7]](_0xebe6[55],_0x1c3bx1a[_0xebe6[10]]);clearInterval(activeChatAutomations[_0xebe6[48]+ _0x1c3bx1a[_0xebe6[10]]]);delete activeChatAutomations[_0xebe6[48]+ _0x1c3bx1a[_0xebe6[10]]]};if(_0x1c3bx1a[_0xebe6[12]]&& _0x1c3bx1a[_0xebe6[51]]=== _0xebe6[52]){createInterval(_0x1c3bx1a)}});Automation[_0xebe6[58]](function(_0x1c3bx1a,_0x1c3bx1b){console[_0xebe6[7]](_0xebe6[45],_0x1c3bx1a[_0xebe6[10]],_0xebe6[57]);if(activeChatAutomations[_0xebe6[48]+ _0x1c3bx1a[_0xebe6[10]]]){console[_0xebe6[7]](_0xebe6[55],_0x1c3bx1a[_0xebe6[10]]);clearInterval(activeChatAutomations[_0xebe6[48]+ _0x1c3bx1a[_0xebe6[10]]]);delete activeChatAutomations[_0xebe6[48]+ _0x1c3bx1a[_0xebe6[10]]]}});return Automation[_0xebe6[28]](_0xebe6[27])[_0xebe6[25]]({where:{status:true,channel:_0xebe6[52]},attributes:[_0xebe6[10],_0xebe6[47]]})[_0xebe6[16]](function(_0x1c3bx1c){_0x1c3bx1c[_0xebe6[14]](function(_0x1c3bxe){createInterval(_0x1c3bxe)})})[_0xebe6[9]](function(_0x1c3bxa){console[_0xebe6[7]](_0xebe6[59],_0x1c3bxa)})}
\ No newline at end of file