jdpro/utils/Rebels_sendJDNotify.js

30 lines
21 KiB
JavaScript
Raw Normal View History

2024-06-28 07:47:44 +00:00
/*
一个强大的推送通知库主要用于汇总多条账号消息后集中推送通知
默认情况下账号消息指的是单一账号的消息它由<前缀><用户名><消息内容>组成其中消息内容由一条或多条组成最后用指定字符拼接成一条合并内容
脚本最终汇总多条账号消息后集中触发推送通知业务每个账号的消息占用一行排列顺序以优先触发记录为原则
此库封装了多条方法推送通知业务调用自 sendNotify.js可引用此模块来平替引用它支持单消息推送
账号消息自定义功能如下环境变量
1关键词匹配白名单触发时推送对应单条账号消息另外定义后不再适用于黑名单关键词过滤 JD_NOTIFY_MATCH_KEYWORDS
export JD_NOTIFY_MATCH_KEYWORDS="积分"多个关键词用@分割
2关键词过滤黑名单触发时不推送对应单条账号消息 JD_NOTIFY_FILTER_KEYWORDS
export JD_NOTIFY_FILTER_KEYWORDS="空气@会员"多个关键词用@分割
3关键词清除触发时会清除消息内容中的对应关键字 JD_NOTIFY_CLEAR_KEYWORDS
export JD_NOTIFY_CLEAR_KEYWORDS="" # "空气"多个关键词用|分割如果你不想在账号消息中看到某些字样则可以使用此功能
4消息内容分隔符 JD_NOTIFY_SEPARATOR默认为中文逗号
export JD_NOTIFY_SEPARATOR="、"此分隔符用于分隔多条账号消息
5设置用户名昵称 JD_NOTIFY_NICKNAMES
export JD_NOTIFY_NICKNAMES="userpin_α@哥哥,userpin_β@弟弟"多个昵称配置用英文逗号分割用户名和昵称用@分割
6是否展示用户名 JD_NOTIFY_SHOW_USERNAMEtrue/false默认展示
export JD_NOTIFY_SHOW_USERNAME="false"
7. 设置推送通知的用户名是否脱敏 JD_NOTIFY_USERNAME_MASKINGtrue/false默认不脱敏根据用户名长度动态将部分字符用*替换
JD_NOTIFY_USERNAME_MASKING="true"
8设置消息前缀格式 JD_NOTIFY_PREFIX_FORMAT默认为 "【京东账号<序号>】<用户名>"
export JD_NOTIFY_PREFIX_FORMAT="账号%【@】"%代表账号序号@代表用户名
9设置自动合并消息中用数字开头表示数量的内容 JD_NOTIFY_AUTO_MERGE_TYPE
export JD_NOTIFY_AUTO_MERGE_TYPE="积分"多个规则用@分割正则匹配
new Env('Rebels_sendJDNotify');
*/
2024-07-07 10:34:15 +00:00
const _0xd9dfef=_0x3306;(function(_0x33130e,_0x2569a3){const _0x2025fd=_0x3306,_0x33ce15=_0x33130e();while(!![]){try{const _0x321f30=-parseInt(_0x2025fd(0x1ff,'yRQz'))/0x1+parseInt(_0x2025fd(0x1d4,'R[]7'))/0x2*(-parseInt(_0x2025fd(0x232,'OQ4#'))/0x3)+-parseInt(_0x2025fd(0x1bc,'j9WF'))/0x4*(-parseInt(_0x2025fd(0x1b9,'OQ4#'))/0x5)+-parseInt(_0x2025fd(0x22d,'h(YY'))/0x6+-parseInt(_0x2025fd(0x1cc,'h(YY'))/0x7*(-parseInt(_0x2025fd(0x1c6,'lEi%'))/0x8)+-parseInt(_0x2025fd(0x1f6,'5y9G'))/0x9+parseInt(_0x2025fd(0x214,'uI$*'))/0xa*(parseInt(_0x2025fd(0x231,'#A)4'))/0xb);if(_0x321f30===_0x2569a3)break;else _0x33ce15['push'](_0x33ce15['shift']());}catch(_0x1fdb37){_0x33ce15['push'](_0x33ce15['shift']());}}}(_0x1716,0xdae73));function _0x3306(_0x1a0d42,_0x7d21e6){const _0x17166b=_0x1716();return _0x3306=function(_0x3306d2,_0x489262){_0x3306d2=_0x3306d2-0x1a3;let _0x54f0f2=_0x17166b[_0x3306d2];if(_0x3306['NvUdcK']===undefined){var _0x27177b=function(_0x347e7f){const _0x2b674f='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x423fb='',_0xa88d03='';for(let _0x19ab71=0x0,_0x4e3ea4,_0x3a05ac,_0x18f0b3=0x0;_0x3a05ac=_0x347e7f['charAt'](_0x18f0b3++);~_0x3a05ac&&(_0x4e3ea4=_0x19ab71%0x4?_0x4e3ea4*0x40+_0x3a05ac:_0x3a05ac,_0x19ab71++%0x4)?_0x423fb+=String['fromCharCode'](0xff&_0x4e3ea4>>(-0x2*_0x19ab71&0x6)):0x0){_0x3a05ac=_0x2b674f['indexOf'](_0x3a05ac);}for(let _0x3b621a=0x0,_0x453517=_0x423fb['length'];_0x3b621a<_0x453517;_0x3b621a++){_0xa88d03+='%'+('00'+_0x423fb['charCodeAt'](_0x3b621a)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0xa88d03);};const _0x176f44=function(_0x3152b6,_0xe54139){let _0x3827fa=[],_0x478e29=0x0,_0x39c8c0,_0x477698='';_0x3152b6=_0x27177b(_0x3152b6);let _0xd87c95;for(_0xd87c95=0x0;_0xd87c95<0x100;_0xd87c95++){_0x3827fa[_0xd87c95]=_0xd87c95;}for(_0xd87c95=0x0;_0xd87c95<0x100;_0xd87c95++){_0x478e29=(_0x478e29+_0x3827fa[_0xd87c95]+_0xe54139['charCodeAt'](_0xd87c95%_0xe54139['length']))%0x100,_0x39c8c0=_0x3827fa[_0xd87c95],_0x3827fa[_0xd87c95]=_0x3827fa[_0x478e29],_0x3827fa[_0x478e29]=_0x39c8c0;}_0xd87c95=0x0,_0x478e29=0x0;for(let _0x54f7da=0x0;_0x54f7da<_0x3152b6['length'];_0x54f7da++){_0xd87c95=(_0xd87c95+0x1)%0x100,_0x478e29=(_0x478e29+_0x3827fa[_0xd87c95])%0x100,_0x39c8c0=_0x3827fa[_0xd87c95],_0x3827fa[_0xd87c95]=_0x3827fa[_0x478e29],_0x3827fa[_0x478e29]=_0x39c8c0,_0x477698+=String['fromCharCode'](_0x3152b6['charCodeAt'](_0x54f7da)^_0x3827fa[(_0x3827fa[_0xd87c95]+_0x3827fa[_0x478e29])%0x100]);}return _0x477698;};_0x3306['pHoaZR']=_0x176f44,_0x1a0d42=arguments,_0x3306['NvUdcK']=!![];}const _0x242e69=_0x17166b[0x0],_0x48abe4=_0x3306d2+_0x242e69,_0x1f28fa=_0x1a0d42[_0x48abe4];return!_0x1f28fa?(_0x3306['JhXGfp']===undefined&&(_0x3306['JhXGfp']=!![]),_0x54f0f2=_0x3306['pHoaZR'](_0x54f0f2,_0x489262),_0x1a0d42[_0x48abe4]=_0x54f0f2):_0x54f0f2=_0x1f28fa,_0x54f0f2;},_0x3306(_0x1a0d42,_0x7d21e6);}function _0x1716(){const _0x5887e3=['smo+W4KOWPjUWPxcRW','kCo3AM7dOSknWOpcKuZcMHJcH8k1d8oGW6FdRG','ESoOW5i0WOrCWOpcUCouWPDusCoj','WOvIkG','W6ZcUY7cKCoLeIWOWRq8va','W7fRWPZcRSkD','WPjPlgpcGmoNia','W4BcUc/cNSo1oqaZWRmUsmkCoq','a8o0FhJdPCk4WO3cGhpcMG','W43dP8kaW7u4WRP7','w8osW4OiWOfxrHFcVmo/W4RcMIddRa','qCoWdCkQaSobW4JcS8knqJVdP1dcH8kxbmkauwqm','bSkXWOyRCCoAkf4dWP3cP1hdISkRWPFdMIFcT8oHpv8','wSkeuv1hz8oApCoGaSk2eSkl','rWbhWPiQW4WliwCHdrVdUYeDWOiuz3JcVCo0nCkgWRiOW6BcV13cLZdcJvHPuG','W4FcUGrAEq','bY4iW6tdOJuZaXBcSq','i8oyzSoN','WRfEW6LY','W5hcLctdQNKlW5/cNa','W6ZcPs7cJmoYpsq5WO4/xCktp8oHWPGTsW','W5RcPGLs','WPVdImkRBHxcNYC','W5TvgCo5','W7yymcK','C8kkmf/cU8kNFCkrrSoWaCkKWQC','zuhcK8k8exHOW49uW5rXx8oRxG','D8opW4mtWPi','W77dH3RdR8k8WRHA','WQbiWPtcJ2z+WOtdGI1SW5RdSbm','W7LKWP4','WPnJmwO','WQBcNCkNW518x8kmxeFdIsDynSo6DJ/cRW','W4BdJd5GW63dL8k5WPddQ8oqrCkB','qSktecrnW7W/zSofxLpdOq','WPRcIqy0WP3dSKS','cv8TWQu','tKZdN8kig8oSW6vMWOH5W4iXdKeHxXtdSH8zW57cOmoqW484xq','Emkada','WPNdK3xdNSkQWQfefmoFlXaRWQ0KW7/cRGOxW4zM','W6ZcPs7cJmoYpsq5WPa7wCkrjColWOK7tSkZzHv4','WQ5EW6LXfmoh','W6pcNZ7dUNmcW5VcGSojW78','W4O9WPlcVLBcNSoIcMJdNG','W5/cNJNdRx0cW44','v8o+W4O+WPj9','oSkUWOy5DSoE','WO7cHrOSWPNdOW','W4BcPJJcMSo1ccOOWRe/',