From c8e1a328ecb5f9a8bd3255589558804d02ab545f Mon Sep 17 00:00:00 2001 From: shanmite Date: Sun, 11 Sep 2022 17:12:50 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=20=E5=85=B3=E6=B3=A8UP=E4=B8=BB7?= =?UTF-8?q?=E5=A4=A9=E4=BB=A5=E4=B8=8A=E7=9A=84=E4=BA=BA=E5=8F=AF=E5=8F=91?= =?UTF-8?q?=E8=AF=84=E8=AE=BA(#192)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed #192 --- lib/core/monitor.js | 2 ++ lib/net/bili.js | 4 ++++ test/api.test.js | 6 +++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/core/monitor.js b/lib/core/monitor.js index 33564a8..4fc9d29 100644 --- a/lib/core/monitor.js +++ b/lib/core/monitor.js @@ -184,6 +184,7 @@ class Monitor extends Searcher { case 1008: case 1009: case 1010: + case 1011: case 2002: case 2003: case 4001: @@ -532,6 +533,7 @@ class Monitor extends Searcher { * - 评论 内容包含敏感信息 1008 * - 评论 重复评论 1009 * - 评论 帐号未登录 1010 + * - 评论 关注UP主7天以上的人可发评论 1011 * - 关注 未知错误 2001 * - 关注 您已被对方拉入黑名单 2002 * - 关注 黑名单用户无法关注 2003 diff --git a/lib/net/bili.js b/lib/net/bili.js index 714f2af..d6766f3 100644 --- a/lib/net/bili.js +++ b/lib/net/bili.js @@ -984,6 +984,7 @@ const bili_client = { * - 评论内容包含敏感信息 8 * - 重复评论 9 * - 帐号未登录 10 + * - 关注UP主7天以上的人可发评论 11 */ async sendChat(rid, msg, type) { const @@ -1028,6 +1029,9 @@ const bili_client = { case -101: log.error('自动评论', '帐号未登录'); return 10; + case 12078: + log.error('自动评论', '关注UP主7天以上的人可发评论'); + return 11; default: log.error('自动评论', `未知错误\n${responseText}`); return 1; diff --git a/test/api.test.js b/test/api.test.js index 7e64fbb..e9ba750 100644 --- a/test/api.test.js +++ b/test/api.test.js @@ -24,8 +24,12 @@ const util = require('./util'); 1), 3 ) - }, async () => { + }, + async () => { assert.notEqual((await bili_client.searchArticlesByKeyword("专栏")).length, 0) + }, + async () => { + assert.notEqual(await bili_client.sendChat("703886913053917267", "t", 17), 1) } ])