yz-yuki-plugin 1.0.2-rc.2 → 1.0.2-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# YUKI-PLUGIN
|
|
4
4
|
|
|
5
|
-
- 一个适用于
|
|
5
|
+
- 一个适用于 `Yunzai 系列机器人框架` 的B站动态和微博动态订阅推送的插件
|
|
6
6
|
|
|
7
7
|
- 支持 群聊/私聊 订阅B站动态和微博动态,支持定时推送,支持手动触发推送,支持简单查询B站/微博用户信息。
|
|
8
8
|
|
|
@@ -10,12 +10,12 @@
|
|
|
10
10
|
|
|
11
11
|
## 🌰安装插件
|
|
12
12
|
|
|
13
|
-
#### 1.
|
|
14
|
-
|
|
13
|
+
#### 1. 安装方式选择
|
|
14
|
+
按照网络情况或个人喜好,选择安装方式。
|
|
15
15
|
|
|
16
|
-
```
|
|
16
|
+
##### ```Yunzai-Next:```
|
|
17
17
|
|
|
18
|
-
1.
|
|
18
|
+
1. yunzai-next npm包 方式 安装插件:
|
|
19
19
|
>```
|
|
20
20
|
> yarn add yz-yuki-plugin -W
|
|
21
21
|
>```
|
|
@@ -45,7 +45,7 @@ export default defineConfig({
|
|
|
45
45
|
> git clone https://mirror.ghproxy.com/https://github.com/snowtafir/yuki-plugin.git ./plugins/yuki-plugin
|
|
46
46
|
> ```
|
|
47
47
|
|
|
48
|
-
```
|
|
48
|
+
##### ```Yunzai-V3:```
|
|
49
49
|
>gitee仓库:
|
|
50
50
|
>```
|
|
51
51
|
>git clone --branch main3 https://gitee.com/snowtafir/yuki-plugin.git ./plugins/yuki-plugin
|
|
@@ -57,12 +57,12 @@ export default defineConfig({
|
|
|
57
57
|
>```
|
|
58
58
|
|
|
59
59
|
#### 2. 安装依赖
|
|
60
|
-
*
|
|
60
|
+
* Yunzai-Next:
|
|
61
61
|
```
|
|
62
62
|
yarn install
|
|
63
63
|
```
|
|
64
64
|
|
|
65
|
-
*
|
|
65
|
+
* Yunzai-V3:
|
|
66
66
|
```
|
|
67
67
|
pnpm install --filter=yuki-plugin
|
|
68
68
|
```
|
|
@@ -155,8 +155,8 @@ https://m.weibo.cn/u/7643376782 # 7643376782 为崩坏星穹铁道博主uid
|
|
|
155
155
|
||||
|
|
156
156
|
| **其他指令** | | |
|
|
157
157
|
| 查看版本信息 | 查看版本信息 | `#优纪版本` |
|
|
158
|
-
| 更新yuki插件 | 系统指令更新yuki插件,
|
|
159
|
-
| 强制更新yuki插件 | 强制更新yuki插件,
|
|
158
|
+
| 更新yuki插件 | 系统指令更新yuki插件,yunzai-next需安装yz-system | `#更新yuki-plugin` |
|
|
159
|
+
| 强制更新yuki插件 | 强制更新yuki插件,yunzai-next需安装yz-system| `#强制更新yuki-plugin` |
|
|
160
160
|
|
|
161
161
|
</details>
|
|
162
162
|
|
|
@@ -185,9 +185,9 @@ https://m.weibo.cn/u/7643376782 # 7643376782 为崩坏星穹铁道博主uid
|
|
|
185
185
|
|
|
186
186
|
| Nickname | Contribution |
|
|
187
187
|
| :-----------------------------------------------------------------: | ----------------------- |
|
|
188
|
-
|Yunzai-
|
|
189
|
-
| [
|
|
190
|
-
| [Yunzai-
|
|
188
|
+
|Yunzai-Next||
|
|
189
|
+
| [Yunzai-org文档](https://yunzai-org.github.io/docs/) | Yunzai Next 文档 |
|
|
190
|
+
| [Yunzai-Next 仓库](https://github.com/yunzai-org/yunzaijs/) | Yunzai Next |
|
|
191
191
|
|Yunzai-V3||
|
|
192
192
|
| [功能/插件库](https://gitee.com/yhArcadia/Yunzai-Bot-plugins-index) | Yunzai-Bot 相关内容索引 |
|
|
193
193
|
| [TRSS-Yunzai](https://gitee.com/TimeRainStarSky/Yunzai) | 时雨🌌星空的 TRSS-Yunzai |
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
desc: 查看版本信息
|
|
81
81
|
- icon: 钓鱼
|
|
82
82
|
title: "#更新yuki-plugin"
|
|
83
|
-
desc: "系统指令更新yuki插件,
|
|
83
|
+
desc: "系统指令更新yuki插件,yz-next需安装yz-system"
|
|
84
84
|
- icon: pluie_lotus
|
|
85
85
|
title: "#强制更新yuki-plugin"
|
|
86
|
-
desc: "强制更新yuki插件,
|
|
86
|
+
desc: "强制更新yuki插件,yz-next需安装yz-system"
|
|
@@ -233,13 +233,13 @@ class BiliQuery {
|
|
|
233
233
|
desc = data?.modules?.module_dynamic?.major?.opus || {};
|
|
234
234
|
pics = desc?.pics;
|
|
235
235
|
pics = pics.map((item) => { return item?.url; }) || [];
|
|
236
|
-
content =
|
|
236
|
+
content = desc?.summary?.text || "";
|
|
237
237
|
}
|
|
238
238
|
else {
|
|
239
239
|
desc = data?.modules?.module_dynamic?.desc || {};
|
|
240
240
|
pics = data?.modules?.module_dynamic?.major?.draw?.items;
|
|
241
241
|
pics = [];
|
|
242
|
-
content =
|
|
242
|
+
content = desc?.text;
|
|
243
243
|
}
|
|
244
244
|
if (!desc && !author)
|
|
245
245
|
return;
|
|
@@ -261,13 +261,13 @@ class BiliQuery {
|
|
|
261
261
|
pics = pics.map((item) => {
|
|
262
262
|
return item.url;
|
|
263
263
|
});
|
|
264
|
-
content =
|
|
264
|
+
content = desc?.summary?.text || "";
|
|
265
265
|
}
|
|
266
266
|
else {
|
|
267
267
|
desc = data?.modules?.module_dynamic?.desc;
|
|
268
268
|
pics = data?.modules?.module_dynamic?.major?.draw?.items;
|
|
269
269
|
pics = pics.map((item) => { return item?.src; });
|
|
270
|
-
content =
|
|
270
|
+
content = desc?.text;
|
|
271
271
|
}
|
|
272
272
|
if (!desc && !pics && !author)
|
|
273
273
|
return;
|
|
@@ -296,7 +296,7 @@ class BiliQuery {
|
|
|
296
296
|
pics = desc?.pics;
|
|
297
297
|
pics = pics.map((item) => { return item.url; }) || [];
|
|
298
298
|
dynamicTitle = desc?.title;
|
|
299
|
-
content =
|
|
299
|
+
content = desc?.summary?.text || "";
|
|
300
300
|
}
|
|
301
301
|
else {
|
|
302
302
|
desc = data?.modules?.module_dynamic?.major?.article || {};
|
|
@@ -325,7 +325,7 @@ class BiliQuery {
|
|
|
325
325
|
case "DYNAMIC_TYPE_FORWARD":
|
|
326
326
|
author = data?.modules?.module_author;
|
|
327
327
|
desc = data?.modules?.module_dynamic?.desc || {};
|
|
328
|
-
content =
|
|
328
|
+
content = desc?.text;
|
|
329
329
|
if (!desc && !author)
|
|
330
330
|
return;
|
|
331
331
|
if (!data.orig)
|
|
@@ -88,19 +88,24 @@ class BiliTask {
|
|
|
88
88
|
for (let [key, value] of uidMap) {
|
|
89
89
|
const tempDynamicList = dynamicList[key] || [];
|
|
90
90
|
const willPushDynamicList = [];
|
|
91
|
+
const printedList = new Set();
|
|
91
92
|
for (let dynamicItem of tempDynamicList) {
|
|
92
93
|
let author = dynamicItem?.modules?.module_author || {};
|
|
93
|
-
|
|
94
|
+
if (!printedList.has(author?.mid)) {
|
|
95
|
+
logger.info(`正在检测B站动态 [ ${author?.name} : ${author?.mid} ]`);
|
|
96
|
+
printedList.add(author?.mid);
|
|
97
|
+
}
|
|
94
98
|
if (!author?.pub_ts)
|
|
95
99
|
continue;
|
|
96
100
|
if (Number(now - author.pub_ts) > interval) {
|
|
97
|
-
logger.
|
|
101
|
+
logger.debug(`超过间隔,跳过 [ ${author?.name} : ${author?.mid} ] ${author?.pub_time} 的动态`);
|
|
98
102
|
continue;
|
|
99
103
|
}
|
|
100
104
|
if (dynamicItem.type === "DYNAMIC_TYPE_FORWARD" && !biliConfigData.pushTransmit)
|
|
101
105
|
continue;
|
|
102
106
|
willPushDynamicList.push(dynamicItem);
|
|
103
107
|
}
|
|
108
|
+
printedList.clear();
|
|
104
109
|
const pushMapInfo = value || {};
|
|
105
110
|
const { chatIds, bot_id, upName, type, chatType } = pushMapInfo;
|
|
106
111
|
for (let pushDynamicData of willPushDynamicList) {
|
|
@@ -46,20 +46,25 @@ class WeiboTask {
|
|
|
46
46
|
for (let [key, value] of uidMap) {
|
|
47
47
|
const tempDynamicList = dynamicList[key] || [];
|
|
48
48
|
const willPushDynamicList = [];
|
|
49
|
+
const printedList = new Set();
|
|
49
50
|
for (let dynamicItem of tempDynamicList) {
|
|
50
51
|
let raw_post = dynamicItem || {};
|
|
51
52
|
let user = raw_post?.mblog?.user || {};
|
|
52
|
-
|
|
53
|
+
if (!printedList.has(user?.id)) {
|
|
54
|
+
logger.info(`正在检测微博动态 [ ${user?.screen_name} : ${user?.id} ]`);
|
|
55
|
+
printedList.add(user?.id);
|
|
56
|
+
}
|
|
53
57
|
if (!raw_post?.mblog?.created_at)
|
|
54
58
|
continue;
|
|
55
59
|
if (Number(now - (WeiboQuery.getDynamicCreatetDate(raw_post) / 1000)) > interval) {
|
|
56
|
-
logger.
|
|
60
|
+
logger.debug(`超过间隔,跳过 [ ${user?.screen_name} : ${user?.id} ] ${raw_post?.mblog?.created_at} 的动态`);
|
|
57
61
|
continue;
|
|
58
62
|
}
|
|
59
63
|
if (dynamicItem.type === "DYNAMIC_TYPE_FORWARD" && !weiboConfigData.pushTransmit)
|
|
60
64
|
continue;
|
|
61
65
|
willPushDynamicList.push(dynamicItem);
|
|
62
66
|
}
|
|
67
|
+
printedList.clear();
|
|
63
68
|
const pushMapInfo = value || {};
|
|
64
69
|
const { chatIds, bot_id, upName, type, chatType } = pushMapInfo;
|
|
65
70
|
for (let pushDynamicData of willPushDynamicList) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yz-yuki-plugin",
|
|
3
|
-
"version": "1.0.2-rc.
|
|
3
|
+
"version": "1.0.2-rc.4",
|
|
4
4
|
"description": "优纪插件,yunzaijs 关于 微博推送、B站推送 等功能的拓展插件",
|
|
5
5
|
"author": "snowtafir",
|
|
6
6
|
"type": "module",
|
|
@@ -23,16 +23,16 @@
|
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"axios": "^1.7.3",
|
|
25
25
|
"chokidar": "^3.6.0",
|
|
26
|
-
"jsdom": "^24.1.
|
|
26
|
+
"jsdom": "^24.1.1",
|
|
27
27
|
"json5": "^2.2.3",
|
|
28
28
|
"md5": "^2.3.0",
|
|
29
29
|
"moment": "^2.30.1",
|
|
30
30
|
"node-fetch": "^3.3.2",
|
|
31
|
-
"puppeteer": "^
|
|
31
|
+
"puppeteer": "^23.0.2",
|
|
32
32
|
"qrcode": "^1.5.4",
|
|
33
33
|
"react": "^18.3.1",
|
|
34
34
|
"react-dom": "^18.3.1",
|
|
35
|
-
"react-puppeteer": "1.0.
|
|
35
|
+
"react-puppeteer": "1.0.2",
|
|
36
36
|
"redis": "^4.7.0",
|
|
37
37
|
"yaml": "^2.5.0",
|
|
38
38
|
"yarn": "^1.19.1"
|
|
@@ -44,12 +44,12 @@
|
|
|
44
44
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
45
45
|
"@rollup/plugin-replace": "^5.0.7",
|
|
46
46
|
"@rollup/plugin-terser": "^0.4.4",
|
|
47
|
-
"@rollup/plugin-typescript": "^11.1.
|
|
47
|
+
"@rollup/plugin-typescript": "^11.1.6",
|
|
48
48
|
"@types/rollup-plugin-auto-external": "^2.0.5",
|
|
49
49
|
"@types/jsdom": "^21.1.7",
|
|
50
50
|
"@types/lodash": "^4.17.7",
|
|
51
51
|
"@types/md5": "^2.3.5",
|
|
52
|
-
"@types/node": "^
|
|
52
|
+
"@types/node": "^22.2.0",
|
|
53
53
|
"@types/node-fetch": "^2.6.11",
|
|
54
54
|
"@types/qrcode": "^1.5.5",
|
|
55
55
|
"@types/react": "^18.3.3",
|
|
@@ -57,28 +57,28 @@
|
|
|
57
57
|
"@types/yaml": "1.9.7",
|
|
58
58
|
"axios": "^1.7.3",
|
|
59
59
|
"chokidar": "^3.6.0",
|
|
60
|
-
"jsdom": "^24.1.
|
|
60
|
+
"jsdom": "^24.1.1",
|
|
61
61
|
"json5": "^2.2.3",
|
|
62
62
|
"md5": "^2.3.0",
|
|
63
63
|
"node-fetch": "^3.3.2",
|
|
64
|
-
"nodemon": "^3.
|
|
65
|
-
"prettier": "^3.
|
|
66
|
-
"puppeteer": "^
|
|
64
|
+
"nodemon": "^3.1.4",
|
|
65
|
+
"prettier": "^3.3.3",
|
|
66
|
+
"puppeteer": "^23.0.2",
|
|
67
67
|
"qrcode": "^1.5.4",
|
|
68
68
|
"react": "^18.3.1",
|
|
69
69
|
"react-dom": "^18.3.1",
|
|
70
|
-
"react-puppeteer": "1.0.
|
|
70
|
+
"react-puppeteer": "1.0.2",
|
|
71
71
|
"redis": "^4.7.0",
|
|
72
72
|
"rollup": "^4.20.0",
|
|
73
73
|
"rollup-plugin-auto-external": "^2.0.0",
|
|
74
74
|
"rollup-plugin-copy": "^3.5.0",
|
|
75
75
|
"rollup-plugin-dts": "^6.1.1",
|
|
76
76
|
"rollup-plugin-ignore": "^1.0.10",
|
|
77
|
-
"tailwindcss": "^3.4.
|
|
77
|
+
"tailwindcss": "^3.4.9",
|
|
78
78
|
"ts-node": "^10.9.2",
|
|
79
|
-
"typescript": "^5.4
|
|
80
|
-
"yunzai": "^1.0.1-rc.
|
|
81
|
-
"yunzai-mys": "^1.0.0-rc.
|
|
79
|
+
"typescript": "^5.5.4",
|
|
80
|
+
"yunzai": "^1.0.1-rc.5",
|
|
81
|
+
"yunzai-mys": "^1.0.0-rc.1"
|
|
82
82
|
},
|
|
83
83
|
"files": [
|
|
84
84
|
"public",
|
package/public/output.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! tailwindcss v3.4.
|
|
1
|
+
/*! tailwindcss v3.4.9 | MIT License | https://tailwindcss.com*/*,:after,:before{box-sizing:border-box;border:0 solid #e5e7eb}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.m-auto{margin:auto}.mb-3{margin-bottom:.75rem}.ml-7{margin-left:1.75rem}.mt-3{margin-top:.75rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-72{height:18rem}.max-h-96{max-height:24rem}.w-32{width:8rem}.w-72{width:18rem}.w-96{width:24rem}.p-1{padding:.25rem}.p-5{padding:1.25rem}.text-center{text-align:center}.text-lg{font-size:1.125rem;line-height:1.75rem}.italic{font-style:italic}.text-blue-500{--tw-text-opacity:1;color:rgb(59 130 246/var(--tw-text-opacity))}.text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity))}
|