koishi-plugin-bilibili-notify 3.2.9-rc.1 → 3.2.9-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/index.js +156 -21
- package/lib/index.mjs +156 -21
- package/package.json +2 -2
- package/readme.md +3 -5
package/lib/index.js
CHANGED
|
@@ -39,7 +39,8 @@ const path = __toESM$1(require("path"));
|
|
|
39
39
|
const qrcode = __toESM$1(require("qrcode"));
|
|
40
40
|
const cron = __toESM$1(require("cron"));
|
|
41
41
|
const luxon = __toESM$1(require("luxon"));
|
|
42
|
-
const
|
|
42
|
+
const __node_rs_jieba = __toESM$1(require("@node-rs/jieba"));
|
|
43
|
+
const __node_rs_jieba_dict = __toESM$1(require("@node-rs/jieba/dict"));
|
|
43
44
|
const __satorijs_element_jsx_runtime = __toESM$1(require("@satorijs/element/jsx-runtime"));
|
|
44
45
|
const node_path = __toESM$1(require("node:path"));
|
|
45
46
|
const node_url = __toESM$1(require("node:url"));
|
|
@@ -615,7 +616,142 @@ const PushTypeMsg = {
|
|
|
615
616
|
};
|
|
616
617
|
|
|
617
618
|
//#endregion
|
|
618
|
-
//#region src/
|
|
619
|
+
//#region src/stop_words.ts
|
|
620
|
+
const stopwords = new Set([
|
|
621
|
+
",",
|
|
622
|
+
"。",
|
|
623
|
+
"!",
|
|
624
|
+
"?",
|
|
625
|
+
":",
|
|
626
|
+
";",
|
|
627
|
+
"“",
|
|
628
|
+
"”",
|
|
629
|
+
"‘",
|
|
630
|
+
"’",
|
|
631
|
+
"(",
|
|
632
|
+
")",
|
|
633
|
+
"、",
|
|
634
|
+
"……",
|
|
635
|
+
"——",
|
|
636
|
+
"-",
|
|
637
|
+
"_",
|
|
638
|
+
".",
|
|
639
|
+
",",
|
|
640
|
+
"(",
|
|
641
|
+
")",
|
|
642
|
+
"【",
|
|
643
|
+
"】",
|
|
644
|
+
"而且",
|
|
645
|
+
"但是",
|
|
646
|
+
"如果",
|
|
647
|
+
"虽然",
|
|
648
|
+
"因为",
|
|
649
|
+
"所以",
|
|
650
|
+
"但是",
|
|
651
|
+
"那么",
|
|
652
|
+
"那么就",
|
|
653
|
+
"今天",
|
|
654
|
+
"昨天",
|
|
655
|
+
"后天",
|
|
656
|
+
"明天",
|
|
657
|
+
"现在",
|
|
658
|
+
"刚刚",
|
|
659
|
+
"刚才",
|
|
660
|
+
"一直",
|
|
661
|
+
"一直在",
|
|
662
|
+
"目前",
|
|
663
|
+
"以前",
|
|
664
|
+
"以后",
|
|
665
|
+
"以前的",
|
|
666
|
+
"the",
|
|
667
|
+
"and",
|
|
668
|
+
"to",
|
|
669
|
+
"of",
|
|
670
|
+
"a",
|
|
671
|
+
"is",
|
|
672
|
+
"in",
|
|
673
|
+
"on",
|
|
674
|
+
"for",
|
|
675
|
+
"with",
|
|
676
|
+
"this",
|
|
677
|
+
"that",
|
|
678
|
+
"you",
|
|
679
|
+
"觉得",
|
|
680
|
+
"表示",
|
|
681
|
+
"发现",
|
|
682
|
+
"认为",
|
|
683
|
+
"看到",
|
|
684
|
+
"听说",
|
|
685
|
+
"了解",
|
|
686
|
+
"知道",
|
|
687
|
+
"说明",
|
|
688
|
+
"指出",
|
|
689
|
+
"讨论",
|
|
690
|
+
"讨论一下",
|
|
691
|
+
"看看",
|
|
692
|
+
"想想",
|
|
693
|
+
"说说",
|
|
694
|
+
"讲讲",
|
|
695
|
+
"一个",
|
|
696
|
+
"一些",
|
|
697
|
+
"这个",
|
|
698
|
+
"那个",
|
|
699
|
+
"每个",
|
|
700
|
+
"什么",
|
|
701
|
+
"东西",
|
|
702
|
+
"事情",
|
|
703
|
+
"这些",
|
|
704
|
+
"那些",
|
|
705
|
+
"这种",
|
|
706
|
+
"那种",
|
|
707
|
+
"怎么说",
|
|
708
|
+
"怎么会",
|
|
709
|
+
"怎么可能",
|
|
710
|
+
"不可能",
|
|
711
|
+
"有点像",
|
|
712
|
+
"真的很",
|
|
713
|
+
"特别是",
|
|
714
|
+
"有时候",
|
|
715
|
+
"每次都",
|
|
716
|
+
"一点点",
|
|
717
|
+
"哪里有",
|
|
718
|
+
"太离谱",
|
|
719
|
+
"太搞笑",
|
|
720
|
+
"太真实",
|
|
721
|
+
"为了",
|
|
722
|
+
"因为",
|
|
723
|
+
"所以",
|
|
724
|
+
"但是",
|
|
725
|
+
"而且",
|
|
726
|
+
"然后",
|
|
727
|
+
"如果",
|
|
728
|
+
"虽然",
|
|
729
|
+
"然而",
|
|
730
|
+
"不过",
|
|
731
|
+
"并且",
|
|
732
|
+
"即使",
|
|
733
|
+
"由于",
|
|
734
|
+
"那么",
|
|
735
|
+
"除非",
|
|
736
|
+
"比如",
|
|
737
|
+
"比如说",
|
|
738
|
+
"现在",
|
|
739
|
+
"刚刚",
|
|
740
|
+
"刚才",
|
|
741
|
+
"以前",
|
|
742
|
+
"以后",
|
|
743
|
+
"一直",
|
|
744
|
+
"从来",
|
|
745
|
+
"目前",
|
|
746
|
+
"最近",
|
|
747
|
+
"已经",
|
|
748
|
+
"后来",
|
|
749
|
+
"之前",
|
|
750
|
+
"某天"
|
|
751
|
+
]);
|
|
752
|
+
|
|
753
|
+
//#endregion
|
|
754
|
+
//#region src/command_register.tsx
|
|
619
755
|
var import_lib$1 = __toESM$1(require_lib$3());
|
|
620
756
|
var ComRegister = class {
|
|
621
757
|
static inject = [
|
|
@@ -648,7 +784,7 @@ var ComRegister = class {
|
|
|
648
784
|
privateBot;
|
|
649
785
|
dynamicJob;
|
|
650
786
|
liveJob;
|
|
651
|
-
|
|
787
|
+
_jieba = __node_rs_jieba.Jieba.withDict(__node_rs_jieba_dict.dict);
|
|
652
788
|
constructor(ctx, config) {
|
|
653
789
|
this.ctx = ctx;
|
|
654
790
|
this.init(config);
|
|
@@ -981,7 +1117,7 @@ var ComRegister = class {
|
|
|
981
1117
|
}
|
|
982
1118
|
async broadcastToTargets(uid, content, type, retry = 3e3) {
|
|
983
1119
|
if (!this.checkAllBotsAreReady()) {
|
|
984
|
-
this.logger.error(
|
|
1120
|
+
this.logger.error(`存在机器人未初始化完毕,无法进行推送,${retry / 1e3}秒后重试`);
|
|
985
1121
|
this.ctx.setTimeout(() => {
|
|
986
1122
|
this.broadcastToTargets(uid, content, type, retry * 2);
|
|
987
1123
|
}, retry);
|
|
@@ -996,7 +1132,7 @@ var ComRegister = class {
|
|
|
996
1132
|
const success = await withRetry(async () => {
|
|
997
1133
|
return await this.ctx.broadcast(atAllArr, /* @__PURE__ */ (0, __satorijs_element_jsx_runtime.jsx)("message", { children: /* @__PURE__ */ (0, __satorijs_element_jsx_runtime.jsx)("at", { type: "all" }) }));
|
|
998
1134
|
}, 1);
|
|
999
|
-
this.logger.info(
|
|
1135
|
+
this.logger.info(`成功推送全体成员消息:${success.length}条`);
|
|
1000
1136
|
}
|
|
1001
1137
|
if (type === PushType.Dynamic && record.dynamicArr?.length >= 1) {
|
|
1002
1138
|
this.logger.info(record.dynamicArr);
|
|
@@ -1004,7 +1140,7 @@ var ComRegister = class {
|
|
|
1004
1140
|
const success = await withRetry(async () => {
|
|
1005
1141
|
return await this.ctx.broadcast(dynamicArr, /* @__PURE__ */ (0, __satorijs_element_jsx_runtime.jsx)("message", { children: content }));
|
|
1006
1142
|
}, 1);
|
|
1007
|
-
this.logger.info(
|
|
1143
|
+
this.logger.info(`成功推送动态消息:${success.length}条`);
|
|
1008
1144
|
}
|
|
1009
1145
|
if ((type === PushType.Live || type === PushType.StartBroadcasting) && record.liveArr?.length >= 1) {
|
|
1010
1146
|
this.logger.info(record.liveArr);
|
|
@@ -1012,7 +1148,7 @@ var ComRegister = class {
|
|
|
1012
1148
|
const success = await withRetry(async () => {
|
|
1013
1149
|
return await this.ctx.broadcast(liveArr, /* @__PURE__ */ (0, __satorijs_element_jsx_runtime.jsx)("message", { children: content }));
|
|
1014
1150
|
}, 1);
|
|
1015
|
-
this.logger.info(
|
|
1151
|
+
this.logger.info(`成功推送直播消息:${success.length}条`);
|
|
1016
1152
|
}
|
|
1017
1153
|
if (type === PushType.LiveGuardBuy && record.liveGuardBuyArr?.length >= 1) {
|
|
1018
1154
|
this.logger.info(record.liveGuardBuyArr);
|
|
@@ -1020,7 +1156,7 @@ var ComRegister = class {
|
|
|
1020
1156
|
const success = await withRetry(async () => {
|
|
1021
1157
|
return await this.ctx.broadcast(liveGuardBuyArr, /* @__PURE__ */ (0, __satorijs_element_jsx_runtime.jsx)("message", { children: content }));
|
|
1022
1158
|
}, 1);
|
|
1023
|
-
this.logger.info(
|
|
1159
|
+
this.logger.info(`成功推送上舰消息:${success.length}条`);
|
|
1024
1160
|
}
|
|
1025
1161
|
return;
|
|
1026
1162
|
}
|
|
@@ -1280,8 +1416,7 @@ var ComRegister = class {
|
|
|
1280
1416
|
return await this.broadcastToTargets(uid, msg, liveType === LiveType.StartBroadcasting ? PushType.StartBroadcasting : PushType.Live);
|
|
1281
1417
|
}
|
|
1282
1418
|
async segmentDanmaku(danmaku, danmakuWeightRecord) {
|
|
1283
|
-
this.
|
|
1284
|
-
if (p$1 && p$1 === 2048) return;
|
|
1419
|
+
this._jieba.cut(danmaku, true).filter((word) => word.length >= 2 && !stopwords.has(word)).map((w$3) => {
|
|
1285
1420
|
danmakuWeightRecord[w$3] = (danmakuWeightRecord[w$3] || 0) + 1;
|
|
1286
1421
|
});
|
|
1287
1422
|
}
|
|
@@ -1848,7 +1983,7 @@ var ComRegister = class {
|
|
|
1848
1983
|
dynamicDebugMode: koishi.Schema.boolean().required()
|
|
1849
1984
|
});
|
|
1850
1985
|
})(ComRegister || (ComRegister = {}));
|
|
1851
|
-
var
|
|
1986
|
+
var command_register_default = ComRegister;
|
|
1852
1987
|
|
|
1853
1988
|
//#endregion
|
|
1854
1989
|
//#region src/database.ts
|
|
@@ -93102,7 +93237,7 @@ var require_lib = __commonJS$1({ "node_modules/koishi-plugin-puppeteer/lib/index
|
|
|
93102
93237
|
} });
|
|
93103
93238
|
|
|
93104
93239
|
//#endregion
|
|
93105
|
-
//#region src/
|
|
93240
|
+
//#region src/generate_img.ts
|
|
93106
93241
|
var import_lib = __toESM$1(require_lib());
|
|
93107
93242
|
const DYNAMIC_TYPE_NONE = "DYNAMIC_TYPE_NONE";
|
|
93108
93243
|
const DYNAMIC_TYPE_FORWARD = "DYNAMIC_TYPE_FORWARD";
|
|
@@ -94590,7 +94725,7 @@ var GenerateImg = class extends koishi.Service {
|
|
|
94590
94725
|
followerDisplay: koishi.Schema.boolean()
|
|
94591
94726
|
});
|
|
94592
94727
|
})(GenerateImg || (GenerateImg = {}));
|
|
94593
|
-
var
|
|
94728
|
+
var generate_img_default = GenerateImg;
|
|
94594
94729
|
|
|
94595
94730
|
//#endregion
|
|
94596
94731
|
//#region node_modules/@oxc-project/runtime/src/helpers/decorate.js
|
|
@@ -94605,7 +94740,7 @@ var require_decorate = __commonJS$1({ "node_modules/@oxc-project/runtime/src/hel
|
|
|
94605
94740
|
} });
|
|
94606
94741
|
|
|
94607
94742
|
//#endregion
|
|
94608
|
-
//#region src/
|
|
94743
|
+
//#region src/bili_api.ts
|
|
94609
94744
|
var import_decorate = __toESM$1(require_decorate());
|
|
94610
94745
|
const mixinKeyEncTab = [
|
|
94611
94746
|
46,
|
|
@@ -95298,10 +95433,10 @@ var BiliAPI = class extends koishi.Service {
|
|
|
95298
95433
|
key: koishi.Schema.string().pattern(/^[0-9a-f]{32}$/).required()
|
|
95299
95434
|
});
|
|
95300
95435
|
})(BiliAPI || (BiliAPI = {}));
|
|
95301
|
-
var
|
|
95436
|
+
var bili_api_default = BiliAPI;
|
|
95302
95437
|
|
|
95303
95438
|
//#endregion
|
|
95304
|
-
//#region src/
|
|
95439
|
+
//#region src/bili_live.ts
|
|
95305
95440
|
var BLive = class extends koishi.Service {
|
|
95306
95441
|
static inject = ["ba"];
|
|
95307
95442
|
listenerRecord = {};
|
|
@@ -95331,7 +95466,7 @@ var BLive = class extends koishi.Service {
|
|
|
95331
95466
|
this.logger.warn(`${roomId}直播间连接未成功关闭`);
|
|
95332
95467
|
}
|
|
95333
95468
|
};
|
|
95334
|
-
var
|
|
95469
|
+
var bili_live_default = BLive;
|
|
95335
95470
|
|
|
95336
95471
|
//#endregion
|
|
95337
95472
|
//#region src/index.ts
|
|
@@ -95373,11 +95508,11 @@ var ServerManager = class extends koishi.Service {
|
|
|
95373
95508
|
registerPlugin = () => {
|
|
95374
95509
|
if (this.servers.length !== 0) return false;
|
|
95375
95510
|
try {
|
|
95376
|
-
const ba = this.ctx.plugin(
|
|
95511
|
+
const ba = this.ctx.plugin(bili_api_default, {
|
|
95377
95512
|
userAgent: globalConfig.userAgent,
|
|
95378
95513
|
key: globalConfig.key
|
|
95379
95514
|
});
|
|
95380
|
-
const gi = this.ctx.plugin(
|
|
95515
|
+
const gi = this.ctx.plugin(generate_img_default, {
|
|
95381
95516
|
filter: globalConfig.filter,
|
|
95382
95517
|
removeBorder: globalConfig.removeBorder,
|
|
95383
95518
|
cardColorStart: globalConfig.cardColorStart,
|
|
@@ -95389,7 +95524,7 @@ var ServerManager = class extends koishi.Service {
|
|
|
95389
95524
|
font: globalConfig.font,
|
|
95390
95525
|
followerDisplay: globalConfig.followerDisplay
|
|
95391
95526
|
});
|
|
95392
|
-
const cr = this.ctx.plugin(
|
|
95527
|
+
const cr = this.ctx.plugin(command_register_default, {
|
|
95393
95528
|
sub: globalConfig.sub,
|
|
95394
95529
|
master: globalConfig.master,
|
|
95395
95530
|
wordcloud: globalConfig.wordcloud,
|
|
@@ -95406,7 +95541,7 @@ var ServerManager = class extends koishi.Service {
|
|
|
95406
95541
|
filter: globalConfig.filter,
|
|
95407
95542
|
dynamicDebugMode: globalConfig.dynamicDebugMode
|
|
95408
95543
|
});
|
|
95409
|
-
const bl = this.ctx.plugin(
|
|
95544
|
+
const bl = this.ctx.plugin(bili_live_default);
|
|
95410
95545
|
this.servers.push(ba);
|
|
95411
95546
|
this.servers.push(bl);
|
|
95412
95547
|
this.servers.push(gi);
|
package/lib/index.mjs
CHANGED
|
@@ -4,7 +4,8 @@ import { resolve } from "path";
|
|
|
4
4
|
import QRCode from "qrcode";
|
|
5
5
|
import { CronJob } from "cron";
|
|
6
6
|
import { DateTime } from "luxon";
|
|
7
|
-
import {
|
|
7
|
+
import { Jieba } from "@node-rs/jieba";
|
|
8
|
+
import { dict } from "@node-rs/jieba/dict";
|
|
8
9
|
import { Fragment, jsx, jsxs } from "@satorijs/element/jsx-runtime";
|
|
9
10
|
import { resolve as resolve$1 } from "node:path";
|
|
10
11
|
import { pathToFileURL } from "node:url";
|
|
@@ -617,7 +618,142 @@ const PushTypeMsg = {
|
|
|
617
618
|
};
|
|
618
619
|
|
|
619
620
|
//#endregion
|
|
620
|
-
//#region src/
|
|
621
|
+
//#region src/stop_words.ts
|
|
622
|
+
const stopwords = new Set([
|
|
623
|
+
",",
|
|
624
|
+
"。",
|
|
625
|
+
"!",
|
|
626
|
+
"?",
|
|
627
|
+
":",
|
|
628
|
+
";",
|
|
629
|
+
"“",
|
|
630
|
+
"”",
|
|
631
|
+
"‘",
|
|
632
|
+
"’",
|
|
633
|
+
"(",
|
|
634
|
+
")",
|
|
635
|
+
"、",
|
|
636
|
+
"……",
|
|
637
|
+
"——",
|
|
638
|
+
"-",
|
|
639
|
+
"_",
|
|
640
|
+
".",
|
|
641
|
+
",",
|
|
642
|
+
"(",
|
|
643
|
+
")",
|
|
644
|
+
"【",
|
|
645
|
+
"】",
|
|
646
|
+
"而且",
|
|
647
|
+
"但是",
|
|
648
|
+
"如果",
|
|
649
|
+
"虽然",
|
|
650
|
+
"因为",
|
|
651
|
+
"所以",
|
|
652
|
+
"但是",
|
|
653
|
+
"那么",
|
|
654
|
+
"那么就",
|
|
655
|
+
"今天",
|
|
656
|
+
"昨天",
|
|
657
|
+
"后天",
|
|
658
|
+
"明天",
|
|
659
|
+
"现在",
|
|
660
|
+
"刚刚",
|
|
661
|
+
"刚才",
|
|
662
|
+
"一直",
|
|
663
|
+
"一直在",
|
|
664
|
+
"目前",
|
|
665
|
+
"以前",
|
|
666
|
+
"以后",
|
|
667
|
+
"以前的",
|
|
668
|
+
"the",
|
|
669
|
+
"and",
|
|
670
|
+
"to",
|
|
671
|
+
"of",
|
|
672
|
+
"a",
|
|
673
|
+
"is",
|
|
674
|
+
"in",
|
|
675
|
+
"on",
|
|
676
|
+
"for",
|
|
677
|
+
"with",
|
|
678
|
+
"this",
|
|
679
|
+
"that",
|
|
680
|
+
"you",
|
|
681
|
+
"觉得",
|
|
682
|
+
"表示",
|
|
683
|
+
"发现",
|
|
684
|
+
"认为",
|
|
685
|
+
"看到",
|
|
686
|
+
"听说",
|
|
687
|
+
"了解",
|
|
688
|
+
"知道",
|
|
689
|
+
"说明",
|
|
690
|
+
"指出",
|
|
691
|
+
"讨论",
|
|
692
|
+
"讨论一下",
|
|
693
|
+
"看看",
|
|
694
|
+
"想想",
|
|
695
|
+
"说说",
|
|
696
|
+
"讲讲",
|
|
697
|
+
"一个",
|
|
698
|
+
"一些",
|
|
699
|
+
"这个",
|
|
700
|
+
"那个",
|
|
701
|
+
"每个",
|
|
702
|
+
"什么",
|
|
703
|
+
"东西",
|
|
704
|
+
"事情",
|
|
705
|
+
"这些",
|
|
706
|
+
"那些",
|
|
707
|
+
"这种",
|
|
708
|
+
"那种",
|
|
709
|
+
"怎么说",
|
|
710
|
+
"怎么会",
|
|
711
|
+
"怎么可能",
|
|
712
|
+
"不可能",
|
|
713
|
+
"有点像",
|
|
714
|
+
"真的很",
|
|
715
|
+
"特别是",
|
|
716
|
+
"有时候",
|
|
717
|
+
"每次都",
|
|
718
|
+
"一点点",
|
|
719
|
+
"哪里有",
|
|
720
|
+
"太离谱",
|
|
721
|
+
"太搞笑",
|
|
722
|
+
"太真实",
|
|
723
|
+
"为了",
|
|
724
|
+
"因为",
|
|
725
|
+
"所以",
|
|
726
|
+
"但是",
|
|
727
|
+
"而且",
|
|
728
|
+
"然后",
|
|
729
|
+
"如果",
|
|
730
|
+
"虽然",
|
|
731
|
+
"然而",
|
|
732
|
+
"不过",
|
|
733
|
+
"并且",
|
|
734
|
+
"即使",
|
|
735
|
+
"由于",
|
|
736
|
+
"那么",
|
|
737
|
+
"除非",
|
|
738
|
+
"比如",
|
|
739
|
+
"比如说",
|
|
740
|
+
"现在",
|
|
741
|
+
"刚刚",
|
|
742
|
+
"刚才",
|
|
743
|
+
"以前",
|
|
744
|
+
"以后",
|
|
745
|
+
"一直",
|
|
746
|
+
"从来",
|
|
747
|
+
"目前",
|
|
748
|
+
"最近",
|
|
749
|
+
"已经",
|
|
750
|
+
"后来",
|
|
751
|
+
"之前",
|
|
752
|
+
"某天"
|
|
753
|
+
]);
|
|
754
|
+
|
|
755
|
+
//#endregion
|
|
756
|
+
//#region src/command_register.tsx
|
|
621
757
|
var import_lib$1 = __toESM$1(require_lib$3());
|
|
622
758
|
var ComRegister = class {
|
|
623
759
|
static inject = [
|
|
@@ -650,7 +786,7 @@ var ComRegister = class {
|
|
|
650
786
|
privateBot;
|
|
651
787
|
dynamicJob;
|
|
652
788
|
liveJob;
|
|
653
|
-
|
|
789
|
+
_jieba = Jieba.withDict(dict);
|
|
654
790
|
constructor(ctx, config) {
|
|
655
791
|
this.ctx = ctx;
|
|
656
792
|
this.init(config);
|
|
@@ -983,7 +1119,7 @@ var ComRegister = class {
|
|
|
983
1119
|
}
|
|
984
1120
|
async broadcastToTargets(uid, content, type, retry = 3e3) {
|
|
985
1121
|
if (!this.checkAllBotsAreReady()) {
|
|
986
|
-
this.logger.error(
|
|
1122
|
+
this.logger.error(`存在机器人未初始化完毕,无法进行推送,${retry / 1e3}秒后重试`);
|
|
987
1123
|
this.ctx.setTimeout(() => {
|
|
988
1124
|
this.broadcastToTargets(uid, content, type, retry * 2);
|
|
989
1125
|
}, retry);
|
|
@@ -998,7 +1134,7 @@ var ComRegister = class {
|
|
|
998
1134
|
const success = await withRetry(async () => {
|
|
999
1135
|
return await this.ctx.broadcast(atAllArr, /* @__PURE__ */ jsx("message", { children: /* @__PURE__ */ jsx("at", { type: "all" }) }));
|
|
1000
1136
|
}, 1);
|
|
1001
|
-
this.logger.info(
|
|
1137
|
+
this.logger.info(`成功推送全体成员消息:${success.length}条`);
|
|
1002
1138
|
}
|
|
1003
1139
|
if (type === PushType.Dynamic && record.dynamicArr?.length >= 1) {
|
|
1004
1140
|
this.logger.info(record.dynamicArr);
|
|
@@ -1006,7 +1142,7 @@ var ComRegister = class {
|
|
|
1006
1142
|
const success = await withRetry(async () => {
|
|
1007
1143
|
return await this.ctx.broadcast(dynamicArr, /* @__PURE__ */ jsx("message", { children: content }));
|
|
1008
1144
|
}, 1);
|
|
1009
|
-
this.logger.info(
|
|
1145
|
+
this.logger.info(`成功推送动态消息:${success.length}条`);
|
|
1010
1146
|
}
|
|
1011
1147
|
if ((type === PushType.Live || type === PushType.StartBroadcasting) && record.liveArr?.length >= 1) {
|
|
1012
1148
|
this.logger.info(record.liveArr);
|
|
@@ -1014,7 +1150,7 @@ var ComRegister = class {
|
|
|
1014
1150
|
const success = await withRetry(async () => {
|
|
1015
1151
|
return await this.ctx.broadcast(liveArr, /* @__PURE__ */ jsx("message", { children: content }));
|
|
1016
1152
|
}, 1);
|
|
1017
|
-
this.logger.info(
|
|
1153
|
+
this.logger.info(`成功推送直播消息:${success.length}条`);
|
|
1018
1154
|
}
|
|
1019
1155
|
if (type === PushType.LiveGuardBuy && record.liveGuardBuyArr?.length >= 1) {
|
|
1020
1156
|
this.logger.info(record.liveGuardBuyArr);
|
|
@@ -1022,7 +1158,7 @@ var ComRegister = class {
|
|
|
1022
1158
|
const success = await withRetry(async () => {
|
|
1023
1159
|
return await this.ctx.broadcast(liveGuardBuyArr, /* @__PURE__ */ jsx("message", { children: content }));
|
|
1024
1160
|
}, 1);
|
|
1025
|
-
this.logger.info(
|
|
1161
|
+
this.logger.info(`成功推送上舰消息:${success.length}条`);
|
|
1026
1162
|
}
|
|
1027
1163
|
return;
|
|
1028
1164
|
}
|
|
@@ -1282,8 +1418,7 @@ var ComRegister = class {
|
|
|
1282
1418
|
return await this.broadcastToTargets(uid, msg, liveType === LiveType.StartBroadcasting ? PushType.StartBroadcasting : PushType.Live);
|
|
1283
1419
|
}
|
|
1284
1420
|
async segmentDanmaku(danmaku, danmakuWeightRecord) {
|
|
1285
|
-
this.
|
|
1286
|
-
if (p$1 && p$1 === 2048) return;
|
|
1421
|
+
this._jieba.cut(danmaku, true).filter((word) => word.length >= 2 && !stopwords.has(word)).map((w$3) => {
|
|
1287
1422
|
danmakuWeightRecord[w$3] = (danmakuWeightRecord[w$3] || 0) + 1;
|
|
1288
1423
|
});
|
|
1289
1424
|
}
|
|
@@ -1850,7 +1985,7 @@ var ComRegister = class {
|
|
|
1850
1985
|
dynamicDebugMode: Schema.boolean().required()
|
|
1851
1986
|
});
|
|
1852
1987
|
})(ComRegister || (ComRegister = {}));
|
|
1853
|
-
var
|
|
1988
|
+
var command_register_default = ComRegister;
|
|
1854
1989
|
|
|
1855
1990
|
//#endregion
|
|
1856
1991
|
//#region src/database.ts
|
|
@@ -93104,7 +93239,7 @@ var require_lib = __commonJS$1({ "node_modules/koishi-plugin-puppeteer/lib/index
|
|
|
93104
93239
|
} });
|
|
93105
93240
|
|
|
93106
93241
|
//#endregion
|
|
93107
|
-
//#region src/
|
|
93242
|
+
//#region src/generate_img.ts
|
|
93108
93243
|
var import_lib = __toESM$1(require_lib());
|
|
93109
93244
|
const DYNAMIC_TYPE_NONE = "DYNAMIC_TYPE_NONE";
|
|
93110
93245
|
const DYNAMIC_TYPE_FORWARD = "DYNAMIC_TYPE_FORWARD";
|
|
@@ -94592,7 +94727,7 @@ var GenerateImg = class extends Service {
|
|
|
94592
94727
|
followerDisplay: Schema.boolean()
|
|
94593
94728
|
});
|
|
94594
94729
|
})(GenerateImg || (GenerateImg = {}));
|
|
94595
|
-
var
|
|
94730
|
+
var generate_img_default = GenerateImg;
|
|
94596
94731
|
|
|
94597
94732
|
//#endregion
|
|
94598
94733
|
//#region node_modules/@oxc-project/runtime/src/helpers/decorate.js
|
|
@@ -94607,7 +94742,7 @@ var require_decorate = __commonJS$1({ "node_modules/@oxc-project/runtime/src/hel
|
|
|
94607
94742
|
} });
|
|
94608
94743
|
|
|
94609
94744
|
//#endregion
|
|
94610
|
-
//#region src/
|
|
94745
|
+
//#region src/bili_api.ts
|
|
94611
94746
|
var import_decorate = __toESM$1(require_decorate());
|
|
94612
94747
|
const mixinKeyEncTab = [
|
|
94613
94748
|
46,
|
|
@@ -95300,10 +95435,10 @@ var BiliAPI = class extends Service {
|
|
|
95300
95435
|
key: Schema.string().pattern(/^[0-9a-f]{32}$/).required()
|
|
95301
95436
|
});
|
|
95302
95437
|
})(BiliAPI || (BiliAPI = {}));
|
|
95303
|
-
var
|
|
95438
|
+
var bili_api_default = BiliAPI;
|
|
95304
95439
|
|
|
95305
95440
|
//#endregion
|
|
95306
|
-
//#region src/
|
|
95441
|
+
//#region src/bili_live.ts
|
|
95307
95442
|
var BLive = class extends Service {
|
|
95308
95443
|
static inject = ["ba"];
|
|
95309
95444
|
listenerRecord = {};
|
|
@@ -95333,7 +95468,7 @@ var BLive = class extends Service {
|
|
|
95333
95468
|
this.logger.warn(`${roomId}直播间连接未成功关闭`);
|
|
95334
95469
|
}
|
|
95335
95470
|
};
|
|
95336
|
-
var
|
|
95471
|
+
var bili_live_default = BLive;
|
|
95337
95472
|
|
|
95338
95473
|
//#endregion
|
|
95339
95474
|
//#region src/index.ts
|
|
@@ -95375,11 +95510,11 @@ var ServerManager = class extends Service {
|
|
|
95375
95510
|
registerPlugin = () => {
|
|
95376
95511
|
if (this.servers.length !== 0) return false;
|
|
95377
95512
|
try {
|
|
95378
|
-
const ba = this.ctx.plugin(
|
|
95513
|
+
const ba = this.ctx.plugin(bili_api_default, {
|
|
95379
95514
|
userAgent: globalConfig.userAgent,
|
|
95380
95515
|
key: globalConfig.key
|
|
95381
95516
|
});
|
|
95382
|
-
const gi = this.ctx.plugin(
|
|
95517
|
+
const gi = this.ctx.plugin(generate_img_default, {
|
|
95383
95518
|
filter: globalConfig.filter,
|
|
95384
95519
|
removeBorder: globalConfig.removeBorder,
|
|
95385
95520
|
cardColorStart: globalConfig.cardColorStart,
|
|
@@ -95391,7 +95526,7 @@ var ServerManager = class extends Service {
|
|
|
95391
95526
|
font: globalConfig.font,
|
|
95392
95527
|
followerDisplay: globalConfig.followerDisplay
|
|
95393
95528
|
});
|
|
95394
|
-
const cr = this.ctx.plugin(
|
|
95529
|
+
const cr = this.ctx.plugin(command_register_default, {
|
|
95395
95530
|
sub: globalConfig.sub,
|
|
95396
95531
|
master: globalConfig.master,
|
|
95397
95532
|
wordcloud: globalConfig.wordcloud,
|
|
@@ -95408,7 +95543,7 @@ var ServerManager = class extends Service {
|
|
|
95408
95543
|
filter: globalConfig.filter,
|
|
95409
95544
|
dynamicDebugMode: globalConfig.dynamicDebugMode
|
|
95410
95545
|
});
|
|
95411
|
-
const bl = this.ctx.plugin(
|
|
95546
|
+
const bl = this.ctx.plugin(bili_live_default);
|
|
95412
95547
|
this.servers.push(ba);
|
|
95413
95548
|
this.servers.push(bl);
|
|
95414
95549
|
this.servers.push(gi);
|
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": "3.2.9-rc.
|
|
4
|
+
"version": "3.2.9-rc.2",
|
|
5
5
|
"contributors": [
|
|
6
6
|
"Akokko <admin@akokko.com>"
|
|
7
7
|
],
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@akokko/blive-message-listener": "^0.5.1",
|
|
39
|
+
"@node-rs/jieba": "^2.0.1",
|
|
39
40
|
"@satorijs/element": "^3.1.8",
|
|
40
41
|
"axios": "^1.10.0",
|
|
41
42
|
"axios-cookiejar-support": "^6.0.2",
|
|
@@ -45,7 +46,6 @@
|
|
|
45
46
|
"luxon": "^3.6.1",
|
|
46
47
|
"md5": "^2.3.0",
|
|
47
48
|
"qrcode": "^1.5.4",
|
|
48
|
-
"segmentit": "^2.0.3",
|
|
49
49
|
"tough-cookie": "^5.1.2"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
package/readme.md
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
- koishi-plugin-bilibili-notify [](https://www.npmjs.com/package/koishi-plugin-bilibili-notify)
|
|
8
|
-
- [重要通知](#重要通知)
|
|
9
8
|
- [重新订阅](#重新订阅)
|
|
10
9
|
- [功能](#功能)
|
|
11
10
|
- [注意事项](#注意事项)
|
|
@@ -16,10 +15,6 @@
|
|
|
16
15
|
- [感谢](#感谢)
|
|
17
16
|
- [License](#License)
|
|
18
17
|
|
|
19
|
-
## 重要通知
|
|
20
|
-
> [!WARNING]
|
|
21
|
-
> `3.2.5-alpha.x` 目前均为测试版本,请不要更新🙅
|
|
22
|
-
|
|
23
18
|
## 重新订阅
|
|
24
19
|
> [!NOTE]
|
|
25
20
|
>由于版本 `2.0.0-alpha.7` 重构了订阅功能,从 `2.0.0-alpha.7` 以前版本升级到以后版本的需重新订阅
|
|
@@ -305,8 +300,11 @@ uid为必填参数,为要推送的UP主的UID,index为可选参数,为要
|
|
|
305
300
|
> - ver 3.2.9-alpha.2 修复:`AxiosError: Request failed with status code 404 xxx at async BiliAPI.checkIfTokenNeedRefresh`、潜在cookie相关bug、弹幕词云bug `Error: 生成图片失败!错误: TimeoutError: Navigation timeout of 30000 ms exceeded`
|
|
306
301
|
> - ver 3.2.9-alpha.3 修复:词云生成空白
|
|
307
302
|
> - ver 3.2.9-alpha.4 修复:弹幕词云bug `Error: 生成图片失败!错误: TimeoutError: Navigation timeout of 30000 ms exceeded`
|
|
303
|
+
|
|
304
|
+
> [!NOTE]
|
|
308
305
|
> - ver 3.2.9-rc.0 优化:弹幕词云生成效果、选项 `pushTime` 设置为0时可关闭该功能; 新增:选项 `wordcloud` 可选择在直播结束后是否生成弹幕词云
|
|
309
306
|
> - ver 3.2.9-rc.1 优化:弹幕词云生成效果;
|
|
307
|
+
> - ver 3.2.9-rc.2 优化:弹幕词云生成效果;
|
|
310
308
|
|
|
311
309
|
## 交流群
|
|
312
310
|
|