diff --git a/lib/core/monitor.js b/lib/core/monitor.js index beeb9c8..47ac483 100644 --- a/lib/core/monitor.js +++ b/lib/core/monitor.js @@ -236,7 +236,7 @@ class Monitor extends Searcher { /** 所有抽奖信息 */ let alllotteryinfo = []; const - { check_if_duplicated, set_lottery_info_url, key_words, model, chatmodel, max_create_time, is_imitator, only_followed, at_users, blockword, blacklist, use_public_blacklist } = config, + { check_if_duplicated, set_lottery_info_url, key_words, model, chatmodel, block_dynamic_type, max_create_time, is_imitator, only_followed, at_users, blockword, blacklist, use_public_blacklist } = config, now_ts = Date.now() / 1000; /** @@ -354,7 +354,12 @@ class Monitor extends Searcher { : blacklist.split(','), keys = [dyid, m_uid, ori_uid]; - log.debug("筛选动态", { real_uid, mIsFollowed, oriIsFollowed, realIsFollowed, needAt, needTopic, isRelayDynamic, key_words, has_key_words, blockword, isBlock, isLottery, isSendChat }) + log.debug("筛选动态", { real_uid, mIsFollowed, oriIsFollowed, realIsFollowed, needAt, needTopic, type, isRelayDynamic, key_words, has_key_words, blockword, isBlock, isLottery, isSendChat }) + + if (block_dynamic_type.includes(type)) { + log.warn("筛选动态", `屏蔽动态类型 ${type}`) + return false + } if (!has_key_words && description) { log.warn("筛选动态", `无关键词动态的描述: ${description}\n\n考虑是否修改设置key_words:\n${key_words.join('\n')}`) diff --git a/lib/data/config.js b/lib/data/config.js index 8ceb96e..dd18828 100644 --- a/lib/data/config.js +++ b/lib/data/config.js @@ -78,6 +78,21 @@ const config = { */ check_if_duplicated: 1, + /** + * 屏蔽动态类型 + * + * | 动态类型 | type值 | + * | :------- |:----- | + * | 转发 | `1` | + * | 含图片 | `2` | + * | 无图纯文字 | `4` | + * | 视频 | `8` | + * | 番剧 | `512` | + * | 活动 | `2048` | + * | 专栏 | `64` | + */ + block_dynamic_type: [0], + /** * - 动态创建时间 * - 多少天前 diff --git a/my_config.example.js b/my_config.example.js index 4cb2a25..3d9d389 100644 --- a/my_config.example.js +++ b/my_config.example.js @@ -92,6 +92,21 @@ module.exports = Object.freeze({ */ check_if_duplicated: 1, + /** + * 屏蔽动态类型 + * + * | 动态类型 | type值 | + * | :------- |:----- | + * | 转发 | `1` | + * | 含图片 | `2` | + * | 无图纯文字 | `4` | + * | 视频 | `8` | + * | 番剧 | `512` | + * | 活动 | `2048` | + * | 专栏 | `64` | + */ + block_dynamic_type: [0], + /** * - 动态创建时间 * - 多少天前