koishi-plugin-ggcevo-game 2.0.6 → 2.0.8

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 +9 -4
  2. package/package.json +2 -2
package/lib/index.js CHANGED
@@ -8061,8 +8061,12 @@ function apply(ctx, config) {
8061
8061
  if (existingEntries.length > 0) {
8062
8062
  return `⛔ 您已被列入黑名单。`;
8063
8063
  }
8064
+ const [record] = await ctx.database.get("ggcevo_sign", { handle });
8065
+ if (!record) {
8066
+ return "📅 请先进行一次签到后再进行抽奖。";
8067
+ }
8064
8068
  const [backpack] = await ctx.database.get("ggcevo_backpack", { handle, itemId: 1 });
8065
- const quantity = backpack?.quantity;
8069
+ const quantity = backpack?.quantity || 0;
8066
8070
  if (quantity < 1) {
8067
8071
  return "您背包内的咕咕币不足。";
8068
8072
  }
@@ -8075,11 +8079,11 @@ function apply(ctx, config) {
8075
8079
  const result = await gachaWithPity(ctx, handle);
8076
8080
  if (result) winCount++;
8077
8081
  }
8078
- const [record] = await ctx.database.get("ggcevo_sign", { handle });
8082
+ const [updatedRecord] = await ctx.database.get("ggcevo_sign", { handle });
8079
8083
  return [
8080
8084
  `🎰 您使用了${quantity}枚咕咕币`,
8081
8085
  winCount > 0 ? `🎉 其中获得${winCount}张兑换券!` : "💔 本次未获得任何兑换券",
8082
- `📊 当前保底进度:${record.pityCounter}/90`
8086
+ `📊 当前保底进度:${updatedRecord?.pityCounter || 0}/90`
8083
8087
  ].join("\n");
8084
8088
  });
8085
8089
  ctx.command("ggcevo/单抽").action(async (argv) => {
@@ -8831,7 +8835,8 @@ ${ticketMessage}${effectMessage}`;
8831
8835
  `处罚原因: ${item.reason}`,
8832
8836
  `处罚次数: ${item.count}`,
8833
8837
  `审核人: ${item.reviewer}`,
8834
- `处罚时间: ${item.date.toLocaleString("zh-CN", { timeZone: "Asia/Shanghai" })}`
8838
+ // toLocaleString 改为 toLocaleDateString 只显示日期
8839
+ `处罚时间: ${item.date.toLocaleDateString("zh-CN", { timeZone: "Asia/Shanghai" })}`
8835
8840
  ];
8836
8841
  let finalText = baseInfo.join("\n");
8837
8842
  return finalText;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-ggcevo-game",
3
3
  "description": "星际争霸2咕咕虫-evolved地图的专属游戏助手插件,集成天梯排行、抽奖系统、签到福利、兑换商城等丰富功能。",
4
- "version": "2.0.6",
4
+ "version": "2.0.8",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [
@@ -19,7 +19,7 @@
19
19
  "peerDependencies": {
20
20
  "@koishijs/plugin-proxy-agent": "^0.3.3",
21
21
  "koishi": "^4.18.7",
22
- "koishi-plugin-sc2arcade-search": "^1.2.3"
22
+ "koishi-plugin-sc2arcade-search": "^1.2.4"
23
23
  },
24
24
  "koishi": {
25
25
  "service": {