koishi-plugin-bilibili-notify 3.2.9-rc.3 → 3.2.9-rc.4
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 +10 -9
- package/lib/index.mjs +10 -9
- package/package.json +3 -3
- package/readme.md +1 -0
package/lib/index.js
CHANGED
|
@@ -113,8 +113,8 @@ const BAConfigSchema = koishi.Schema.object({
|
|
|
113
113
|
pushImgsInDynamic: koishi.Schema.boolean().default(false).description("是否推送动态中的图片,默认不开启。开启后会单独推送动态中的图片,该功能容易导致QQ风控"),
|
|
114
114
|
live: koishi.Schema.object({}).description("直播推送设置"),
|
|
115
115
|
liveDetectType: koishi.Schema.union([koishi.Schema.const("WS").description("使用WebSocket连接到B站消息服务器进行直播检测,推荐使用"), koishi.Schema.const("API").description("通过轮询API发送请求监测直播状态,此模式理论可无限订阅,但容易产生其他问题,功能没有WS模式全面").experimental()]).role("radio").default("WS").description("直播检测方式,WS为连接到B站消息服务器,API为通过轮询发送请求监测,默认使用WS检测"),
|
|
116
|
-
wordcloud: koishi.Schema.boolean().default(false).description("直播结束后,是否生成本场直播弹幕词云"),
|
|
117
|
-
liveSummary: koishi.Schema.string().default("🔍【弹幕情报站】本场直播数据如下:\\n🧍♂️ 总共 -dmc
|
|
116
|
+
wordcloud: koishi.Schema.boolean().default(false).description("直播结束后,是否生成本场直播弹幕词云").experimental(),
|
|
117
|
+
liveSummary: koishi.Schema.string().default("🔍【弹幕情报站】本场直播数据如下:\\n🧍♂️ 总共 -dmc 位-mdn上线\\n💬 共计 -dca 条弹幕飞驰而过\\n📊 热词云图已生成,快来看看你有没有上榜!\\n\\n👑 本场顶级输出选手:\\n🥇 -un1 - 弹幕输出 -dc1 条\\n🥈 -un2 - 弹幕 -dc2 条,萌力惊人\\n🥉 -un3 - -dc3 条精准狙击\\n\\n🎖️ 特别嘉奖:-un4 & -un5\\n你们的弹幕,我们都记录在案!🕵️♀️").description("自定义直播总结语,开启弹幕词云自动发送。变量解释:-dmc代表总弹幕发送人数,-mdn代表主播粉丝牌子名,-dca代表总弹幕数,-un1到-un5代表弹幕发送条数前五名用户的用户名,-dc1到-dc5代表弹幕发送条数前五名的弹幕发送数量"),
|
|
118
118
|
restartPush: koishi.Schema.boolean().default(true).description("插件重启后,如果订阅的主播正在直播,是否进行一次推送,默认开启"),
|
|
119
119
|
pushTime: koishi.Schema.number().min(0).max(12).step(.5).default(1).description("设定间隔多长时间推送一次直播状态,单位为小时,默认为一小时"),
|
|
120
120
|
customLiveStart: koishi.Schema.string().default("-name开播啦,当前粉丝数:-follower\\n-link").description("自定义开播提示语,-name代表UP昵称,-follower代表当前粉丝数,-link代表直播间链接(如果使用的是QQ官方机器人,请不要使用),\\n为换行。例如-name开播啦,会发送为xxxUP开播啦"),
|
|
@@ -936,9 +936,9 @@ var ComRegister = class {
|
|
|
936
936
|
});
|
|
937
937
|
biliCom.subcommand(".wc").action(async ({ session }) => {
|
|
938
938
|
const words = [
|
|
939
|
-
["摆烂",
|
|
940
|
-
["可以",
|
|
941
|
-
["可以",
|
|
939
|
+
["摆烂", 91],
|
|
940
|
+
["可以", 82],
|
|
941
|
+
["可以", 72],
|
|
942
942
|
["可以", 42],
|
|
943
943
|
["dog", 40],
|
|
944
944
|
["dog", 40],
|
|
@@ -1035,7 +1035,7 @@ var ComRegister = class {
|
|
|
1035
1035
|
["赵六", 27],
|
|
1036
1036
|
["田七", 25]
|
|
1037
1037
|
];
|
|
1038
|
-
const danmakerRankMsg = this.config.liveSummary.replace("-dmc", "114").replace("-dca", "514").replace("-un1", `${top5DanmakuMaker[0][0]}`).replace("-dc1", `${top5DanmakuMaker[0][1]}`).replace("-un2", `${top5DanmakuMaker[1][0]}`).replace("-dc2", `${top5DanmakuMaker[1][1]}`).replace("-un3", `${top5DanmakuMaker[2][0]}`).replace("-dc3", `${top5DanmakuMaker[2][1]}`).replace("-un4", `${top5DanmakuMaker[3][0]}`).replace("-dc4", `${top5DanmakuMaker[3][1]}`).replace("-un5", `${top5DanmakuMaker[4][0]}`).replace("-dc5", `${top5DanmakuMaker[4][1]}`).replaceAll("\\n", "\n");
|
|
1038
|
+
const danmakerRankMsg = this.config.liveSummary.replace("-dmc", "114").replace("-mdn", "特工").replace("-dca", "514").replace("-un1", `${top5DanmakuMaker[0][0]}`).replace("-dc1", `${top5DanmakuMaker[0][1]}`).replace("-un2", `${top5DanmakuMaker[1][0]}`).replace("-dc2", `${top5DanmakuMaker[1][1]}`).replace("-un3", `${top5DanmakuMaker[2][0]}`).replace("-dc3", `${top5DanmakuMaker[2][1]}`).replace("-un4", `${top5DanmakuMaker[3][0]}`).replace("-dc4", `${top5DanmakuMaker[3][1]}`).replace("-un5", `${top5DanmakuMaker[4][0]}`).replace("-dc5", `${top5DanmakuMaker[4][1]}`).replaceAll("\\n", "\n");
|
|
1039
1039
|
await session.send(danmakerRankMsg);
|
|
1040
1040
|
});
|
|
1041
1041
|
}
|
|
@@ -1444,7 +1444,8 @@ var ComRegister = class {
|
|
|
1444
1444
|
roomId: data$1.room_id,
|
|
1445
1445
|
liveOpenFollowerNum,
|
|
1446
1446
|
liveEndFollowerNum,
|
|
1447
|
-
liveFollowerChange
|
|
1447
|
+
liveFollowerChange,
|
|
1448
|
+
medalName: data$1.medal_name
|
|
1448
1449
|
};
|
|
1449
1450
|
}
|
|
1450
1451
|
async useLiveRoomInfo(roomId) {
|
|
@@ -1486,7 +1487,7 @@ var ComRegister = class {
|
|
|
1486
1487
|
const sendDanmakuWordCloud = async () => {
|
|
1487
1488
|
this.logger.info("开始制作弹幕词云");
|
|
1488
1489
|
this.logger.info("正在获取前90热词");
|
|
1489
|
-
const top90Words = Object.entries(danmakuWeightRecord).sort((a$1, b$2) => b$2[1] - a$1[1]).slice(0, 90)
|
|
1490
|
+
const top90Words = Object.entries(danmakuWeightRecord).sort((a$1, b$2) => b$2[1] - a$1[1]).slice(0, 90);
|
|
1490
1491
|
this.logger.info("弹幕词云前90词及权重:");
|
|
1491
1492
|
this.logger.info(top90Words);
|
|
1492
1493
|
this.logger.info("正在准备生成弹幕词云");
|
|
@@ -1498,7 +1499,7 @@ var ComRegister = class {
|
|
|
1498
1499
|
const danmakuMakerCount = Object.keys(danmakuMakerRecord).length;
|
|
1499
1500
|
const danmakuCount = Object.values(danmakuMakerRecord).reduce((sum, val) => sum + val, 0);
|
|
1500
1501
|
const top5DanmakuMaker = Object.entries(danmakuMakerRecord).sort((a$1, b$2) => b$2[1] - a$1[1]).slice(0, 5);
|
|
1501
|
-
const danmakuMakerMsg = this.config.liveSummary.replace("-dmc", `${danmakuMakerCount}`).replace("-dca", `${danmakuCount}`).replace("-un1", `${top5DanmakuMaker[0][0]}`).replace("-dc1", `${top5DanmakuMaker[0][1]}`).replace("-un2", `${top5DanmakuMaker[1][0]}`).replace("-dc2", `${top5DanmakuMaker[1][1]}`).replace("-un3", `${top5DanmakuMaker[2][0]}`).replace("-dc3", `${top5DanmakuMaker[2][1]}`).replace("-un4", `${top5DanmakuMaker[3][0]}`).replace("-dc4", `${top5DanmakuMaker[3][1]}`).replace("-un5", `${top5DanmakuMaker[4][0]}`).replace("-dc5", `${top5DanmakuMaker[4][1]}`).replaceAll("\\n", "\n");
|
|
1502
|
+
const danmakuMakerMsg = this.config.liveSummary.replace("-dmc", `${danmakuMakerCount}`).replace("-mdn", `${masterInfo.medalName}`).replace("-dca", `${danmakuCount}`).replace("-un1", `${top5DanmakuMaker[0][0]}`).replace("-dc1", `${top5DanmakuMaker[0][1]}`).replace("-un2", `${top5DanmakuMaker[1][0]}`).replace("-dc2", `${top5DanmakuMaker[1][1]}`).replace("-un3", `${top5DanmakuMaker[2][0]}`).replace("-dc3", `${top5DanmakuMaker[2][1]}`).replace("-un4", `${top5DanmakuMaker[3][0]}`).replace("-dc4", `${top5DanmakuMaker[3][1]}`).replace("-un5", `${top5DanmakuMaker[4][0]}`).replace("-dc5", `${top5DanmakuMaker[4][1]}`).replaceAll("\\n", "\n");
|
|
1502
1503
|
await this.broadcastToTargets(uid, danmakuMakerMsg, PushType.Live);
|
|
1503
1504
|
Object.keys(danmakuWeightRecord).forEach((key) => delete danmakuWeightRecord[key]);
|
|
1504
1505
|
Object.keys(danmakuMakerRecord).forEach((key) => delete danmakuMakerRecord[key]);
|
package/lib/index.mjs
CHANGED
|
@@ -115,8 +115,8 @@ const BAConfigSchema = Schema.object({
|
|
|
115
115
|
pushImgsInDynamic: Schema.boolean().default(false).description("是否推送动态中的图片,默认不开启。开启后会单独推送动态中的图片,该功能容易导致QQ风控"),
|
|
116
116
|
live: Schema.object({}).description("直播推送设置"),
|
|
117
117
|
liveDetectType: Schema.union([Schema.const("WS").description("使用WebSocket连接到B站消息服务器进行直播检测,推荐使用"), Schema.const("API").description("通过轮询API发送请求监测直播状态,此模式理论可无限订阅,但容易产生其他问题,功能没有WS模式全面").experimental()]).role("radio").default("WS").description("直播检测方式,WS为连接到B站消息服务器,API为通过轮询发送请求监测,默认使用WS检测"),
|
|
118
|
-
wordcloud: Schema.boolean().default(false).description("直播结束后,是否生成本场直播弹幕词云"),
|
|
119
|
-
liveSummary: Schema.string().default("🔍【弹幕情报站】本场直播数据如下:\\n🧍♂️ 总共 -dmc
|
|
118
|
+
wordcloud: Schema.boolean().default(false).description("直播结束后,是否生成本场直播弹幕词云").experimental(),
|
|
119
|
+
liveSummary: Schema.string().default("🔍【弹幕情报站】本场直播数据如下:\\n🧍♂️ 总共 -dmc 位-mdn上线\\n💬 共计 -dca 条弹幕飞驰而过\\n📊 热词云图已生成,快来看看你有没有上榜!\\n\\n👑 本场顶级输出选手:\\n🥇 -un1 - 弹幕输出 -dc1 条\\n🥈 -un2 - 弹幕 -dc2 条,萌力惊人\\n🥉 -un3 - -dc3 条精准狙击\\n\\n🎖️ 特别嘉奖:-un4 & -un5\\n你们的弹幕,我们都记录在案!🕵️♀️").description("自定义直播总结语,开启弹幕词云自动发送。变量解释:-dmc代表总弹幕发送人数,-mdn代表主播粉丝牌子名,-dca代表总弹幕数,-un1到-un5代表弹幕发送条数前五名用户的用户名,-dc1到-dc5代表弹幕发送条数前五名的弹幕发送数量"),
|
|
120
120
|
restartPush: Schema.boolean().default(true).description("插件重启后,如果订阅的主播正在直播,是否进行一次推送,默认开启"),
|
|
121
121
|
pushTime: Schema.number().min(0).max(12).step(.5).default(1).description("设定间隔多长时间推送一次直播状态,单位为小时,默认为一小时"),
|
|
122
122
|
customLiveStart: Schema.string().default("-name开播啦,当前粉丝数:-follower\\n-link").description("自定义开播提示语,-name代表UP昵称,-follower代表当前粉丝数,-link代表直播间链接(如果使用的是QQ官方机器人,请不要使用),\\n为换行。例如-name开播啦,会发送为xxxUP开播啦"),
|
|
@@ -938,9 +938,9 @@ var ComRegister = class {
|
|
|
938
938
|
});
|
|
939
939
|
biliCom.subcommand(".wc").action(async ({ session }) => {
|
|
940
940
|
const words = [
|
|
941
|
-
["摆烂",
|
|
942
|
-
["可以",
|
|
943
|
-
["可以",
|
|
941
|
+
["摆烂", 91],
|
|
942
|
+
["可以", 82],
|
|
943
|
+
["可以", 72],
|
|
944
944
|
["可以", 42],
|
|
945
945
|
["dog", 40],
|
|
946
946
|
["dog", 40],
|
|
@@ -1037,7 +1037,7 @@ var ComRegister = class {
|
|
|
1037
1037
|
["赵六", 27],
|
|
1038
1038
|
["田七", 25]
|
|
1039
1039
|
];
|
|
1040
|
-
const danmakerRankMsg = this.config.liveSummary.replace("-dmc", "114").replace("-dca", "514").replace("-un1", `${top5DanmakuMaker[0][0]}`).replace("-dc1", `${top5DanmakuMaker[0][1]}`).replace("-un2", `${top5DanmakuMaker[1][0]}`).replace("-dc2", `${top5DanmakuMaker[1][1]}`).replace("-un3", `${top5DanmakuMaker[2][0]}`).replace("-dc3", `${top5DanmakuMaker[2][1]}`).replace("-un4", `${top5DanmakuMaker[3][0]}`).replace("-dc4", `${top5DanmakuMaker[3][1]}`).replace("-un5", `${top5DanmakuMaker[4][0]}`).replace("-dc5", `${top5DanmakuMaker[4][1]}`).replaceAll("\\n", "\n");
|
|
1040
|
+
const danmakerRankMsg = this.config.liveSummary.replace("-dmc", "114").replace("-mdn", "特工").replace("-dca", "514").replace("-un1", `${top5DanmakuMaker[0][0]}`).replace("-dc1", `${top5DanmakuMaker[0][1]}`).replace("-un2", `${top5DanmakuMaker[1][0]}`).replace("-dc2", `${top5DanmakuMaker[1][1]}`).replace("-un3", `${top5DanmakuMaker[2][0]}`).replace("-dc3", `${top5DanmakuMaker[2][1]}`).replace("-un4", `${top5DanmakuMaker[3][0]}`).replace("-dc4", `${top5DanmakuMaker[3][1]}`).replace("-un5", `${top5DanmakuMaker[4][0]}`).replace("-dc5", `${top5DanmakuMaker[4][1]}`).replaceAll("\\n", "\n");
|
|
1041
1041
|
await session.send(danmakerRankMsg);
|
|
1042
1042
|
});
|
|
1043
1043
|
}
|
|
@@ -1446,7 +1446,8 @@ var ComRegister = class {
|
|
|
1446
1446
|
roomId: data$1.room_id,
|
|
1447
1447
|
liveOpenFollowerNum,
|
|
1448
1448
|
liveEndFollowerNum,
|
|
1449
|
-
liveFollowerChange
|
|
1449
|
+
liveFollowerChange,
|
|
1450
|
+
medalName: data$1.medal_name
|
|
1450
1451
|
};
|
|
1451
1452
|
}
|
|
1452
1453
|
async useLiveRoomInfo(roomId) {
|
|
@@ -1488,7 +1489,7 @@ var ComRegister = class {
|
|
|
1488
1489
|
const sendDanmakuWordCloud = async () => {
|
|
1489
1490
|
this.logger.info("开始制作弹幕词云");
|
|
1490
1491
|
this.logger.info("正在获取前90热词");
|
|
1491
|
-
const top90Words = Object.entries(danmakuWeightRecord).sort((a$1, b$2) => b$2[1] - a$1[1]).slice(0, 90)
|
|
1492
|
+
const top90Words = Object.entries(danmakuWeightRecord).sort((a$1, b$2) => b$2[1] - a$1[1]).slice(0, 90);
|
|
1492
1493
|
this.logger.info("弹幕词云前90词及权重:");
|
|
1493
1494
|
this.logger.info(top90Words);
|
|
1494
1495
|
this.logger.info("正在准备生成弹幕词云");
|
|
@@ -1500,7 +1501,7 @@ var ComRegister = class {
|
|
|
1500
1501
|
const danmakuMakerCount = Object.keys(danmakuMakerRecord).length;
|
|
1501
1502
|
const danmakuCount = Object.values(danmakuMakerRecord).reduce((sum, val) => sum + val, 0);
|
|
1502
1503
|
const top5DanmakuMaker = Object.entries(danmakuMakerRecord).sort((a$1, b$2) => b$2[1] - a$1[1]).slice(0, 5);
|
|
1503
|
-
const danmakuMakerMsg = this.config.liveSummary.replace("-dmc", `${danmakuMakerCount}`).replace("-dca", `${danmakuCount}`).replace("-un1", `${top5DanmakuMaker[0][0]}`).replace("-dc1", `${top5DanmakuMaker[0][1]}`).replace("-un2", `${top5DanmakuMaker[1][0]}`).replace("-dc2", `${top5DanmakuMaker[1][1]}`).replace("-un3", `${top5DanmakuMaker[2][0]}`).replace("-dc3", `${top5DanmakuMaker[2][1]}`).replace("-un4", `${top5DanmakuMaker[3][0]}`).replace("-dc4", `${top5DanmakuMaker[3][1]}`).replace("-un5", `${top5DanmakuMaker[4][0]}`).replace("-dc5", `${top5DanmakuMaker[4][1]}`).replaceAll("\\n", "\n");
|
|
1504
|
+
const danmakuMakerMsg = this.config.liveSummary.replace("-dmc", `${danmakuMakerCount}`).replace("-mdn", `${masterInfo.medalName}`).replace("-dca", `${danmakuCount}`).replace("-un1", `${top5DanmakuMaker[0][0]}`).replace("-dc1", `${top5DanmakuMaker[0][1]}`).replace("-un2", `${top5DanmakuMaker[1][0]}`).replace("-dc2", `${top5DanmakuMaker[1][1]}`).replace("-un3", `${top5DanmakuMaker[2][0]}`).replace("-dc3", `${top5DanmakuMaker[2][1]}`).replace("-un4", `${top5DanmakuMaker[3][0]}`).replace("-dc4", `${top5DanmakuMaker[3][1]}`).replace("-un5", `${top5DanmakuMaker[4][0]}`).replace("-dc5", `${top5DanmakuMaker[4][1]}`).replaceAll("\\n", "\n");
|
|
1504
1505
|
await this.broadcastToTargets(uid, danmakuMakerMsg, PushType.Live);
|
|
1505
1506
|
Object.keys(danmakuWeightRecord).forEach((key) => delete danmakuWeightRecord[key]);
|
|
1506
1507
|
Object.keys(danmakuMakerRecord).forEach((key) => delete danmakuMakerRecord[key]);
|
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.4",
|
|
5
5
|
"contributors": [
|
|
6
6
|
"Akokko <admin@akokko.com>"
|
|
7
7
|
],
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"tough-cookie": "^5.1.2"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@biomejs/biome": "^2.0.
|
|
52
|
+
"@biomejs/biome": "^2.0.6",
|
|
53
53
|
"@koishijs/cache": "^2.1.0",
|
|
54
54
|
"@koishijs/client": "^5.30.9",
|
|
55
55
|
"@koishijs/plugin-help": "^2.4.5",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"@types/md5": "^2.3.5",
|
|
62
62
|
"@types/qrcode": "^1.5.5",
|
|
63
63
|
"@types/tough-cookie": "^4.0.5",
|
|
64
|
-
"globals": "^16.
|
|
64
|
+
"globals": "^16.3.0",
|
|
65
65
|
"koishi": "^4.18.8",
|
|
66
66
|
"koishi-plugin-puppeteer": "^3.9.0",
|
|
67
67
|
"tsdown": "^0.12.9",
|
package/readme.md
CHANGED
|
@@ -306,6 +306,7 @@ uid为必填参数,为要推送的UP主的UID,index为可选参数,为要
|
|
|
306
306
|
> - ver 3.2.9-rc.1 优化:弹幕词云生成效果;
|
|
307
307
|
> - ver 3.2.9-rc.2 优化:弹幕词云生成效果;
|
|
308
308
|
> - ver 3.2.9-rc.3 优化:弹幕词云生成效果; 新增:直播总结语,开启弹幕词云后自动发送、选项 `liveSummary` 可自定义直播总结语; 修复:一场直播完成后,如果插件中途没有被关闭过,会影响同一位up主下一次直播词云数据;
|
|
309
|
+
> - ver 3.2.9-rc.4 优化:弹幕词云生成效果; 新增:直播总结 `-mdn` 变量,代表主播粉丝牌子名
|
|
309
310
|
|
|
310
311
|
## 交流群
|
|
311
312
|
|