KR/function/sendJDNotify.js

24 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
2023-11-06 13:40:18 +08:00
var version_='jsjiami.com.v7';function iii1II(_0x183061,_0x2e336b){const _0x54e579=Iii11l();return iii1II=function(_0x2aea3b,_0x1870c6){_0x2aea3b=_0x2aea3b-0x1c9;let _0x32082e=_0x54e579[_0x2aea3b];if(iii1II['IRbRGQ']===undefined){var _0x24b961=function(_0x5a111f){const _0x4cf38b='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x436d3a='',_0x5492e1='';for(let _0x21906c=0x0,_0x2bcae4,_0x7c8a8b,_0x9b282f=0x0;_0x7c8a8b=_0x5a111f['charAt'](_0x9b282f++);~_0x7c8a8b&&(_0x2bcae4=_0x21906c%0x4?_0x2bcae4*0x40+_0x7c8a8b:_0x7c8a8b,_0x21906c++%0x4)?_0x436d3a+=String['fromCharCode'](0xff&_0x2bcae4>>(-0x2*_0x21906c&0x6)):0x0){_0x7c8a8b=_0x4cf38b['indexOf'](_0x7c8a8b);}for(let _0x3fca38=0x0,_0x42236b=_0x436d3a['length'];_0x3fca38<_0x42236b;_0x3fca38++){_0x5492e1+='%'+('00'+_0x436d3a['charCodeAt'](_0x3fca38)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x5492e1);};const _0x4e544b=function(_0x3429ef,_0x3de768){let _0x255d88=[],_0xf47390=0x0,_0x63a965,_0x3e1371='';_0x3429ef=_0x24b961(_0x3429ef);let _0x55f6b4;for(_0x55f6b4=0x0;_0x55f6b4<0x100;_0x55f6b4++){_0x255d88[_0x55f6b4]=_0x55f6b4;}for(_0x55f6b4=0x0;_0x55f6b4<0x100;_0x55f6b4++){_0xf47390=(_0xf47390+_0x255d88[_0x55f6b4]+_0x3de768['charCodeAt'](_0x55f6b4%_0x3de768['length']))%0x100,_0x63a965=_0x255d88[_0x55f6b4],_0x255d88[_0x55f6b4]=_0x255d88[_0xf47390],_0x255d88[_0xf47390]=_0x63a965;}_0x55f6b4=0x0,_0xf47390=0x0;for(let _0x38495a=0x0;_0x38495a<_0x3429ef['length'];_0x38495a++){_0x55f6b4=(_0x55f6b4+0x1)%0x100,_0xf47390=(_0xf47390+_0x255d88[_0x55f6b4])%0x100,_0x63a965=_0x255d88[_0x55f6b4],_0x255d88[_0x55f6b4]=_0x255d88[_0xf47390],_0x255d88[_0xf47390]=_0x63a965,_0x3e1371+=String['fromCharCode'](_0x3429ef['charCodeAt'](_0x38495a)^_0x255d88[(_0x255d88[_0x55f6b4]+_0x255d88[_0xf47390])%0x100]);}return _0x3e1371;};iii1II['Fptrnq']=_0x4e544b,_0x183061=arguments,iii1II['IRbRGQ']=!![];}const _0x148fcc=_0x54e579[0x0],_0x4aac66=_0x2aea3b+_0x148fcc,_0x1f135b=_0x183061[_0x4aac66];return!_0x1f135b?(iii1II['nDLrJY']===undefined&&(iii1II['nDLrJY']=!![]),_0x32082e=iii1II['Fptrnq'](_0x32082e,_0x1870c6),_0x183061[_0x4aac66]=_0x32082e):_0x32082e=_0x1f135b,_0x32082e;},iii1II(_0x183061,_0x2e336b);}function Iii11l(){const I1il11=(function(){return[...[version_,'bAPjEsBQjPrSiJaLLQmQRiyKe.EQKcuomB.ROve7==','vmoXW4ritgKlxq','W54tWQdcVJi','W4VcNSkNW6pdJW','neBdH3FdJZS','W67cLCkbW7FdGmo7c8oJ','emkcW513','W73cPmkAugpdKYzYW7qLzc0kqa','W5hdVue9mSoZWOS','W5OEtbaP','W6ldIvDNhmkKpqZdKJSCWRGvfq','aSklhSkGW4y','r8oGW4TAW7u','w3NdR8o2W5u','qqi+W40mW6RdV24','ECoKW6rlW5zMzXdcRKC','lx/dKs0Eemoum8kfAmojjYO','WRKRW4aUWQq','W73dVmoQwW/dIJhcV1BdRa','mudcULtcSq','W4dcMgFdN8kv','W7S7lfFdSNa','W641W75cW7S','W7BcH8kHWRRdMmoQWRa','lCk6ECoPWPJdLCk2WOaUra','W6W9nL3dVG','WOddVSooWQJcUa/dTve','k8oyh8oMlmkDyG','WQDsmCkLrhf6WPSCkW','ab1ufmk6','WQ48WQTVWOmHbmk/cW','W5JcPCo0WQq','WR4yW5uWWRpdMSk1WPLlWQxcKSkgWRKE','arL1W7xdSSkCbq','W5BcOmkltMe','W4BdTKC','W6WrtGK8pa/cVHVdUmoEpmoDWOu','m1/cSeJcK8kZW5/cUW','cSkJWOVcRI0','WOTmnmkVthO','rCo4W6HjW4LT','W54BWRdcTHJcQCooW75xjf/dMudcOq','W5VcPmo5WQ/cTG','j8kDvCoMWPu','g8oxc3/dNq','p0BdNv3dNIdcPmo5WONdLG','WQDDo8kLqgP1WOikgCoABmoraq','oL7cVNDT','hSkaW4VdHra','lmoEaSoIjSkaCW','WRFcK8k+W5ddLrZcLGJdT8oOlZy','W5hcRmkrrKRdMr9+W6eV','kSkIWOhcNtS','WRddImouWQNcGCkTk8otmqpcN8ks','prD4W6ldUmkhhZ84brpdMCohWR8','adxcV8kvW5q','FH3cQ1nM','z8o2sCkKWPhcSwlcTdBdRW','hCo0iL/dIsxcQw0mW6Gon8o3CW','WP/cQY52','A8o+WQZcSNa0W5ybfSoMWPq5nq','WPTtnSkYsNfV','W7WWW5LyW4S','WPeRcuTK','fmk9FSoU','ztqPWR4zaSkM'],...(function(){return[...['jMBcQYC9WQCTWPmqcCotW64','emktWOJcSdvr','WQpcG8oIWQNcM8oIW7FdTCka','W5hdUmoNxc7dKcVcOKpdLfusW6ug','W5z9WP9qpW','W7G4WQRcUIu','pmkmW5nXwCkBWONdOmkoW4ldMmoUW7hdSG','z1jglCom','pmoEbCo+la','A1bHkmoHWQFcGcy','CWeIW4WaW6ZdRLWSW6VcS8kwWOLSWPtcQvnpgmo1WRm','f8k6zG','oCkzWQlcSba','W4LOWP1Ep0G','Cs9HWQVdL37cU8oP','ECoNW6HBW45PyrJcJ1hdRSkGE8oUWQFcT2O','iuTnWP4aDG','uCozzCkwWQO','smkjDCkXu8oCkcTEWOtcV8o9yG','W67dK1f6gmk7','W5pdRui5','f8owbmoMjSk+CXraW59PWQNdRCkU','W7STWOBcNZ7cK8okW519chddT2BcMw/cGmoOcdO','W6pdVmo3tcddGIdcPq','hGXmhSkM','WPrznSkHw3C','kSk9W7ldOJy','W6ldLv