koishi-plugin-bilibili-notify 2.0.0-alpha.12 → 2.0.0-alpha.13

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.
@@ -199,6 +199,7 @@
199
199
  - ver 2.0.0-alpha.10 新增:可对每个群聊针对性设置是否艾特全体成员 优化:直播下播通知
200
200
  - ver 2.0.0-alpha.11 回档:订阅时可直接接收群号/频道号 修复:直播过程推送消息不成功的bug
201
201
  - ver 2.0.0-alpha.12 更改:开启艾特全体成员后,只有在开播时才艾特全体成员
202
+ - ver 2.0.0-alpha.13 修复:无法对TG群组的特殊频道号进行订阅处理;提示 `您未配置对应平台的机器人,不能在该平台进行订阅操作` 仍进行订阅操作
202
203
 
203
204
  ## 交流群
204
205
 
@@ -293,7 +293,7 @@ class ComRegister {
293
293
  });
294
294
  biliCom
295
295
  .subcommand('.sub <mid:string> [...groupId:string]', '订阅用户动态和直播通知')
296
- .option('multiplatform', '-m <value:string>', { type: /^[A-Za-z0-9]+@?(?:,[A-Za-z0-9]+@?)*\.[A-Za-z0-9]+(?:;[A-Za-z0-9]+@?(?:,[A-Za-z0-9]+@?)*\.[A-Za-z0-9]+)*$/ })
296
+ .option('multiplatform', '-m <value:string>', { type: /^(-?[a-zA-Z0-9]+@?[a-zA-Z0-9]*\.[a-zA-Z0-9]+(?:,-?[a-zA-Z0-9]+@?[a-zA-Z0-9]*\.[a-zA-Z0-9]+)*)(;(-?[a-zA-Z0-9]+@?[a-zA-Z0-9]*\.[a-zA-Z0-9]+(?:,-?[a-zA-Z0-9]+@?[a-zA-Z0-9]*\.[a-zA-Z0-9]+)*))*$/ })
297
297
  .option('live', '-l')
298
298
  .option('dynamic', '-d')
299
299
  .option('atAll', '-a')
@@ -344,13 +344,16 @@ class ComRegister {
344
344
  }
345
345
  // 判断是否使用了多平台
346
346
  if (target) {
347
- target.forEach(async ({ channelIdArr, platform }, index) => {
347
+ for (const [index, { channelIdArr, platform }] of target.entries()) {
348
348
  if (channelIdArr.length > 0) { // 输入了推送群号或频道号
349
349
  // 拿到对应的bot
350
350
  const bot = this.getBot(ctx, platform);
351
351
  // 判断是否配置了对应平台的机器人
352
352
  if (!ctx.bots.some(bot => bot.platform === platform)) {
353
+ // 发送提示消息
353
354
  await session.send('您未配置对应平台的机器人,不能在该平台进行订阅操作');
355
+ // 直接返回
356
+ return;
354
357
  }
355
358
  // 判断是否需要加入的群全部推送
356
359
  if (channelIdArr[0].channelId !== 'all') {
@@ -399,7 +402,7 @@ class ComRegister {
399
402
  // 发送提示消息
400
403
  await session.send('没有填写群号或频道号,默认订阅到当前聊天环境');
401
404
  }
402
- });
405
+ }
403
406
  }
404
407
  else {
405
408
  // 用户直接订阅,将当前环境赋值给target
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.12",
4
+ "version": "2.0.0-alpha.13",
5
5
  "contributors": [
6
6
  "Akokko <admin@akokko.com>"
7
7
  ],