koishi-plugin-bilibili-notify 3.2.0-alpha.6 → 3.2.0-alpha.7

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.
@@ -672,12 +672,14 @@ class ComRegister {
672
672
  await this.broadcastToTargets(sub.target, (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [koishi_1.h.image(buffer, "image/jpeg"), dUrl] }), type_1.PushType.Dynamic);
673
673
  // 判断是否需要发送动态中的图片
674
674
  if (this.config.pushImgsInDynamic) {
675
- // 判断是否为图文动态,且存在draw
676
- if (item.type === "DYNAMIC_TYPE_DRAW" &&
677
- item.modules.module_dynamic.major?.draw) {
678
- for (const img of item.modules.module_dynamic.major.draw
679
- .items) {
680
- await this.broadcastToTargets(sub.target, (0, jsx_runtime_1.jsx)("img", { src: img.src, alt: "\u52A8\u6001\u56FE\u7247" }), type_1.PushType.Dynamic);
675
+ // 获取pics
676
+ const pics = item.modules.module_dynamic.major.opus?.pics;
677
+ // 判断是否为图文动态,且存在pics
678
+ if (item.type === "DYNAMIC_TYPE_DRAW" && pics) {
679
+ for (const pic of pics) {
680
+ await this.broadcastToTargets(sub.target, (0, jsx_runtime_1.jsx)("img", { src: pic.url, alt: "\u52A8\u6001\u56FE\u7247" }), type_1.PushType.Dynamic);
681
+ // 随机睡眠1-3秒
682
+ await this.ctx.sleep(Math.floor(Math.random() * 2000) + 1000);
681
683
  }
682
684
  }
683
685
  }
@@ -858,12 +860,14 @@ class ComRegister {
858
860
  if (this.config.pushImgsInDynamic) {
859
861
  // logger
860
862
  this.logger.info("需要发送动态中的图片,开始发送...");
861
- // 判断是否为图文动态,且存在draw
862
- if (item.type === "DYNAMIC_TYPE_DRAW" &&
863
- item.modules.module_dynamic.major?.draw) {
864
- for (const img of item.modules.module_dynamic.major.draw
865
- .items) {
866
- await this.broadcastToTargets(sub.target, (0, jsx_runtime_1.jsx)("img", { src: img.src, alt: "\u52A8\u6001\u56FE\u7247" }), type_1.PushType.Dynamic);
863
+ // 获取pics
864
+ const pics = item.modules.module_dynamic.major.opus?.pics;
865
+ // 判断是否为图文动态,且存在pics
866
+ if (item.type === "DYNAMIC_TYPE_DRAW" && pics) {
867
+ for (const pic of pics) {
868
+ await this.broadcastToTargets(sub.target, (0, jsx_runtime_1.jsx)("img", { src: pic.url, alt: "\u52A8\u6001\u56FE\u7247" }), type_1.PushType.Dynamic);
869
+ // 随机睡眠1-3秒
870
+ await this.ctx.sleep(Math.floor(Math.random() * 2000) + 1000);
867
871
  }
868
872
  }
869
873
  // logger
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-bilibili-notify",
3
3
  "description": "Koishi bilibili notify plugin",
4
- "version": "3.2.0-alpha.6",
4
+ "version": "3.2.0-alpha.7",
5
5
  "contributors": [
6
6
  "Akokko <admin@akokko.com>"
7
7
  ],
package/readme.md CHANGED
@@ -255,6 +255,7 @@ uid为必填参数,为要推送的UP主的UID,index为可选参数,为要
255
255
  - ver 3.2.0-alpha.4 修复:直播卡片推送时间会是设置的 `pushTime` 的两倍;
256
256
  - ver 3.2.0-alpha.5 修复:直播检测 `WS` 模式下,直播中推送卡片 `累计观看人数` 位置错误显示为 `粉丝数变化` 、转发动态的留言文字不显示; 优化:直播检测 `API` 模式下,直播推送语 `-watched` 固定显示为 `API模式无法获取`;
257
257
  - ver 3.2.0-alpha.6 优化:调整配置项;
258
+ - ver 3.2.0-alpha.7 修复:自 `3.1.7` 版本 `pushImagesInDynamic` 功能失效;
258
259
 
259
260
  ## 交流群
260
261