diff --git a/lib/core/monitor.js b/lib/core/monitor.js index 3be1b34..79b8db8 100644 --- a/lib/core/monitor.js +++ b/lib/core/monitor.js @@ -593,12 +593,15 @@ class Monitor extends Searcher { let status = 0, { uid, dyid, chat_type, rid, relay_chat, ctrl, chat } = option, - { check_if_duplicated, is_copy_chat, is_repost_then_chat, is_not_create_partition } = config; + { check_if_duplicated, is_copy_chat, copy_blockword, is_repost_then_chat, is_not_create_partition } = config; /* 评论 */ if (rid && chat_type) { if (is_copy_chat) { - const copy_chat = getRandomOne(await bili.getChat(rid, chat_type)); + const copy_chat = getRandomOne( + (await bili.getChat(rid, chat_type)) + .filter(it => !(new RegExp(copy_blockword.join('|')).test(it[1]))) + ); chat = copy_chat[1] .replace( new RegExp(copy_chat[0], 'g'), diff --git a/lib/data/config.js b/lib/data/config.js index 5e8ff55..3847872 100644 --- a/lib/data/config.js +++ b/lib/data/config.js @@ -336,6 +336,11 @@ const config = { */ is_copy_chat: false, + /** + * 热评屏蔽词 + */ + copy_blockword: [], + /** * - 抽奖UP用户分组id(网页端点击分区后地址栏中的tagid) * - 自动获取 diff --git a/my_config.example.js b/my_config.example.js index 4e5478c..a980ab0 100644 --- a/my_config.example.js +++ b/my_config.example.js @@ -345,6 +345,11 @@ module.exports = Object.freeze({ */ is_copy_chat: false, + /** + * 热评屏蔽词 + */ + copy_blockword: ["三不原则"], + /** * - 抽奖UP用户分组id(网页端点击分区后地址栏中的tagid) * - 自动获取