koishi-plugin-bilibili-notify 1.2.0-rc.1 → 1.2.0-rc.3
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 +26 -13
- package/package.json +1 -1
- package/readme.md +2 -0
package/lib/comRegister.js
CHANGED
|
@@ -332,7 +332,7 @@ class ComRegister {
|
|
|
332
332
|
content = await ctx.biliAPI.getUserInfo(mid);
|
|
333
333
|
}
|
|
334
334
|
catch (e) {
|
|
335
|
-
return 'bili sub getUserInfo()
|
|
335
|
+
return 'bili sub getUserInfo() 本次网络请求失败,请重试';
|
|
336
336
|
}
|
|
337
337
|
// 判断是否有其他问题
|
|
338
338
|
if (content.code !== 0) {
|
|
@@ -452,8 +452,9 @@ 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
|
+
this.logger.info(session.event.platform);
|
|
457
458
|
// 需要订阅直播
|
|
458
459
|
if (liveMsg) {
|
|
459
460
|
await session.execute(`bili live ${roomId} ${targetId.split(',').join(' ')} -b ${session.event.platform}`);
|
|
@@ -476,14 +477,17 @@ class ComRegister {
|
|
|
476
477
|
.example('bili dynamic 1194210119 订阅UID为1194210119的动态')
|
|
477
478
|
.action(async ({ session, options }, uid, ...guildId) => {
|
|
478
479
|
this.logger.info('调用bili.dynamic指令');
|
|
480
|
+
this.logger.info('Platform:', options.bot);
|
|
479
481
|
// 如果uid为空则返回
|
|
480
482
|
if (!uid)
|
|
481
|
-
return
|
|
483
|
+
return `${uid}非法调用 dynamic 指令`; // 用户uid不能为空
|
|
482
484
|
if (!guildId)
|
|
483
|
-
return
|
|
484
|
-
if (!options.bot)
|
|
485
|
-
|
|
486
|
-
|
|
485
|
+
return `${uid}非法调用 dynamic 指令`; // 目标群组或频道不能为空
|
|
486
|
+
if (!options.bot) {
|
|
487
|
+
this.logger.warn(`${uid}非法调用 dynamic 指令,未传入订阅平台`);
|
|
488
|
+
return `${uid}非法调用 dynamic 指令`;
|
|
489
|
+
}
|
|
490
|
+
// 寻找对应订阅管理对象
|
|
487
491
|
const index = this.subManager.findIndex(sub => sub.uid === uid);
|
|
488
492
|
// 不存在则直接返回
|
|
489
493
|
if (index === -1) {
|
|
@@ -508,7 +512,10 @@ class ComRegister {
|
|
|
508
512
|
case 'telegram':
|
|
509
513
|
bot = this.telegramBot;
|
|
510
514
|
break;
|
|
511
|
-
default:
|
|
515
|
+
default: {
|
|
516
|
+
this.logger.warn(`${uid}非法调用 dynamic 指令,不支持该平台`);
|
|
517
|
+
return '非法调用';
|
|
518
|
+
}
|
|
512
519
|
}
|
|
513
520
|
// 开始循环检测
|
|
514
521
|
const dispose = ctx.setInterval(this.dynamicDetect(ctx, bot, uid, guildId), config.dynamicLoopTime * 1000);
|
|
@@ -522,13 +529,16 @@ class ComRegister {
|
|
|
522
529
|
.example('bili live 26316137 订阅房间号为26316137的直播间')
|
|
523
530
|
.action(async ({ options }, roomId, ...guildId) => {
|
|
524
531
|
this.logger.info('调用bili.live指令');
|
|
532
|
+
this.logger.info('Platform:', options.bot);
|
|
525
533
|
// 如果room_id为空则返回
|
|
526
534
|
if (!roomId)
|
|
527
|
-
return
|
|
535
|
+
return `${roomId}非法调用 dynamic 指令`; // 订阅主播房间号不能为空
|
|
528
536
|
if (!guildId)
|
|
529
|
-
return
|
|
530
|
-
if (!options.bot)
|
|
531
|
-
|
|
537
|
+
return `${roomId}非法调用 dynamic 指令`; // 目标群组或频道不能为空
|
|
538
|
+
if (!options.bot) {
|
|
539
|
+
this.logger.warn(`${roomId}非法调用 dynamic 指令,未传入推送平台`);
|
|
540
|
+
return `${roomId}非法调用 dynamic 指令`;
|
|
541
|
+
}
|
|
532
542
|
// 保存到订阅管理对象
|
|
533
543
|
const index = this.subManager.findIndex(sub => sub.roomId === roomId);
|
|
534
544
|
// 要订阅的对象不在订阅管理对象中,直接返回
|
|
@@ -552,7 +562,10 @@ class ComRegister {
|
|
|
552
562
|
case 'telegram':
|
|
553
563
|
bot = this.telegramBot;
|
|
554
564
|
break;
|
|
555
|
-
default:
|
|
565
|
+
default: {
|
|
566
|
+
this.logger.warn(`${roomId}非法调用 dynamic 指令,不支持该平台`);
|
|
567
|
+
return `${roomId}非法调用 dynamic 指令`;
|
|
568
|
+
}
|
|
556
569
|
}
|
|
557
570
|
// 开始循环检测
|
|
558
571
|
const dispose = ctx.setInterval(this.liveDetect(ctx, bot, roomId, guildId), config.liveLoopTime * 1000);
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -109,6 +109,8 @@
|
|
|
109
109
|
- ver 1.2.0-alpha.5 修复了与PostgreSQL不兼容的问题,优化了图片推送,增强了推送容错
|
|
110
110
|
- ver 1.2.0-rc.0 现已支持自定义开播和下播提示语(实验性)
|
|
111
111
|
- ver 1.2.0-rc.1 现已支持Telegram平台(实验性)
|
|
112
|
+
- ver 1.2.0-rc.2 添加更多日志输出
|
|
113
|
+
- ver 1.2.0-rc.3 针对Telegram的Bug测试版本
|
|
112
114
|
|
|
113
115
|
## 交流群
|
|
114
116
|
801338523 使用问题或bug都可以在群里提出
|