From 4fa6d9ace479a7950ae215a078ec2f1c19e619ad Mon Sep 17 00:00:00 2001 From: shanmite Date: Tue, 3 Jan 2023 13:00:35 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=8F=AF=E5=85=B3=E9=97=AD=E9=A2=84?= =?UTF-8?q?=E7=BA=A6=E6=8A=BD=E5=A5=96=E8=BD=AC=E5=8F=91=20(#196)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed #196 --- lib/core/monitor.js | 15 ++++++++++++++- lib/data/config.js | 5 +++++ my_config.example.js | 6 ++++++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/lib/core/monitor.js b/lib/core/monitor.js index a979331..7ae7b05 100644 --- a/lib/core/monitor.js +++ b/lib/core/monitor.js @@ -263,7 +263,16 @@ class Monitor extends Searcher { /** 所有抽奖信息 */ let alllotteryinfo = []; const - { check_if_duplicated, save_lottery_info_to_file, set_lottery_info_url, disable_reserve_lottery, reserve_lottery_wait, 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, save_lottery_info_to_file, + set_lottery_info_url, disable_reserve_lottery, + is_not_relay_reserve_lottery, + reserve_lottery_wait, 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; /** @@ -433,6 +442,10 @@ class Monitor extends Searcher { } else { await delay(reserve_lottery_wait); await bili.reserve_lottery(reserve_id) + if (is_not_relay_reserve_lottery === true) { + log.info("预约抽奖", "已关闭预约抽奖转发功能"); + return false + } } } } diff --git a/lib/data/config.js b/lib/data/config.js index 2955b6a..74046c2 100644 --- a/lib/data/config.js +++ b/lib/data/config.js @@ -100,6 +100,11 @@ const config = { */ disable_reserve_lottery: false, + /** + * 不转发预约抽奖 + * - 预约抽奖可能与转发抽奖并存 + */ + is_not_relay_reserve_lottery: false, /** * 检查是否重复转发 diff --git a/my_config.example.js b/my_config.example.js index 5920596..0627202 100644 --- a/my_config.example.js +++ b/my_config.example.js @@ -102,6 +102,12 @@ module.exports = Object.freeze({ */ disable_reserve_lottery: false, + /** + * 不转发预约抽奖 + * - 预约抽奖可能与转发抽奖并存 + */ + is_not_relay_reserve_lottery: false, + /** * 检查是否重复转发 * - 不检查 -1