koishi-plugin-bilibili-notify 3.2.1-alpha.8 → 3.2.1
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 +1 -1
- package/lib/biliAPI.js +51 -46
- package/lib/blive.js +20 -23
- package/lib/comRegister.js +125 -120
- package/lib/database.js +6 -2
- package/lib/font/HYZhengYuan-75W.ttf +0 -0
- package/lib/generateImg.js +33 -31
- package/lib/index.js +131 -91
- package/lib/type/index.d.ts +19 -0
- package/lib/type/index.js +7 -4
- package/lib/utils/index.js +8 -3
- package/package.json +34 -9
- package/readme.md +5 -4
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
|
// 定义开播时间
|
|
@@ -1021,7 +1026,7 @@ class ComRegister {
|
|
|
1021
1026
|
// 定义定时推送函数
|
|
1022
1027
|
const pushAtTimeFunc = async () => {
|
|
1023
1028
|
// 判断是否信息是否获取成功
|
|
1024
|
-
if (!(await useMasterAndLiveRoomInfo(LiveType.LiveBroadcast))) {
|
|
1029
|
+
if (!(await useMasterAndLiveRoomInfo(type_1.LiveType.LiveBroadcast))) {
|
|
1025
1030
|
// 未获取成功,直接返回
|
|
1026
1031
|
await this.sendPrivateMsg("获取直播间信息失败,推送直播卡片失败!");
|
|
1027
1032
|
// 停止服务
|
|
@@ -1052,7 +1057,7 @@ class ComRegister {
|
|
|
1052
1057
|
.replace("-link", `https://live.bilibili.com/${liveRoomInfo.short_id === 0 ? liveRoomInfo.room_id : liveRoomInfo.short_id}`)
|
|
1053
1058
|
: null;
|
|
1054
1059
|
// 发送直播通知卡片
|
|
1055
|
-
await this.sendLiveNotifyCard(LiveType.LiveBroadcast, watched, {
|
|
1060
|
+
await this.sendLiveNotifyCard(type_1.LiveType.LiveBroadcast, watched, {
|
|
1056
1061
|
liveRoomInfo,
|
|
1057
1062
|
masterInfo,
|
|
1058
1063
|
cardStyle,
|
|
@@ -1141,7 +1146,7 @@ class ComRegister {
|
|
|
1141
1146
|
const content = `[${masterInfo.username}的直播间]「${body.user.uname}」加入了大航海(${body.gift_name})`;
|
|
1142
1147
|
// 直接发送消息
|
|
1143
1148
|
channelArrLen > 0 &&
|
|
1144
|
-
this.broadcastToTargets(liveGuardBuyPushTargetArr, content, PushType.LiveGuardBuy);
|
|
1149
|
+
this.broadcastToTargets(liveGuardBuyPushTargetArr, content, type_1.PushType.LiveGuardBuy);
|
|
1145
1150
|
},
|
|
1146
1151
|
onLiveStart: async () => {
|
|
1147
1152
|
// 判断是否已经开播
|
|
@@ -1150,7 +1155,7 @@ class ComRegister {
|
|
|
1150
1155
|
// 设置开播状态为true
|
|
1151
1156
|
liveStatus = true;
|
|
1152
1157
|
// 判断是否信息是否获取成功
|
|
1153
|
-
if (!(await useMasterAndLiveRoomInfo(LiveType.StartBroadcasting))) {
|
|
1158
|
+
if (!(await useMasterAndLiveRoomInfo(type_1.LiveType.StartBroadcasting))) {
|
|
1154
1159
|
// 设置开播状态为false
|
|
1155
1160
|
liveStatus = false;
|
|
1156
1161
|
// 未获取成功,直接返回
|
|
@@ -1174,7 +1179,7 @@ class ComRegister {
|
|
|
1174
1179
|
.replace("-link", `https://live.bilibili.com/${liveRoomInfo.short_id === 0 ? liveRoomInfo.room_id : liveRoomInfo.short_id}`)
|
|
1175
1180
|
: null;
|
|
1176
1181
|
// 推送开播通知
|
|
1177
|
-
await this.sendLiveNotifyCard(LiveType.StartBroadcasting, follower, {
|
|
1182
|
+
await this.sendLiveNotifyCard(type_1.LiveType.StartBroadcasting, follower, {
|
|
1178
1183
|
liveRoomInfo,
|
|
1179
1184
|
masterInfo,
|
|
1180
1185
|
cardStyle,
|
|
@@ -1189,7 +1194,7 @@ class ComRegister {
|
|
|
1189
1194
|
// 将直播状态设置为false
|
|
1190
1195
|
liveStatus = false;
|
|
1191
1196
|
// 判断是否信息是否获取成功
|
|
1192
|
-
if (!(await useMasterAndLiveRoomInfo(LiveType.StopBroadcast))) {
|
|
1197
|
+
if (!(await useMasterAndLiveRoomInfo(type_1.LiveType.StopBroadcast))) {
|
|
1193
1198
|
// 未获取成功,直接返回
|
|
1194
1199
|
await this.sendPrivateMsg("获取直播间信息失败,推送直播下播卡片失败!");
|
|
1195
1200
|
// 停止服务
|
|
@@ -1222,7 +1227,7 @@ class ComRegister {
|
|
|
1222
1227
|
.replace("\\n", "\n")
|
|
1223
1228
|
: null;
|
|
1224
1229
|
// 推送通知卡片
|
|
1225
|
-
await this.sendLiveNotifyCard(LiveType.StopBroadcast, followerChange, {
|
|
1230
|
+
await this.sendLiveNotifyCard(type_1.LiveType.StopBroadcast, followerChange, {
|
|
1226
1231
|
liveRoomInfo,
|
|
1227
1232
|
masterInfo,
|
|
1228
1233
|
cardStyle,
|
|
@@ -1236,7 +1241,7 @@ class ComRegister {
|
|
|
1236
1241
|
// 启动直播间弹幕监测
|
|
1237
1242
|
await this.ctx.bl.startLiveRoomListener(roomId, handler);
|
|
1238
1243
|
// 第一次启动获取信息并判信息是否获取成功
|
|
1239
|
-
if (!(await useMasterAndLiveRoomInfo(LiveType.FirstLiveBroadcast))) {
|
|
1244
|
+
if (!(await useMasterAndLiveRoomInfo(type_1.LiveType.FirstLiveBroadcast))) {
|
|
1240
1245
|
// 未获取成功,直接返回
|
|
1241
1246
|
return this.sendPrivateMsg("获取直播间信息失败,启动直播间弹幕检测失败!");
|
|
1242
1247
|
}
|
|
@@ -1257,7 +1262,7 @@ class ComRegister {
|
|
|
1257
1262
|
: null;
|
|
1258
1263
|
// 发送直播通知卡片
|
|
1259
1264
|
if (this.config.restartPush) {
|
|
1260
|
-
await this.sendLiveNotifyCard(LiveType.LiveBroadcast, watched, {
|
|
1265
|
+
await this.sendLiveNotifyCard(type_1.LiveType.LiveBroadcast, watched, {
|
|
1261
1266
|
liveRoomInfo,
|
|
1262
1267
|
masterInfo,
|
|
1263
1268
|
cardStyle,
|
|
@@ -1307,7 +1312,7 @@ class ComRegister {
|
|
|
1307
1312
|
}
|
|
1308
1313
|
const useLiveInfo = async () => {
|
|
1309
1314
|
// 发送请求
|
|
1310
|
-
const { data } = await withRetry(async () => (await this.ctx.ba.getLiveRoomInfoByUids(uids)), 3).catch(async () => {
|
|
1315
|
+
const { data } = await (0, utils_1.withRetry)(async () => (await this.ctx.ba.getLiveRoomInfoByUids(uids)), 3).catch(async () => {
|
|
1311
1316
|
// 返回undefined
|
|
1312
1317
|
return undefined;
|
|
1313
1318
|
});
|
|
@@ -1334,7 +1339,7 @@ class ComRegister {
|
|
|
1334
1339
|
// 将直播状态改为true
|
|
1335
1340
|
liveStatus.live = true;
|
|
1336
1341
|
// 初始化主播和直播间信息
|
|
1337
|
-
await useMasterAndLiveRoomInfo(LiveType.FirstLiveBroadcast, liveStatus);
|
|
1342
|
+
await useMasterAndLiveRoomInfo(type_1.LiveType.FirstLiveBroadcast, liveStatus);
|
|
1338
1343
|
// 判断是否需要设置开播时间
|
|
1339
1344
|
if (!liveStatus.liveStartTimeInit) {
|
|
1340
1345
|
// 设置开播时间
|
|
@@ -1352,7 +1357,7 @@ class ComRegister {
|
|
|
1352
1357
|
.replace("-link", `https://live.bilibili.com/${liveStatus.liveRoomInfo.short_id === 0 ? liveStatus.liveRoomInfo.room_id : liveStatus.liveRoomInfo.short_id}`)
|
|
1353
1358
|
: null;
|
|
1354
1359
|
// 发送直播通知卡片
|
|
1355
|
-
await this.sendLiveNotifyCard(LiveType.LiveBroadcast, "API", {
|
|
1360
|
+
await this.sendLiveNotifyCard(type_1.LiveType.LiveBroadcast, "API", {
|
|
1356
1361
|
liveRoomInfo: liveStatus.liveRoomInfo,
|
|
1357
1362
|
masterInfo: liveStatus.masterInfo,
|
|
1358
1363
|
cardStyle: sub.card,
|
|
@@ -1382,7 +1387,7 @@ class ComRegister {
|
|
|
1382
1387
|
if (liveStatus.live === true) {
|
|
1383
1388
|
// 现在下播了,发送下播通知
|
|
1384
1389
|
// 判断信息是否获取成功
|
|
1385
|
-
if (!(await useMasterAndLiveRoomInfo(LiveType.StopBroadcast, liveStatus))) {
|
|
1390
|
+
if (!(await useMasterAndLiveRoomInfo(type_1.LiveType.StopBroadcast, liveStatus))) {
|
|
1386
1391
|
// 未获取成功,直接返回
|
|
1387
1392
|
await this.sendPrivateMsg("获取直播间信息失败,推送直播下播卡片失败!");
|
|
1388
1393
|
// 停止服务
|
|
@@ -1420,7 +1425,7 @@ class ComRegister {
|
|
|
1420
1425
|
.replace("\\n", "\n")
|
|
1421
1426
|
: null;
|
|
1422
1427
|
// 推送通知卡片
|
|
1423
|
-
await this.sendLiveNotifyCard(LiveType.StopBroadcast, followerChange, {
|
|
1428
|
+
await this.sendLiveNotifyCard(type_1.LiveType.StopBroadcast, followerChange, {
|
|
1424
1429
|
liveRoomInfo: liveStatus.liveRoomInfo,
|
|
1425
1430
|
masterInfo: liveStatus.masterInfo,
|
|
1426
1431
|
cardStyle: sub.card,
|
|
@@ -1436,7 +1441,7 @@ class ComRegister {
|
|
|
1436
1441
|
if (liveStatus.live === false) {
|
|
1437
1442
|
// 开播了
|
|
1438
1443
|
// 判断信息是否获取成功
|
|
1439
|
-
if (!(await useMasterAndLiveRoomInfo(LiveType.StopBroadcast, liveStatus))) {
|
|
1444
|
+
if (!(await useMasterAndLiveRoomInfo(type_1.LiveType.StopBroadcast, liveStatus))) {
|
|
1440
1445
|
// 未获取成功,直接返回
|
|
1441
1446
|
await this.sendPrivateMsg("获取直播间信息失败,推送直播开播卡片失败!");
|
|
1442
1447
|
// 停止服务
|
|
@@ -1460,7 +1465,7 @@ class ComRegister {
|
|
|
1460
1465
|
.replace("-link", `https://live.bilibili.com/${liveStatus.liveRoomInfo.short_id === 0 ? liveStatus.liveRoomInfo.room_id : liveStatus.liveRoomInfo.short_id}`)
|
|
1461
1466
|
: null;
|
|
1462
1467
|
// 推送开播通知
|
|
1463
|
-
await this.sendLiveNotifyCard(LiveType.StartBroadcasting, follower, {
|
|
1468
|
+
await this.sendLiveNotifyCard(type_1.LiveType.StartBroadcasting, follower, {
|
|
1464
1469
|
liveRoomInfo: liveStatus.liveRoomInfo,
|
|
1465
1470
|
masterInfo: liveStatus.masterInfo,
|
|
1466
1471
|
cardStyle: sub.card,
|
|
@@ -1477,7 +1482,7 @@ class ComRegister {
|
|
|
1477
1482
|
break;
|
|
1478
1483
|
}
|
|
1479
1484
|
// 判断是否信息是否获取成功
|
|
1480
|
-
if (!(await useMasterAndLiveRoomInfo(LiveType.LiveBroadcast, liveStatus))) {
|
|
1485
|
+
if (!(await useMasterAndLiveRoomInfo(type_1.LiveType.LiveBroadcast, liveStatus))) {
|
|
1481
1486
|
// 未获取成功,直接返回
|
|
1482
1487
|
await this.sendPrivateMsg("获取直播间信息失败,推送直播卡片失败!");
|
|
1483
1488
|
// 停止服务
|
|
@@ -1500,7 +1505,7 @@ class ComRegister {
|
|
|
1500
1505
|
.replace("-link", `https://live.bilibili.com/${liveStatus.liveRoomInfo.short_id === 0 ? liveStatus.liveRoomInfo.room_id : liveStatus.liveRoomInfo.short_id}`)
|
|
1501
1506
|
: null;
|
|
1502
1507
|
// 发送直播通知卡片
|
|
1503
|
-
await this.sendLiveNotifyCard(LiveType.LiveBroadcast, "API", {
|
|
1508
|
+
await this.sendLiveNotifyCard(type_1.LiveType.LiveBroadcast, "API", {
|
|
1504
1509
|
liveRoomInfo: liveStatus.liveRoomInfo,
|
|
1505
1510
|
masterInfo: liveStatus.masterInfo,
|
|
1506
1511
|
cardStyle: sub.card,
|
|
@@ -1517,7 +1522,7 @@ class ComRegister {
|
|
|
1517
1522
|
}
|
|
1518
1523
|
};
|
|
1519
1524
|
// 返回一个闭包函数
|
|
1520
|
-
return withLock(handler);
|
|
1525
|
+
return (0, utils_1.withLock)(handler);
|
|
1521
1526
|
}
|
|
1522
1527
|
subShow() {
|
|
1523
1528
|
// 在控制台中显示订阅对象
|
|
@@ -1543,9 +1548,9 @@ class ComRegister {
|
|
|
1543
1548
|
const subTableArray = subInfo.split("\n");
|
|
1544
1549
|
subTableArray.splice(subTableArray.length - 1, 1);
|
|
1545
1550
|
// 定义Table
|
|
1546
|
-
table = (
|
|
1551
|
+
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) => (
|
|
1547
1552
|
// biome-ignore lint/correctness/useJsxKeyInIterable: <explanation>
|
|
1548
|
-
|
|
1553
|
+
(0, jsx_runtime_1.jsx)("li", { children: str }))) })] }));
|
|
1549
1554
|
}
|
|
1550
1555
|
// 设置更新后的提示
|
|
1551
1556
|
this.subNotifier = this.ctx.notifier.create(table);
|
|
@@ -1569,17 +1574,17 @@ class ComRegister {
|
|
|
1569
1574
|
// 判断是否有数据
|
|
1570
1575
|
if (!this.loginDBData?.dynamic_group_id) {
|
|
1571
1576
|
// 没有数据,没有创建分组,尝试创建分组
|
|
1572
|
-
const createGroupData = await this.ctx.ba.createGroup("订阅");
|
|
1577
|
+
const createGroupData = (await this.ctx.ba.createGroup("订阅"));
|
|
1573
1578
|
// 如果分组已创建,则获取分组id
|
|
1574
1579
|
if (createGroupData.code === 22106) {
|
|
1575
1580
|
// 分组已存在,拿到之前的分组id
|
|
1576
|
-
const allGroupData = await this.ctx.ba.getAllGroup();
|
|
1581
|
+
const allGroupData = (await this.ctx.ba.getAllGroup());
|
|
1577
1582
|
// 遍历所有分组
|
|
1578
1583
|
for (const group of allGroupData.data) {
|
|
1579
1584
|
// 找到订阅分组
|
|
1580
1585
|
if (group.name === "订阅") {
|
|
1581
1586
|
// 拿到分组id
|
|
1582
|
-
this.loginDBData.dynamic_group_id = group.tagid;
|
|
1587
|
+
this.loginDBData.dynamic_group_id = group.tagid.toString();
|
|
1583
1588
|
// 保存到数据库
|
|
1584
1589
|
this.ctx.database.set("loginBili", 1, {
|
|
1585
1590
|
dynamic_group_id: this.loginDBData.dynamic_group_id,
|
|
@@ -1595,7 +1600,7 @@ class ComRegister {
|
|
|
1595
1600
|
}
|
|
1596
1601
|
// 创建成功,保存到数据库
|
|
1597
1602
|
this.ctx.database.set("loginBili", 1, {
|
|
1598
|
-
dynamic_group_id:
|
|
1603
|
+
dynamic_group_id: createGroupData.data.tagid.toString(),
|
|
1599
1604
|
});
|
|
1600
1605
|
// 创建成功
|
|
1601
1606
|
return { code: createGroupData.code, msg: createGroupData.message };
|
|
@@ -1735,7 +1740,7 @@ class ComRegister {
|
|
|
1735
1740
|
// logger
|
|
1736
1741
|
this.logger.info(`加载订阅UID:${sub.uid}中...`);
|
|
1737
1742
|
// 定义Data
|
|
1738
|
-
const { code: userInfoCode, msg: userInfoMsg, data: userInfoData, } = await withRetry(async () => {
|
|
1743
|
+
const { code: userInfoCode, msg: userInfoMsg, data: userInfoData, } = await (0, utils_1.withRetry)(async () => {
|
|
1739
1744
|
// 获取用户信息
|
|
1740
1745
|
const data = await this.ctx.ba.getUserInfo(sub.uid);
|
|
1741
1746
|
// 返回用户信息
|
|
@@ -1812,7 +1817,7 @@ class ComRegister {
|
|
|
1812
1817
|
}
|
|
1813
1818
|
enableDynamicDetect() {
|
|
1814
1819
|
// 定义Job
|
|
1815
|
-
this.dynamicJob = new CronJob("*/2 * * * *", this.config.dynamicDebugMode
|
|
1820
|
+
this.dynamicJob = new cron_1.CronJob("*/2 * * * *", this.config.dynamicDebugMode
|
|
1816
1821
|
? this.debug_dynamicDetect()
|
|
1817
1822
|
: this.dynamicDetect());
|
|
1818
1823
|
// logger
|
|
@@ -1822,7 +1827,7 @@ class ComRegister {
|
|
|
1822
1827
|
}
|
|
1823
1828
|
async enableLiveDetect() {
|
|
1824
1829
|
// 定义Job
|
|
1825
|
-
this.liveJob = new CronJob("*/30 * * * * *", await this.liveDetectWithAPI());
|
|
1830
|
+
this.liveJob = new cron_1.CronJob("*/30 * * * * *", await this.liveDetectWithAPI());
|
|
1826
1831
|
// logger
|
|
1827
1832
|
this.logger.info("直播监测已开启");
|
|
1828
1833
|
// 开始直播监测
|
|
@@ -1841,54 +1846,54 @@ class ComRegister {
|
|
|
1841
1846
|
}
|
|
1842
1847
|
}
|
|
1843
1848
|
(function (ComRegister) {
|
|
1844
|
-
ComRegister.Config = Schema.object({
|
|
1845
|
-
sub: Schema.array(Schema.object({
|
|
1846
|
-
uid: Schema.string().description("订阅用户UID"),
|
|
1847
|
-
dynamic: Schema.boolean().description("是否订阅用户动态"),
|
|
1848
|
-
live: Schema.boolean().description("是否订阅用户直播"),
|
|
1849
|
-
target: Schema.array(Schema.object({
|
|
1850
|
-
channelArr: Schema.array(Schema.object({
|
|
1851
|
-
channelId: Schema.string().description("频道/群组号"),
|
|
1852
|
-
dynamic: Schema.boolean().description("该频道/群组是否推送动态信息"),
|
|
1853
|
-
live: Schema.boolean().description("该频道/群组是否推送直播通知"),
|
|
1854
|
-
liveGuardBuy: Schema.boolean().description("该频道/群组是否推送弹幕消息"),
|
|
1855
|
-
atAll: Schema.boolean().description("推送开播通知时是否艾特全体成员"),
|
|
1856
|
-
bot: Schema.string().description("若您有多个相同平台机器人,可在此填写当前群聊执行推送的机器人账号。不填则默认第一个"),
|
|
1849
|
+
ComRegister.Config = koishi_1.Schema.object({
|
|
1850
|
+
sub: koishi_1.Schema.array(koishi_1.Schema.object({
|
|
1851
|
+
uid: koishi_1.Schema.string().description("订阅用户UID"),
|
|
1852
|
+
dynamic: koishi_1.Schema.boolean().description("是否订阅用户动态"),
|
|
1853
|
+
live: koishi_1.Schema.boolean().description("是否订阅用户直播"),
|
|
1854
|
+
target: koishi_1.Schema.array(koishi_1.Schema.object({
|
|
1855
|
+
channelArr: koishi_1.Schema.array(koishi_1.Schema.object({
|
|
1856
|
+
channelId: koishi_1.Schema.string().description("频道/群组号"),
|
|
1857
|
+
dynamic: koishi_1.Schema.boolean().description("该频道/群组是否推送动态信息"),
|
|
1858
|
+
live: koishi_1.Schema.boolean().description("该频道/群组是否推送直播通知"),
|
|
1859
|
+
liveGuardBuy: koishi_1.Schema.boolean().description("该频道/群组是否推送弹幕消息"),
|
|
1860
|
+
atAll: koishi_1.Schema.boolean().description("推送开播通知时是否艾特全体成员"),
|
|
1861
|
+
bot: koishi_1.Schema.string().description("若您有多个相同平台机器人,可在此填写当前群聊执行推送的机器人账号。不填则默认第一个"),
|
|
1857
1862
|
})).description("频道/群组信息"),
|
|
1858
|
-
platform: Schema.string().description("推送平台"),
|
|
1863
|
+
platform: koishi_1.Schema.string().description("推送平台"),
|
|
1859
1864
|
})).description("订阅用户需要发送的频道/群组信息"),
|
|
1860
|
-
card: Schema.object({
|
|
1861
|
-
enable: Schema.boolean(),
|
|
1862
|
-
cardColorStart: Schema.string(),
|
|
1863
|
-
cardColorEnd: Schema.string(),
|
|
1864
|
-
cardBasePlateColor: Schema.string(),
|
|
1865
|
-
cardBasePlateBorder: Schema.string(),
|
|
1865
|
+
card: koishi_1.Schema.object({
|
|
1866
|
+
enable: koishi_1.Schema.boolean(),
|
|
1867
|
+
cardColorStart: koishi_1.Schema.string(),
|
|
1868
|
+
cardColorEnd: koishi_1.Schema.string(),
|
|
1869
|
+
cardBasePlateColor: koishi_1.Schema.string(),
|
|
1870
|
+
cardBasePlateBorder: koishi_1.Schema.string(),
|
|
1866
1871
|
}).description("自定义推送卡片颜色,默认使用插件内置的颜色,设置后会覆盖插件内置的颜色"),
|
|
1867
1872
|
}))
|
|
1868
1873
|
.role("table")
|
|
1869
1874
|
.description("手动输入订阅信息,方便自定义订阅内容,这里的订阅内容不会存入数据库。uid: 订阅用户UID,dynamic: 是否需要订阅动态,live: 是否需要订阅直播"),
|
|
1870
|
-
master: Schema.object({
|
|
1871
|
-
enable: Schema.boolean(),
|
|
1872
|
-
platform: Schema.string(),
|
|
1873
|
-
masterAccount: Schema.string(),
|
|
1874
|
-
masterAccountGuildId: Schema.string(),
|
|
1875
|
+
master: koishi_1.Schema.object({
|
|
1876
|
+
enable: koishi_1.Schema.boolean(),
|
|
1877
|
+
platform: koishi_1.Schema.string(),
|
|
1878
|
+
masterAccount: koishi_1.Schema.string(),
|
|
1879
|
+
masterAccountGuildId: koishi_1.Schema.string(),
|
|
1875
1880
|
}),
|
|
1876
|
-
liveDetectType: Schema.string(),
|
|
1877
|
-
restartPush: Schema.boolean().required(),
|
|
1878
|
-
pushTime: Schema.number().required(),
|
|
1879
|
-
pushImgsInDynamic: Schema.boolean().required(),
|
|
1880
|
-
liveLoopTime: Schema.number().default(10),
|
|
1881
|
-
customLiveStart: Schema.string().required(),
|
|
1882
|
-
customLive: Schema.string(),
|
|
1883
|
-
customLiveEnd: Schema.string().required(),
|
|
1884
|
-
dynamicUrl: Schema.boolean().required(),
|
|
1885
|
-
filter: Schema.object({
|
|
1886
|
-
enable: Schema.boolean(),
|
|
1887
|
-
notify: Schema.boolean(),
|
|
1888
|
-
regex: Schema.string(),
|
|
1889
|
-
keywords: Schema.array(String),
|
|
1881
|
+
liveDetectType: koishi_1.Schema.string(),
|
|
1882
|
+
restartPush: koishi_1.Schema.boolean().required(),
|
|
1883
|
+
pushTime: koishi_1.Schema.number().required(),
|
|
1884
|
+
pushImgsInDynamic: koishi_1.Schema.boolean().required(),
|
|
1885
|
+
liveLoopTime: koishi_1.Schema.number().default(10),
|
|
1886
|
+
customLiveStart: koishi_1.Schema.string().required(),
|
|
1887
|
+
customLive: koishi_1.Schema.string(),
|
|
1888
|
+
customLiveEnd: koishi_1.Schema.string().required(),
|
|
1889
|
+
dynamicUrl: koishi_1.Schema.boolean().required(),
|
|
1890
|
+
filter: koishi_1.Schema.object({
|
|
1891
|
+
enable: koishi_1.Schema.boolean(),
|
|
1892
|
+
notify: koishi_1.Schema.boolean(),
|
|
1893
|
+
regex: koishi_1.Schema.string(),
|
|
1894
|
+
keywords: koishi_1.Schema.array(String),
|
|
1890
1895
|
}),
|
|
1891
|
-
dynamicDebugMode: Schema.boolean().required(),
|
|
1896
|
+
dynamicDebugMode: koishi_1.Schema.boolean().required(),
|
|
1892
1897
|
});
|
|
1893
1898
|
})(ComRegister || (ComRegister = {}));
|
|
1894
|
-
|
|
1899
|
+
exports.default = ComRegister;
|