koishi-plugin-bilibili-notify 3.4.0-alpha.0 → 3.4.0-alpha.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/index.cjs +13 -13
- package/lib/index.mjs +5 -5
- package/package.json +1 -1
package/lib/index.cjs
CHANGED
|
@@ -32,8 +32,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
32
32
|
let koishi = require("koishi");
|
|
33
33
|
require("@koishijs/plugin-notifier");
|
|
34
34
|
require("@koishijs/plugin-help");
|
|
35
|
-
let node_url = require("node:url");
|
|
36
|
-
let node_path = require("node:path");
|
|
37
35
|
let blive_message_listener = require("blive-message-listener");
|
|
38
36
|
let qrcode = require("qrcode");
|
|
39
37
|
qrcode = __toESM(qrcode);
|
|
@@ -42,6 +40,8 @@ let luxon = require("luxon");
|
|
|
42
40
|
let __node_rs_jieba = require("@node-rs/jieba");
|
|
43
41
|
let __node_rs_jieba_dict = require("@node-rs/jieba/dict");
|
|
44
42
|
require("koishi-plugin-puppeteer");
|
|
43
|
+
let node_path = require("node:path");
|
|
44
|
+
let node_url = require("node:url");
|
|
45
45
|
let md5 = require("md5");
|
|
46
46
|
md5 = __toESM(md5);
|
|
47
47
|
let node_crypto = require("node:crypto");
|
|
@@ -188,7 +188,7 @@ async function withRetry(fn, maxAttempts = 3, delayMs = 1e3) {
|
|
|
188
188
|
} catch (error) {
|
|
189
189
|
attempt++;
|
|
190
190
|
if (attempt >= maxAttempts) throw error;
|
|
191
|
-
await new Promise((resolve$
|
|
191
|
+
await new Promise((resolve$1) => setTimeout(resolve$1, delayMs * attempt));
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
194
|
function replaceButKeep(oldObj, newObj, keepKeys) {
|
|
@@ -1311,9 +1311,9 @@ var ComRegister = class {
|
|
|
1311
1311
|
const liveData = { likedNum: "0" };
|
|
1312
1312
|
const liveMsgObj = this.liveMsgManager.get(sub.uid);
|
|
1313
1313
|
const guardLevelImg = {
|
|
1314
|
-
[blive_message_listener.GuardLevel.Jianzhang]:
|
|
1315
|
-
[blive_message_listener.GuardLevel.Tidu]:
|
|
1316
|
-
[blive_message_listener.GuardLevel.Zongdu]:
|
|
1314
|
+
[blive_message_listener.GuardLevel.Jianzhang]: "https://s1.hdslb.com/bfs/static/blive/live-pay-mono/relation/relation/assets/captain-Bjw5Byb5.png",
|
|
1315
|
+
[blive_message_listener.GuardLevel.Tidu]: "https://s1.hdslb.com/bfs/static/blive/live-pay-mono/relation/relation/assets/supervisor-u43ElIjU.png",
|
|
1316
|
+
[blive_message_listener.GuardLevel.Zongdu]: "https://s1.hdslb.com/bfs/static/blive/live-pay-mono/relation/relation/assets/governor-DpDXKEdA.png"
|
|
1317
1317
|
};
|
|
1318
1318
|
const sendDanmakuWordCloudAndLiveSummary = async (customLiveSummary) => {
|
|
1319
1319
|
this.logger.info("开始制作弹幕词云");
|
|
@@ -1693,10 +1693,10 @@ var ComRegister = class {
|
|
|
1693
1693
|
this.subNotifier = this.ctx.notifier.create(table);
|
|
1694
1694
|
}
|
|
1695
1695
|
async checkIfLoginInfoIsLoaded() {
|
|
1696
|
-
return new Promise((resolve$
|
|
1696
|
+
return new Promise((resolve$1) => {
|
|
1697
1697
|
const check = () => {
|
|
1698
1698
|
if (!this.ctx["bilibili-notify-api"].getLoginInfoIsLoaded()) this.ctx.setTimeout(check, 500);
|
|
1699
|
-
else resolve$
|
|
1699
|
+
else resolve$1("success");
|
|
1700
1700
|
};
|
|
1701
1701
|
check();
|
|
1702
1702
|
});
|
|
@@ -4405,10 +4405,10 @@ var ServerManager = class extends koishi.Service {
|
|
|
4405
4405
|
};
|
|
4406
4406
|
disposePlugin = async () => {
|
|
4407
4407
|
if (this.servers.length === 0) return false;
|
|
4408
|
-
await new Promise((resolve$
|
|
4408
|
+
await new Promise((resolve$1) => {
|
|
4409
4409
|
for (const fork of this.servers) fork.dispose();
|
|
4410
4410
|
this.servers = [];
|
|
4411
|
-
resolve$
|
|
4411
|
+
resolve$1("ok");
|
|
4412
4412
|
});
|
|
4413
4413
|
return true;
|
|
4414
4414
|
};
|
|
@@ -4418,15 +4418,15 @@ var ServerManager = class extends koishi.Service {
|
|
|
4418
4418
|
return false;
|
|
4419
4419
|
}
|
|
4420
4420
|
await this.disposePlugin();
|
|
4421
|
-
return new Promise((resolve$
|
|
4421
|
+
return new Promise((resolve$1) => {
|
|
4422
4422
|
this.ctx.setTimeout(() => {
|
|
4423
4423
|
try {
|
|
4424
4424
|
this.registerPlugin();
|
|
4425
4425
|
} catch (e) {
|
|
4426
4426
|
this.logger.error("重启插件失败", e);
|
|
4427
|
-
resolve$
|
|
4427
|
+
resolve$1(false);
|
|
4428
4428
|
}
|
|
4429
|
-
resolve$
|
|
4429
|
+
resolve$1(true);
|
|
4430
4430
|
}, 1e3);
|
|
4431
4431
|
});
|
|
4432
4432
|
};
|
package/lib/index.mjs
CHANGED
|
@@ -2,8 +2,6 @@ import "node:module";
|
|
|
2
2
|
import { Schema, Service, Universal, h } from "koishi";
|
|
3
3
|
import "@koishijs/plugin-notifier";
|
|
4
4
|
import "@koishijs/plugin-help";
|
|
5
|
-
import { pathToFileURL } from "node:url";
|
|
6
|
-
import { resolve } from "node:path";
|
|
7
5
|
import { GuardLevel, startListen } from "blive-message-listener";
|
|
8
6
|
import QRCode from "qrcode";
|
|
9
7
|
import { CronJob } from "cron";
|
|
@@ -11,6 +9,8 @@ import { DateTime } from "luxon";
|
|
|
11
9
|
import { Jieba } from "@node-rs/jieba";
|
|
12
10
|
import { dict } from "@node-rs/jieba/dict";
|
|
13
11
|
import "koishi-plugin-puppeteer";
|
|
12
|
+
import { resolve } from "node:path";
|
|
13
|
+
import { pathToFileURL } from "node:url";
|
|
14
14
|
import md5 from "md5";
|
|
15
15
|
import crypto from "node:crypto";
|
|
16
16
|
import http from "node:http";
|
|
@@ -1286,9 +1286,9 @@ var ComRegister = class {
|
|
|
1286
1286
|
const liveData = { likedNum: "0" };
|
|
1287
1287
|
const liveMsgObj = this.liveMsgManager.get(sub.uid);
|
|
1288
1288
|
const guardLevelImg = {
|
|
1289
|
-
[GuardLevel.Jianzhang]:
|
|
1290
|
-
[GuardLevel.Tidu]:
|
|
1291
|
-
[GuardLevel.Zongdu]:
|
|
1289
|
+
[GuardLevel.Jianzhang]: "https://s1.hdslb.com/bfs/static/blive/live-pay-mono/relation/relation/assets/captain-Bjw5Byb5.png",
|
|
1290
|
+
[GuardLevel.Tidu]: "https://s1.hdslb.com/bfs/static/blive/live-pay-mono/relation/relation/assets/supervisor-u43ElIjU.png",
|
|
1291
|
+
[GuardLevel.Zongdu]: "https://s1.hdslb.com/bfs/static/blive/live-pay-mono/relation/relation/assets/governor-DpDXKEdA.png"
|
|
1292
1292
|
};
|
|
1293
1293
|
const sendDanmakuWordCloudAndLiveSummary = async (customLiveSummary) => {
|
|
1294
1294
|
this.logger.info("开始制作弹幕词云");
|