koishi-plugin-bilibili-notify 3.0.0-alpha.9 → 3.0.0-beta.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.
@@ -1,55 +1,62 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- /* eslint-disable @typescript-eslint/no-explicit-any */
4
3
  const koishi_1 = require("koishi");
5
- const path_1 = require("path");
6
- const url_1 = require("url");
4
+ const luxon_1 = require("luxon");
5
+ const node_path_1 = require("node:path");
6
+ const node_url_1 = require("node:url");
7
+ const utils_1 = require("./utils");
7
8
  // 动态类型
8
- const DYNAMIC_TYPE_NONE = 'DYNAMIC_TYPE_NONE';
9
- const DYNAMIC_TYPE_FORWARD = 'DYNAMIC_TYPE_FORWARD';
10
- const DYNAMIC_TYPE_AV = 'DYNAMIC_TYPE_AV';
11
- const DYNAMIC_TYPE_PGC = 'DYNAMIC_TYPE_PGC';
12
- const DYNAMIC_TYPE_COURSES = 'DYNAMIC_TYPE_COURSES';
13
- const DYNAMIC_TYPE_WORD = 'DYNAMIC_TYPE_WORD';
14
- const DYNAMIC_TYPE_DRAW = 'DYNAMIC_TYPE_DRAW';
15
- const DYNAMIC_TYPE_ARTICLE = 'DYNAMIC_TYPE_ARTICLE';
16
- const DYNAMIC_TYPE_MUSIC = 'DYNAMIC_TYPE_MUSIC';
17
- const DYNAMIC_TYPE_COMMON_SQUARE = 'DYNAMIC_TYPE_COMMON_SQUARE';
18
- const DYNAMIC_TYPE_COMMON_VERTICAL = 'DYNAMIC_TYPE_COMMON_VERTICAL';
19
- const DYNAMIC_TYPE_LIVE = 'DYNAMIC_TYPE_LIVE';
20
- const DYNAMIC_TYPE_MEDIALIST = 'DYNAMIC_TYPE_MEDIALIST';
21
- const DYNAMIC_TYPE_COURSES_SEASON = 'DYNAMIC_TYPE_COURSES_SEASON';
22
- const DYNAMIC_TYPE_COURSES_BATCH = 'DYNAMIC_TYPE_COURSES_BATCH';
23
- const DYNAMIC_TYPE_AD = 'DYNAMIC_TYPE_AD';
24
- const DYNAMIC_TYPE_APPLET = 'DYNAMIC_TYPE_APPLET';
25
- const DYNAMIC_TYPE_SUBSCRIPTION = 'DYNAMIC_TYPE_SUBSCRIPTION';
26
- const DYNAMIC_TYPE_LIVE_RCMD = 'DYNAMIC_TYPE_LIVE_RCMD';
27
- const DYNAMIC_TYPE_BANNER = 'DYNAMIC_TYPE_BANNER';
28
- const DYNAMIC_TYPE_UGC_SEASON = 'DYNAMIC_TYPE_UGC_SEASON';
29
- const DYNAMIC_TYPE_SUBSCRIPTION_NEW = 'DYNAMIC_TYPE_SUBSCRIPTION_NEW';
9
+ const DYNAMIC_TYPE_NONE = "DYNAMIC_TYPE_NONE";
10
+ const DYNAMIC_TYPE_FORWARD = "DYNAMIC_TYPE_FORWARD";
11
+ const DYNAMIC_TYPE_AV = "DYNAMIC_TYPE_AV";
12
+ const DYNAMIC_TYPE_PGC = "DYNAMIC_TYPE_PGC";
13
+ const DYNAMIC_TYPE_WORD = "DYNAMIC_TYPE_WORD";
14
+ const DYNAMIC_TYPE_DRAW = "DYNAMIC_TYPE_DRAW";
15
+ const DYNAMIC_TYPE_ARTICLE = "DYNAMIC_TYPE_ARTICLE";
16
+ const DYNAMIC_TYPE_MUSIC = "DYNAMIC_TYPE_MUSIC";
17
+ const DYNAMIC_TYPE_COMMON_SQUARE = "DYNAMIC_TYPE_COMMON_SQUARE";
18
+ const DYNAMIC_TYPE_LIVE = "DYNAMIC_TYPE_LIVE";
19
+ const DYNAMIC_TYPE_MEDIALIST = "DYNAMIC_TYPE_MEDIALIST";
20
+ const DYNAMIC_TYPE_COURSES_SEASON = "DYNAMIC_TYPE_COURSES_SEASON";
21
+ const DYNAMIC_TYPE_LIVE_RCMD = "DYNAMIC_TYPE_LIVE_RCMD";
22
+ const DYNAMIC_TYPE_UGC_SEASON = "DYNAMIC_TYPE_UGC_SEASON";
30
23
  // 内容卡片类型
