Skip to content

Commit

Permalink
feat: 预约抽奖参与间隔reserve_lottery_wait(#191)
Browse files Browse the repository at this point in the history
Fixed #191
  • Loading branch information
shanmiteko committed Sep 11, 2022
1 parent 58edd41 commit 35fe448
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/core/monitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ class Monitor extends Searcher {
/** 所有抽奖信息 */
let alllotteryinfo = [];
const
{ 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,
{ check_if_duplicated, 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,
now_ts = Date.now() / 1000;

/**
Expand Down Expand Up @@ -411,6 +411,7 @@ class Monitor extends Searcher {
if (hasEnv('NOT_GO_LOTTERY')) {
log.info('NOT_GO_LOTTERY', 'ON');
} else {
await delay(reserve_lottery_wait);
await bili.reserve_lottery(reserve_id)
}
}
Expand Down
6 changes: 6 additions & 0 deletions lib/data/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,12 @@ const config = {
*/
random_dynamic_wait: 2000,

/**
* - 预约抽奖间隔
* - 单位毫秒
*/
reserve_lottery_wait: 6000,

/**
* - up主粉丝数限制
*/
Expand Down
6 changes: 6 additions & 0 deletions my_config.example.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,12 @@ module.exports = Object.freeze({
*/
random_dynamic_wait: 2000,

/**
* - 预约抽奖间隔
* - 单位毫秒
*/
reserve_lottery_wait: 6000,

/**
* - up主粉丝数限制
*/
Expand Down

0 comments on commit 35fe448

Please sign in to comment.