fix: 优化截取tag的逻辑

This commit is contained in:
shanmite 2021-08-06 22:03:31 +08:00
parent f157761f5c
commit 673b3883a8
4 changed files with 15 additions and 13 deletions

View File

@ -78,11 +78,11 @@ body:
- id: nodejs_version
type: input
validations:
required: true
required: false
attributes:
label: "NodeJs版本"
description: |
在控制台输入 node -v 即可查看版本号
若使用源码运行请在控制台输入`node -v`查看版本号。
placeholder: |
eg: v16.5.0

View File

@ -195,7 +195,7 @@ class Monitor extends Public {
, isFollowed = (new RegExp(uid)).test(attentionList)
, description = typeof des === 'string' ? des : ''
, needAt = /(?:@|艾特)[^@|(艾特)]*?好友/.test(description)
, needTopic = (/(?<=[带加上](?:话题|tag))#.*#/i.exec(description) || [])[0]
, needTopic = [...(new Set(description.match(/(?<=[带加上](?:话题|tag).*)#.+?#/ig) || []))].join(' ')
, isRelayDynamic = type === 1
, isTwoLevelDynamic = /\/\/@/.test(description)
, has_key_words = key_words.every(it => new RegExp(it).test(description))

View File

@ -10,7 +10,8 @@ const metainfo = [
` __/ | | | `,
` |___/ |_| `,
` `,
` v2.0.2 by shanmite`,
` Verison: v2.0.3`,
` Written by shanmite`,
]
/**多账号存储 */
let multiple_account = [];

View File

@ -225,15 +225,16 @@ module.exports = {
/**
* 清除动态类型
| 动态类型 | type值 |
| ---------- | ------ |
| | `0` |
| 转发 | `1` |
| 含图片 | `2` |
| 无图纯文字 | `4` |
| 视频 | `8` |
| 专栏 | `64` |
| 活动 | `2048` |
*
* | 动态类型 | type值 |
* | :------- |:----- |
* | | `0` |
* | 转发 | `1` |
* | 含图片 | `2` |
* | 无图纯文字 | `4` |
* | 视频 | `8` |
* | 活动 | `2048` |
* | 专栏 | `64` |
*/
clear_dynamic_type: 1
},