koishi-plugin-ll-mc 3.1.2 → 3.1.3

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/index.js +4 -5
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -2578,7 +2578,7 @@ ${targetUserRecord[0].username}
2578
2578
  background-color: #F5F7FA;
2579
2579
  }
2580
2580
  body {
2581
- padding: 16px;
2581
+ padding: 24px;
2582
2582
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
2583
2583
  -webkit-font-smoothing: antialiased;
2584
2584
  }
@@ -2637,10 +2637,9 @@ ${rows}
2637
2637
  logger.warn("Leaderboard template wait timed out, screenshotting current content.");
2638
2638
  }
2639
2639
  await page.waitForSelector(".card").catch(() => {});
2640
- const el = await page.$(".card");
2641
- const buf = el
2642
- ? await el.screenshot({ type: "png" })
2643
- : await page.screenshot({ type: "png", fullPage: true });
2640
+ // 背景(自定义 CSS/API 背景)是加在 html 上的,必须截整页才能把卡片外的背景一起截进来;
2641
+ // body 高度由内容撑开(无 min-height),所以 fullPage 不会产生多余空白。
2642
+ const buf = await page.screenshot({ type: "png", fullPage: true });
2644
2643
  return `data:image/png;base64,${buf.toString("base64")}`;
2645
2644
  } catch (error) {
2646
2645
  logger.error("Failed to render leaderboard template:", error);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-ll-mc",
3
3
  "description": "消息数量统计插件(基于 koishi-plugin-message-counter 重做,官方QQ机器人兼容)",
4
- "version": "3.1.2",
4
+ "version": "3.1.3",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [