koishi-plugin-checkgal 1.4.2 → 1.4.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.
Files changed (2) hide show
  1. package/lib/commands.js +4 -7
  2. package/package.json +1 -1
package/lib/commands.js CHANGED
@@ -18,10 +18,8 @@ function apply(ctx, config) {
18
18
  }
19
19
  // 缓存结果
20
20
  results.forEach(game => ctx.gameCache.set(game.id, game));
21
- // 并发下载并转换所有图片
22
- const imageBuffers = await Promise.all(results.map(game => ctx.touchgal.downloadAndConvertImage(game.banner)));
23
- const forwardMessages = results.map((game, index) => {
24
- const imageBuffer = imageBuffers[index];
21
+ for (const game of results) {
22
+ const imageBuffer = await ctx.touchgal.downloadAndConvertImage(game.banner);
25
23
  const imageElement = imageBuffer
26
24
  ? koishi_1.h.image(imageBuffer, 'image/jpeg')
27
25
  : (0, koishi_1.h)('text', { content: '封面图加载失败' });
@@ -32,9 +30,8 @@ function apply(ctx, config) {
32
30
  `平台: ${game.platform.join(', ')}`,
33
31
  `语言: ${game.language.join(', ')}`,
34
32
  ].join('\n');
35
- return (0, koishi_1.h)('message', { userId: session.bot.selfId, nickname: 'CheckGal Bot' }, content);
36
- });
37
- await session.send((0, koishi_1.h)('message', { forward: true }, forwardMessages));
33
+ await session.send(content);
34
+ }
38
35
  });
39
36
  ctx.command('下载gal <id:number>', '获取Galgame下载地址')
40
37
  .action(async ({ session }, id) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "koishi-plugin-checkgal",
3
- "version": "1.4.2",
3
+ "version": "1.4.4",
4
4
  "description": "个人测试请勿使用",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",