koishi-plugin-bilibili-notify 3.6.3 → 3.6.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/font/HYZhengYuan-75W.ttf +0 -0
- package/lib/index.cjs +48 -15
- package/lib/index.mjs +43 -11
- package/package.json +4 -4
|
Binary file
|
package/lib/index.cjs
CHANGED
|
@@ -5,7 +5,7 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var
|
|
8
|
+
var __exportAll = (all, symbols) => {
|
|
9
9
|
let target = {};
|
|
10
10
|
for (var name$2 in all) {
|
|
11
11
|
__defProp(target, name$2, {
|
|
@@ -40,16 +40,17 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
40
40
|
//#endregion
|
|
41
41
|
let koishi = require("koishi");
|
|
42
42
|
require("@koishijs/plugin-notifier");
|
|
43
|
-
let
|
|
43
|
+
let _koishijs_plugin_console = require("@koishijs/plugin-console");
|
|
44
44
|
let node_path = require("node:path");
|
|
45
|
+
node_path = __toESM(node_path);
|
|
45
46
|
require("@koishijs/plugin-help");
|
|
46
47
|
let blive_message_listener = require("blive-message-listener");
|
|
47
48
|
let qrcode = require("qrcode");
|
|
48
49
|
qrcode = __toESM(qrcode);
|
|
49
50
|
let cron = require("cron");
|
|
50
51
|
let luxon = require("luxon");
|
|
51
|
-
let
|
|
52
|
-
let
|
|
52
|
+
let _node_rs_jieba = require("@node-rs/jieba");
|
|
53
|
+
let _node_rs_jieba_dict = require("@node-rs/jieba/dict");
|
|
53
54
|
require("koishi-plugin-puppeteer");
|
|
54
55
|
let node_url = require("node:url");
|
|
55
56
|
let md5 = require("md5");
|
|
@@ -209,7 +210,7 @@ let BiliLoginStatus = /* @__PURE__ */ function(BiliLoginStatus$1) {
|
|
|
209
210
|
//#endregion
|
|
210
211
|
//#region src/data_server.ts
|
|
211
212
|
/** biome-ignore-all assist/source/organizeImports: <import> */
|
|
212
|
-
var BilibiliNotifyDataServer = class extends
|
|
213
|
+
var BilibiliNotifyDataServer = class extends _koishijs_plugin_console.DataService {
|
|
213
214
|
biliData = {
|
|
214
215
|
status: BiliLoginStatus.LOADING_LOGIN_INFO,
|
|
215
216
|
msg: "正在加载登录信息..."
|
|
@@ -444,7 +445,7 @@ var ComRegister = class ComRegister {
|
|
|
444
445
|
privateBot;
|
|
445
446
|
dynamicJob;
|
|
446
447
|
liveAPIJob;
|
|
447
|
-
_jieba =
|
|
448
|
+
_jieba = _node_rs_jieba.Jieba.withDict(_node_rs_jieba_dict.dict);
|
|
448
449
|
stopwords;
|
|
449
450
|
reciveSubTimes = 0;
|
|
450
451
|
groupInfo = null;
|
|
@@ -2023,7 +2024,7 @@ var command_register_default = ComRegister;
|
|
|
2023
2024
|
|
|
2024
2025
|
//#endregion
|
|
2025
2026
|
//#region src/database.ts
|
|
2026
|
-
var database_exports = /* @__PURE__ */
|
|
2027
|
+
var database_exports = /* @__PURE__ */ __exportAll({
|
|
2027
2028
|
apply: () => apply$1,
|
|
2028
2029
|
name: () => name$1
|
|
2029
2030
|
});
|
|
@@ -2057,9 +2058,11 @@ const ADDITIONAL_TYPE_RESERVE = "ADDITIONAL_TYPE_RESERVE";
|
|
|
2057
2058
|
var GenerateImg = class GenerateImg extends koishi.Service {
|
|
2058
2059
|
static inject = ["puppeteer"];
|
|
2059
2060
|
giConfig;
|
|
2061
|
+
fontPath;
|
|
2060
2062
|
constructor(ctx, config) {
|
|
2061
2063
|
super(ctx, "bilibili-notify-generate-img");
|
|
2062
2064
|
this.giConfig = config;
|
|
2065
|
+
this.fontPath = node_path.default.resolve(__dirname, "font/HYZhengYuan-75W.ttf");
|
|
2063
2066
|
}
|
|
2064
2067
|
numberToStr(num) {
|
|
2065
2068
|
return num > 1e4 ? `${(num / 1e4).toFixed(1)}万` : num.toString();
|
|
@@ -2092,11 +2095,17 @@ var GenerateImg = class GenerateImg extends koishi.Service {
|
|
|
2092
2095
|
<head>
|
|
2093
2096
|
<title>直播通知</title>
|
|
2094
2097
|
<style>
|
|
2098
|
+
@font-face {
|
|
2099
|
+
font-family: "NotoColorEmoji";
|
|
2100
|
+
src: url('file://${this.fontPath}') format('truetype');
|
|
2101
|
+
font-display: swap;
|
|
2102
|
+
}
|
|
2103
|
+
|
|
2095
2104
|
* {
|
|
2096
2105
|
margin: 0;
|
|
2097
2106
|
padding: 0;
|
|
2098
2107
|
box-sizing: border-box;
|
|
2099
|
-
font-family: "${this.giConfig.font}", "Microsoft YaHei", "Source Han Sans", "Noto Sans CJK", sans-serif;
|
|
2108
|
+
font-family: "${this.giConfig.font}", "NotoColorEmoji", "Microsoft YaHei", "Source Han Sans", "Noto Sans CJK", sans-serif;
|
|
2100
2109
|
}
|
|
2101
2110
|
|
|
2102
2111
|
html {
|
|
@@ -2255,11 +2264,17 @@ var GenerateImg = class GenerateImg extends koishi.Service {
|
|
|
2255
2264
|
<head>
|
|
2256
2265
|
<title>上舰通知</title>
|
|
2257
2266
|
<style>
|
|
2267
|
+
@font-face {
|
|
2268
|
+
font-family: "NotoColorEmoji";
|
|
2269
|
+
src: url('file://${this.fontPath}') format('truetype');
|
|
2270
|
+
font-display: swap;
|
|
2271
|
+
}
|
|
2272
|
+
|
|
2258
2273
|
* {
|
|
2259
2274
|
margin: 0;
|
|
2260
2275
|
padding: 0;
|
|
2261
2276
|
box-sizing: border-box;
|
|
2262
|
-
font-family: "${this.giConfig.font}", "Microsoft YaHei", "Source Han Sans", "Noto Sans CJK", sans-serif;
|
|
2277
|
+
font-family: "${this.giConfig.font}", "NotoColorEmoji", "Microsoft YaHei", "Source Han Sans", "Noto Sans CJK", sans-serif;
|
|
2263
2278
|
}
|
|
2264
2279
|
|
|
2265
2280
|
html {
|
|
@@ -2691,11 +2706,17 @@ var GenerateImg = class GenerateImg extends koishi.Service {
|
|
|
2691
2706
|
const [main] = await getDynamicMajor(data, false);
|
|
2692
2707
|
let style;
|
|
2693
2708
|
if (this.giConfig.enableLargeFont) style = `
|
|
2709
|
+
@font-face {
|
|
2710
|
+
font-family: "NotoColorEmoji";
|
|
2711
|
+
src: url('file://${this.fontPath}') format('truetype');
|
|
2712
|
+
font-display: swap;
|
|
2713
|
+
}
|
|
2714
|
+
|
|
2694
2715
|
* {
|
|
2695
2716
|
margin: 0;
|
|
2696
2717
|
padding: 0;
|
|
2697
2718
|
box-sizing: border-box;
|
|
2698
|
-
font-family: "${this.giConfig.font}", "Microsoft YaHei", "Source Han Sans", "Noto Sans CJK", sans-serif;
|
|
2719
|
+
font-family: "${this.giConfig.font}", "NotoColorEmoji", "Microsoft YaHei", "Source Han Sans", "Noto Sans CJK", sans-serif;
|
|
2699
2720
|
}
|
|
2700
2721
|
|
|
2701
2722
|
html {
|
|
@@ -3054,11 +3075,17 @@ var GenerateImg = class GenerateImg extends koishi.Service {
|
|
|
3054
3075
|
}
|
|
3055
3076
|
`;
|
|
3056
3077
|
else style = `
|
|
3078
|
+
@font-face {
|
|
3079
|
+
font-family: "NotoColorEmoji";
|
|
3080
|
+
src: url('file://${this.fontPath}') format('truetype');
|
|
3081
|
+
font-display: swap;
|
|
3082
|
+
}
|
|
3083
|
+
|
|
3057
3084
|
* {
|
|
3058
3085
|
margin: 0;
|
|
3059
3086
|
padding: 0;
|
|
3060
3087
|
box-sizing: border-box;
|
|
3061
|
-
font-family: "${this.giConfig.font}", "Microsoft YaHei", "Source Han Sans", "Noto Sans CJK", sans-serif;
|
|
3088
|
+
font-family: "${this.giConfig.font}", "NotoColorEmoji", "Microsoft YaHei", "Source Han Sans", "Noto Sans CJK", sans-serif;
|
|
3062
3089
|
}
|
|
3063
3090
|
|
|
3064
3091
|
html {
|
|
@@ -3513,11 +3540,17 @@ var GenerateImg = class GenerateImg extends koishi.Service {
|
|
|
3513
3540
|
<meta charset="UTF-8">
|
|
3514
3541
|
<title>高清词云展示</title>
|
|
3515
3542
|
<style>
|
|
3543
|
+
@font-face {
|
|
3544
|
+
font-family: "NotoColorEmoji";
|
|
3545
|
+
src: url('file://${this.fontPath}') format('truetype');
|
|
3546
|
+
font-display: swap;
|
|
3547
|
+
}
|
|
3548
|
+
|
|
3516
3549
|
* {
|
|
3517
3550
|
margin: 0;
|
|
3518
3551
|
padding: 0;
|
|
3519
3552
|
box-sizing: border-box;
|
|
3520
|
-
font-family: "${this.giConfig.font}", "Microsoft YaHei", "Source Han Sans", "Noto Sans CJK", sans-serif;
|
|
3553
|
+
font-family: "${this.giConfig.font}", "NotoColorEmoji", "Microsoft YaHei", "Source Han Sans", "Noto Sans CJK", sans-serif;
|
|
3521
3554
|
}
|
|
3522
3555
|
|
|
3523
3556
|
html {
|
|
@@ -4360,7 +4393,7 @@ var BiliAPI = class extends koishi.Service {
|
|
|
4360
4393
|
let csrf;
|
|
4361
4394
|
let expires;
|
|
4362
4395
|
let domain;
|
|
4363
|
-
let path;
|
|
4396
|
+
let path$1;
|
|
4364
4397
|
let secure;
|
|
4365
4398
|
let httpOnly;
|
|
4366
4399
|
let sameSite;
|
|
@@ -4369,7 +4402,7 @@ var BiliAPI = class extends koishi.Service {
|
|
|
4369
4402
|
csrf = cookieData.value;
|
|
4370
4403
|
expires = cookieData.expires ? luxon.DateTime.fromISO(cookieData.expires).toJSDate() : "Infinity";
|
|
4371
4404
|
domain = cookieData.domain;
|
|
4372
|
-
path = cookieData.path;
|
|
4405
|
+
path$1 = cookieData.path;
|
|
4373
4406
|
secure = cookieData.secure;
|
|
4374
4407
|
httpOnly = cookieData.httpOnly;
|
|
4375
4408
|
sameSite = cookieData.sameSite;
|
|
@@ -4396,7 +4429,7 @@ var BiliAPI = class extends koishi.Service {
|
|
|
4396
4429
|
value: "some_non_empty_value",
|
|
4397
4430
|
expires,
|
|
4398
4431
|
domain,
|
|
4399
|
-
path,
|
|
4432
|
+
path: path$1,
|
|
4400
4433
|
secure,
|
|
4401
4434
|
httpOnly,
|
|
4402
4435
|
sameSite
|
package/lib/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import "node:module";
|
|
|
2
2
|
import { Schema, Service, Universal, h } from "koishi";
|
|
3
3
|
import "@koishijs/plugin-notifier";
|
|
4
4
|
import { DataService } from "@koishijs/plugin-console";
|
|
5
|
-
import { resolve } from "node:path";
|
|
5
|
+
import path, { resolve } from "node:path";
|
|
6
6
|
import "@koishijs/plugin-help";
|
|
7
7
|
import { GuardLevel, startListen } from "blive-message-listener";
|
|
8
8
|
import QRCode from "qrcode";
|
|
@@ -23,7 +23,7 @@ import OpenAI from "openai";
|
|
|
23
23
|
|
|
24
24
|
//#region rolldown:runtime
|
|
25
25
|
var __defProp = Object.defineProperty;
|
|
26
|
-
var
|
|
26
|
+
var __exportAll = (all, symbols) => {
|
|
27
27
|
let target = {};
|
|
28
28
|
for (var name$2 in all) {
|
|
29
29
|
__defProp(target, name$2, {
|
|
@@ -1994,7 +1994,7 @@ var command_register_default = ComRegister;
|
|
|
1994
1994
|
|
|
1995
1995
|
//#endregion
|
|
1996
1996
|
//#region src/database.ts
|
|
1997
|
-
var database_exports = /* @__PURE__ */
|
|
1997
|
+
var database_exports = /* @__PURE__ */ __exportAll({
|
|
1998
1998
|
apply: () => apply$1,
|
|
1999
1999
|
name: () => name$1
|
|
2000
2000
|
});
|
|
@@ -2028,9 +2028,11 @@ const ADDITIONAL_TYPE_RESERVE = "ADDITIONAL_TYPE_RESERVE";
|
|
|
2028
2028
|
var GenerateImg = class GenerateImg extends Service {
|
|
2029
2029
|
static inject = ["puppeteer"];
|
|
2030
2030
|
giConfig;
|
|
2031
|
+
fontPath;
|
|
2031
2032
|
constructor(ctx, config) {
|
|
2032
2033
|
super(ctx, "bilibili-notify-generate-img");
|
|
2033
2034
|
this.giConfig = config;
|
|
2035
|
+
this.fontPath = path.resolve(__dirname, "font/HYZhengYuan-75W.ttf");
|
|
2034
2036
|
}
|
|
2035
2037
|
numberToStr(num) {
|
|
2036
2038
|
return num > 1e4 ? `${(num / 1e4).toFixed(1)}万` : num.toString();
|
|
@@ -2063,11 +2065,17 @@ var GenerateImg = class GenerateImg extends Service {
|
|
|
2063
2065
|
<head>
|
|
2064
2066
|
<title>直播通知</title>
|
|
2065
2067
|
<style>
|
|
2068
|
+
@font-face {
|
|
2069
|
+
font-family: "NotoColorEmoji";
|
|
2070
|
+
src: url('file://${this.fontPath}') format('truetype');
|
|
2071
|
+
font-display: swap;
|
|
2072
|
+
}
|
|
2073
|
+
|
|
2066
2074
|
* {
|
|
2067
2075
|
margin: 0;
|
|
2068
2076
|
padding: 0;
|
|
2069
2077
|
box-sizing: border-box;
|
|
2070
|
-
font-family: "${this.giConfig.font}", "Microsoft YaHei", "Source Han Sans", "Noto Sans CJK", sans-serif;
|
|
2078
|
+
font-family: "${this.giConfig.font}", "NotoColorEmoji", "Microsoft YaHei", "Source Han Sans", "Noto Sans CJK", sans-serif;
|
|
2071
2079
|
}
|
|
2072
2080
|
|
|
2073
2081
|
html {
|
|
@@ -2226,11 +2234,17 @@ var GenerateImg = class GenerateImg extends Service {
|
|
|
2226
2234
|
<head>
|
|
2227
2235
|
<title>上舰通知</title>
|
|
2228
2236
|
<style>
|
|
2237
|
+
@font-face {
|
|
2238
|
+
font-family: "NotoColorEmoji";
|
|
2239
|
+
src: url('file://${this.fontPath}') format('truetype');
|
|
2240
|
+
font-display: swap;
|
|
2241
|
+
}
|
|
2242
|
+
|
|
2229
2243
|
* {
|
|
2230
2244
|
margin: 0;
|
|
2231
2245
|
padding: 0;
|
|
2232
2246
|
box-sizing: border-box;
|
|
2233
|
-
font-family: "${this.giConfig.font}", "Microsoft YaHei", "Source Han Sans", "Noto Sans CJK", sans-serif;
|
|
2247
|
+
font-family: "${this.giConfig.font}", "NotoColorEmoji", "Microsoft YaHei", "Source Han Sans", "Noto Sans CJK", sans-serif;
|
|
2234
2248
|
}
|
|
2235
2249
|
|
|
2236
2250
|
html {
|
|
@@ -2662,11 +2676,17 @@ var GenerateImg = class GenerateImg extends Service {
|
|
|
2662
2676
|
const [main] = await getDynamicMajor(data, false);
|
|
2663
2677
|
let style;
|
|
2664
2678
|
if (this.giConfig.enableLargeFont) style = `
|
|
2679
|
+
@font-face {
|
|
2680
|
+
font-family: "NotoColorEmoji";
|
|
2681
|
+
src: url('file://${this.fontPath}') format('truetype');
|
|
2682
|
+
font-display: swap;
|
|
2683
|
+
}
|
|
2684
|
+
|
|
2665
2685
|
* {
|
|
2666
2686
|
margin: 0;
|
|
2667
2687
|
padding: 0;
|
|
2668
2688
|
box-sizing: border-box;
|
|
2669
|
-
font-family: "${this.giConfig.font}", "Microsoft YaHei", "Source Han Sans", "Noto Sans CJK", sans-serif;
|
|
2689
|
+
font-family: "${this.giConfig.font}", "NotoColorEmoji", "Microsoft YaHei", "Source Han Sans", "Noto Sans CJK", sans-serif;
|
|
2670
2690
|
}
|
|
2671
2691
|
|
|
2672
2692
|
html {
|
|
@@ -3025,11 +3045,17 @@ var GenerateImg = class GenerateImg extends Service {
|
|
|
3025
3045
|
}
|
|
3026
3046
|
`;
|
|
3027
3047
|
else style = `
|
|
3048
|
+
@font-face {
|
|
3049
|
+
font-family: "NotoColorEmoji";
|
|
3050
|
+
src: url('file://${this.fontPath}') format('truetype');
|
|
3051
|
+
font-display: swap;
|
|
3052
|
+
}
|
|
3053
|
+
|
|
3028
3054
|
* {
|
|
3029
3055
|
margin: 0;
|
|
3030
3056
|
padding: 0;
|
|
3031
3057
|
box-sizing: border-box;
|
|
3032
|
-
font-family: "${this.giConfig.font}", "Microsoft YaHei", "Source Han Sans", "Noto Sans CJK", sans-serif;
|
|
3058
|
+
font-family: "${this.giConfig.font}", "NotoColorEmoji", "Microsoft YaHei", "Source Han Sans", "Noto Sans CJK", sans-serif;
|
|
3033
3059
|
}
|
|
3034
3060
|
|
|
3035
3061
|
html {
|
|
@@ -3484,11 +3510,17 @@ var GenerateImg = class GenerateImg extends Service {
|
|
|
3484
3510
|
<meta charset="UTF-8">
|
|
3485
3511
|
<title>高清词云展示</title>
|
|
3486
3512
|
<style>
|
|
3513
|
+
@font-face {
|
|
3514
|
+
font-family: "NotoColorEmoji";
|
|
3515
|
+
src: url('file://${this.fontPath}') format('truetype');
|
|
3516
|
+
font-display: swap;
|
|
3517
|
+
}
|
|
3518
|
+
|
|
3487
3519
|
* {
|
|
3488
3520
|
margin: 0;
|
|
3489
3521
|
padding: 0;
|
|
3490
3522
|
box-sizing: border-box;
|
|
3491
|
-
font-family: "${this.giConfig.font}", "Microsoft YaHei", "Source Han Sans", "Noto Sans CJK", sans-serif;
|
|
3523
|
+
font-family: "${this.giConfig.font}", "NotoColorEmoji", "Microsoft YaHei", "Source Han Sans", "Noto Sans CJK", sans-serif;
|
|
3492
3524
|
}
|
|
3493
3525
|
|
|
3494
3526
|
html {
|
|
@@ -4331,7 +4363,7 @@ var BiliAPI = class extends Service {
|
|
|
4331
4363
|
let csrf;
|
|
4332
4364
|
let expires;
|
|
4333
4365
|
let domain;
|
|
4334
|
-
let path;
|
|
4366
|
+
let path$1;
|
|
4335
4367
|
let secure;
|
|
4336
4368
|
let httpOnly;
|
|
4337
4369
|
let sameSite;
|
|
@@ -4340,7 +4372,7 @@ var BiliAPI = class extends Service {
|
|
|
4340
4372
|
csrf = cookieData.value;
|
|
4341
4373
|
expires = cookieData.expires ? DateTime.fromISO(cookieData.expires).toJSDate() : "Infinity";
|
|
4342
4374
|
domain = cookieData.domain;
|
|
4343
|
-
path = cookieData.path;
|
|
4375
|
+
path$1 = cookieData.path;
|
|
4344
4376
|
secure = cookieData.secure;
|
|
4345
4377
|
httpOnly = cookieData.httpOnly;
|
|
4346
4378
|
sameSite = cookieData.sameSite;
|
|
@@ -4367,7 +4399,7 @@ var BiliAPI = class extends Service {
|
|
|
4367
4399
|
value: "some_non_empty_value",
|
|
4368
4400
|
expires,
|
|
4369
4401
|
domain,
|
|
4370
|
-
path,
|
|
4402
|
+
path: path$1,
|
|
4371
4403
|
secure,
|
|
4372
4404
|
httpOnly,
|
|
4373
4405
|
sameSite
|
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.6.
|
|
4
|
+
"version": "3.6.4",
|
|
5
5
|
"main": "./lib/index.cjs",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
7
7
|
"files": [
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"@types/qrcode": "^1.5.6",
|
|
52
52
|
"@types/tough-cookie": "^4.0.5",
|
|
53
53
|
"koishi-plugin-puppeteer": "^3.9.0",
|
|
54
|
-
"tsdown": "^0.
|
|
54
|
+
"tsdown": "^0.18.4",
|
|
55
55
|
"yakumo": "^1.0.0"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
@@ -80,8 +80,8 @@
|
|
|
80
80
|
"types": "./lib/index.d.cts",
|
|
81
81
|
"exports": {
|
|
82
82
|
".": {
|
|
83
|
-
"
|
|
84
|
-
"
|
|
83
|
+
"require": "./lib/index.cjs",
|
|
84
|
+
"import": "./lib/index.mjs"
|
|
85
85
|
},
|
|
86
86
|
"./package.json": "./package.json"
|
|
87
87
|
}
|