feat: 增加设置屏蔽动态类型block_dynamic_type(#99)

This commit is contained in:
shanmite 2021-12-23 14:42:46 +08:00
parent 548ad4b589
commit da75c8c17b
3 changed files with 37 additions and 2 deletions

View File

@ -236,7 +236,7 @@ class Monitor extends Searcher {
/** 所有抽奖信息 */ /** 所有抽奖信息 */
let alllotteryinfo = []; let alllotteryinfo = [];
const 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; now_ts = Date.now() / 1000;
/** /**
@ -354,7 +354,12 @@ class Monitor extends Searcher {
: blacklist.split(','), : blacklist.split(','),
keys = [dyid, m_uid, ori_uid]; 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) { if (!has_key_words && description) {
log.warn("筛选动态", `无关键词动态的描述: ${description}\n\n考虑是否修改设置key_words:\n${key_words.join('\n')}`) log.warn("筛选动态", `无关键词动态的描述: ${description}\n\n考虑是否修改设置key_words:\n${key_words.join('\n')}`)

View File

@ -78,6 +78,21 @@ const config = {
*/ */
check_if_duplicated: 1, check_if_duplicated: 1,
/**
* 屏蔽动态类型
*
* | 动态类型 | type值 |
* | :------- |:----- |
* | 转发 | `1` |
* | 含图片 | `2` |
* | 无图纯文字 | `4` |
* | 视频 | `8` |
* | 番剧 | `512` |
* | 活动 | `2048` |
* | 专栏 | `64` |
*/
block_dynamic_type: [0],
/** /**
* - 动态创建时间 * - 动态创建时间
* - 多少天前 * - 多少天前

View File

@ -92,6 +92,21 @@ module.exports = Object.freeze({
*/ */
check_if_duplicated: 1, check_if_duplicated: 1,
/**
* 屏蔽动态类型
*
* | 动态类型 | type值 |
* | :------- |:----- |
* | 转发 | `1` |
* | 含图片 | `2` |
* | 无图纯文字 | `4` |
* | 视频 | `8` |
* | 番剧 | `512` |
* | 活动 | `2048` |
* | 专栏 | `64` |
*/
block_dynamic_type: [0],
/** /**
* - 动态创建时间 * - 动态创建时间
* - 多少天前 * - 多少天前