koishi-plugin-bilibili-notify 1.2.0-rc.1 → 1.2.0-rc.2
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/lib/comRegister.js +22 -12
- package/package.json +1 -1
package/lib/comRegister.js
CHANGED
|
@@ -452,7 +452,7 @@ class ComRegister {
|
|
|
452
452
|
userData = data;
|
|
453
453
|
}
|
|
454
454
|
catch (e) {
|
|
455
|
-
return 'bili sub指令 getMasterInfo()
|
|
455
|
+
return 'bili sub指令 getMasterInfo() 网络请求失败,请重试';
|
|
456
456
|
}
|
|
457
457
|
// 需要订阅直播
|
|
458
458
|
if (liveMsg) {
|
|
@@ -478,12 +478,14 @@ class ComRegister {
|
|
|
478
478
|
this.logger.info('调用bili.dynamic指令');
|
|
479
479
|
// 如果uid为空则返回
|
|
480
480
|
if (!uid)
|
|
481
|
-
return
|
|
481
|
+
return `${uid}非法调用 dynamic 指令`; // 用户uid不能为空
|
|
482
482
|
if (!guildId)
|
|
483
|
-
return
|
|
484
|
-
if (!options.bot)
|
|
485
|
-
|
|
486
|
-
|
|
483
|
+
return `${uid}非法调用 dynamic 指令`; // 目标群组或频道不能为空
|
|
484
|
+
if (!options.bot) {
|
|
485
|
+
this.logger.warn(`${uid}非法调用 dynamic 指令,未传入订阅平台`);
|
|
486
|
+
return `${uid}非法调用 dynamic 指令`;
|
|
487
|
+
}
|
|
488
|
+
// 寻找对应订阅管理对象
|
|
487
489
|
const index = this.subManager.findIndex(sub => sub.uid === uid);
|
|
488
490
|
// 不存在则直接返回
|
|
489
491
|
if (index === -1) {
|
|
@@ -508,7 +510,10 @@ class ComRegister {
|
|
|
508
510
|
case 'telegram':
|
|
509
511
|
bot = this.telegramBot;
|
|
510
512
|
break;
|
|
511
|
-
default:
|
|
513
|
+
default: {
|
|
514
|
+
this.logger.warn(`${uid}非法调用 dynamic 指令,不支持该平台`);
|
|
515
|
+
return '非法调用';
|
|
516
|
+
}
|
|
512
517
|
}
|
|
513
518
|
// 开始循环检测
|
|
514
519
|
const dispose = ctx.setInterval(this.dynamicDetect(ctx, bot, uid, guildId), config.dynamicLoopTime * 1000);
|
|
@@ -524,11 +529,13 @@ class ComRegister {
|
|
|
524
529
|
this.logger.info('调用bili.live指令');
|
|
525
530
|
// 如果room_id为空则返回
|
|
526
531
|
if (!roomId)
|
|
527
|
-
return
|
|
532
|
+
return `${roomId}非法调用 dynamic 指令`; // 订阅主播房间号不能为空
|
|
528
533
|
if (!guildId)
|
|
529
|
-
return
|
|
530
|
-
if (!options.bot)
|
|
531
|
-
|
|
534
|
+
return `${roomId}非法调用 dynamic 指令`; // 目标群组或频道不能为空
|
|
535
|
+
if (!options.bot) {
|
|
536
|
+
this.logger.warn(`${roomId}非法调用 dynamic 指令,未传入推送平台`);
|
|
537
|
+
return `${roomId}非法调用 dynamic 指令`;
|
|
538
|
+
}
|
|
532
539
|
// 保存到订阅管理对象
|
|
533
540
|
const index = this.subManager.findIndex(sub => sub.roomId === roomId);
|
|
534
541
|
// 要订阅的对象不在订阅管理对象中,直接返回
|
|
@@ -552,7 +559,10 @@ class ComRegister {
|
|
|
552
559
|
case 'telegram':
|
|
553
560
|
bot = this.telegramBot;
|
|
554
561
|
break;
|
|
555
|
-
default:
|
|
562
|
+
default: {
|
|
563
|
+
this.logger.warn(`${roomId}非法调用 dynamic 指令,不支持该平台`);
|
|
564
|
+
return `${roomId}非法调用 dynamic 指令`;
|
|
565
|
+
}
|
|
556
566
|
}
|
|
557
567
|
// 开始循环检测
|
|
558
568
|
const dispose = ctx.setInterval(this.liveDetect(ctx, bot, roomId, guildId), config.liveLoopTime * 1000);
|