koishi-plugin-ggcevo-game 1.0.27 → 1.1.0
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.
- package/lib/index.js +3 -2
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -1544,11 +1544,12 @@ ${achievementList.join("\n")}`;
|
|
|
1544
1544
|
const nowChina = convertUTCtoChinaTime(/* @__PURE__ */ new Date());
|
|
1545
1545
|
const todayStart = new Date(nowChina);
|
|
1546
1546
|
todayStart.setUTCHours(0, 0, 0, 0);
|
|
1547
|
+
const adjustedTime = new Date(todayStart.getTime() - 8 * 60 * 60 * 1e3);
|
|
1547
1548
|
if (config.sameOpponentLimit) {
|
|
1548
1549
|
const sameOpponentCount = await ctx.database.select("ggcevo_pk_logs").where({
|
|
1549
1550
|
initiator_handle: initiatorHandle,
|
|
1550
1551
|
target_handle: targetHandle,
|
|
1551
|
-
date: { $gte:
|
|
1552
|
+
date: { $gte: adjustedTime }
|
|
1552
1553
|
}).execute((row) => import_koishi.$.count(row.id));
|
|
1553
1554
|
if (sameOpponentCount > 0) {
|
|
1554
1555
|
return "您今天已经挑战过该玩家,请明天再试";
|
|
@@ -1557,7 +1558,7 @@ ${achievementList.join("\n")}`;
|
|
|
1557
1558
|
if (config.maxDailyBeChallenged > 0) {
|
|
1558
1559
|
const beChallengedCount = await ctx.database.select("ggcevo_pk_logs").where({
|
|
1559
1560
|
target_handle: targetHandle,
|
|
1560
|
-
date: { $gte:
|
|
1561
|
+
date: { $gte: adjustedTime }
|
|
1561
1562
|
}).execute((row) => import_koishi.$.count(row.id));
|
|
1562
1563
|
if (beChallengedCount >= config.maxDailyBeChallenged) {
|
|
1563
1564
|
return `该玩家今日已被挑战太多次(最多${config.maxDailyBeChallenged}次)`;
|