koishi-plugin-bilibili-notify 3.3.6 → 3.3.8-alpha.0
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 +28 -32
- package/lib/index.mjs +28 -32
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -70,7 +70,7 @@ const BAConfigSchema = koishi.Schema.object({
|
|
|
70
70
|
basicSettings: koishi.Schema.object({}).description("基本设置"),
|
|
71
71
|
userAgent: koishi.Schema.string().description("设置请求头User-Agen,请求出现-352时可以尝试修改,UA获取方法可参考:https://blog.csdn.net/qq_44503987/article/details/104929111"),
|
|
72
72
|
subTitle: koishi.Schema.object({}).description("订阅配置"),
|
|
73
|
-
advancedSub: koishi.Schema.boolean().default(false).description("
|
|
73
|
+
advancedSub: koishi.Schema.boolean().default(false).description("是否开启高级订阅,高级订阅是独立于本插件的一个专门用于订阅配置的插件,用于高度自定义订阅消息。若开启高级订阅,请打开该选项并下载插件 bilibili-notify-advanced-subscription"),
|
|
74
74
|
subs: koishi.Schema.array(koishi.Schema.object({
|
|
75
75
|
name: koishi.Schema.string().required().description("备注"),
|
|
76
76
|
uid: koishi.Schema.string().required().description("UID和roomid"),
|
|
@@ -337,11 +337,10 @@ const stopwords = new Set([
|
|
|
337
337
|
"之前",
|
|
338
338
|
"某天"
|
|
339
339
|
]);
|
|
340
|
-
var stop_words_default = stopwords;
|
|
341
340
|
|
|
342
341
|
//#endregion
|
|
343
342
|
//#region src/command_register.ts
|
|
344
|
-
var ComRegister = class {
|
|
343
|
+
var ComRegister$1 = class {
|
|
345
344
|
static inject = [
|
|
346
345
|
"bilibili-notify",
|
|
347
346
|
"bilibili-notify-api",
|
|
@@ -711,11 +710,11 @@ var ComRegister = class {
|
|
|
711
710
|
}
|
|
712
711
|
mergeStopWords(stopWordsStr) {
|
|
713
712
|
if (!stopWordsStr || stopWordsStr.trim() === "") {
|
|
714
|
-
this.stopwords = new Set(
|
|
713
|
+
this.stopwords = new Set(stopwords);
|
|
715
714
|
return;
|
|
716
715
|
}
|
|
717
716
|
const additionalStopWords = stopWordsStr.split(",").map((word) => word.trim()).filter((word) => word !== "");
|
|
718
|
-
this.stopwords = new Set([...
|
|
717
|
+
this.stopwords = new Set([...stopwords, ...additionalStopWords]);
|
|
719
718
|
}
|
|
720
719
|
initManagerAfterLoadSub() {
|
|
721
720
|
for (const [uid, sub] of this.subManager) {
|
|
@@ -880,6 +879,10 @@ var ComRegister = class {
|
|
|
880
879
|
for (const bot of this.ctx.bots) if (bot.platform === platform) bots.push(bot);
|
|
881
880
|
let num = 0;
|
|
882
881
|
const sendMessageByBot = async (channelId, botIndex = 0) => {
|
|
882
|
+
if (!bots[botIndex]) {
|
|
883
|
+
this.logger.warn(`${platform} 没有配置对应机器人,无法进行推送!`);
|
|
884
|
+
return;
|
|
885
|
+
}
|
|
883
886
|
if (bots[botIndex].status !== koishi.Universal.Status.ONLINE) {
|
|
884
887
|
this.logger.error(`${platform} 机器人未初始化完毕,无法进行推送,${retry / 1e3}秒后重试`);
|
|
885
888
|
this.ctx.setTimeout(async () => {
|
|
@@ -1166,9 +1169,11 @@ var ComRegister = class {
|
|
|
1166
1169
|
async useLiveRoomInfo(roomId) {
|
|
1167
1170
|
const data = await withRetry(async () => await this.ctx["bilibili-notify-api"].getLiveRoomInfo(roomId)).then((content) => content.data).catch((e) => {
|
|
1168
1171
|
this.logger.error(`liveDetect getLiveRoomInfo 发生了错误,错误为:${e.message}`);
|
|
1169
|
-
return false;
|
|
1170
1172
|
});
|
|
1171
|
-
if (!data)
|
|
1173
|
+
if (!data) {
|
|
1174
|
+
await this.sendPrivateMsgAndStopService();
|
|
1175
|
+
return;
|
|
1176
|
+
}
|
|
1172
1177
|
return data;
|
|
1173
1178
|
}
|
|
1174
1179
|
async sendLiveNotifyCard(liveType, followerDisplay, liveInfo, uid, liveNotifyMsg) {
|
|
@@ -1257,7 +1262,7 @@ var ComRegister = class {
|
|
|
1257
1262
|
flag = false;
|
|
1258
1263
|
return flag;
|
|
1259
1264
|
}
|
|
1260
|
-
masterInfo = await this.useMasterInfo(liveRoomInfo.uid, masterInfo, liveType).catch(() => {
|
|
1265
|
+
masterInfo = await this.useMasterInfo(liveRoomInfo.uid.toString(), masterInfo, liveType).catch(() => {
|
|
1261
1266
|
flag = false;
|
|
1262
1267
|
return null;
|
|
1263
1268
|
});
|
|
@@ -1294,10 +1299,6 @@ var ComRegister = class {
|
|
|
1294
1299
|
const now = Date.now();
|
|
1295
1300
|
if (now - lastLiveStart < LIVE_EVENT_COOLDOWN) {
|
|
1296
1301
|
this.logger.warn(`[${sub.roomid}] 开播事件冷却期内被忽略`);
|
|
1297
|
-
if (!liveTime) {
|
|
1298
|
-
await useMasterAndLiveRoomInfo(LiveType.StartBroadcasting);
|
|
1299
|
-
liveTime = liveRoomInfo?.live_time || Date.now();
|
|
1300
|
-
}
|
|
1301
1302
|
return;
|
|
1302
1303
|
}
|
|
1303
1304
|
lastLiveStart = now;
|
|
@@ -1311,7 +1312,7 @@ var ComRegister = class {
|
|
|
1311
1312
|
await this.sendPrivateMsg("获取直播间信息失败,推送直播开播卡片失败!");
|
|
1312
1313
|
return await this.sendPrivateMsgAndStopService();
|
|
1313
1314
|
}
|
|
1314
|
-
liveTime = liveRoomInfo?.live_time ||
|
|
1315
|
+
liveTime = liveRoomInfo?.live_time || luxon.DateTime.now().toFormat("yyyy-MM-dd HH:mm:ss");
|
|
1315
1316
|
const diffTime = await this.ctx["bilibili-notify-generate-img"].getTimeDifference(liveTime);
|
|
1316
1317
|
const follower = masterInfo.liveOpenFollowerNum >= 1e4 ? `${(masterInfo.liveOpenFollowerNum / 1e4).toFixed(1)}万` : masterInfo.liveOpenFollowerNum.toString();
|
|
1317
1318
|
const liveStartMsg = liveMsgObj.customLiveStart.replace("-name", masterInfo.username).replace("-time", diffTime).replace("-follower", follower).replaceAll("\\n", "\n").replace("-link", `https://live.bilibili.com/${liveRoomInfo.short_id === 0 ? liveRoomInfo.room_id : liveRoomInfo.short_id}`);
|
|
@@ -1331,7 +1332,7 @@ var ComRegister = class {
|
|
|
1331
1332
|
this.logger.warn(`[${sub.roomid}] 下播事件冷却期内被忽略`);
|
|
1332
1333
|
if (!liveTime) {
|
|
1333
1334
|
await useMasterAndLiveRoomInfo(LiveType.StopBroadcast);
|
|
1334
|
-
liveTime = liveRoomInfo?.live_time ||
|
|
1335
|
+
liveTime = liveRoomInfo?.live_time || luxon.DateTime.now().toFormat("yyyy-MM-dd HH:mm:ss");
|
|
1335
1336
|
}
|
|
1336
1337
|
return;
|
|
1337
1338
|
}
|
|
@@ -1341,11 +1342,7 @@ var ComRegister = class {
|
|
|
1341
1342
|
return;
|
|
1342
1343
|
}
|
|
1343
1344
|
liveStatus = false;
|
|
1344
|
-
|
|
1345
|
-
await this.sendPrivateMsg("获取直播间信息失败,推送直播下播卡片失败!");
|
|
1346
|
-
return await this.sendPrivateMsgAndStopService();
|
|
1347
|
-
}
|
|
1348
|
-
liveTime = liveTime || liveRoomInfo?.live_time || Date.now();
|
|
1345
|
+
liveTime = liveRoomInfo?.live_time || luxon.DateTime.now().toFormat("yyyy-MM-dd HH:mm:ss");
|
|
1349
1346
|
const diffTime = await this.ctx["bilibili-notify-generate-img"].getTimeDifference(liveTime);
|
|
1350
1347
|
const followerChange = (() => {
|
|
1351
1348
|
const liveFollowerChangeNum = masterInfo.liveFollowerChange;
|
|
@@ -1807,8 +1804,8 @@ var ComRegister = class {
|
|
|
1807
1804
|
}),
|
|
1808
1805
|
dynamicDebugMode: koishi.Schema.boolean().required()
|
|
1809
1806
|
});
|
|
1810
|
-
})(ComRegister || (ComRegister = {}));
|
|
1811
|
-
var
|
|
1807
|
+
})(ComRegister$1 || (ComRegister$1 = {}));
|
|
1808
|
+
var ComRegister = ComRegister$1;
|
|
1812
1809
|
|
|
1813
1810
|
//#endregion
|
|
1814
1811
|
//#region src/database.ts
|
|
@@ -1844,7 +1841,7 @@ const DYNAMIC_TYPE_COURSES_SEASON = "DYNAMIC_TYPE_COURSES_SEASON";
|
|
|
1844
1841
|
const DYNAMIC_TYPE_LIVE_RCMD = "DYNAMIC_TYPE_LIVE_RCMD";
|
|
1845
1842
|
const DYNAMIC_TYPE_UGC_SEASON = "DYNAMIC_TYPE_UGC_SEASON";
|
|
1846
1843
|
const ADDITIONAL_TYPE_RESERVE = "ADDITIONAL_TYPE_RESERVE";
|
|
1847
|
-
var GenerateImg = class extends koishi.Service {
|
|
1844
|
+
var GenerateImg$1 = class extends koishi.Service {
|
|
1848
1845
|
static inject = ["puppeteer"];
|
|
1849
1846
|
giConfig;
|
|
1850
1847
|
constructor(ctx, config) {
|
|
@@ -3308,8 +3305,8 @@ var GenerateImg = class extends koishi.Service {
|
|
|
3308
3305
|
hideDesc: koishi.Schema.boolean(),
|
|
3309
3306
|
followerDisplay: koishi.Schema.boolean()
|
|
3310
3307
|
});
|
|
3311
|
-
})(GenerateImg || (GenerateImg = {}));
|
|
3312
|
-
var
|
|
3308
|
+
})(GenerateImg$1 || (GenerateImg$1 = {}));
|
|
3309
|
+
var GenerateImg = GenerateImg$1;
|
|
3313
3310
|
|
|
3314
3311
|
//#endregion
|
|
3315
3312
|
//#region src/bili_api.ts
|
|
@@ -3404,7 +3401,7 @@ const COPY_USER_TO_GROUP = "https://api.bilibili.com/x/relation/tags/copyUsers";
|
|
|
3404
3401
|
const GET_RELATION_GROUP_DETAIL = "https://api.bilibili.com/x/relation/tag";
|
|
3405
3402
|
const GET_LIVE_ROOM_INFO_STREAM_KEY = "https://api.live.bilibili.com/xlive/web-room/v1/index/getDanmuInfo";
|
|
3406
3403
|
const GET_LIVE_ROOMS_INFO = "https://api.live.bilibili.com/room/v1/Room/get_status_info_by_uids";
|
|
3407
|
-
var BiliAPI = class extends koishi.Service {
|
|
3404
|
+
var BiliAPI$1 = class extends koishi.Service {
|
|
3408
3405
|
static inject = ["database", "notifier"];
|
|
3409
3406
|
jar;
|
|
3410
3407
|
client;
|
|
@@ -4079,8 +4076,8 @@ var BiliAPI = class extends koishi.Service {
|
|
|
4079
4076
|
userAgent: koishi.Schema.string(),
|
|
4080
4077
|
key: koishi.Schema.string().pattern(/^[0-9a-f]{32}$/).required()
|
|
4081
4078
|
});
|
|
4082
|
-
})(BiliAPI || (BiliAPI = {}));
|
|
4083
|
-
var
|
|
4079
|
+
})(BiliAPI$1 || (BiliAPI$1 = {}));
|
|
4080
|
+
var BiliAPI = BiliAPI$1;
|
|
4084
4081
|
|
|
4085
4082
|
//#endregion
|
|
4086
4083
|
//#region src/bili_live.ts
|
|
@@ -4113,7 +4110,6 @@ var BLive = class extends koishi.Service {
|
|
|
4113
4110
|
this.logger.warn(`${roomId}直播间连接未成功关闭`);
|
|
4114
4111
|
}
|
|
4115
4112
|
};
|
|
4116
|
-
var bili_live_default = BLive;
|
|
4117
4113
|
|
|
4118
4114
|
//#endregion
|
|
4119
4115
|
//#region src/index.ts
|
|
@@ -4155,11 +4151,11 @@ var ServerManager = class extends koishi.Service {
|
|
|
4155
4151
|
registerPlugin = () => {
|
|
4156
4152
|
if (this.servers.length !== 0) return false;
|
|
4157
4153
|
try {
|
|
4158
|
-
const ba = this.ctx.plugin(
|
|
4154
|
+
const ba = this.ctx.plugin(BiliAPI, {
|
|
4159
4155
|
userAgent: globalConfig.userAgent,
|
|
4160
4156
|
key: globalConfig.key
|
|
4161
4157
|
});
|
|
4162
|
-
const gi = this.ctx.plugin(
|
|
4158
|
+
const gi = this.ctx.plugin(GenerateImg, {
|
|
4163
4159
|
filter: globalConfig.filter,
|
|
4164
4160
|
removeBorder: globalConfig.removeBorder,
|
|
4165
4161
|
cardColorStart: globalConfig.cardColorStart,
|
|
@@ -4171,7 +4167,7 @@ var ServerManager = class extends koishi.Service {
|
|
|
4171
4167
|
font: globalConfig.font,
|
|
4172
4168
|
followerDisplay: globalConfig.followerDisplay
|
|
4173
4169
|
});
|
|
4174
|
-
const cr = this.ctx.plugin(
|
|
4170
|
+
const cr = this.ctx.plugin(ComRegister, {
|
|
4175
4171
|
advancedSub: globalConfig.advancedSub,
|
|
4176
4172
|
subs: globalConfig.subs,
|
|
4177
4173
|
master: globalConfig.master,
|
|
@@ -4190,7 +4186,7 @@ var ServerManager = class extends koishi.Service {
|
|
|
4190
4186
|
filter: globalConfig.filter,
|
|
4191
4187
|
dynamicDebugMode: globalConfig.dynamicDebugMode
|
|
4192
4188
|
});
|
|
4193
|
-
const bl = this.ctx.plugin(
|
|
4189
|
+
const bl = this.ctx.plugin(BLive);
|
|
4194
4190
|
this.servers.push(ba);
|
|
4195
4191
|
this.servers.push(bl);
|
|
4196
4192
|
this.servers.push(gi);
|
package/lib/index.mjs
CHANGED
|
@@ -52,7 +52,7 @@ const BAConfigSchema = Schema.object({
|
|
|
52
52
|
basicSettings: Schema.object({}).description("基本设置"),
|
|
53
53
|
userAgent: Schema.string().description("设置请求头User-Agen,请求出现-352时可以尝试修改,UA获取方法可参考:https://blog.csdn.net/qq_44503987/article/details/104929111"),
|
|
54
54
|
subTitle: Schema.object({}).description("订阅配置"),
|
|
55
|
-
advancedSub: Schema.boolean().default(false).description("
|
|
55
|
+
advancedSub: Schema.boolean().default(false).description("是否开启高级订阅,高级订阅是独立于本插件的一个专门用于订阅配置的插件,用于高度自定义订阅消息。若开启高级订阅,请打开该选项并下载插件 bilibili-notify-advanced-subscription"),
|
|
56
56
|
subs: Schema.array(Schema.object({
|
|
57
57
|
name: Schema.string().required().description("备注"),
|
|
58
58
|
uid: Schema.string().required().description("UID和roomid"),
|
|
@@ -319,11 +319,10 @@ const stopwords = new Set([
|
|
|
319
319
|
"之前",
|
|
320
320
|
"某天"
|
|
321
321
|
]);
|
|
322
|
-
var stop_words_default = stopwords;
|
|
323
322
|
|
|
324
323
|
//#endregion
|
|
325
324
|
//#region src/command_register.ts
|
|
326
|
-
var ComRegister = class {
|
|
325
|
+
var ComRegister$1 = class {
|
|
327
326
|
static inject = [
|
|
328
327
|
"bilibili-notify",
|
|
329
328
|
"bilibili-notify-api",
|
|
@@ -693,11 +692,11 @@ var ComRegister = class {
|
|
|
693
692
|
}
|
|
694
693
|
mergeStopWords(stopWordsStr) {
|
|
695
694
|
if (!stopWordsStr || stopWordsStr.trim() === "") {
|
|
696
|
-
this.stopwords = new Set(
|
|
695
|
+
this.stopwords = new Set(stopwords);
|
|
697
696
|
return;
|
|
698
697
|
}
|
|
699
698
|
const additionalStopWords = stopWordsStr.split(",").map((word) => word.trim()).filter((word) => word !== "");
|
|
700
|
-
this.stopwords = new Set([...
|
|
699
|
+
this.stopwords = new Set([...stopwords, ...additionalStopWords]);
|
|
701
700
|
}
|
|
702
701
|
initManagerAfterLoadSub() {
|
|
703
702
|
for (const [uid, sub] of this.subManager) {
|
|
@@ -862,6 +861,10 @@ var ComRegister = class {
|
|
|
862
861
|
for (const bot of this.ctx.bots) if (bot.platform === platform) bots.push(bot);
|
|
863
862
|
let num = 0;
|
|
864
863
|
const sendMessageByBot = async (channelId, botIndex = 0) => {
|
|
864
|
+
if (!bots[botIndex]) {
|
|
865
|
+
this.logger.warn(`${platform} 没有配置对应机器人,无法进行推送!`);
|
|
866
|
+
return;
|
|
867
|
+
}
|
|
865
868
|
if (bots[botIndex].status !== Universal.Status.ONLINE) {
|
|
866
869
|
this.logger.error(`${platform} 机器人未初始化完毕,无法进行推送,${retry / 1e3}秒后重试`);
|
|
867
870
|
this.ctx.setTimeout(async () => {
|
|
@@ -1148,9 +1151,11 @@ var ComRegister = class {
|
|
|
1148
1151
|
async useLiveRoomInfo(roomId) {
|
|
1149
1152
|
const data = await withRetry(async () => await this.ctx["bilibili-notify-api"].getLiveRoomInfo(roomId)).then((content) => content.data).catch((e) => {
|
|
1150
1153
|
this.logger.error(`liveDetect getLiveRoomInfo 发生了错误,错误为:${e.message}`);
|
|
1151
|
-
return false;
|
|
1152
1154
|
});
|
|
1153
|
-
if (!data)
|
|
1155
|
+
if (!data) {
|
|
1156
|
+
await this.sendPrivateMsgAndStopService();
|
|
1157
|
+
return;
|
|
1158
|
+
}
|
|
1154
1159
|
return data;
|
|
1155
1160
|
}
|
|
1156
1161
|
async sendLiveNotifyCard(liveType, followerDisplay, liveInfo, uid, liveNotifyMsg) {
|
|
@@ -1239,7 +1244,7 @@ var ComRegister = class {
|
|
|
1239
1244
|
flag = false;
|
|
1240
1245
|
return flag;
|
|
1241
1246
|
}
|
|
1242
|
-
masterInfo = await this.useMasterInfo(liveRoomInfo.uid, masterInfo, liveType).catch(() => {
|
|
1247
|
+
masterInfo = await this.useMasterInfo(liveRoomInfo.uid.toString(), masterInfo, liveType).catch(() => {
|
|
1243
1248
|
flag = false;
|
|
1244
1249
|
return null;
|
|
1245
1250
|
});
|
|
@@ -1276,10 +1281,6 @@ var ComRegister = class {
|
|
|
1276
1281
|
const now = Date.now();
|
|
1277
1282
|
if (now - lastLiveStart < LIVE_EVENT_COOLDOWN) {
|
|
1278
1283
|
this.logger.warn(`[${sub.roomid}] 开播事件冷却期内被忽略`);
|
|
1279
|
-
if (!liveTime) {
|
|
1280
|
-
await useMasterAndLiveRoomInfo(LiveType.StartBroadcasting);
|
|
1281
|
-
liveTime = liveRoomInfo?.live_time || Date.now();
|
|
1282
|
-
}
|
|
1283
1284
|
return;
|
|
1284
1285
|
}
|
|
1285
1286
|
lastLiveStart = now;
|
|
@@ -1293,7 +1294,7 @@ var ComRegister = class {
|
|
|
1293
1294
|
await this.sendPrivateMsg("获取直播间信息失败,推送直播开播卡片失败!");
|
|
1294
1295
|
return await this.sendPrivateMsgAndStopService();
|
|
1295
1296
|
}
|
|
1296
|
-
liveTime = liveRoomInfo?.live_time ||
|
|
1297
|
+
liveTime = liveRoomInfo?.live_time || DateTime.now().toFormat("yyyy-MM-dd HH:mm:ss");
|
|
1297
1298
|
const diffTime = await this.ctx["bilibili-notify-generate-img"].getTimeDifference(liveTime);
|
|
1298
1299
|
const follower = masterInfo.liveOpenFollowerNum >= 1e4 ? `${(masterInfo.liveOpenFollowerNum / 1e4).toFixed(1)}万` : masterInfo.liveOpenFollowerNum.toString();
|
|
1299
1300
|
const liveStartMsg = liveMsgObj.customLiveStart.replace("-name", masterInfo.username).replace("-time", diffTime).replace("-follower", follower).replaceAll("\\n", "\n").replace("-link", `https://live.bilibili.com/${liveRoomInfo.short_id === 0 ? liveRoomInfo.room_id : liveRoomInfo.short_id}`);
|
|
@@ -1313,7 +1314,7 @@ var ComRegister = class {
|
|
|
1313
1314
|
this.logger.warn(`[${sub.roomid}] 下播事件冷却期内被忽略`);
|
|
1314
1315
|
if (!liveTime) {
|
|
1315
1316
|
await useMasterAndLiveRoomInfo(LiveType.StopBroadcast);
|
|
1316
|
-
liveTime = liveRoomInfo?.live_time ||
|
|
1317
|
+
liveTime = liveRoomInfo?.live_time || DateTime.now().toFormat("yyyy-MM-dd HH:mm:ss");
|
|
1317
1318
|
}
|
|
1318
1319
|
return;
|
|
1319
1320
|
}
|
|
@@ -1323,11 +1324,7 @@ var ComRegister = class {
|
|
|
1323
1324
|
return;
|
|
1324
1325
|
}
|
|
1325
1326
|
liveStatus = false;
|
|
1326
|
-
|
|
1327
|
-
await this.sendPrivateMsg("获取直播间信息失败,推送直播下播卡片失败!");
|
|
1328
|
-
return await this.sendPrivateMsgAndStopService();
|
|
1329
|
-
}
|
|
1330
|
-
liveTime = liveTime || liveRoomInfo?.live_time || Date.now();
|
|
1327
|
+
liveTime = liveRoomInfo?.live_time || DateTime.now().toFormat("yyyy-MM-dd HH:mm:ss");
|
|
1331
1328
|
const diffTime = await this.ctx["bilibili-notify-generate-img"].getTimeDifference(liveTime);
|
|
1332
1329
|
const followerChange = (() => {
|
|
1333
1330
|
const liveFollowerChangeNum = masterInfo.liveFollowerChange;
|
|
@@ -1789,8 +1786,8 @@ var ComRegister = class {
|
|
|
1789
1786
|
}),
|
|
1790
1787
|
dynamicDebugMode: Schema.boolean().required()
|
|
1791
1788
|
});
|
|
1792
|
-
})(ComRegister || (ComRegister = {}));
|
|
1793
|
-
var
|
|
1789
|
+
})(ComRegister$1 || (ComRegister$1 = {}));
|
|
1790
|
+
var ComRegister = ComRegister$1;
|
|
1794
1791
|
|
|
1795
1792
|
//#endregion
|
|
1796
1793
|
//#region src/database.ts
|
|
@@ -1826,7 +1823,7 @@ const DYNAMIC_TYPE_COURSES_SEASON = "DYNAMIC_TYPE_COURSES_SEASON";
|
|
|
1826
1823
|
const DYNAMIC_TYPE_LIVE_RCMD = "DYNAMIC_TYPE_LIVE_RCMD";
|
|
1827
1824
|
const DYNAMIC_TYPE_UGC_SEASON = "DYNAMIC_TYPE_UGC_SEASON";
|
|
1828
1825
|
const ADDITIONAL_TYPE_RESERVE = "ADDITIONAL_TYPE_RESERVE";
|
|
1829
|
-
var GenerateImg = class extends Service {
|
|
1826
|
+
var GenerateImg$1 = class extends Service {
|
|
1830
1827
|
static inject = ["puppeteer"];
|
|
1831
1828
|
giConfig;
|
|
1832
1829
|
constructor(ctx, config) {
|
|
@@ -3290,8 +3287,8 @@ var GenerateImg = class extends Service {
|
|
|
3290
3287
|
hideDesc: Schema.boolean(),
|
|
3291
3288
|
followerDisplay: Schema.boolean()
|
|
3292
3289
|
});
|
|
3293
|
-
})(GenerateImg || (GenerateImg = {}));
|
|
3294
|
-
var
|
|
3290
|
+
})(GenerateImg$1 || (GenerateImg$1 = {}));
|
|
3291
|
+
var GenerateImg = GenerateImg$1;
|
|
3295
3292
|
|
|
3296
3293
|
//#endregion
|
|
3297
3294
|
//#region src/bili_api.ts
|
|
@@ -3386,7 +3383,7 @@ const COPY_USER_TO_GROUP = "https://api.bilibili.com/x/relation/tags/copyUsers";
|
|
|
3386
3383
|
const GET_RELATION_GROUP_DETAIL = "https://api.bilibili.com/x/relation/tag";
|
|
3387
3384
|
const GET_LIVE_ROOM_INFO_STREAM_KEY = "https://api.live.bilibili.com/xlive/web-room/v1/index/getDanmuInfo";
|
|
3388
3385
|
const GET_LIVE_ROOMS_INFO = "https://api.live.bilibili.com/room/v1/Room/get_status_info_by_uids";
|
|
3389
|
-
var BiliAPI = class extends Service {
|
|
3386
|
+
var BiliAPI$1 = class extends Service {
|
|
3390
3387
|
static inject = ["database", "notifier"];
|
|
3391
3388
|
jar;
|
|
3392
3389
|
client;
|
|
@@ -4061,8 +4058,8 @@ var BiliAPI = class extends Service {
|
|
|
4061
4058
|
userAgent: Schema.string(),
|
|
4062
4059
|
key: Schema.string().pattern(/^[0-9a-f]{32}$/).required()
|
|
4063
4060
|
});
|
|
4064
|
-
})(BiliAPI || (BiliAPI = {}));
|
|
4065
|
-
var
|
|
4061
|
+
})(BiliAPI$1 || (BiliAPI$1 = {}));
|
|
4062
|
+
var BiliAPI = BiliAPI$1;
|
|
4066
4063
|
|
|
4067
4064
|
//#endregion
|
|
4068
4065
|
//#region src/bili_live.ts
|
|
@@ -4095,7 +4092,6 @@ var BLive = class extends Service {
|
|
|
4095
4092
|
this.logger.warn(`${roomId}直播间连接未成功关闭`);
|
|
4096
4093
|
}
|
|
4097
4094
|
};
|
|
4098
|
-
var bili_live_default = BLive;
|
|
4099
4095
|
|
|
4100
4096
|
//#endregion
|
|
4101
4097
|
//#region src/index.ts
|
|
@@ -4137,11 +4133,11 @@ var ServerManager = class extends Service {
|
|
|
4137
4133
|
registerPlugin = () => {
|
|
4138
4134
|
if (this.servers.length !== 0) return false;
|
|
4139
4135
|
try {
|
|
4140
|
-
const ba = this.ctx.plugin(
|
|
4136
|
+
const ba = this.ctx.plugin(BiliAPI, {
|
|
4141
4137
|
userAgent: globalConfig.userAgent,
|
|
4142
4138
|
key: globalConfig.key
|
|
4143
4139
|
});
|
|
4144
|
-
const gi = this.ctx.plugin(
|
|
4140
|
+
const gi = this.ctx.plugin(GenerateImg, {
|
|
4145
4141
|
filter: globalConfig.filter,
|
|
4146
4142
|
removeBorder: globalConfig.removeBorder,
|
|
4147
4143
|
cardColorStart: globalConfig.cardColorStart,
|
|
@@ -4153,7 +4149,7 @@ var ServerManager = class extends Service {
|
|
|
4153
4149
|
font: globalConfig.font,
|
|
4154
4150
|
followerDisplay: globalConfig.followerDisplay
|
|
4155
4151
|
});
|
|
4156
|
-
const cr = this.ctx.plugin(
|
|
4152
|
+
const cr = this.ctx.plugin(ComRegister, {
|
|
4157
4153
|
advancedSub: globalConfig.advancedSub,
|
|
4158
4154
|
subs: globalConfig.subs,
|
|
4159
4155
|
master: globalConfig.master,
|
|
@@ -4172,7 +4168,7 @@ var ServerManager = class extends Service {
|
|
|
4172
4168
|
filter: globalConfig.filter,
|
|
4173
4169
|
dynamicDebugMode: globalConfig.dynamicDebugMode
|
|
4174
4170
|
});
|
|
4175
|
-
const bl = this.ctx.plugin(
|
|
4171
|
+
const bl = this.ctx.plugin(BLive);
|
|
4176
4172
|
this.servers.push(ba);
|
|
4177
4173
|
this.servers.push(bl);
|
|
4178
4174
|
this.servers.push(gi);
|