From b5fdb2d2476921ab979dd42ce98c6c940278e315 Mon Sep 17 00:00:00 2001 From: shanmiteko Date: Thu, 7 Oct 2021 12:44:33 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20clear=5Fdynamic=5Ftype=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E5=8F=AF=E4=BB=A5=E5=A4=9A=E9=80=89(#42)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/clear.js | 6 +++++- my_config.example.js | 6 +++++- package.json | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/clear.js b/lib/clear.js index b623fec..567c2e1 100644 --- a/lib/clear.js +++ b/lib/clear.js @@ -68,7 +68,11 @@ async function clear() { for (const [index, dyinfo] of allModifyDynamicResArray.entries()) { log.info('清理动态', `第${page + 1}页中的第${index + 1}个动态`) const { type, dynamic_id, createtime } = dyinfo || {}; - if (type === clear_dynamic_type) { + if (typeof type !== 'undefined' + && clear_dynamic_type instanceof Array + ? clear_dynamic_type.includes(type) + : clear_dynamic_type === type + ) { const { origin_uid } = dyinfo, days_ago = (Now - createtime) / 86400; diff --git a/my_config.example.js b/my_config.example.js index 09efc54..cf7903a 100644 --- a/my_config.example.js +++ b/my_config.example.js @@ -256,8 +256,12 @@ module.exports = Object.freeze({ * | 番剧 | `512` | * | 活动 | `2048` | * | 专栏 | `64` | + * + * @example + * 1 + * [1,2,4] */ - clear_dynamic_type: 1 + clear_dynamic_type: [1] }, /** diff --git a/package.json b/package.json index c62062f..7dc356e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lottery-auto-script", - "version": "2.2.2", + "version": "2.2.3", "description": "自动参与B站动态抽奖", "main": "main.js", "scripts": {