koishi-plugin-xxck-1 0.2.39 → 0.2.41

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 +5 -2
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -1117,19 +1117,22 @@ async function _do_upgrade(ctx, session, card_ids, signResetHour, signResetMinut
1117
1117
  const now = /* @__PURE__ */ new Date();
1118
1118
  let resetHour = signResetHour ?? 0;
1119
1119
  let resetMinute = signResetMinute ?? 0;
1120
+ ctx.logger.info("=== 【升格日志】刷新时间配置 ===");
1121
+ ctx.logger.info("resetHour =", resetHour);
1122
+ ctx.logger.info("resetMinute =", resetMinute);
1120
1123
  let todayDate = new Date(now);
1121
1124
  todayDate.setHours(resetHour, resetMinute, 0, 0);
1122
1125
  if (now < todayDate) {
1123
1126
  todayDate.setDate(todayDate.getDate() - 1);
1124
1127
  }
1125
1128
  const today = `${todayDate.getFullYear()}${String(todayDate.getMonth() + 1).padStart(2, "0")}${String(todayDate.getDate()).padStart(2, "0")}`;
1129
+ ctx.logger.info("=== 【升格日志】实际使用的店铺日期 ===", today);
1126
1130
  let total_cost = 0;
1127
1131
  const shop_card_info = [];
1128
1132
  const [shopCards, cardPool] = await Promise.all([
1129
1133
  ctx.database.get("gacha_shop_daily", { shop_date: today }),
1130
1134
  ctx.database.get("gacha_card_pool", {})
1131
1135
  ]);
1132
- ctx.logger.info(`[升格] 使用店铺日期: ${today}`);
1133
1136
  ctx.logger.info(`[升格] 当前店铺卡片:`, shopCards.map((s) => s.card_id));
1134
1137
  for (const [cid, num] of Object.entries(cid_count)) {
1135
1138
  const shopCard = shopCards.find((sc) => String(sc.card_id) === String(cid));
@@ -2485,7 +2488,7 @@ async function apply(ctx, config) {
2485
2488
  if (!argv.session) return;
2486
2489
  const session = argv.session;
2487
2490
  const validIds = cardIds.filter((id) => id.trim());
2488
- await _do_upgrade(ctx, session, validIds);
2491
+ await _do_upgrade(ctx, session, validIds, config.signResetHour, config.signResetMinute);
2489
2492
  });
2490
2493
  ctx.command("WWC兑换 <次数>", "水汽兑换普通抽数,100水汽=1抽,每日上限80抽,单次1-40").alias("wwc兑换").alias("WWC水汽兑换").action(async (argv, count) => {
2491
2494
  if (!argv.session) return;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-xxck-1",
3
3
  "description": "自用(?)抽卡系统|完整指令说明见readme|建议使用skia-canvas|指令与本地化已经基本完成",
4
- "version": "0.2.39",
4
+ "version": "0.2.41",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [