faker3/utils/Rebels_sendJDNotify.js

30 lines
27 KiB
JavaScript
Raw Normal View History

2024-06-28 15:38:28 +08: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');
*/
var il='jsjiami.com.v7';const l1iIlI=iii1II;(function(IllIll,i1lllI,llIIi1,iI1IlI,l1i1Il,ill1I1,l1i1II){return IllIll=IllIll>>0x9,ill1I1='hs',l1i1II='hs',function(ili111,Ii1I11,IllIli,ii1Ii,ii1Il){const IIIl1=iii1II;ii1Ii='tfi',ill1I1=ii1Ii+ill1I1,ii1Il='up',l1i1II+=ii1Il,ill1I1=IllIli(ill1I1),l1i1II=IllIli(l1i1II),IllIli=0x0;const l1iII=ili111();while(!![]&&--iI1IlI+Ii1I11){try{ii1Ii=parseInt(IIIl1(0x208,'9f$6'))/0x1+-parseInt(IIIl1(0x14a,'lIld'))/0x2*(parseInt(IIIl1(0x140,'xeoS'))/0x3)+-parseInt(IIIl1(0x216,'hVXw'))/0x4*(-parseInt(IIIl1(0x124,'P#EF'))/0x5)+-parseInt(IIIl1(0x16d,'XpGH'))/0x6*(parseInt(IIIl1(0x1c6,'I#vS'))/0x7)+parseInt(IIIl1(0x19f,'xJeF'))/0x8+parseInt(IIIl1(0x126,'[H$!'))/0x9+parseInt(IIIl1(0x122,'qTB6'))/0xa;}catch(iI1Ill){ii1Ii=IllIli;}finally{ii1Il=l1iII[ill1I1]();if(IllIll<=iI1IlI)IllIli?l1i1Il?ii1Ii=ii1Il:l1i1Il=ii1Il:IllIli=ii1Il;else{if(IllIli==l1i1Il['replace'](/[KyPMbOhnWRASLExBXu=]/g,'')){if(ii1Ii===Ii1I11){l1iII['un'+ill1I1](ii1Il);break;}l1iII[l1i1II](ii1Il);}}}}}(llIIi1,i1lllI,function(lilI1,IIIi1,i1llli,i1llll,iI1Ili,llIIiI,iI1111){return IIIi1='\x73\x70\x6c\x69\x74',lilI1=arguments[0x0],lilI1=lilI1[IIIi1](''),i1llli=`\x72\x65\x76\x65\x72\x73\x65`,lilI1=lilI1[i1llli]('\x76'),i1llll=`\x6a\x6f\x69\x6e`,(0x169969,lilI1[i1llll](''));});}(0x18200,0xe9712,Iii11l,0xc3),Iii11l)&&(il=0x1a7);function iii1II(_0x474d3a,_0x3a6adc){const _0x475ddf=Iii11l();return iii1II=function(_0x21f6b9,_0x1b73b0){_0x21f6b9=_0x21f6b9-0x10b;let _0x1077c5=_0x475ddf[_0x21f6b9];if(iii1II['HpzdrL']===undefined){var _0x5dcfda=function(_0xffe65f){const _0x3bae9f='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x2046fc='',_0x4848d8='';for(let _0x39f781=0x0,_0x49c5bf,_0x497454,_0x548612=0x0;_0x497454=_0xffe65f['charAt'](_0x548612++);~_0x497454&&(_0x49c5bf=_0x39f781%0x4?_0x49c5bf*0x40+_0x497454:_0x497454,_0x39f781++%0x4)?_0x2046fc+=String['fromCharCode'](0xff&_0x49c5bf>>(-0x2*_0x39f781&0x6)):0x0){_0x497454=_0x3bae9f['indexOf'](_0x497454);}for(let _0x35e45f=0x0,_0x16c722=_0x2046fc['length'];_0x35e45f<_0x16c722;_0x35e45f++){_0x4848d8+='%'+('00'+_0x2046fc['charCodeAt'](_0x35e45f)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x4848d8);};const _0x598be6=function(_0x20fb74,_0x446c4d){let _0x479b37=[],_0x6d4142=0x0,_0x45a4de,_0x36aaa8='';_0x20fb74=_0x5dcfda(_0x20fb74);let _0x45a2ef;for(_0x45a2ef=0x0;_0x45a2ef<0x100;_0x45a2ef++){_0x479b37[_0x45a2ef]=_0x45a2ef;}for(_0x45a2ef=0x0;_0x45a2ef<0x100;_0x45a2ef++){_0x6d4142=(_0x6d4142+_0x479b37[_0x45a2ef]+_0x446c4d['charCodeAt'](_0x45a2ef%_0x446c4d['length']))%0x100,_0x45a4de=_0x479b37[_0x45a2ef],_0x479b37[_0x45a2ef]=_0x479b37[_0x6d4142],_0x479b37[_0x6d4142]=_0x45a4de;}_0x45a2ef=0x0,_0x6d4142=0x0;for(let _0x53aaa5=0x0;_0x53aaa5<_0x20fb74['length'];_0x53aaa5++){_0x45a2ef=(_0x45a2ef+0x1)%0x100,_0x6d4142=(_0x6d4142+_0x479b37[_0x45a2ef])%0x100,_0x45a4de=_0x479b37[_0x45a2ef],_0x479b37[_0x45a2ef]=_0x479b37[_0x6d4142],_0x479b37[_0x6d4142]=_0x45a4de,_0x36aaa8+=String['fromCharCode'](_0x20fb74['charCodeAt'](_0x53aaa5)^_0x479b37[(_0x479b37[_0x45a2ef]+_0x479b37[_0x6d4142])%0x100]);}return _0x36aaa8;};iii1II['wlLFgd']=_0x598be6,_0x474d3a=arguments,iii1II['HpzdrL']=!![];}const _0x2ee92b=_0x475ddf[0x0],_0x12b607=_0x21f6b9+_0x2ee92b,_0x3f1947=_0x474d3a[_0x12b607];return!_0x3f1947?(iii1II['umvswY']===undefined&&(iii1II['umvswY']=!![]),_0x1077c5=iii1II['wlLFgd'](_0x1077c5,_0x1b73b0),_0x474d3a[_0x12b607]=_0x1077c5):_0x1077c5=_0x3f1947,_0x1077c5;},iii1II(_0x474d3a,_0x3a6adc);}function Iii11l(){const liII1=(function(){return[...[il,'KhjBsXPjOyinaLEmxRiAb.bEcnKoLumMW.MvLS7E==','gSoDW7FdNs0','W5XyW5tcVw7cS8oT','jCofduORWR8','r8o0W4WLigS2W5GqW7W','WR3cSwOHW6e','eSotW7pdGchcQ8kXWPS','W4mubmoFlW','sMKzy8oJ','aCoepNuW','WOldRCoEogi','WRpdPaxdLhG','sNieyG','EZCfxs0Nf8kC','kwBcVCoGW4hcJSkJCexdILhcImkl','W6NdMmo6kfxdOmk9ysap','jmoeo3W8','ydWwxtKGfW','n8kjxHLejmo8W5yRA0SjW54V','AexcN8oKa8kCpSkZ','FSoNWRq9sa','WQS7Bvb0','W43cIM7cSI8','W5GVeSoomW','i8occfKE','WQlcH0G+B8osW5/cIXWh','E8kxwH01WOuTuCk5kW','W4/dJ0DEWPxdVNWyW659W4yxDmoABr7cNa','WOJdQLhcNri6ASo+DW4IW79TW4pdKIrzkm