koishi-plugin-bilibili-notify 3.2.1-alpha.1 → 3.2.1-alpha.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/biliAPI.d.ts +2 -2
- package/lib/biliAPI.js +100 -56
- package/lib/blive.js +7 -5
- package/lib/comRegister.js +133 -143
- package/lib/database.js +6 -2
- package/lib/generateImg.js +33 -31
- package/lib/index.js +131 -91
- package/lib/type/index.js +7 -4
- package/lib/utils/index.js +8 -3
- package/package.json +1 -1
- package/readme.md +3 -1
package/lib/comRegister.js
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const jsx_runtime_1 = require("@satorijs/element/jsx-runtime");
|
|
2
7
|
// Koishi核心依赖
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
8
|
+
const koishi_1 = require("koishi");
|
|
9
|
+
const qrcode_1 = __importDefault(require("qrcode"));
|
|
10
|
+
const cron_1 = require("cron");
|
|
6
11
|
// Utils
|
|
7
|
-
|
|
12
|
+
const utils_1 = require("./utils");
|
|
8
13
|
// Types
|
|
9
|
-
|
|
10
|
-
|
|
14
|
+
const type_1 = require("./type");
|
|
15
|
+
const luxon_1 = require("luxon");
|
|
11
16
|
class ComRegister {
|
|
12
17
|
// 必须服务
|
|
13
18
|
static inject = ["ba", "gi", "database", "bl", "sm"];
|
|
@@ -118,7 +123,7 @@ class ComRegister {
|
|
|
118
123
|
if (content.code !== 0)
|
|
119
124
|
return await session.send("出问题咯,请联系管理员解决");
|
|
120
125
|
// 生成二维码
|
|
121
|
-
|
|
126
|
+
qrcode_1.default.toBuffer(content.data.url, {
|
|
122
127
|
errorCorrectionLevel: "H", // 错误更正水平
|
|
123
128
|
type: "png", // 输出类型
|
|
124
129
|
margin: 1, // 边距大小
|
|
@@ -129,7 +134,7 @@ class ComRegister {
|
|
|
129
134
|
}, async (err, buffer) => {
|
|
130
135
|
if (err)
|
|
131
136
|
return await session.send("二维码生成出错,请重新尝试");
|
|
132
|
-
await session.send(h.image(buffer, "image/jpeg"));
|
|
137
|
+
await session.send(koishi_1.h.image(buffer, "image/jpeg"));
|
|
133
138
|
});
|
|
134
139
|
// 检查之前是否存在登录定时器
|
|
135
140
|
if (this.loginTimer)
|
|
@@ -267,7 +272,7 @@ class ComRegister {
|
|
|
267
272
|
// 获取动态内容
|
|
268
273
|
const item = content.data.items[i];
|
|
269
274
|
// 生成图片
|
|
270
|
-
const buffer = await withRetry(async () => {
|
|
275
|
+
const buffer = await (0, utils_1.withRetry)(async () => {
|
|
271
276
|
// 渲染图片
|
|
272
277
|
return await this.ctx.gi.generateDynamicImg(item);
|
|
273
278
|
}, 1).catch(async (e) => {
|
|
@@ -292,7 +297,7 @@ class ComRegister {
|
|
|
292
297
|
this.logger.error(`dynamicDetect generateDynamicImg() 推送卡片发送失败,原因:${e.message}`);
|
|
293
298
|
});
|
|
294
299
|
// 发送图片
|
|
295
|
-
buffer && (await session.send(h.image(buffer, "image/jpeg")));
|
|
300
|
+
buffer && (await session.send(koishi_1.h.image(buffer, "image/jpeg")));
|
|
296
301
|
});
|
|
297
302
|
}
|
|
298
303
|
async init(config) {
|
|
@@ -357,7 +362,7 @@ class ComRegister {
|
|
|
357
362
|
initManager() {
|
|
358
363
|
for (const sub of this.subManager) {
|
|
359
364
|
if (sub.dynamic) {
|
|
360
|
-
this.dynamicTimelineManager.set(sub.uid, Math.floor(DateTime.now().toSeconds()));
|
|
365
|
+
this.dynamicTimelineManager.set(sub.uid, Math.floor(luxon_1.DateTime.now().toSeconds()));
|
|
361
366
|
}
|
|
362
367
|
if (sub.live) {
|
|
363
368
|
this.liveStatusManager.set(sub.uid, {
|
|
@@ -439,7 +444,7 @@ class ComRegister {
|
|
|
439
444
|
async sendMessageWithRetry(bot, channelId,
|
|
440
445
|
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
441
446
|
content) {
|
|
442
|
-
withRetry(async () => await bot.sendMessage(channelId, content), 1).catch(async (e) => {
|
|
447
|
+
(0, utils_1.withRetry)(async () => await bot.sendMessage(channelId, content), 1).catch(async (e) => {
|
|
443
448
|
if (e.message === "this._request is not a function") {
|
|
444
449
|
// 2S之后重新发送消息
|
|
445
450
|
this.ctx.setTimeout(async () => {
|
|
@@ -457,7 +462,7 @@ class ComRegister {
|
|
|
457
462
|
// 定义数组
|
|
458
463
|
const pushArr = [];
|
|
459
464
|
// 判断类型
|
|
460
|
-
if (type === PushType.Live || type === PushType.StartBroadcasting) {
|
|
465
|
+
if (type === type_1.PushType.Live || type === type_1.PushType.StartBroadcasting) {
|
|
461
466
|
for (const target of targets) {
|
|
462
467
|
for (const channel of target.channelArr) {
|
|
463
468
|
if (channel.live) {
|
|
@@ -467,7 +472,7 @@ class ComRegister {
|
|
|
467
472
|
}
|
|
468
473
|
return pushArr;
|
|
469
474
|
}
|
|
470
|
-
if (type === PushType.Dynamic) {
|
|
475
|
+
if (type === type_1.PushType.Dynamic) {
|
|
471
476
|
for (const target of targets) {
|
|
472
477
|
for (const channel of target.channelArr) {
|
|
473
478
|
if (channel.dynamic) {
|
|
@@ -477,7 +482,7 @@ class ComRegister {
|
|
|
477
482
|
}
|
|
478
483
|
return pushArr;
|
|
479
484
|
}
|
|
480
|
-
if (type === PushType.LiveGuardBuy) {
|
|
485
|
+
if (type === type_1.PushType.LiveGuardBuy) {
|
|
481
486
|
for (const target of targets) {
|
|
482
487
|
for (const channel of target.channelArr) {
|
|
483
488
|
if (channel.liveGuardBuy) {
|
|
@@ -497,7 +502,7 @@ class ComRegister {
|
|
|
497
502
|
// logger
|
|
498
503
|
this.logger.info(`推送消息到 ${pushArr.length} 个目标频道,目标频道为:${pushArr.join(", ")}`);
|
|
499
504
|
// 推送消息
|
|
500
|
-
await withRetry(async () => {
|
|
505
|
+
await (0, utils_1.withRetry)(async () => {
|
|
501
506
|
await this.ctx.broadcast(pushArr, content);
|
|
502
507
|
}, 1);
|
|
503
508
|
// 结束
|
|
@@ -518,28 +523,28 @@ class ComRegister {
|
|
|
518
523
|
}
|
|
519
524
|
// 模式匹配
|
|
520
525
|
const pushTypePatternMatching = {
|
|
521
|
-
[PushType.Live]: async () => {
|
|
526
|
+
[type_1.PushType.Live]: async () => {
|
|
522
527
|
if (targetChannel.live) {
|
|
523
528
|
// 直接推送
|
|
524
529
|
await this.sendMessageWithRetry(bot, targetChannel.channelId, content);
|
|
525
530
|
}
|
|
526
531
|
},
|
|
527
|
-
[PushType.Dynamic]: async () => {
|
|
532
|
+
[type_1.PushType.Dynamic]: async () => {
|
|
528
533
|
if (targetChannel.dynamic) {
|
|
529
534
|
await this.sendMessageWithRetry(bot, targetChannel.channelId, content);
|
|
530
535
|
}
|
|
531
536
|
},
|
|
532
|
-
[PushType.StartBroadcasting]: async () => {
|
|
537
|
+
[type_1.PushType.StartBroadcasting]: async () => {
|
|
533
538
|
// 判断是否需要推送直播消息
|
|
534
539
|
if (targetChannel.live) {
|
|
535
540
|
await this.sendMessageWithRetry(bot, targetChannel.channelId, content);
|
|
536
541
|
}
|
|
537
542
|
// 判断是否需要艾特全体成员
|
|
538
543
|
if (targetChannel.atAll) {
|
|
539
|
-
await this.sendMessageWithRetry(bot, targetChannel.channelId,
|
|
544
|
+
await this.sendMessageWithRetry(bot, targetChannel.channelId, (0, jsx_runtime_1.jsx)("at", { type: "all" }));
|
|
540
545
|
}
|
|
541
546
|
},
|
|
542
|
-
[PushType.LiveGuardBuy]: async () => {
|
|
547
|
+
[type_1.PushType.LiveGuardBuy]: async () => {
|
|
543
548
|
// 判断是否需要推送直播消息
|
|
544
549
|
if (targetChannel.liveGuardBuy) {
|
|
545
550
|
await this.sendMessageWithRetry(bot, targetChannel.channelId, content);
|
|
@@ -555,7 +560,7 @@ class ComRegister {
|
|
|
555
560
|
// 定义本次请求推送的动态
|
|
556
561
|
const currentPushDyn = {};
|
|
557
562
|
// 使用withRetry函数进行重试
|
|
558
|
-
const content = await withRetry(async () => {
|
|
563
|
+
const content = await (0, utils_1.withRetry)(async () => {
|
|
559
564
|
// 获取动态内容
|
|
560
565
|
return (await this.ctx.ba.getAllDynamic());
|
|
561
566
|
}, 1).catch((e) => {
|
|
@@ -629,7 +634,7 @@ class ComRegister {
|
|
|
629
634
|
// 获取订阅对象
|
|
630
635
|
const sub = this.subManager.find((sub) => sub.uid === uid);
|
|
631
636
|
// 推送该条动态
|
|
632
|
-
const buffer = await withRetry(async () => {
|
|
637
|
+
const buffer = await (0, utils_1.withRetry)(async () => {
|
|
633
638
|
// 渲染图片
|
|
634
639
|
return await this.ctx.gi.generateDynamicImg(item, sub.card.enable ? sub.card : undefined);
|
|
635
640
|
}, 1).catch(async (e) => {
|
|
@@ -639,19 +644,19 @@ class ComRegister {
|
|
|
639
644
|
if (e.message === "出现关键词,屏蔽该动态") {
|
|
640
645
|
// 如果需要发送才发送
|
|
641
646
|
if (this.config.filter.notify) {
|
|
642
|
-
await this.broadcastToTargets(sub.target, `${name}发布了一条含有屏蔽关键字的动态`, PushType.Dynamic);
|
|
647
|
+
await this.broadcastToTargets(sub.target, `${name}发布了一条含有屏蔽关键字的动态`, type_1.PushType.Dynamic);
|
|
643
648
|
}
|
|
644
649
|
return;
|
|
645
650
|
}
|
|
646
651
|
if (e.message === "已屏蔽转发动态") {
|
|
647
652
|
if (this.config.filter.notify) {
|
|
648
|
-
await this.broadcastToTargets(sub.target, `${name}转发了一条动态,已屏蔽`, PushType.Dynamic);
|
|
653
|
+
await this.broadcastToTargets(sub.target, `${name}转发了一条动态,已屏蔽`, type_1.PushType.Dynamic);
|
|
649
654
|
}
|
|
650
655
|
return;
|
|
651
656
|
}
|
|
652
657
|
if (e.message === "已屏蔽专栏动态") {
|
|
653
658
|
if (this.config.filter.notify) {
|
|
654
|
-
await this.broadcastToTargets(sub.target, `${name}投稿了一条专栏,已屏蔽`, PushType.Dynamic);
|
|
659
|
+
await this.broadcastToTargets(sub.target, `${name}投稿了一条专栏,已屏蔽`, type_1.PushType.Dynamic);
|
|
655
660
|
}
|
|
656
661
|
return;
|
|
657
662
|
}
|
|
@@ -678,7 +683,7 @@ class ComRegister {
|
|
|
678
683
|
// logger
|
|
679
684
|
this.logger.info("推送动态中...");
|
|
680
685
|
// 发送推送卡片
|
|
681
|
-
await this.broadcastToTargets(sub.target,
|
|
686
|
+
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);
|
|
682
687
|
// 判断是否需要发送动态中的图片
|
|
683
688
|
if (this.config.pushImgsInDynamic) {
|
|
684
689
|
// 判断是否为图文动态
|
|
@@ -688,7 +693,7 @@ class ComRegister {
|
|
|
688
693
|
// 判断pics是否存在
|
|
689
694
|
if (pics) {
|
|
690
695
|
for (const pic of pics) {
|
|
691
|
-
await this.broadcastToTargets(sub.target,
|
|
696
|
+
await this.broadcastToTargets(sub.target, (0, jsx_runtime_1.jsx)("img", { src: pic.url, alt: "\u52A8\u6001\u56FE\u7247" }), type_1.PushType.Dynamic);
|
|
692
697
|
// 随机睡眠1-3秒
|
|
693
698
|
await this.ctx.sleep(Math.floor(Math.random() * 2000) + 1000);
|
|
694
699
|
}
|
|
@@ -714,7 +719,7 @@ class ComRegister {
|
|
|
714
719
|
}
|
|
715
720
|
};
|
|
716
721
|
// 返回一个闭包函数
|
|
717
|
-
return withLock(handler);
|
|
722
|
+
return (0, utils_1.withLock)(handler);
|
|
718
723
|
}
|
|
719
724
|
debug_dynamicDetect() {
|
|
720
725
|
// 定义handler
|
|
@@ -724,7 +729,7 @@ class ComRegister {
|
|
|
724
729
|
// logger
|
|
725
730
|
this.logger.info("开始获取动态信息...");
|
|
726
731
|
// 使用withRetry函数进行重试
|
|
727
|
-
const content = await withRetry(async () => {
|
|
732
|
+
const content = await (0, utils_1.withRetry)(async () => {
|
|
728
733
|
// 获取动态内容
|
|
729
734
|
return (await this.ctx.ba.getAllDynamic());
|
|
730
735
|
}, 1).catch((e) => {
|
|
@@ -793,7 +798,7 @@ class ComRegister {
|
|
|
793
798
|
const uid = item.modules.module_author.mid.toString();
|
|
794
799
|
const name = item.modules.module_author.name;
|
|
795
800
|
// logger
|
|
796
|
-
this.logger.info(`获取到动态信息,UP主:${name},UID:${uid},动态发布时间:${DateTime.fromSeconds(postTime).toFormat("yyyy-MM-dd HH:mm:ss")}`);
|
|
801
|
+
this.logger.info(`获取到动态信息,UP主:${name},UID:${uid},动态发布时间:${luxon_1.DateTime.fromSeconds(postTime).toFormat("yyyy-MM-dd HH:mm:ss")}`);
|
|
797
802
|
// 判断是否存在时间线
|
|
798
803
|
if (this.dynamicTimelineManager.has(uid)) {
|
|
799
804
|
// logger
|
|
@@ -801,7 +806,7 @@ class ComRegister {
|
|
|
801
806
|
// 寻找关注的UP主
|
|
802
807
|
const timeline = this.dynamicTimelineManager.get(uid);
|
|
803
808
|
// logger
|
|
804
|
-
this.logger.info(`上次推送时间线:${DateTime.fromSeconds(timeline).toFormat("yyyy-MM-dd HH:mm:ss")}`);
|
|
809
|
+
this.logger.info(`上次推送时间线:${luxon_1.DateTime.fromSeconds(timeline).toFormat("yyyy-MM-dd HH:mm:ss")}`);
|
|
805
810
|
// 判断动态发布时间是否大于时间线
|
|
806
811
|
if (timeline < postTime) {
|
|
807
812
|
// logger
|
|
@@ -811,7 +816,7 @@ class ComRegister {
|
|
|
811
816
|
// logger
|
|
812
817
|
this.logger.info("开始渲染推送卡片...");
|
|
813
818
|
// 推送该条动态
|
|
814
|
-
const buffer = await withRetry(async () => {
|
|
819
|
+
const buffer = await (0, utils_1.withRetry)(async () => {
|
|
815
820
|
// 渲染图片
|
|
816
821
|
return await this.ctx.gi.generateDynamicImg(item, sub.card.enable ? sub.card : undefined);
|
|
817
822
|
}, 1).catch(async (e) => {
|
|
@@ -821,19 +826,19 @@ class ComRegister {
|
|
|
821
826
|
if (e.message === "出现关键词,屏蔽该动态") {
|
|
822
827
|
// 如果需要发送才发送
|
|
823
828
|
if (this.config.filter.notify) {
|
|
824
|
-
await this.broadcastToTargets(sub.target, `${name}发布了一条含有屏蔽关键字的动态`, PushType.Dynamic);
|
|
829
|
+
await this.broadcastToTargets(sub.target, `${name}发布了一条含有屏蔽关键字的动态`, type_1.PushType.Dynamic);
|
|
825
830
|
}
|
|
826
831
|
return;
|
|
827
832
|
}
|
|
828
833
|
if (e.message === "已屏蔽转发动态") {
|
|
829
834
|
if (this.config.filter.notify) {
|
|
830
|
-
await this.broadcastToTargets(sub.target, `${name}转发了一条动态,已屏蔽`, PushType.Dynamic);
|
|
835
|
+
await this.broadcastToTargets(sub.target, `${name}转发了一条动态,已屏蔽`, type_1.PushType.Dynamic);
|
|
831
836
|
}
|
|
832
837
|
return;
|
|
833
838
|
}
|
|
834
839
|
if (e.message === "已屏蔽专栏动态") {
|
|
835
840
|
if (this.config.filter.notify) {
|
|
836
|
-
await this.broadcastToTargets(sub.target, `${name}投稿了一条专栏,已屏蔽`, PushType.Dynamic);
|
|
841
|
+
await this.broadcastToTargets(sub.target, `${name}投稿了一条专栏,已屏蔽`, type_1.PushType.Dynamic);
|
|
837
842
|
}
|
|
838
843
|
return;
|
|
839
844
|
}
|
|
@@ -867,7 +872,7 @@ class ComRegister {
|
|
|
867
872
|
// logger
|
|
868
873
|
this.logger.info("推送动态中...");
|
|
869
874
|
// 发送推送卡片
|
|
870
|
-
await this.broadcastToTargets(sub.target,
|
|
875
|
+
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);
|
|
871
876
|
// 判断是否需要发送动态中的图片
|
|
872
877
|
if (this.config.pushImgsInDynamic) {
|
|
873
878
|
// logger
|
|
@@ -879,7 +884,7 @@ class ComRegister {
|
|
|
879
884
|
// 判断pics是否存在
|
|
880
885
|
if (pics) {
|
|
881
886
|
for (const pic of pics) {
|
|
882
|
-
await this.broadcastToTargets(sub.target,
|
|
887
|
+
await this.broadcastToTargets(sub.target, (0, jsx_runtime_1.jsx)("img", { src: pic.url, alt: "\u52A8\u6001\u56FE\u7247" }), type_1.PushType.Dynamic);
|
|
883
888
|
// 随机睡眠1-3秒
|
|
884
889
|
await this.ctx.sleep(Math.floor(Math.random() * 2000) + 1000);
|
|
885
890
|
}
|
|
@@ -907,13 +912,13 @@ class ComRegister {
|
|
|
907
912
|
// 更新当前时间线
|
|
908
913
|
this.dynamicTimelineManager.set(uid, postTime);
|
|
909
914
|
// logger
|
|
910
|
-
this.logger.info(`更新时间线成功,UP主:${uid},时间线:${DateTime.fromSeconds(postTime).toFormat("yyyy-MM-dd HH:mm:ss")}`);
|
|
915
|
+
this.logger.info(`更新时间线成功,UP主:${uid},时间线:${luxon_1.DateTime.fromSeconds(postTime).toFormat("yyyy-MM-dd HH:mm:ss")}`);
|
|
911
916
|
}
|
|
912
917
|
// logger
|
|
913
918
|
this.logger.info(`本次推送动态数量:${Object.keys(currentPushDyn).length}`);
|
|
914
919
|
};
|
|
915
920
|
// 返回一个闭包函数
|
|
916
|
-
return withLock(handler);
|
|
921
|
+
return (0, utils_1.withLock)(handler);
|
|
917
922
|
}
|
|
918
923
|
// 定义获取主播信息方法
|
|
919
924
|
async useMasterInfo(uid, masterInfo, liveType) {
|
|
@@ -924,8 +929,8 @@ class ComRegister {
|
|
|
924
929
|
let liveEndFollowerNum;
|
|
925
930
|
let liveFollowerChange;
|
|
926
931
|
// 判断直播状态
|
|
927
|
-
if (liveType === LiveType.StartBroadcasting ||
|
|
928
|
-
liveType === LiveType.FirstLiveBroadcast) {
|
|
932
|
+
if (liveType === type_1.LiveType.StartBroadcasting ||
|
|
933
|
+
liveType === type_1.LiveType.FirstLiveBroadcast) {
|
|
929
934
|
// 第一次启动或刚开播
|
|
930
935
|
// 将当前粉丝数赋值给liveOpenFollowerNum、liveEndFollowerNum
|
|
931
936
|
liveOpenFollowerNum = data.follower_num;
|
|
@@ -933,8 +938,8 @@ class ComRegister {
|
|
|
933
938
|
// 将粉丝数变化赋值为0
|
|
934
939
|
liveFollowerChange = 0;
|
|
935
940
|
}
|
|
936
|
-
if (liveType === LiveType.StopBroadcast ||
|
|
937
|
-
liveType === LiveType.LiveBroadcast) {
|
|
941
|
+
if (liveType === type_1.LiveType.StopBroadcast ||
|
|
942
|
+
liveType === type_1.LiveType.LiveBroadcast) {
|
|
938
943
|
// 将上一次的liveOpenFollowerNum赋值给本次的liveOpenFollowerNum
|
|
939
944
|
liveOpenFollowerNum = masterInfo.liveOpenFollowerNum;
|
|
940
945
|
// 将当前粉丝数赋值给liveEndFollowerNum
|
|
@@ -954,7 +959,7 @@ class ComRegister {
|
|
|
954
959
|
}
|
|
955
960
|
async useLiveRoomInfo(roomId) {
|
|
956
961
|
// 发送请求获取直播间信息
|
|
957
|
-
const data = await withRetry(async () => await this.ctx.ba.getLiveRoomInfo(roomId))
|
|
962
|
+
const data = await (0, utils_1.withRetry)(async () => await this.ctx.ba.getLiveRoomInfo(roomId))
|
|
958
963
|
.then((content) => content.data)
|
|
959
964
|
.catch((e) => {
|
|
960
965
|
this.logger.error(`liveDetect getLiveRoomInfo 发生了错误,错误为:${e.message}`);
|
|
@@ -969,7 +974,7 @@ class ComRegister {
|
|
|
969
974
|
}
|
|
970
975
|
async sendLiveNotifyCard(liveType, followerDisplay, liveInfo, target, liveNotifyMsg) {
|
|
971
976
|
// 生成图片
|
|
972
|
-
const buffer = await withRetry(async () => {
|
|
977
|
+
const buffer = await (0, utils_1.withRetry)(async () => {
|
|
973
978
|
// 获取直播通知卡片
|
|
974
979
|
return await this.ctx.gi.generateLiveImg(liveInfo.liveRoomInfo, liveInfo.masterInfo.username, liveInfo.masterInfo.userface, followerDisplay, liveType, liveInfo.cardStyle.enable ? liveInfo.cardStyle : undefined);
|
|
975
980
|
}, 1).catch((e) => {
|
|
@@ -979,11 +984,11 @@ class ComRegister {
|
|
|
979
984
|
if (!buffer)
|
|
980
985
|
return await this.sendPrivateMsgAndStopService();
|
|
981
986
|
// 推送直播信息
|
|
982
|
-
const msg = (
|
|
987
|
+
const msg = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [koishi_1.h.image(buffer, "image/jpeg"), liveNotifyMsg || ""] }));
|
|
983
988
|
// 只有在开播时才艾特全体成员
|
|
984
|
-
return await this.broadcastToTargets(target, msg, liveType === LiveType.StartBroadcasting
|
|
985
|
-
? PushType.StartBroadcasting
|
|
986
|
-
: PushType.Live);
|
|
989
|
+
return await this.broadcastToTargets(target, msg, liveType === type_1.LiveType.StartBroadcasting
|
|
990
|
+
? type_1.PushType.StartBroadcasting
|
|
991
|
+
: type_1.PushType.Live);
|
|
987
992
|
}
|
|
988
993
|
async liveDetectWithListener(roomId, target, cardStyle) {
|
|
989
994
|
// 定义开播时间
|
|
@@ -992,10 +997,6 @@ class ComRegister {
|
|
|
992
997
|
let pushAtTimeTimer;
|
|
993
998
|
// 定义弹幕存放数组
|
|
994
999
|
const currentLiveDanmakuArr = [];
|
|
995
|
-
// init flag
|
|
996
|
-
let initFlag = false;
|
|
997
|
-
// 连接中断flag
|
|
998
|
-
let connFlag = false;
|
|
999
1000
|
// 定义开播状态
|
|
1000
1001
|
let liveStatus = false;
|
|
1001
1002
|
// 定义channelIdArr总长度
|
|
@@ -1021,7 +1022,7 @@ class ComRegister {
|
|
|
1021
1022
|
// 定义定时推送函数
|
|
1022
1023
|
const pushAtTimeFunc = async () => {
|
|
1023
1024
|
// 判断是否信息是否获取成功
|
|
1024
|
-
if (!(await useMasterAndLiveRoomInfo(LiveType.LiveBroadcast))) {
|
|
1025
|
+
if (!(await useMasterAndLiveRoomInfo(type_1.LiveType.LiveBroadcast))) {
|
|
1025
1026
|
// 未获取成功,直接返回
|
|
1026
1027
|
await this.sendPrivateMsg("获取直播间信息失败,推送直播卡片失败!");
|
|
1027
1028
|
// 停止服务
|
|
@@ -1052,7 +1053,7 @@ class ComRegister {
|
|
|
1052
1053
|
.replace("-link", `https://live.bilibili.com/${liveRoomInfo.short_id === 0 ? liveRoomInfo.room_id : liveRoomInfo.short_id}`)
|
|
1053
1054
|
: null;
|
|
1054
1055
|
// 发送直播通知卡片
|
|
1055
|
-
await this.sendLiveNotifyCard(LiveType.LiveBroadcast, watched, {
|
|
1056
|
+
await this.sendLiveNotifyCard(type_1.LiveType.LiveBroadcast, watched, {
|
|
1056
1057
|
liveRoomInfo,
|
|
1057
1058
|
masterInfo,
|
|
1058
1059
|
cardStyle,
|
|
@@ -1088,30 +1089,19 @@ class ComRegister {
|
|
|
1088
1089
|
};
|
|
1089
1090
|
// 构建消息处理函数
|
|
1090
1091
|
const handler = {
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
// init flag设置为true
|
|
1094
|
-
initFlag = true;
|
|
1095
|
-
// connFlag设置为false
|
|
1096
|
-
connFlag = false;
|
|
1097
|
-
// logger
|
|
1098
|
-
this.logger.info(`${roomId}直播间连接已建立!`);
|
|
1099
|
-
}
|
|
1092
|
+
onStartListen: () => {
|
|
1093
|
+
this.logger.info(`[${roomId}]开始监听直播间消息!`);
|
|
1100
1094
|
},
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
// 发送消息
|
|
1112
|
-
await this.sendPrivateMsg(`${roomId}直播间连接已中断!`);
|
|
1113
|
-
this.logger.error(`${roomId}直播间连接已中断!`);
|
|
1114
|
-
}
|
|
1095
|
+
onError: async () => {
|
|
1096
|
+
// 更直播状态
|
|
1097
|
+
liveStatus = false;
|
|
1098
|
+
// 关闭定时推送
|
|
1099
|
+
pushAtTimeTimer?.();
|
|
1100
|
+
// 停止服务
|
|
1101
|
+
this.ctx.bl.closeListener(roomId);
|
|
1102
|
+
// 发送消息
|
|
1103
|
+
await this.sendPrivateMsg(`[${roomId}]直播间连接发生错误!`);
|
|
1104
|
+
this.logger.error(`[${roomId}]直播间连接发生错误!`);
|
|
1115
1105
|
},
|
|
1116
1106
|
onIncomeDanmu: ({ body }) => {
|
|
1117
1107
|
// 保存消息到数组
|
|
@@ -1130,7 +1120,7 @@ class ComRegister {
|
|
|
1130
1120
|
const content = `[${masterInfo.username}的直播间]「${body.user.uname}」加入了大航海(${body.gift_name})`;
|
|
1131
1121
|
// 直接发送消息
|
|
1132
1122
|
channelArrLen > 0 &&
|
|
1133
|
-
this.broadcastToTargets(liveGuardBuyPushTargetArr, content, PushType.LiveGuardBuy);
|
|
1123
|
+
this.broadcastToTargets(liveGuardBuyPushTargetArr, content, type_1.PushType.LiveGuardBuy);
|
|
1134
1124
|
},
|
|
1135
1125
|
onLiveStart: async () => {
|
|
1136
1126
|
// 判断是否已经开播
|
|
@@ -1139,7 +1129,7 @@ class ComRegister {
|
|
|
1139
1129
|
// 设置开播状态为true
|
|
1140
1130
|
liveStatus = true;
|
|
1141
1131
|
// 判断是否信息是否获取成功
|
|
1142
|
-
if (!(await useMasterAndLiveRoomInfo(LiveType.StartBroadcasting))) {
|
|
1132
|
+
if (!(await useMasterAndLiveRoomInfo(type_1.LiveType.StartBroadcasting))) {
|
|
1143
1133
|
// 设置开播状态为false
|
|
1144
1134
|
liveStatus = false;
|
|
1145
1135
|
// 未获取成功,直接返回
|
|
@@ -1163,7 +1153,7 @@ class ComRegister {
|
|
|
1163
1153
|
.replace("-link", `https://live.bilibili.com/${liveRoomInfo.short_id === 0 ? liveRoomInfo.room_id : liveRoomInfo.short_id}`)
|
|
1164
1154
|
: null;
|
|
1165
1155
|
// 推送开播通知
|
|
1166
|
-
await this.sendLiveNotifyCard(LiveType.StartBroadcasting, follower, {
|
|
1156
|
+
await this.sendLiveNotifyCard(type_1.LiveType.StartBroadcasting, follower, {
|
|
1167
1157
|
liveRoomInfo,
|
|
1168
1158
|
masterInfo,
|
|
1169
1159
|
cardStyle,
|
|
@@ -1178,7 +1168,7 @@ class ComRegister {
|
|
|
1178
1168
|
// 将直播状态设置为false
|
|
1179
1169
|
liveStatus = false;
|
|
1180
1170
|
// 判断是否信息是否获取成功
|
|
1181
|
-
if (!(await useMasterAndLiveRoomInfo(LiveType.StopBroadcast))) {
|
|
1171
|
+
if (!(await useMasterAndLiveRoomInfo(type_1.LiveType.StopBroadcast))) {
|
|
1182
1172
|
// 未获取成功,直接返回
|
|
1183
1173
|
await this.sendPrivateMsg("获取直播间信息失败,推送直播下播卡片失败!");
|
|
1184
1174
|
// 停止服务
|
|
@@ -1211,7 +1201,7 @@ class ComRegister {
|
|
|
1211
1201
|
.replace("\\n", "\n")
|
|
1212
1202
|
: null;
|
|
1213
1203
|
// 推送通知卡片
|
|
1214
|
-
await this.sendLiveNotifyCard(LiveType.StopBroadcast, followerChange, {
|
|
1204
|
+
await this.sendLiveNotifyCard(type_1.LiveType.StopBroadcast, followerChange, {
|
|
1215
1205
|
liveRoomInfo,
|
|
1216
1206
|
masterInfo,
|
|
1217
1207
|
cardStyle,
|
|
@@ -1225,7 +1215,7 @@ class ComRegister {
|
|
|
1225
1215
|
// 启动直播间弹幕监测
|
|
1226
1216
|
await this.ctx.bl.startLiveRoomListener(roomId, handler);
|
|
1227
1217
|
// 第一次启动获取信息并判信息是否获取成功
|
|
1228
|
-
if (!(await useMasterAndLiveRoomInfo(LiveType.FirstLiveBroadcast))) {
|
|
1218
|
+
if (!(await useMasterAndLiveRoomInfo(type_1.LiveType.FirstLiveBroadcast))) {
|
|
1229
1219
|
// 未获取成功,直接返回
|
|
1230
1220
|
return this.sendPrivateMsg("获取直播间信息失败,启动直播间弹幕检测失败!");
|
|
1231
1221
|
}
|
|
@@ -1246,7 +1236,7 @@ class ComRegister {
|
|
|
1246
1236
|
: null;
|
|
1247
1237
|
// 发送直播通知卡片
|
|
1248
1238
|
if (this.config.restartPush) {
|
|
1249
|
-
await this.sendLiveNotifyCard(LiveType.LiveBroadcast, watched, {
|
|
1239
|
+
await this.sendLiveNotifyCard(type_1.LiveType.LiveBroadcast, watched, {
|
|
1250
1240
|
liveRoomInfo,
|
|
1251
1241
|
masterInfo,
|
|
1252
1242
|
cardStyle,
|
|
@@ -1296,7 +1286,7 @@ class ComRegister {
|
|
|
1296
1286
|
}
|
|
1297
1287
|
const useLiveInfo = async () => {
|
|
1298
1288
|
// 发送请求
|
|
1299
|
-
const { data } = await withRetry(async () => (await this.ctx.ba.getLiveRoomInfoByUids(uids)), 3).catch(async () => {
|
|
1289
|
+
const { data } = await (0, utils_1.withRetry)(async () => (await this.ctx.ba.getLiveRoomInfoByUids(uids)), 3).catch(async () => {
|
|
1300
1290
|
// 返回undefined
|
|
1301
1291
|
return undefined;
|
|
1302
1292
|
});
|
|
@@ -1323,7 +1313,7 @@ class ComRegister {
|
|
|
1323
1313
|
// 将直播状态改为true
|
|
1324
1314
|
liveStatus.live = true;
|
|
1325
1315
|
// 初始化主播和直播间信息
|
|
1326
|
-
await useMasterAndLiveRoomInfo(LiveType.FirstLiveBroadcast, liveStatus);
|
|
1316
|
+
await useMasterAndLiveRoomInfo(type_1.LiveType.FirstLiveBroadcast, liveStatus);
|
|
1327
1317
|
// 判断是否需要设置开播时间
|
|
1328
1318
|
if (!liveStatus.liveStartTimeInit) {
|
|
1329
1319
|
// 设置开播时间
|
|
@@ -1341,7 +1331,7 @@ class ComRegister {
|
|
|
1341
1331
|
.replace("-link", `https://live.bilibili.com/${liveStatus.liveRoomInfo.short_id === 0 ? liveStatus.liveRoomInfo.room_id : liveStatus.liveRoomInfo.short_id}`)
|
|
1342
1332
|
: null;
|
|
1343
1333
|
// 发送直播通知卡片
|
|
1344
|
-
await this.sendLiveNotifyCard(LiveType.LiveBroadcast, "API", {
|
|
1334
|
+
await this.sendLiveNotifyCard(type_1.LiveType.LiveBroadcast, "API", {
|
|
1345
1335
|
liveRoomInfo: liveStatus.liveRoomInfo,
|
|
1346
1336
|
masterInfo: liveStatus.masterInfo,
|
|
1347
1337
|
cardStyle: sub.card,
|
|
@@ -1371,7 +1361,7 @@ class ComRegister {
|
|
|
1371
1361
|
if (liveStatus.live === true) {
|
|
1372
1362
|
// 现在下播了,发送下播通知
|
|
1373
1363
|
// 判断信息是否获取成功
|
|
1374
|
-
if (!(await useMasterAndLiveRoomInfo(LiveType.StopBroadcast, liveStatus))) {
|
|
1364
|
+
if (!(await useMasterAndLiveRoomInfo(type_1.LiveType.StopBroadcast, liveStatus))) {
|
|
1375
1365
|
// 未获取成功,直接返回
|
|
1376
1366
|
await this.sendPrivateMsg("获取直播间信息失败,推送直播下播卡片失败!");
|
|
1377
1367
|
// 停止服务
|
|
@@ -1409,7 +1399,7 @@ class ComRegister {
|
|
|
1409
1399
|
.replace("\\n", "\n")
|
|
1410
1400
|
: null;
|
|
1411
1401
|
// 推送通知卡片
|
|
1412
|
-
await this.sendLiveNotifyCard(LiveType.StopBroadcast, followerChange, {
|
|
1402
|
+
await this.sendLiveNotifyCard(type_1.LiveType.StopBroadcast, followerChange, {
|
|
1413
1403
|
liveRoomInfo: liveStatus.liveRoomInfo,
|
|
1414
1404
|
masterInfo: liveStatus.masterInfo,
|
|
1415
1405
|
cardStyle: sub.card,
|
|
@@ -1425,7 +1415,7 @@ class ComRegister {
|
|
|
1425
1415
|
if (liveStatus.live === false) {
|
|
1426
1416
|
// 开播了
|
|
1427
1417
|
// 判断信息是否获取成功
|
|
1428
|
-
if (!(await useMasterAndLiveRoomInfo(LiveType.StopBroadcast, liveStatus))) {
|
|
1418
|
+
if (!(await useMasterAndLiveRoomInfo(type_1.LiveType.StopBroadcast, liveStatus))) {
|
|
1429
1419
|
// 未获取成功,直接返回
|
|
1430
1420
|
await this.sendPrivateMsg("获取直播间信息失败,推送直播开播卡片失败!");
|
|
1431
1421
|
// 停止服务
|
|
@@ -1449,7 +1439,7 @@ class ComRegister {
|
|
|
1449
1439
|
.replace("-link", `https://live.bilibili.com/${liveStatus.liveRoomInfo.short_id === 0 ? liveStatus.liveRoomInfo.room_id : liveStatus.liveRoomInfo.short_id}`)
|
|
1450
1440
|
: null;
|
|
1451
1441
|
// 推送开播通知
|
|
1452
|
-
await this.sendLiveNotifyCard(LiveType.StartBroadcasting, follower, {
|
|
1442
|
+
await this.sendLiveNotifyCard(type_1.LiveType.StartBroadcasting, follower, {
|
|
1453
1443
|
liveRoomInfo: liveStatus.liveRoomInfo,
|
|
1454
1444
|
masterInfo: liveStatus.masterInfo,
|
|
1455
1445
|
cardStyle: sub.card,
|
|
@@ -1466,7 +1456,7 @@ class ComRegister {
|
|
|
1466
1456
|
break;
|
|
1467
1457
|
}
|
|
1468
1458
|
// 判断是否信息是否获取成功
|
|
1469
|
-
if (!(await useMasterAndLiveRoomInfo(LiveType.LiveBroadcast, liveStatus))) {
|
|
1459
|
+
if (!(await useMasterAndLiveRoomInfo(type_1.LiveType.LiveBroadcast, liveStatus))) {
|
|
1470
1460
|
// 未获取成功,直接返回
|
|
1471
1461
|
await this.sendPrivateMsg("获取直播间信息失败,推送直播卡片失败!");
|
|
1472
1462
|
// 停止服务
|
|
@@ -1489,7 +1479,7 @@ class ComRegister {
|
|
|
1489
1479
|
.replace("-link", `https://live.bilibili.com/${liveStatus.liveRoomInfo.short_id === 0 ? liveStatus.liveRoomInfo.room_id : liveStatus.liveRoomInfo.short_id}`)
|
|
1490
1480
|
: null;
|
|
1491
1481
|
// 发送直播通知卡片
|
|
1492
|
-
await this.sendLiveNotifyCard(LiveType.LiveBroadcast, "API", {
|
|
1482
|
+
await this.sendLiveNotifyCard(type_1.LiveType.LiveBroadcast, "API", {
|
|
1493
1483
|
liveRoomInfo: liveStatus.liveRoomInfo,
|
|
1494
1484
|
masterInfo: liveStatus.masterInfo,
|
|
1495
1485
|
cardStyle: sub.card,
|
|
@@ -1506,7 +1496,7 @@ class ComRegister {
|
|
|
1506
1496
|
}
|
|
1507
1497
|
};
|
|
1508
1498
|
// 返回一个闭包函数
|
|
1509
|
-
return withLock(handler);
|
|
1499
|
+
return (0, utils_1.withLock)(handler);
|
|
1510
1500
|
}
|
|
1511
1501
|
subShow() {
|
|
1512
1502
|
// 在控制台中显示订阅对象
|
|
@@ -1532,9 +1522,9 @@ class ComRegister {
|
|
|
1532
1522
|
const subTableArray = subInfo.split("\n");
|
|
1533
1523
|
subTableArray.splice(subTableArray.length - 1, 1);
|
|
1534
1524
|
// 定义Table
|
|
1535
|
-
table = (
|
|
1525
|
+
table = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("p", { children: "\u5F53\u524D\u8BA2\u9605\u5BF9\u8C61\uFF1A" }), (0, jsx_runtime_1.jsx)("ul", { children: subTableArray.map((str) => (
|
|
1536
1526
|
// biome-ignore lint/correctness/useJsxKeyInIterable: <explanation>
|
|
1537
|
-
|
|
1527
|
+
(0, jsx_runtime_1.jsx)("li", { children: str }))) })] }));
|
|
1538
1528
|
}
|
|
1539
1529
|
// 设置更新后的提示
|
|
1540
1530
|
this.subNotifier = this.ctx.notifier.create(table);
|
|
@@ -1724,7 +1714,7 @@ class ComRegister {
|
|
|
1724
1714
|
// logger
|
|
1725
1715
|
this.logger.info(`加载订阅UID:${sub.uid}中...`);
|
|
1726
1716
|
// 定义Data
|
|
1727
|
-
const { code: userInfoCode, msg: userInfoMsg, data: userInfoData, } = await withRetry(async () => {
|
|
1717
|
+
const { code: userInfoCode, msg: userInfoMsg, data: userInfoData, } = await (0, utils_1.withRetry)(async () => {
|
|
1728
1718
|
// 获取用户信息
|
|
1729
1719
|
const data = await this.ctx.ba.getUserInfo(sub.uid);
|
|
1730
1720
|
// 返回用户信息
|
|
@@ -1801,7 +1791,7 @@ class ComRegister {
|
|
|
1801
1791
|
}
|
|
1802
1792
|
enableDynamicDetect() {
|
|
1803
1793
|
// 定义Job
|
|
1804
|
-
this.dynamicJob = new CronJob("*/2 * * * *", this.config.dynamicDebugMode
|
|
1794
|
+
this.dynamicJob = new cron_1.CronJob("*/2 * * * *", this.config.dynamicDebugMode
|
|
1805
1795
|
? this.debug_dynamicDetect()
|
|
1806
1796
|
: this.dynamicDetect());
|
|
1807
1797
|
// logger
|
|
@@ -1811,7 +1801,7 @@ class ComRegister {
|
|
|
1811
1801
|
}
|
|
1812
1802
|
async enableLiveDetect() {
|
|
1813
1803
|
// 定义Job
|
|
1814
|
-
this.liveJob = new CronJob("*/30 * * * * *", await this.liveDetectWithAPI());
|
|
1804
|
+
this.liveJob = new cron_1.CronJob("*/30 * * * * *", await this.liveDetectWithAPI());
|
|
1815
1805
|
// logger
|
|
1816
1806
|
this.logger.info("直播监测已开启");
|
|
1817
1807
|
// 开始直播监测
|
|
@@ -1830,54 +1820,54 @@ class ComRegister {
|
|
|
1830
1820
|
}
|
|
1831
1821
|
}
|
|
1832
1822
|
(function (ComRegister) {
|
|
1833
|
-
ComRegister.Config = Schema.object({
|
|
1834
|
-
sub: Schema.array(Schema.object({
|
|
1835
|
-
uid: Schema.string().description("订阅用户UID"),
|
|
1836
|
-
dynamic: Schema.boolean().description("是否订阅用户动态"),
|
|
1837
|
-
live: Schema.boolean().description("是否订阅用户直播"),
|
|
1838
|
-
target: Schema.array(Schema.object({
|
|
1839
|
-
channelArr: Schema.array(Schema.object({
|
|
1840
|
-
channelId: Schema.string().description("频道/群组号"),
|
|
1841
|
-
dynamic: Schema.boolean().description("该频道/群组是否推送动态信息"),
|
|
1842
|
-
live: Schema.boolean().description("该频道/群组是否推送直播通知"),
|
|
1843
|
-
liveGuardBuy: Schema.boolean().description("该频道/群组是否推送弹幕消息"),
|
|
1844
|
-
atAll: Schema.boolean().description("推送开播通知时是否艾特全体成员"),
|
|
1845
|
-
bot: Schema.string().description("若您有多个相同平台机器人,可在此填写当前群聊执行推送的机器人账号。不填则默认第一个"),
|
|
1823
|
+
ComRegister.Config = koishi_1.Schema.object({
|
|
1824
|
+
sub: koishi_1.Schema.array(koishi_1.Schema.object({
|
|
1825
|
+
uid: koishi_1.Schema.string().description("订阅用户UID"),
|
|
1826
|
+
dynamic: koishi_1.Schema.boolean().description("是否订阅用户动态"),
|
|
1827
|
+
live: koishi_1.Schema.boolean().description("是否订阅用户直播"),
|
|
1828
|
+
target: koishi_1.Schema.array(koishi_1.Schema.object({
|
|
1829
|
+
channelArr: koishi_1.Schema.array(koishi_1.Schema.object({
|
|
1830
|
+
channelId: koishi_1.Schema.string().description("频道/群组号"),
|
|
1831
|
+
dynamic: koishi_1.Schema.boolean().description("该频道/群组是否推送动态信息"),
|
|
1832
|
+
live: koishi_1.Schema.boolean().description("该频道/群组是否推送直播通知"),
|
|
1833
|
+
liveGuardBuy: koishi_1.Schema.boolean().description("该频道/群组是否推送弹幕消息"),
|
|
1834
|
+
atAll: koishi_1.Schema.boolean().description("推送开播通知时是否艾特全体成员"),
|
|
1835
|
+
bot: koishi_1.Schema.string().description("若您有多个相同平台机器人,可在此填写当前群聊执行推送的机器人账号。不填则默认第一个"),
|
|
1846
1836
|
})).description("频道/群组信息"),
|
|
1847
|
-
platform: Schema.string().description("推送平台"),
|
|
1837
|
+
platform: koishi_1.Schema.string().description("推送平台"),
|
|
1848
1838
|
})).description("订阅用户需要发送的频道/群组信息"),
|
|
1849
|
-
card: Schema.object({
|
|
1850
|
-
enable: Schema.boolean(),
|
|
1851
|
-
cardColorStart: Schema.string(),
|
|
1852
|
-
cardColorEnd: Schema.string(),
|
|
1853
|
-
cardBasePlateColor: Schema.string(),
|
|
1854
|
-
cardBasePlateBorder: Schema.string(),
|
|
1839
|
+
card: koishi_1.Schema.object({
|
|
1840
|
+
enable: koishi_1.Schema.boolean(),
|
|
1841
|
+
cardColorStart: koishi_1.Schema.string(),
|
|
1842
|
+
cardColorEnd: koishi_1.Schema.string(),
|
|
1843
|
+
cardBasePlateColor: koishi_1.Schema.string(),
|
|
1844
|
+
cardBasePlateBorder: koishi_1.Schema.string(),
|
|
1855
1845
|
}).description("自定义推送卡片颜色,默认使用插件内置的颜色,设置后会覆盖插件内置的颜色"),
|
|
1856
1846
|
}))
|
|
1857
1847
|
.role("table")
|
|
1858
1848
|
.description("手动输入订阅信息,方便自定义订阅内容,这里的订阅内容不会存入数据库。uid: 订阅用户UID,dynamic: 是否需要订阅动态,live: 是否需要订阅直播"),
|
|
1859
|
-
master: Schema.object({
|
|
1860
|
-
enable: Schema.boolean(),
|
|
1861
|
-
platform: Schema.string(),
|
|
1862
|
-
masterAccount: Schema.string(),
|
|
1863
|
-
masterAccountGuildId: Schema.string(),
|
|
1849
|
+
master: koishi_1.Schema.object({
|
|
1850
|
+
enable: koishi_1.Schema.boolean(),
|
|
1851
|
+
platform: koishi_1.Schema.string(),
|
|
1852
|
+
masterAccount: koishi_1.Schema.string(),
|
|
1853
|
+
masterAccountGuildId: koishi_1.Schema.string(),
|
|
1864
1854
|
}),
|
|
1865
|
-
liveDetectType: Schema.string(),
|
|
1866
|
-
restartPush: Schema.boolean().required(),
|
|
1867
|
-
pushTime: Schema.number().required(),
|
|
1868
|
-
pushImgsInDynamic: Schema.boolean().required(),
|
|
1869
|
-
liveLoopTime: Schema.number().default(10),
|
|
1870
|
-
customLiveStart: Schema.string().required(),
|
|
1871
|
-
customLive: Schema.string(),
|
|
1872
|
-
customLiveEnd: Schema.string().required(),
|
|
1873
|
-
dynamicUrl: Schema.boolean().required(),
|
|
1874
|
-
filter: Schema.object({
|
|
1875
|
-
enable: Schema.boolean(),
|
|
1876
|
-
notify: Schema.boolean(),
|
|
1877
|
-
regex: Schema.string(),
|
|
1878
|
-
keywords: Schema.array(String),
|
|
1855
|
+
liveDetectType: koishi_1.Schema.string(),
|
|
1856
|
+
restartPush: koishi_1.Schema.boolean().required(),
|
|
1857
|
+
pushTime: koishi_1.Schema.number().required(),
|
|
1858
|
+
pushImgsInDynamic: koishi_1.Schema.boolean().required(),
|
|
1859
|
+
liveLoopTime: koishi_1.Schema.number().default(10),
|
|
1860
|
+
customLiveStart: koishi_1.Schema.string().required(),
|
|
1861
|
+
customLive: koishi_1.Schema.string(),
|
|
1862
|
+
customLiveEnd: koishi_1.Schema.string().required(),
|
|
1863
|
+
dynamicUrl: koishi_1.Schema.boolean().required(),
|
|
1864
|
+
filter: koishi_1.Schema.object({
|
|
1865
|
+
enable: koishi_1.Schema.boolean(),
|
|
1866
|
+
notify: koishi_1.Schema.boolean(),
|
|
1867
|
+
regex: koishi_1.Schema.string(),
|
|
1868
|
+
keywords: koishi_1.Schema.array(String),
|
|
1879
1869
|
}),
|
|
1880
|
-
dynamicDebugMode: Schema.boolean().required(),
|
|
1870
|
+
dynamicDebugMode: koishi_1.Schema.boolean().required(),
|
|
1881
1871
|
});
|
|
1882
1872
|
})(ComRegister || (ComRegister = {}));
|
|
1883
|
-
|
|
1873
|
+
exports.default = ComRegister;
|