31
- /* const ADDITIONAL_TYPE_NONE = 'ADDITIONAL_TYPE_NONE'
32
- const ADDITIONAL_TYPE_PGC = 'ADDITIONAL_TYPE_PGC'
33
- const ADDITIONAL_TYPE_GOODS = 'ADDITIONAL_TYPE_GOODS'
34
- const ADDITIONAL_TYPE_VOTE = 'ADDITIONAL_TYPE_VOTE'
35
- const ADDITIONAL_TYPE_COMMON = 'ADDITIONAL_TYPE_COMMON'
36
- const ADDITIONAL_TYPE_MATCH = 'ADDITIONAL_TYPE_MATCH'
37
- const ADDITIONAL_TYPE_UP_RCMD = 'ADDITIONAL_TYPE_UP_RCMD'
38
- const ADDITIONAL_TYPE_UGC = 'ADDITIONAL_TYPE_UGC' */
39
- const ADDITIONAL_TYPE_RESERVE = 'ADDITIONAL_TYPE_RESERVE';
24
+ const ADDITIONAL_TYPE_RESERVE = "ADDITIONAL_TYPE_RESERVE";
40
25
  class GenerateImg extends koishi_1.Service {
41
- static inject = ['puppeteer', 'ba'];
26
+ static inject = ["puppeteer", "ba"];
42
27
  giConfig;
43
28
  constructor(ctx, config) {
44
- super(ctx, 'gi');
29
+ super(ctx, "gi");
45
30
  this.giConfig = config;
46
31
  }
47
- async generateLiveImg(data, username, userface, liveStatus /*0未开播 1刚开播 2已开播 3停止直播*/) {
32
+ async imgHandler(html) {
33
+ const htmlPath = `file://${__dirname.replaceAll("\\", "/")}/page/0.html`;
34
+ const page = await this.ctx.puppeteer.page();
35
+ await page.goto(htmlPath);
36
+ await page.setContent(html, { waitUntil: "networkidle0" });
37
+ const elementHandle = await page.$("html");
38
+ const boundingBox = await elementHandle.boundingBox();
39
+ const buffer = await page.screenshot({
40
+ type: "png",
41
+ clip: {
42
+ x: boundingBox.x,
43
+ y: boundingBox.y,
44
+ width: boundingBox.width,
45
+ height: boundingBox.height,
46
+ },
47
+ });
48
+ await elementHandle.dispose();
49
+ await page.close();
50
+ return buffer;
51
+ }
52
+ async generateLiveImg(
53
+ // biome-ignore lint/suspicious/noExplicitAny: <explanation>
54
+ data, username, userface, followerDisplay, liveStatus /*0未开播 1刚开播 2已开播 3停止直播*/) {
48
55
  const [titleStatus, liveTime, cover] = await this.getLiveStatus(data.live_time, liveStatus);
49
56
  // 加载字体
50
- const fontURL = (0, url_1.pathToFileURL)((0, path_1.resolve)(__dirname, 'font/HYZhengYuan-75W.ttf'));
57
+ const fontURL = (0, node_url_1.pathToFileURL)((0, node_path_1.resolve)(__dirname, "font/HYZhengYuan-75W.ttf"));
51
58
  // 卡片内容
52
- const html = `
59
+ const html = /* html */ `
53
60
  <!DOCTYPE html>
54
61
  <html>
55
62
  <head>
@@ -64,7 +71,7 @@ class GenerateImg extends koishi_1.Service {
64
71
  margin: 0;
65
72
  padding: 0;
66
73
  box-sizing: border-box;
67
- font-family: "${this.giConfig.font}", "Custom Font", "Microsoft YaHei", "Source Han Sans", "Noto Sans CJK", sans-serif;
74
+ font-family: \"${this.giConfig.font}\", "Custom Font", "Microsoft YaHei", "Source Han Sans", "Noto Sans CJK", sans-serif;
68
75
  }
69
76
 
70
77
  html {
@@ -84,9 +91,9 @@ class GenerateImg extends koishi_1.Service {
84
91
  width: 100%;
85
92
  height: auto;
86
93
  box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
87
- padding: 15px;
94
+ padding: ${this.giConfig.cardBasePlateBorder};
88
95
  border-radius: 10px;
89
- background-color: #FFF5EE;
96
+ background-color: ${this.giConfig.cardBasePlateColor};
90
97
  }
91
98
 
92
99
  .card {
@@ -160,7 +167,7 @@ class GenerateImg extends koishi_1.Service {
160
167
  </head>
161
168
  <body>
162
169
  <div class="background">
163
- <div ${this.giConfig.removeBorder ? '' : 'class="base-plate"'}>
170
+ <div ${this.giConfig.removeBorder ? "" : 'class="base-plate"'}>
164
171
  <div class="card">
165
172
  <img src="${cover ? data.user_cover : data.keyframe}"
166
173
  alt="封面">
@@ -174,13 +181,25 @@ class GenerateImg extends koishi_1.Service {
174
181
  <span class="broadcast-message">${username}${titleStatus}</span>
175
182
  </div>
176
183
  </div>
177
- ${this.giConfig.hideDesc ? '' : `<p class="card-text">${data.description ? data.description : '这个主播很懒,什么都简介都没写'}</p>`}
184
+ ${this.giConfig.hideDesc ? "" : `<p class="card-text">${data.description ? data.description : "这个主播很懒,什么简介都没写"}</p>`}
178
185
  <p class="card-link">
179
186
  <span>人气:${data.online > 10000 ? `${(data.online / 10000).toFixed(1)}万` : data.online}</span>
180
187
  <span>分区名称:${data.area_name}</span>
181
188
  </p>
182
189
  <p class="card-link">
183
190
  <span>${liveTime}</span>
191
+ ${this.giConfig.followerDisplay
192
+ ? /* html */ `
193
+ <span>
194
+ ${liveStatus === 1
195
+ ? `当前粉丝数:${followerDisplay}`
196
+ : liveStatus === 2
197
+ ? `累计观看人数:${followerDisplay}`
198
+ : liveStatus === 3
199
+ ? `粉丝数变化:${followerDisplay}`
200
+ : ""}
201
+ </span>`
202
+ : ""}
184
203
  </p>
185
204
  </div>
186
205
  </div>
@@ -190,41 +209,12 @@ class GenerateImg extends koishi_1.Service {
190
209
  </html>
191
210
  `;
192
211
  // 多次尝试生成图片
193
- const attempts = 3;
194
- for (let i = 0; i < attempts; i++) {
195
- try {
196
- // 判断渲染方式
197
- if (this.giConfig.renderType) { // 为1则为真,进入page模式
198
- const htmlPath = 'file://' + __dirname.replaceAll('\\', '/') + '/page/0.html';
199
- const page = await this.ctx.puppeteer.page();
200
- await page.goto(htmlPath);
201
- await page.setContent(html, { waitUntil: 'networkidle0' });
202
- const elementHandle = await page.$('html');
203
- const boundingBox = await elementHandle.boundingBox();
204
- const buffer = await page.screenshot({
205
- type: 'png',
206
- clip: {
207
- x: boundingBox.x,
208
- y: boundingBox.y,
209
- width: boundingBox.width,
210
- height: boundingBox.height
211
- }
212
- });
213
- await elementHandle.dispose();
214
- await page.close();
215
- return { buffer };
216
- }
217
- // 使用render模式渲染
218
- const pic = await this.ctx.puppeteer.render(html);
219
- return { pic };
220
- }
221
- catch (e) {
222
- if (i === attempts - 1) { // 已尝试三次
223
- throw new Error('生成图片失败!错误: ' + e.toString());
224
- }
225
- }
226
- }
212
+ return await (0, utils_1.withRetry)(() => this.imgHandler(html)).catch((e) => {
213
+ // 已尝试三次
214
+ throw new Error(`生成图片失败!错误: ${e.toString()}`);
215
+ });
227
216
  }
217
+ // biome-ignore lint/suspicious/noExplicitAny: <explanation>
228
218
  async generateDynamicImg(data) {
229
219
  // module_author
230
220
  const module_author = data.modules.module_author;
@@ -246,11 +236,15 @@ class GenerateImg extends koishi_1.Service {
246
236
  const forward = module_stat.forward.count;
247
237
  const like = module_stat.like.count;
248
238
  // TOPIC
249
- const topic = data.modules.module_dynamic.topic ? data.modules.module_dynamic.topic.name : '';
250
- const getDynamicMajor = async (dynamicMajorData, forward) => {
239
+ const topic = data.modules.module_dynamic.topic
240
+ ? data.modules.module_dynamic.topic.name
241
+ : "";
242
+ const getDynamicMajor = async (
243
+ // biome-ignore lint/suspicious/noExplicitAny: <explanation>
244
+ dynamicMajorData, forward) => {
251
245
  // 定义返回值
252
- let main = '';
253
- let link = '';
246
+ let main = "";
247
+ let link = "";
254
248
  // 定义forward类型返回值
255
249
  let forwardInfo;
256
250
  // 最基本的图文处理
@@ -259,30 +253,29 @@ class GenerateImg extends koishi_1.Service {
259
253
  if (module_dynamic.desc) {
260
254
  const richText = module_dynamic.desc.rich_text_nodes.reduce((accumulator, currentValue) => {
261
255
  if (currentValue.emoji) {
262
- return accumulator + `<img style="width:28px; height:28px;" src="${currentValue.emoji.icon_url}"/>`;
263
- }
264
- else {
265
- return accumulator + currentValue.text;
256
+ return /* html */ `${accumulator}<img style="width:28px; height:28px;" src="${currentValue.emoji.icon_url}"/>`;
266
257
  }
267
- }, '');
258
+ return accumulator + currentValue.text;
259
+ }, "");
268
260
  // 关键字和正则屏蔽
269
- if (this.giConfig.filter.enable) { // 开启动态屏蔽功能
270
- if (this.giConfig.filter.regex) { // 正则屏蔽
261
+ if (this.giConfig.filter.enable) {
262
+ // 开启动态屏蔽功能
263
+ if (this.giConfig.filter.regex) {
264
+ // 正则屏蔽
271
265
  const reg = new RegExp(this.giConfig.filter.regex);
272
266
  if (reg.test(richText))
273
- throw new Error('出现关键词,屏蔽该动态');
267
+ throw new Error("出现关键词,屏蔽该动态");
274
268
  }
275
269
  if (this.giConfig.filter.keywords.length !== 0 &&
276
- this.giConfig.filter.keywords
277
- .some(keyword => richText.includes(keyword))) {
278
- throw new Error('出现关键词,屏蔽该动态');
270
+ this.giConfig.filter.keywords.some((keyword) => richText.includes(keyword))) {
271
+ throw new Error("出现关键词,屏蔽该动态");
279
272
  }
280
273
  }
281
274
  // 查找\n
282
- const text = richText.replace(/\n/g, '<br>');
275
+ const text = richText.replace(/\n/g, "<br>");
283
276
  // 拼接字符串
284
277
  if (text) {
285
- main += `
278
+ main += /* html */ `
286
279
  <div class="card-details">
287
280
  ${text}
288
281
  </div>
@@ -290,14 +283,14 @@ class GenerateImg extends koishi_1.Service {
290
283
  }
291
284
  }
292
285
  // 图片
293
- let major = '';
294
- const arrowImg = (0, url_1.pathToFileURL)((0, path_1.resolve)(__dirname, 'img/arrow.png'));
295
- if (module_dynamic.major && module_dynamic.major.draw) {
286
+ let major = "";
287
+ const arrowImg = (0, node_url_1.pathToFileURL)((0, node_path_1.resolve)(__dirname, "img/arrow.png"));
288
+ if (module_dynamic.major?.draw) {
296
289
  if (module_dynamic.major.draw.items.length === 1) {
297
290
  const height = module_dynamic.major.draw.items[0].height;
298
291
  console.log(height);
299
292
  if (height > 3000) {
300
- major += `
293
+ major += /* html */ `
301
294
  <div class="single-photo-container">
302
295
  <img class="single-photo-item" src="${module_dynamic.major.draw.items[0].src}"/>
303
296
  <div class="single-photo-mask">
@@ -308,7 +301,7 @@ class GenerateImg extends koishi_1.Service {
308
301
  `;
309
302
  }
310
303
  else {
311
- major += `
304
+ major += /* html */ `
312
305
  <div class="single-photo-container">
313
306
  <img class="single-photo-item" src="${module_dynamic.major.draw.items[0].src}"/>
314
307
  </div>
@@ -317,15 +310,15 @@ class GenerateImg extends koishi_1.Service {
317
310
  }
318
311
  else if (module_dynamic.major.draw.items.length === 4) {
319
312
  major += module_dynamic.major.draw.items.reduce((acc, cV) => {
320
- return acc + `<img class="four-photo-item" src="${cV.src}"/>`;
321
- }, '');
313
+ return /* html */ `${acc}<img class="four-photo-item" src="${cV.src}"/>`;
314
+ }, "");
322
315
  }
323
316
  else {
324
317
  major += module_dynamic.major.draw.items.reduce((acc, cV) => {
325
- return acc + `<img class="photo-item" src="${cV.src}"/>`;
326
- }, '');
318
+ return /* html */ `${acc}<img class="photo-item" src="${cV.src}"/>`;
319
+ }, "");
327
320
  }
328
- main += `
321
+ main += /* html */ `
329
322
  <div class="card-major">
330
323
  ${major}
331
324
  </div>
@@ -343,7 +336,7 @@ class GenerateImg extends koishi_1.Service {
343
336
  if (dynamicMajorData.type === DYNAMIC_TYPE_FORWARD) {
344
337
  //转发动态屏蔽
345
338
  if (this.giConfig.filter.enable && this.giConfig.filter.forward) {
346
- throw new Error('已屏蔽转发动态');
339
+ throw new Error("已屏蔽转发动态");
347
340
  }
348
341
  // User info
349
342
  const forward_module_author = dynamicMajorData.orig.modules.module_author;
@@ -353,11 +346,11 @@ class GenerateImg extends koishi_1.Service {
353
346
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
354
347
  const [forwardMain, _, forwardInfo] = await getDynamicMajor(dynamicMajorData.orig, true);
355
348
  // 拼接main
356
- main += `
349
+ main += /* html */ `
357
350
  <div class="card-forward">
358
351
  <div class="forward-userinfo">
359
352
  <img class="forward-avatar" src="${forwardUserAvatarUrl}" alt="avatar">
360
- <span class="forward-username">${forwardUserName} ${forwardInfo ? forwardInfo : ''}</span>
353
+ <span class="forward-username">${forwardUserName} ${forwardInfo ? forwardInfo : ""}</span>
361
354
  </div>
362
355
  <div class="forward-main">
363
356
  ${forwardMain}
@@ -370,20 +363,21 @@ class GenerateImg extends koishi_1.Service {
370
363
  const additional = dynamicMajorData.modules.module_dynamic.additional;
371
364
  // 有附加信息,判断类型
372
365
  switch (additional.type) {
373
- case ADDITIONAL_TYPE_RESERVE: { // 预约信息
366
+ case ADDITIONAL_TYPE_RESERVE: {
367
+ // 预约信息
374
368
  const reserve = additional.reserve;
375
369
  // 定义按钮
376
370
  let button;
377
371
  // 判断按钮类型
378
- if (reserve.button.uncheck.text === '已结束') {
379
- button = `
372
+ if (reserve.button.uncheck.text === "已结束") {
373
+ button = /* html */ `
380
374
  <button class="reserve-button-end">
381
375
  <span>${reserve.button.uncheck.text}</span>
382
376
  </button>
383
377
  `;
384
378
  }
385
379
  else {
386
- button = `
380
+ button = /* html */ `
387
381
  <button class="reserve-button-ing">
388
382
  <svg class="bili-dyn-card-reserve__action__icon" style="width: 16px; height: 16px;"
389
383
  xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
@@ -402,7 +396,7 @@ class GenerateImg extends koishi_1.Service {
402
396
  </button>
403
397
  `;
404
398
  }
405
- main += `
399
+ main += /* html */ `
406
400
  <div class="card-reserve">
407
401
  <div class="reserve-main">
408
402
  <div class="reserve-title">
@@ -413,8 +407,8 @@ class GenerateImg extends koishi_1.Service {
413
407
  <span class="reserve-time">${reserve.desc1.text}</span>
414
408
  <span class="reserve-num">${reserve.desc2.text}</span>
415
409
  </div>
416
- ${reserve.desc3 ?
417
- `<div class="reserve-prize">
410
+ ${reserve.desc3
411
+ ? `<div class="reserve-prize">
418
412
  <svg class="bili-dyn-card-reserve__lottery__icon"
419
413
  style="width: 16px; height: 16px;" xmlns="http://www.w3.org/2000/svg"
420
414
  xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 16 16" width="16"
@@ -443,7 +437,8 @@ class GenerateImg extends koishi_1.Service {
443
437
  d="M4.359835 1.609835C4.21339 1.756285 4.21339 1.99372 4.359835 2.140165L8.0429 5.823225C8.140525 5.920875 8.140525 6.079125 8.0429 6.176775L4.359835 9.859825C4.21339 10.006275 4.21339 10.243725 4.359835 10.390175C4.506285 10.5366 4.743725 10.5366 4.89017 10.390175L8.573225 6.7071C8.96375 6.316575 8.96375 5.683425 8.573225 5.2929L4.89017 1.609835C4.743725 1.46339 4.506285 1.46339 4.359835 1.609835z"
444
438
  fill="currentColor"></path>
445
439
  </svg>
446
- </div>` : ''}
440
+ </div>`
441
+ : ""}
447
442
  </div>
448
443
  </div>
449
444
  <div class="reserve-button">
@@ -457,19 +452,20 @@ class GenerateImg extends koishi_1.Service {
457
452
  link += `请将$替换为. www$bilibili$com/opus/${dynamicMajorData.id_str}`;
458
453
  break;
459
454
  }
460
- case DYNAMIC_TYPE_AV: { // 投稿新视频
455
+ case DYNAMIC_TYPE_AV: {
456
+ // 投稿新视频
461
457
  // 处理文字
462
458
  basicDynamic();
463
459
  const archive = dynamicMajorData.modules.module_dynamic.major.archive;
464
- if (archive.badge.text === '投稿视频') {
460
+ if (archive.badge.text === "投稿视频") {
465
461
  if (forward) {
466
- forwardInfo = '投稿了视频';
462
+ forwardInfo = "投稿了视频";
467
463
  }
468
464
  else {
469
465
  pubTime = `${pubTime} · 投稿了视频`;
470
466
  }
471
467
  }
472
- main += `
468
+ main += /* html */ `
473
469
  <div class="card-video">
474
470
  <div class="video-cover">
475
471
  <img src="${archive.cover}"
@@ -529,37 +525,46 @@ class GenerateImg extends koishi_1.Service {
529
525
  link = `请将$替换为. www$bilibili$com/video/${archive.bvid}`;
530
526
  break;
531
527
  }
532
- case DYNAMIC_TYPE_LIVE: return [`${upName}发起了直播预约,我暂时无法渲染,请自行查看`, link];
533
- case DYNAMIC_TYPE_MEDIALIST: return [`${upName}分享了收藏夹,我暂时无法渲染,请自行查看`, link];
534
- case DYNAMIC_TYPE_PGC: return [`${upName}发布了剧集(番剧、电影、纪录片),我暂时无法渲染,请自行查看`, link];
535
- case DYNAMIC_TYPE_ARTICLE: return [`${upName}投稿了新专栏,我暂时无法渲染,请自行查看`, link];
536
- case DYNAMIC_TYPE_MUSIC: return [`${upName}发行了新歌,我暂时无法渲染,请自行查看`, link];
537
- case DYNAMIC_TYPE_COMMON_SQUARE: return [`${upName}发布了装扮|剧集|点评|普通分享,我暂时无法渲染,请自行查看`, link];
538
- case DYNAMIC_TYPE_COURSES_SEASON: return [`${upName}发布了新课程,我暂时无法渲染,请自行查看`, link];
539
- case DYNAMIC_TYPE_UGC_SEASON: return [`${upName}更新了合集,我暂时无法渲染,请自行查看`, link];
540
- case DYNAMIC_TYPE_NONE: return [`${upName}发布了一条无效动态`, link];
528
+ case DYNAMIC_TYPE_LIVE:
529
+ return [`${upName}发起了直播预约,我暂时无法渲染,请自行查看`, link];
530
+ case DYNAMIC_TYPE_MEDIALIST:
531
+ return [`${upName}分享了收藏夹,我暂时无法渲染,请自行查看`, link];
532
+ case DYNAMIC_TYPE_PGC:
533
+ return [
534
+ `${upName}发布了剧集(番剧、电影、纪录片),我暂时无法渲染,请自行查看`,
535
+ link,
536
+ ];
537
+ case DYNAMIC_TYPE_ARTICLE:
538
+ return [`${upName}投稿了新专栏,我暂时无法渲染,请自行查看`, link];
539
+ case DYNAMIC_TYPE_MUSIC:
540
+ return [`${upName}发行了新歌,我暂时无法渲染,请自行查看`, link];
541
+ case DYNAMIC_TYPE_COMMON_SQUARE:
542
+ return [
543
+ `${upName}发布了装扮|剧集|点评|普通分享,我暂时无法渲染,请自行查看`,
544
+ link,
545
+ ];
546
+ case DYNAMIC_TYPE_COURSES_SEASON:
547
+ return [`${upName}发布了新课程,我暂时无法渲染,请自行查看`, link];
548
+ case DYNAMIC_TYPE_UGC_SEASON:
549
+ return [`${upName}更新了合集,我暂时无法渲染,请自行查看`, link];
550
+ case DYNAMIC_TYPE_NONE:
551
+ return [`${upName}发布了一条无效动态`, link];
541
552
  // 直播开播,不做处理
542
- case DYNAMIC_TYPE_LIVE_RCMD: throw new Error('直播开播动态,不做处理');
543
- case DYNAMIC_TYPE_SUBSCRIPTION_NEW:
544
- case DYNAMIC_TYPE_BANNER:
545
- case DYNAMIC_TYPE_SUBSCRIPTION:
546
- case DYNAMIC_TYPE_APPLET:
547
- case DYNAMIC_TYPE_AD:
548
- case DYNAMIC_TYPE_COURSES_BATCH:
549
- case DYNAMIC_TYPE_COURSES:
550
- case DYNAMIC_TYPE_COMMON_VERTICAL:
551
- default: return [`${upName}发布了一条我无法识别的动态,请自行查看`, ''];
553
+ case DYNAMIC_TYPE_LIVE_RCMD:
554
+ throw new Error("直播开播动态,不做处理");
555
+ default:
556
+ return [`${upName}发布了一条我无法识别的动态,请自行查看`, ""];
552
557
  }
553
558
  return [main, link, forwardInfo];
554
559
  };
555
560
  // 获取动态主要内容
556
561
  const [main, link] = await getDynamicMajor(data, false);
557
562
  // 加载字体
558
- const fontURL = (0, url_1.pathToFileURL)((0, path_1.resolve)(__dirname, 'font/HYZhengYuan-75W.ttf'));
563
+ const fontURL = (0, node_url_1.pathToFileURL)((0, node_path_1.resolve)(__dirname, "font/HYZhengYuan-75W.ttf"));
559
564
  // 判断是否开启大字体模式
560
565
  let style;
561
566
  if (this.giConfig.enableLargeFont) {
562
- style = `
567
+ style = /* css */ `
563
568
  @font-face {
564
569
  font-family: "Custom Font";
565
570
  src: url(${fontURL});
@@ -569,7 +574,7 @@ class GenerateImg extends koishi_1.Service {
569
574
  margin: 0;
570
575
  padding: 0;
571
576
  box-sizing: border-box;
572
- font-family: "${this.giConfig.font}", "Custom Font", "Microsoft YaHei", "Source Han Sans", "Noto Sans CJK", sans-serif;
577
+ font-family: \"${this.giConfig.font}\", "Custom Font", "Microsoft YaHei", "Source Han Sans", "Noto Sans CJK", sans-serif;
573
578
  }
574
579
 
575
580
  html {
@@ -589,9 +594,9 @@ class GenerateImg extends koishi_1.Service {
589
594
  width: 100%;
590
595
  height: auto;
591
596
  box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
592
- padding: 15px;
597
+ padding: ${this.giConfig.cardBasePlateBorder};
593
598
  border-radius: 10px;
594
- background-color: #FFF5EE;
599
+ background-color: ${this.giConfig.cardBasePlateColor};
595
600
  }
596
601
 
597
602
  .card {
@@ -924,7 +929,7 @@ class GenerateImg extends koishi_1.Service {
924
929
  `;
925
930
  }
926
931
  else {
927
- style = `
932
+ style = /* css */ `
928
933
  @font-face {
929
934
  font-family: "Custom Font";
930
935
  src: url(${fontURL});
@@ -934,7 +939,7 @@ class GenerateImg extends koishi_1.Service {
934
939
  margin: 0;
935
940
  padding: 0;
936
941
  box-sizing: border-box;
937
- font-family: "${this.giConfig.font}", "Custom Font", "Microsoft YaHei", "Source Han Sans", "Noto Sans CJK", sans-serif;
942
+ font-family: \"${this.giConfig.font}\", "Custom Font", "Microsoft YaHei", "Source Han Sans", "Noto Sans CJK", sans-serif;
938
943
  }
939
944
 
940
945
  html {
@@ -954,9 +959,9 @@ class GenerateImg extends koishi_1.Service {
954
959
  width: 100%;
955
960
  height: auto;
956
961
  box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
957
- padding: 15px;
962
+ padding: ${this.giConfig.cardBasePlateBorder};
958
963
  border-radius: 10px;
959
- background-color: #FFF5EE;
964
+ background-color: ${this.giConfig.cardBasePlateColor};
960
965
  }
961
966
 
962
967
  .card {
@@ -1290,7 +1295,7 @@ class GenerateImg extends koishi_1.Service {
1290
1295
  `;
1291
1296
  }
1292
1297
  // 定义卡片内容
1293
- const html = `
1298
+ const html = /* html */ `
1294
1299
  <!DOCTYPE html>
1295
1300
  <html>
1296
1301
  <head>
@@ -1301,7 +1306,7 @@ class GenerateImg extends koishi_1.Service {
1301
1306
  </head>
1302
1307
  <body>
1303
1308
  <div class="background">
1304
- <div ${this.giConfig.removeBorder ? '' : 'class="base-plate"'}>
1309
+ <div ${this.giConfig.removeBorder ? "" : 'class="base-plate"'}>
1305
1310
  <div class="card">
1306
1311
  <div class="card-body">
1307
1312
  <!-- 主播头像 -->
@@ -1311,24 +1316,28 @@ class GenerateImg extends koishi_1.Service {
1311
1316
  <div class="card-content">
1312
1317
  <div class="card-header">
1313
1318
  <div class="up-info">
1314
- <div class="up-name" style="${module_author.vip.type !== 0 ? 'color: #FB7299' : ''}">${upName}</div>
1319
+ <div class="up-name" style="${module_author.vip.type !== 0 ? "color: #FB7299" : ""}">${upName}</div>
1315
1320
  <div class="pub-time">${pubTime}</div>
1316
1321
  </div>
1317
- ${module_author.decorate ? `
1322
+ ${module_author.decorate
1323
+ ? `
1318
1324
  <div class="dress-up">
1319
1325
  <img src="${dynamicCardUrl}" />
1320
1326
  <span>${dynamicCardId}</span>
1321
1327
  </div>
1322
- ` : ''}
1328
+ `
1329
+ : ""}
1323
1330
  </div>
1324
1331
  <div class="card-topic">
1325
- ${topic ? `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"
1332
+ ${topic
1333
+ ? `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"
1326
1334
  class="bili-dyn-topic__icon">
1327
1335
  <path fill-rule="evenodd" clip-rule="evenodd"
1328
1336
  d="M11.4302 2.57458C11.4416 2.51023 11.4439 2.43974 11.4218 2.3528C11.3281 1.98196 10.9517 1.72037 10.5284 1.7527C10.432 1.76018 10.3599 1.78383 10.297 1.81376C10.2347 1.84398 10.1832 1.88155 10.1401 1.92465C10.1195 1.94485 10.1017 1.96692 10.0839 1.98897L10.0808 1.99289L10.0237 2.06277L9.91103 2.2033C9.76177 2.39141 9.61593 2.58191 9.47513 2.77556C9.33433 2.96936 9.19744 3.16585 9.06672 3.36638C9.00275 3.46491 8.93968 3.56401 8.87883 3.66461L8.56966 3.6613C8.00282 3.6574 7.43605 3.65952 6.86935 3.67034C6.80747 3.56778 6.74325 3.46677 6.67818 3.3664C6.54732 3.16585 6.41045 2.96934 6.26968 2.77568C6.12891 2.58186 5.98309 2.39134 5.83387 2.20322L5.72122 2.06268L5.66416 1.99279L5.6622 1.99036C5.64401 1.96783 5.62586 1.94535 5.60483 1.92454C5.56192 1.88144 5.51022 1.84388 5.44797 1.81364C5.38522 1.78386 5.31305 1.76006 5.21665 1.75273C4.80555 1.72085 4.4203 1.97094 4.32341 2.35273C4.30147 2.43968 4.30358 2.51018 4.31512 2.57453C4.32715 2.63859 4.34975 2.69546 4.38112 2.74649C4.39567 2.77075 4.41283 2.79315 4.42999 2.81557C4.43104 2.81694 4.43209 2.81831 4.43314 2.81968L4.48759 2.89122L4.59781 3.03355C4.74589 3.22242 4.89739 3.40905 5.05377 3.59254C5.09243 3.63788 5.13136 3.68306 5.17057 3.72785C4.99083 3.73681 4.81112 3.7467 4.63143 3.75756C4.41278 3.771 4.19397 3.78537 3.97547 3.80206L3.64757 3.82786L3.48362 3.84177L3.39157 3.85181C3.36984 3.8543 3.34834 3.8577 3.32679 3.86111C3.31761 3.86257 3.30843 3.86402 3.29921 3.86541C3.05406 3.90681 2.81526 3.98901 2.59645 4.10752C2.37765 4.22603 2.17867 4.38039 2.00992 4.56302C1.84117 4.74565 1.70247 4.95593 1.60144 5.18337C1.50025 5.4105 1.43687 5.65447 1.41362 5.90153C1.33103 6.77513 1.27663 7.6515 1.25742 8.5302C1.23758 9.40951 1.25835 10.2891 1.3098 11.1655C1.32266 11.3846 1.33738 11.6035 1.35396 11.8223L1.38046 12.1505L1.39472 12.3144L1.39658 12.335L1.39906 12.3583L1.40417 12.4048C1.40671 12.4305 1.41072 12.4558 1.41473 12.4811C1.41561 12.4866 1.41648 12.4922 1.41734 12.4977C1.45717 12.7449 1.53806 12.9859 1.65567 13.2074C1.77314 13.4289 1.92779 13.6304 2.11049 13.8022C2.29319 13.974 2.50441 14.1159 2.73329 14.2197C2.96201 14.3235 3.2084 14.3901 3.45836 14.4135C3.47066 14.415 3.48114 14.4159 3.49135 14.4167C3.49477 14.417 3.49817 14.4173 3.50159 14.4176L3.5425 14.4212L3.62448 14.4283L3.78843 14.4417L4.11633 14.4674C4.33514 14.4831 4.55379 14.4983 4.7726 14.5111C6.52291 14.6145 8.27492 14.6346 10.0263 14.5706C10.4642 14.5547 10.9019 14.5332 11.3396 14.5062C11.5584 14.4923 11.7772 14.4776 11.9959 14.4604L12.3239 14.434L12.4881 14.4196L12.5813 14.4093C12.6035 14.4065 12.6255 14.403 12.6474 14.3995C12.6565 14.3981 12.6655 14.3966 12.6746 14.3952C12.9226 14.3527 13.1635 14.2691 13.3844 14.1486C13.6052 14.0284 13.8059 13.8716 13.9759 13.6868C14.1463 13.5022 14.2861 13.2892 14.3874 13.0593C14.4381 12.9444 14.4793 12.8253 14.5108 12.7037C14.519 12.6734 14.5257 12.6428 14.5322 12.612L14.5421 12.566L14.55 12.5196C14.5556 12.4887 14.5607 12.4578 14.5641 12.4266C14.5681 12.3959 14.5723 12.363 14.5746 12.3373C14.6642 11.4637 14.7237 10.5864 14.7435 9.70617C14.764 8.825 14.7347 7.94337 14.6719 7.06715C14.6561 6.8479 14.6385 6.62896 14.6183 6.41033L14.5867 6.08246L14.5697 5.91853L14.5655 5.87758C14.5641 5.86445 14.5618 5.8473 14.5599 5.83231C14.5588 5.8242 14.5578 5.81609 14.5567 5.80797C14.5538 5.78514 14.5509 5.76229 14.5466 5.7396C14.5064 5.49301 14.4252 5.25275 14.3067 5.03242C14.1886 4.81208 14.0343 4.61153 13.8519 4.44095C13.6695 4.27038 13.4589 4.12993 13.2311 4.02733C13.0033 3.92458 12.7583 3.85907 12.5099 3.83636C12.4974 3.83492 12.4865 3.83394 12.4759 3.833C12.4729 3.83273 12.4698 3.83246 12.4668 3.83219L12.4258 3.82879L12.3438 3.82199L12.1798 3.80886L11.8516 3.78413C11.633 3.76915 11.4143 3.75478 11.1955 3.74288C10.993 3.73147 10.7904 3.72134 10.5878 3.71243L10.6914 3.59236C10.8479 3.40903 10.9992 3.22242 11.1473 3.03341L11.2576 2.89124L11.312 2.81971C11.3136 2.81773 11.3151 2.81575 11.3166 2.81377C11.3333 2.79197 11.3501 2.77013 11.3641 2.74653C11.3954 2.6955 11.418 2.63863 11.4302 2.57458ZM9.33039 5.49268C9.38381 5.16945 9.67705 4.95281 9.98536 5.00882L9.98871 5.00944C10.2991 5.06783 10.5063 5.37802 10.4524 5.70377L10.2398 6.99039L11.3846 6.9904C11.7245 6.9904 12 7.27925 12 7.63557C12 7.99188 11.7245 8.28073 11.3846 8.28073L10.0266 8.28059L9.7707 9.82911L11.0154 9.82913C11.3553 9.82913 11.6308 10.118 11.6308 10.4743C11.6308 10.8306 11.3553 11.1195 11.0154 11.1195L9.55737 11.1195L9.32807 12.5073C9.27465 12.8306 8.98141 13.0472 8.6731 12.9912L8.66975 12.9906C8.35937 12.9322 8.1522 12.622 8.20604 12.2962L8.40041 11.1195H6.89891L6.66961 12.5073C6.61619 12.8306 6.32295 13.0472 6.01464 12.9912L6.01129 12.9906C5.7009 12.9322 5.49374 12.622 5.54758 12.2962L5.74196 11.1195L4.61538 11.1195C4.27552 11.1195 4 10.8306 4 10.4743C4 10.118 4.27552 9.82913 4.61538 9.82913L5.95514 9.82911L6.21103 8.28059L4.98462 8.28073C4.64475 8.28073 4.36923 7.99188 4.36923 7.63557C4.36923 7.27925 4.64475 6.9904 4.98462 6.9904L6.42421 6.99039L6.67193 5.49268C6.72535 5.16945 7.01859 4.95281 7.3269 5.00882L7.33025 5.00944C7.64063 5.06783 7.8478 5.37802 7.79396 5.70377L7.58132 6.99039H9.08281L9.33039 5.49268ZM8.61374 9.82911L8.86963 8.28059H7.36813L7.11225 9.82911H8.61374Z"
1329
1337
  fill="currentColor"></path>
1330
1338
  </svg>
1331
- ${topic}` : ''}
1339
+ ${topic}`
1340
+ : ""}
1332
1341
  </div>
1333
1342
  ${main}
1334
1343
  <div class="card-stat">
@@ -1372,40 +1381,10 @@ class GenerateImg extends koishi_1.Service {
1372
1381
  </html>
1373
1382
  `;
1374
1383
  // 多次尝试生成图片
1375
- const attempts = 3;
1376
- for (let i = 0; i < attempts; i++) {
1377
- try {
1378
- // 判断渲染方式
1379
- if (this.giConfig.renderType) { // 为1则为真,进入page模式
1380
- const htmlPath = 'file://' + __dirname.replaceAll('\\', '/') + '/page/0.html';
1381
- const page = await this.ctx.puppeteer.page();
1382
- await page.goto(htmlPath);
1383
- await page.setContent(html, { waitUntil: 'networkidle0' });
1384
- const elementHandle = await page.$('html');
1385
- const boundingBox = await elementHandle.boundingBox();
1386
- const buffer = await page.screenshot({
1387
- type: 'png',
1388
- clip: {
1389
- x: boundingBox.x,
1390
- y: boundingBox.y,
1391
- width: boundingBox.width,
1392
- height: boundingBox.height
1393
- }
1394
- });
1395
- await elementHandle.dispose();
1396
- await page.close();
1397
- return { buffer, link };
1398
- }
1399
- // 使用render模式渲染
1400
- const pic = await this.ctx.puppeteer.render(html);
1401
- return { pic, link };
1402
- }
1403
- catch (e) {
1404
- if (i === attempts - 1) { // 已尝试三次
1405
- throw new Error('生成图片失败!错误: ' + e.toString());
1406
- }
1407
- }
1408
- }
1384
+ return await (0, utils_1.withRetry)(() => this.imgHandler(html)).catch((e) => {
1385
+ // 已尝试三次
1386
+ throw new Error(`生成图片失败!错误: ${e.toString()}`);
1387
+ });
1409
1388
  }
1410
1389
  async getLiveStatus(time, liveStatus) {
1411
1390
  let titleStatus;
@@ -1413,25 +1392,25 @@ class GenerateImg extends koishi_1.Service {
1413
1392
  let cover;
1414
1393
  switch (liveStatus) {
1415
1394
  case 0: {
1416
- titleStatus = '未直播';
1417
- liveTime = '未开播';
1395
+ titleStatus = "未直播";
1396
+ liveTime = "未开播";
1418
1397
  cover = true;
1419
1398
  break;
1420
1399
  }
1421
1400
  case 1: {
1422
- titleStatus = '开播啦';
1401
+ titleStatus = "开播啦";
1423
1402
  liveTime = `开播时间:${time}`;
1424
1403
  cover = true;
1425
1404
  break;
1426
1405
  }
1427
1406
  case 2: {
1428
- titleStatus = '正在直播';
1407
+ titleStatus = "正在直播";
1429
1408
  liveTime = `直播时长:${await this.getTimeDifference(time)}`;
1430
1409
  cover = false;
1431
1410
  break;
1432
1411
  }
1433
1412
  case 3: {
1434
- titleStatus = '下播啦';
1413
+ titleStatus = "下播啦";
1435
1414
  liveTime = `开播时间:${time}`;
1436
1415
  cover = true;
1437
1416
  break;
@@ -1441,51 +1420,69 @@ class GenerateImg extends koishi_1.Service {
1441
1420
  }
1442
1421
  async getTimeDifference(dateString) {
1443
1422
  // 将日期字符串转换为Date对象
1444
- const date = new Date(dateString);
1445
- // 获取Unix时间戳(以毫秒为单位)
1446
- const unixTime = date.getTime() / 1000;
1447
- // 获取当前Unix时间戳
1448
- const now = this.ctx.ba.getTimeOfUTC8();
1449
- // 计算时间差(以秒为单位)
1450
- const differenceInSeconds = Math.floor(now - unixTime);
1451
- // 获取yyyy:MM:dd HH:mm:ss
1452
- const days = Math.floor(differenceInSeconds / (24 * 60 * 60));
1453
- const hours = Math.floor((differenceInSeconds % (24 * 60 * 60)) / (60 * 60));
1454
- const minutes = Math.floor((differenceInSeconds % (60 * 60)) / 60);
1455
- const seconds = differenceInSeconds % 60;
1456
- // 返回格式化的字符串
1457
- return days ?
1458
- `${days}天${hours}小时${minutes.toString().padStart(2, '0')}分${seconds.toString().padStart(2, '0')}秒` :
1459
- `${hours}小时${minutes.toString().padStart(2, '0')}分${seconds.toString().padStart(2, '0')}秒`;
1423
+ const apiDateTime = luxon_1.DateTime.fromFormat(dateString, "yyyy-MM-dd HH:mm:ss", {
1424
+ zone: "UTC+8",
1425
+ });
1426
+ // 获取当前时间
1427
+ const currentDateTime = luxon_1.DateTime.now();
1428
+ // 计算时间差
1429
+ const diff = currentDateTime.diff(apiDateTime, [
1430
+ "years",
1431
+ "months",
1432
+ "days",
1433
+ "hours",
1434
+ "minutes",
1435
+ "seconds",
1436
+ ]);
1437
+ const { years, months, days, hours, minutes, seconds } = diff.toObject();
1438
+ // 按单位生成可读字符串(过滤零值)
1439
+ const parts = [];
1440
+ if (years !== 0)
1441
+ parts.push(`${Math.abs(years)}年`);
1442
+ if (months !== 0)
1443
+ parts.push(`${Math.abs(months)}个月`);
1444
+ if (days !== 0)
1445
+ parts.push(`${Math.abs(days)}天`);
1446
+ if (hours !== 0)
1447
+ parts.push(`${Math.abs(hours)}小时`);
1448
+ if (minutes !== 0)
1449
+ parts.push(`${Math.abs(minutes)}分`);
1450
+ if (seconds !== 0)
1451
+ parts.push(`${Math.round(Math.abs(seconds))}秒`);
1452
+ // 处理负值
1453
+ const sign = diff.as("seconds") < 0 ? "-" : "";
1454
+ // 组合结果(如果无差值返回"0秒")
1455
+ return parts.length > 0 ? `${sign}${parts.join("")}` : "0秒";
1460
1456
  }
1461
1457
  unixTimestampToString(timestamp) {
1462
1458
  const date = new Date(timestamp * 1000);
1463
1459
  const year = date.getFullYear();
1464
- const month = ("0" + (date.getMonth() + 1)).slice(-2);
1465
- const day = ("0" + date.getDate()).slice(-2);
1466
- const hours = ("0" + (date.getHours())).slice(-2);
1467
- const minutes = ("0" + date.getMinutes()).slice(-2);
1468
- const seconds = ("0" + date.getSeconds()).slice(-2);
1460
+ const month = `0${date.getMonth() + 1}`.slice(-2);
1461
+ const day = `0${date.getDate()}`.slice(-2);
1462
+ const hours = `0${date.getHours()}`.slice(-2);
1463
+ const minutes = `0${date.getMinutes()}`.slice(-2);
1464
+ const seconds = `0${date.getSeconds()}`.slice(-2);
1469
1465
  return `${year}年${month}月${day}日 ${hours}:${minutes}:${seconds}`;
1470
1466
  }
1471
1467
  }
1472
- // eslint-disable-next-line @typescript-eslint/no-namespace
1473
1468
  (function (GenerateImg) {
1474
1469
  GenerateImg.Config = koishi_1.Schema.object({
1475
- renderType: koishi_1.Schema.number(),
1476
1470
  filter: koishi_1.Schema.object({
1477
1471
  enable: koishi_1.Schema.boolean(),
1478
1472
  notify: koishi_1.Schema.boolean(),
1479
1473
  regex: koishi_1.Schema.string(),
1480
1474
  keywords: koishi_1.Schema.array(String),
1481
- forward: koishi_1.Schema.boolean()
1475
+ forward: koishi_1.Schema.boolean(),
1482
1476
  }),
1483
1477
  removeBorder: koishi_1.Schema.boolean(),
1484
1478
  cardColorStart: koishi_1.Schema.string(),
1485
1479
  cardColorEnd: koishi_1.Schema.string(),
1480
+ cardBasePlateColor: koishi_1.Schema.string(),
1481
+ cardBasePlateBorder: koishi_1.Schema.string(),
1486
1482
  enableLargeFont: koishi_1.Schema.boolean(),
1487
1483
  font: koishi_1.Schema.string(),
1488
- hideDesc: koishi_1.Schema.boolean()
1484
+ hideDesc: koishi_1.Schema.boolean(),
1485
+ followerDisplay: koishi_1.Schema.boolean(),
1489
1486
  });
1490
1487
  })(GenerateImg || (GenerateImg = {}));
1491
1488
  exports.default = GenerateImg;