From ae34c691b125d4202d07a65cdc80eab50775ddc1 Mon Sep 17 00:00:00 2001 From: shanmite Date: Wed, 5 Jan 2022 18:13:48 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E8=AE=BE=E7=BD=AE`is?= =?UTF-8?q?=5Frepost=5Fthen=5Fchat`(#103)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 转发并评论 --- lib/core/monitor.js | 8 ++++++-- lib/data/config.js | 6 ++++++ my_config.example.js | 6 ++++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/lib/core/monitor.js b/lib/core/monitor.js index 3ea92e5..74c73bc 100644 --- a/lib/core/monitor.js +++ b/lib/core/monitor.js @@ -519,7 +519,7 @@ class Monitor extends Searcher { let status = 0 const { uid, dyid, chat_type, rid, relay_chat, ctrl } = option, - { chat, check_if_duplicated } = config; + { chat, check_if_duplicated, is_repost_then_chat } = config; /* 评论 */ if (rid && chat_type) { @@ -527,7 +527,11 @@ class Monitor extends Searcher { status = await retryfn( 5, [1, 4], - () => bili.sendChat(rid, getRandomOne(chat), chat_type) + () => bili.sendChat( + rid, + is_repost_then_chat ? relay_chat : getRandomOne(chat), + chat_type + ) ) if (status) { diff --git a/lib/data/config.js b/lib/data/config.js index dd18828..a0406a9 100644 --- a/lib/data/config.js +++ b/lib/data/config.js @@ -260,6 +260,12 @@ const config = { */ blockword: ["脚本", "抽奖号", "钓鱼"], + /** + * 转发并评论 + * - 评论内容与转发内容相同 + */ + is_repost_then_chat: false, + /** * 转发评语 */ diff --git a/my_config.example.js b/my_config.example.js index 3d9d389..3550481 100644 --- a/my_config.example.js +++ b/my_config.example.js @@ -275,6 +275,12 @@ module.exports = Object.freeze({ */ blockword: ["脚本", "抽奖号", "钓鱼"], + /** + * 转发并评论 + * - 评论内容与转发内容相同 + */ + is_repost_then_chat: false, + /** * 转发评语 */