KR/function/sendJDNotify.js

25 lines
21 KiB
JavaScript
Raw Normal View History

2023-08-01 16:47:55 +08:00
/*
2023-11-03 11:17:33 +08:00
一个强大的推送通知库主要用于汇总多条账号消息后集中推送通知
默认情况下账号消息指的是单一账号的消息它由<前缀><用户名><消息内容>组成其中消息内容由一条或多条组成最后用指定字符拼接成一条合并内容
脚本最终汇总多条账号消息后集中触发推送通知业务每个账号的消息占用一行排列顺序以优先触发记录为原则
此库封装了多条方法推送通知业务调用自 sendNotify.js可引用此模块来平替引用它支持单消息推送
账号消息自定义功能如下环境变量
1关键词过滤触发时不推送对应单条账号消息 JD_NOTIFY_FILTER_KEYWORDS
export JD_NOTIFY_FILTER_KEYWORDS="空气@会员"多个关键词用@分割
2消息内容分隔符 JD_NOTIFY_DELIMITER默认为中文逗号
export JD_NOTIFY_DELIMITER="、"此分隔符用于分隔多条账号消息
3设置替换用户名为昵称 JD_NOTIFY_NICKNAMES
export JD_NOTIFY_NICKNAMES="userpin_α@哥哥,userpin_β@弟弟"多个昵称配置用英文逗号分割用户名和昵称用@分割
4是否显示用户名 JD_NOTIFY_SHOW_USERNAMEtrue/false默认显示
export JD_NOTIFY_SHOW_USERNAME="false"
5设置消息前缀格式 JD_NOTIFY_PREFIX_FORMATA默认为 "【京东账号<序号>】"
export JD_NOTIFY_PREFIX_FORMATA="[账号%]"%代表账号序号
6设置自动合并消息中用数字开头表示数量的内容 JD_NOTIFY_AUTO_MERGE_TYPE
export JD_NOTIFY_AUTO_MERGE_TYPE="积分 🎟️"多个规则用@分割正则匹配
2023-08-01 16:47:55 +08:00
new Env('sendJDNotify');
*/
2023-11-03 11:17:33 +08:00
var version_='jsjiami.com.v7';const l1l1iI=iii1II;function iii1II(_0x1a8110,_0x3d0e23){const _0xfbdf4f=Iii11l();return iii1II=function(_0x3a1ca9,_0x154f15){_0x3a1ca9=_0x3a1ca9-0x1ac;let _0x29f192=_0xfbdf4f[_0x3a1ca9];if(iii1II['BFrkUi']===undefined){var _0x242aa6=function(_0x279412){const _0x761072='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x420950='',_0x34d57d='';for(let _0x5baadc=0x0,_0x58ea7a,_0x8a5768,_0x1d3bf9=0x0;_0x8a5768=_0x279412['charAt'](_0x1d3bf9++);~_0x8a5768&&(_0x58ea7a=_0x5baadc%0x4?_0x58ea7a*0x40+_0x8a5768:_0x8a5768,_0x5baadc++%0x4)?_0x420950+=String['fromCharCode'](0xff&_0x58ea7a>>(-0x2*_0x5baadc&0x6)):0x0){_0x8a5768=_0x761072['indexOf'](_0x8a5768);}for(let _0x4428ea=0x0,_0x38ae4c=_0x420950['length'];_0x4428ea<_0x38ae4c;_0x4428ea++){_0x34d57d+='%'+('00'+_0x420950['charCodeAt'](_0x4428ea)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x34d57d);};const _0x23a107=function(_0x394420,_0xdf5705){let _0x2db9cc=[],_0x4175eb=0x0,_0x51d787,_0x5cdf9b='';_0x394420=_0x242aa6(_0x394420);let _0x15ccfe;for(_0x15ccfe=0x0;_0x15ccfe<0x100;_0x15ccfe++){_0x2db9cc[_0x15ccfe]=_0x15ccfe;}for(_0x15ccfe=0x0;_0x15ccfe<0x100;_0x15ccfe++){_0x4175eb=(_0x4175eb+_0x2db9cc[_0x15ccfe]+_0xdf5705['charCodeAt'](_0x15ccfe%_0xdf5705['length']))%0x100,_0x51d787=_0x2db9cc[_0x15ccfe],_0x2db9cc[_0x15ccfe]=_0x2db9cc[_0x4175eb],_0x2db9cc[_0x4175eb]=_0x51d787;}_0x15ccfe=0x0,_0x4175eb=0x0;for(let _0x32803e=0x0;_0x32803e<_0x394420['length'];_0x32803e++){_0x15ccfe=(_0x15ccfe+0x1)%0x100,_0x4175eb=(_0x4175eb+_0x2db9cc[_0x15ccfe])%0x100,_0x51d787=_0x2db9cc[_0x15ccfe],_0x2db9cc[_0x15ccfe]=_0x2db9cc[_0x4175eb],_0x2db9cc[_0x4175eb]=_0x51d787,_0x5cdf9b+=String['fromCharCode'](_0x394420['charCodeAt'](_0x32803e)^_0x2db9cc[(_0x2db9cc[_0x15ccfe]+_0x2db9cc[_0x4175eb])%0x100]);}return _0x5cdf9b;};iii1II['IWpxgM']=_0x23a107,_0x1a8110=arguments,iii1II['BFrkUi']=!![];}const _0x30950e=_0xfbdf4f[0x0],_0x370a62=_0x3a1ca9+_0x30950e,_0x5f395d=_0x1a8110[_0x370a62];return!_0x5f395d?(iii1II['HVDWxT']===undefined&&(iii1II['HVDWxT']=!![]),_0x29f192=iii1II['IWpxgM'](_0x29f192,_0x154f15),_0x1a8110[_0x370a62]=_0x29f192):_0x29f192=_0x5f395d,_0x29f192;},iii1II(_0x1a8110,_0x3d0e23);}function Iii11l(){const iI1Iil=(function(){return[...[version_,'EUWejxfusWjYFxiaUmYiKU.qcwCoEmqN.vhUy7xO==','W6ZdK8oXWQ8U','kb3cKaTcW6xdGYVdSCoQWODqrX9lm8kuW5TdW6GoWOq','wSkwWRS','tmkGB8kisG','kadcHX1xW63dNaJdMmoXWOzfvG','WQunWQ9znG','WRBcS8k5CufVWPtcPeJcGSofBXVdTareW7iYvCkZvG','o8kUW5W','44kd5lQa5lU06lEQ5y+yWOpJG5y','vcZdSv3dMa','W5NcGaGeW6m','WQiyWOFdUmkDWOfv','uNSFWRpdGSodmSodWRVdKcpdUa','r8kbwSkJymo0WRldJCozm8kUjCkXWRTnWQiz','W4rziCo7WRpcVu1gWPddKW','v0pdTq','aSk1D8okuWpcKCk9F8oBWOLGlG','WRlcNGlcJ14','W4XkWOFcVKldH8kZz8oWBXejofJcVSkeECkOcWNdMq','W4xdPKjtWOS','BSobExhcMG','mGddISobWRbr','W7ymWRZdTmo7n8oRW49xWOPSWQXV','W7BdJmoalw3cLSkXWOiozcJdImo+fq','pMxdPhlcHCoQfmo4','W5j7aCo/WPu','WRZcU8oXW6ddJa','WOJdO2eQimoLfSkaW6fnWPJdKmoeBG','W5JdVSoRW4zZ','W5hdPSoMmrK8WOhcS0BcICokuG','guFdPSoUWOlcMmkBWRRcL8kv','W5FdM3hdIYZdTmo2WPXuW4SAyJxdNG','dGldNCofWQjDtfCKW51IkmkV','WRhdR2GRiG','r8o8lCkqa1q','W7xdGSodW7jBW77dKfb3FmkLywG','B8kYE3q','AHb0l8kzimouWQiIWRfacs4s','ymk1CxuP','W7DoeZuBW4zr','WPddIrD7W5O2','WQFcNCkIt08','WRqjWQW','w8oHE3VcTCkEW5fFW7S9','DmkjuCk3z8o9','WPm/WOZcKrS','WPCUWOFcKmopW6q','zMzbia','W6dcJX8tW6RdUKqlF8kzxdbXW7iAW7RdKfjFWQRdGa','WRVdGdDmW6i','WRddR2mpia','kJ5RWR/cTSkYoadcUCkuWP9RW7ddJ1ZcR8kWuSoIW683WQ9s','WQlcPwNcPCkq','W7vEede','B8kpW5X7WQK','n8osWPuJEa','WRldTeGbda','W4JcNIK','eCoCWQiuxf90','W5BdPmo/WQC9','CIhdUG','WOddHCoWWOtdSa','W6HsjSo8','W4b+craz','W6bCWOtcPvS','rCksWRVcHGzplq','jgRdVmogWQ8'],...(function(){return[...['pCoJjcDLFComW4SrW7XybW','W77cHrroW7C','uuldRCkvWOyQWR4','uSoLlCknbum','axRdU8oaWRS','W7tdTCk7ASk8W6ZdTZ8','WQldSmo/WRJdVKObW4LqW5PPChnZgSoknYpcOLNcQhnnc3O','D8oGF30','AH9OomkDa8oqWR0GWQC','WQGzWO3dQCka','W4Lnjc4l','WOOzWQJcKWq','W4RdPuTXWOS','krpdPWNdRSotng1my8o5W7i0','FSkgWORcPGq','oInpW7xcL8kxj8oiWRhdRsVdKmkEcG','CCkxyvm7','qexdGeWdWRxdVcddJSonWOjR','WR3dPmoeWPNdIW','AXddIeq','iCk2W75WWPBcKCoa','yXrfcCkS','W6tdTSkuyCkR','W