koishi-plugin-ggcevo-game 0.3.19 → 0.3.21

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 -3
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -453,8 +453,9 @@ ${itemDetails.join("\n")}`;
453
453
  targetDateChina.setDate(targetDateChina.getDate() + 1);
454
454
  const targetDateUTC = new Date(targetDateChina.getTime() - 8 * 60 * 60 * 1e3);
455
455
  const nowChina = convertUTCtoChinaTime(/* @__PURE__ */ new Date());
456
- const isToday = targetDateChina.getFullYear() === nowChina.getFullYear() && targetDateChina.getMonth() === nowChina.getMonth() && targetDateChina.getDate() === nowChina.getDate();
457
- if (isToday) {
456
+ console.log(targetDateChina);
457
+ console.log(nowChina);
458
+ if (isSameDate(targetDateChina, nowChina)) {
458
459
  return "您需要补签的日期是今天,请进行正常签到。";
459
460
  }
460
461
  if (targetDateChina >= nowChina) {
@@ -485,7 +486,7 @@ ${itemDetails.join("\n")}`;
485
486
  await ctx.database.set("ggcevo_backpack", { handle, itemId: 1 }, {
486
487
  quantity: (backpack?.quantity || 0) + tickets
487
488
  });
488
- return `补签成功!已为您补签 ${targetDateChina.toLocaleDateString("zh-CN")},连续签到 ${newConsecutiveDays} 天,消耗 ${costPoints} 金币,获得 ${points} 金币和 ${tickets} 枚咕咕币`;
489
+ return `补签成功!已为您补签 ${targetDateUTC.toLocaleString("zh-CN", { timeZone: "Asia/Shanghai", hour12: false })},连续签到 ${newConsecutiveDays} 天,消耗 ${costPoints} 金币,获得 ${points} 金币和 ${tickets} 枚咕咕币`;
489
490
  } catch (error) {
490
491
  console.error("补签错误:", error);
491
492
  return "补签失败,请稍后重试。";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-ggcevo-game",
3
3
  "description": "星际争霸2游戏大厅地图咕咕虫-evo小游戏",
4
- "version": "0.3.19",
4
+ "version": "0.3.21",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [