koishi-plugin-bilibili-notify 2.0.0-alpha.17 → 2.0.0-alpha.18

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.
@@ -1165,9 +1165,14 @@ class ComRegister {
1165
1165
  if (data.live_status === 1) { // 当前正在直播
1166
1166
  // 设置开播时间
1167
1167
  liveTime = data.live_time;
1168
+ // 设置直播中消息
1169
+ const liveMsg = this.config.customLive ? this.config.customLive
1170
+ .replace('-name', username)
1171
+ .replace('-time', await ctx.gi.getTimeDifference(liveTime))
1172
+ .replace('-link', `https://live.bilibili.com/${data.short_id === 0 ? data.room_id : data.short_id}`) : '';
1168
1173
  // 发送直播通知卡片
1169
1174
  if (this.config.restartPush)
1170
- sendLiveNotifyCard(data, LiveType.LiveBroadcast);
1175
+ sendLiveNotifyCard(data, LiveType.LiveBroadcast, liveMsg);
1171
1176
  // 改变开播状态
1172
1177
  open = true;
1173
1178
  } // 未开播,直接返回
@@ -1218,7 +1223,7 @@ class ComRegister {
1218
1223
  }
1219
1224
  }
1220
1225
  }
1221
- // 定义开播通知语
1226
+ // 定义开播通知语
1222
1227
  const liveStartMsg = this.config.customLiveStart
1223
1228
  .replace('-name', username)
1224
1229
  .replace('-time', await ctx.gi.getTimeDifference(liveTime))
@@ -1455,9 +1460,7 @@ class ComRegister {
1455
1460
  // 判断是否订阅直播
1456
1461
  if (sub.live) {
1457
1462
  // 订阅直播
1458
- liveDispose = ctx.setInterval(() => {
1459
- this.liveDetect(ctx, data.live_room.room_id, sub.target);
1460
- }, this.config.liveLoopTime * 1000);
1463
+ liveDispose = ctx.setInterval(this.liveDetect(ctx, data.live_room.roomid, sub.target), this.config.liveLoopTime * 1000);
1461
1464
  }
1462
1465
  }
1463
1466
  // 在B站中订阅该对象
package/lib/index.js CHANGED
@@ -314,6 +314,7 @@ class ServerManager extends koishi_1.Service {
314
314
  restartPush: globalConfig.restartPush,
315
315
  pushTime: globalConfig.pushTime,
316
316
  customLiveStart: globalConfig.customLiveStart,
317
+ customLive: globalConfig.customLive,
317
318
  customLiveEnd: globalConfig.customLiveEnd,
318
319
  dynamicCheckNumber: globalConfig.dynamicCheckNumber,
319
320
  dynamicLoopTime: this.dynamicLoopTime,
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": "2.0.0-alpha.17",
4
+ "version": "2.0.0-alpha.18",
5
5
  "contributors": [
6
6
  "Akokko <admin@akokko.com>"
7
7
  ],
package/readme.md CHANGED
@@ -204,6 +204,7 @@
204
204
  - ver 2.0.0-alpha.15 新增:手动订阅功能 修复:一些潜在的bug
205
205
  - ver 2.0.0-alpha.16 优化:手动订阅功能
206
206
  - ver 2.0.0-alpha.17 修复:直接订阅当前环境不会推送
207
+ - ver 2.0.0-alpha.18 修复:手动订阅无法推送直播通知;自定义直播中通知语不会发送
207
208
 
208
209
  ## 交流群
209
210