feat: 新增设置disable_reserve_lottery

是否不参与预约抽奖
This commit is contained in:
shanmite 2022-06-25 10:39:57 +08:00
parent 03e24b9b84
commit 607b2d7055
3 changed files with 19 additions and 5 deletions

View File

@ -246,7 +246,7 @@ class Monitor extends Searcher {
/** 所有抽奖信息 */
let alllotteryinfo = [];
const
{ check_if_duplicated, set_lottery_info_url, sneaktower, key_words, model, chatmodel, chat: chats, relay: relays, block_dynamic_type, max_create_time, is_imitator, only_followed, at_users, blockword, blacklist, use_public_blacklist } = config,
{ check_if_duplicated, set_lottery_info_url, disable_reserve_lottery, sneaktower, key_words, model, chatmodel, chat: chats, relay: relays, block_dynamic_type, max_create_time, is_imitator, only_followed, at_users, blockword, blacklist, use_public_blacklist } = config,
now_ts = Date.now() / 1000;
/**
@ -374,11 +374,15 @@ class Monitor extends Searcher {
}
if (reserve_id) {
log.info("预约抽奖", "开始");
if (hasEnv('NOT_GO_LOTTERY')) {
log.info('NOT_GO_LOTTERY', 'ON');
if (disable_reserve_lottery) {
log.info("已关闭预约抽奖功能")
} else {
await bili.reserve_lottery(reserve_id)
log.info("预约抽奖", "开始");
if (hasEnv('NOT_GO_LOTTERY')) {
log.info('NOT_GO_LOTTERY', 'ON');
} else {
await bili.reserve_lottery(reserve_id)
}
}
}

View File

@ -69,6 +69,11 @@ const config = {
*/
chatmodel: '01',
/**
* 不参与预约抽奖
*/
disable_reserve_lottery: false,
/**
* 检查是否重复转发
* - 不检查 -1

View File

@ -84,6 +84,11 @@ module.exports = Object.freeze({
*/
chatmodel: '01',
/**
* 不参与预约抽奖
*/
disable_reserve_lottery: false,
/**
* 检查是否重复转发
* - 不检查 -1