mirror of
https://github.com/shanmiteko/LotteryAutoScript.git
synced 2026-07-22 21:13:47 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a426eb48f5 |
+17
-16
@@ -55,9 +55,10 @@ class Monitor extends Searcher {
|
||||
event_bus.emit('Turn_on_the_Monitor')
|
||||
break
|
||||
case 22:
|
||||
config.only_followed = true;
|
||||
log.warn('账号异常', `UID(${global_var.get('myUID')})临时进入只转已关注模式(异常号只会对部分UP出现关注异常)`)
|
||||
if (!config.is_exception) {
|
||||
config.is_exception = true;
|
||||
await sendNotify('[动态抽奖]账号异常通知', `UID: ${global_var.get('myUID')}\n\n已自动跳过异常关注(异常号只会对部分UP出现关注异常)\n\n可在设置中令is_exception为true关闭此推送`)
|
||||
await sendNotify('[动态抽奖]账号异常通知', `UID: ${global_var.get('myUID')}\n\n临时进入只转已关注模式(异常号只会对部分UP出现关注异常)\n\n可在设置中令is_exception为true关闭此推送`)
|
||||
}
|
||||
event_bus.emit('Turn_on_the_Monitor')
|
||||
break
|
||||
@@ -116,10 +117,10 @@ class Monitor extends Searcher {
|
||||
}
|
||||
}
|
||||
status = await this.go(Lottery)
|
||||
if (status % 2 !== 0) {
|
||||
if (status) {
|
||||
return status
|
||||
}
|
||||
d_storage.updateDyid(Lottery.dyid);
|
||||
d_storage.updateDyid(Lottery.dyid)
|
||||
await utils.delay(config.wait * (Math.random() + 0.5));
|
||||
}
|
||||
log.info('抽奖', '开始转发下一组动态');
|
||||
@@ -191,20 +192,20 @@ class Monitor extends Searcher {
|
||||
|
||||
const
|
||||
/**判断是转发源动态还是现动态 */
|
||||
uid = lottery_info_type === 'uid' ? uids[1] : uids[0]
|
||||
, isFollowed = (new RegExp(uid)).test(attentionList)
|
||||
, description = typeof des === 'string' ? des : ''
|
||||
, needAt = /(?:@|艾特)[^@|(艾特)]*?好友/.test(description)
|
||||
, needTopic = [...new Set(description.match(/(?<=[带加上](?:话题|tag).*)#.+?#|(?<=[带加上])#.+?#(?=话题|tag)/ig) || [])].join(' ')
|
||||
, isRelayDynamic = type === 1
|
||||
, isTwoLevelDynamic = /\/\/@/.test(description)
|
||||
, has_key_words = key_words.every(it => new RegExp(it).test(description))
|
||||
, isBlock = new RegExp(blockword.join('|')).test(description)
|
||||
, isLottery =
|
||||
uid = lottery_info_type === 'uid' ? uids[1] : uids[0],
|
||||
isFollowed = (new RegExp(uid)).test(attentionList),
|
||||
description = typeof des === 'string' ? des : '',
|
||||
needAt = /(?:@|艾特)[^@|(艾特)]*?好友/.test(description),
|
||||
needTopic = [...new Set(description.match(/(?<=[带加上](?:话题|tag).*)#.+?#|(?<=[带加上])#.+?#(?=话题|tag)/ig) || [])].join(' '),
|
||||
isRelayDynamic = type === 1,
|
||||
isTwoLevelDynamic = /\/\/@/.test(description),
|
||||
has_key_words = key_words.every(it => new RegExp(it).test(description)),
|
||||
isBlock = new RegExp(blockword.join('|')).test(description),
|
||||
isLottery =
|
||||
(is_imitator && lottery_info_type === 'uid' && model !== '00')
|
||||
|| (hasOfficialLottery && model[0] === '1')
|
||||
|| (!hasOfficialLottery && model[1] === '1' && !isTwoLevelDynamic && has_key_words)
|
||||
, isSendChat =
|
||||
|| (!hasOfficialLottery && model[1] === '1' && !isTwoLevelDynamic && has_key_words),
|
||||
isSendChat =
|
||||
(is_imitator && lottery_info_type === 'uid' && chatmodel !== '00')
|
||||
|| (hasOfficialLottery && chatmodel[0] === '1')
|
||||
|| (!hasOfficialLottery && chatmodel[1] === '1');
|
||||
|
||||
+10
-10
@@ -221,7 +221,7 @@ function serverNotify(text, desp) {
|
||||
}
|
||||
})
|
||||
} else {
|
||||
log.warn('发送通知', '您未提供server酱的SCKEY,取消微信推送消息通知\n');
|
||||
log.debug('发送通知', '您未提供server酱的SCKEY,取消微信推送消息通知\n');
|
||||
resolve()
|
||||
}
|
||||
})
|
||||
@@ -263,7 +263,7 @@ function serverNotifyTurbo(text, desp) {
|
||||
}
|
||||
})
|
||||
} else {
|
||||
log.warn('发送通知', '您未提供server酱(Turbo版)的SCKEY,取消微信推送消息通知\n');
|
||||
log.debug('发送通知', '您未提供server酱(Turbo版)的SCKEY,取消微信推送消息通知\n');
|
||||
resolve()
|
||||
}
|
||||
})
|
||||
@@ -319,7 +319,7 @@ function coolPush(text, desp) {
|
||||
}
|
||||
})
|
||||
} else {
|
||||
log.warn('发送通知', '您未提供酷推的SKEY,取消QQ推送消息通知\n');
|
||||
log.debug('发送通知', '您未提供酷推的SKEY,取消QQ推送消息通知\n');
|
||||
resolve()
|
||||
}
|
||||
})
|
||||
@@ -362,7 +362,7 @@ function barkNotify(text, desp, params = {}) {
|
||||
}
|
||||
})
|
||||
} else {
|
||||
log.warn('发送通知', '您未提供Bark的APP推送BARK_PUSH,取消Bark推送消息通知\n');
|
||||
log.debug('发送通知', '您未提供Bark的APP推送BARK_PUSH,取消Bark推送消息通知\n');
|
||||
resolve()
|
||||
}
|
||||
})
|
||||
@@ -417,7 +417,7 @@ function tgBotNotify(text, desp) {
|
||||
}
|
||||
send(options)
|
||||
} else {
|
||||
log.warn('发送通知', '您未提供telegram机器人推送所需的TG_BOT_TOKEN和TG_USER_ID,取消telegram推送消息通知\n');
|
||||
log.debug('发送通知', '您未提供telegram机器人推送所需的TG_BOT_TOKEN和TG_USER_ID,取消telegram推送消息通知\n');
|
||||
resolve()
|
||||
}
|
||||
})
|
||||
@@ -512,7 +512,7 @@ function ddBotNotify(text, desp) {
|
||||
}
|
||||
})
|
||||
} else {
|
||||
log.warn('发送通知', '您未提供钉钉机器人推送所需的DD_BOT_TOKEN或者DD_BOT_SECRET,取消钉钉推送消息通知\n');
|
||||
log.debug('发送通知', '您未提供钉钉机器人推送所需的DD_BOT_TOKEN或者DD_BOT_SECRET,取消钉钉推送消息通知\n');
|
||||
resolve()
|
||||
}
|
||||
})
|
||||
@@ -558,7 +558,7 @@ function qywxBotNotify(text, desp) {
|
||||
}
|
||||
})
|
||||
} else {
|
||||
log.warn('发送通知', '您未提供企业微信机器人推送所需的QYWX_KEY,取消企业微信推送消息通知\n');
|
||||
log.debug('发送通知', '您未提供企业微信机器人推送所需的QYWX_KEY,取消企业微信推送消息通知\n');
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
@@ -610,7 +610,7 @@ function iGotNotify(text, desp, params = {}) {
|
||||
}
|
||||
})
|
||||
} else {
|
||||
log.warn('发送通知', '您未提供iGot的推送IGOT_PUSH_KEY,取消iGot推送消息通知\n');
|
||||
log.debug('发送通知', '您未提供iGot的推送IGOT_PUSH_KEY,取消iGot推送消息通知\n');
|
||||
resolve()
|
||||
}
|
||||
})
|
||||
@@ -656,7 +656,7 @@ function pushPlusNotify(text, desp) {
|
||||
}
|
||||
})
|
||||
} else {
|
||||
log.warn('发送通知', '您未提供push+推送所需的PUSH_PLUS_TOKEN,取消push+推送消息通知\n');
|
||||
log.debug('发送通知', '您未提供push+推送所需的PUSH_PLUS_TOKEN,取消push+推送消息通知\n');
|
||||
resolve()
|
||||
}
|
||||
})
|
||||
@@ -684,7 +684,7 @@ async function email(text, desp) {
|
||||
}
|
||||
log.info('发送通知', 'email发送成功');
|
||||
} else {
|
||||
log.warn('发送通知', '您未提供email推送所需的所有参数故取消email推送消息通知\n');
|
||||
log.debug('发送通知', '您未提供email推送所需的所有参数故取消email推送消息通知\n');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "lottery-auto-script",
|
||||
"version": "2.0.7",
|
||||
"version": "2.0.8",
|
||||
"description": "自动参与B站动态抽奖",
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user