koishi-plugin-checkgal 1.0.3 → 1.1.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.
Files changed (2) hide show
  1. package/lib/commands.js +7 -7
  2. package/package.json +1 -1
package/lib/commands.js CHANGED
@@ -19,11 +19,11 @@ function apply(ctx, config) {
19
19
  // 缓存结果
20
20
  results.forEach(game => ctx.gameCache.set(game.id, game));
21
21
  // 并发下载并转换所有图片
22
- const imageBuffers = await Promise.all(results.map(game => ctx.touchgal.downloadAndConvertImage(game.banner)));
22
+ const imagePaths = await Promise.all(results.map(game => ctx.touchgal.downloadAndConvertImage(game.banner)));
23
23
  const forwardMessages = results.map((game, index) => {
24
- const imageBuffer = imageBuffers[index];
25
- const imageElement = imageBuffer
26
- ? (0, koishi_1.h)('image', { url: `base64://${imageBuffer.toString('base64')}` })
24
+ const imagePath = imagePaths[index];
25
+ const imageElement = imagePath
26
+ ? (0, koishi_1.h)('image', { url: `file://${imagePath}` })
27
27
  : (0, koishi_1.h)('text', { content: '封面图加载失败' });
28
28
  const content = [
29
29
  imageElement,
@@ -63,9 +63,9 @@ function apply(ctx, config) {
63
63
  return `未找到ID为 ${id} 的下载资源。`;
64
64
  }
65
65
  const gameTitle = gameInfo ? `游戏: ${gameInfo.name} (ID: ${id})` : `游戏ID: ${id}`;
66
- const imageBuffer = gameInfo ? await ctx.touchgal.downloadAndConvertImage(gameInfo.banner) : null;
67
- const imageElement = imageBuffer
68
- ? (0, koishi_1.h)('image', { url: `base64://${imageBuffer.toString('base64')}` })
66
+ const imagePath = gameInfo ? await ctx.touchgal.downloadAndConvertImage(gameInfo.banner) : null;
67
+ const imageElement = imagePath
68
+ ? (0, koishi_1.h)('image', { url: `file://${imagePath}` })
69
69
  : (0, koishi_1.h)('text', { content: gameInfo ? '封面图加载失败' : '' });
70
70
  const header = [
71
71
  imageElement,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "koishi-plugin-checkgal",
3
- "version": "1.0.3",
3
+ "version": "1.1.1",
4
4
  "description": "个人测试请勿使用",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",