koishi-plugin-ggcevo-game 1.0.2 → 1.0.4
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 +21 -24
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -413,7 +413,7 @@ ${itemDetails.join("\n")}`;
|
|
|
413
413
|
}
|
|
414
414
|
if (!latestTime) return "您还没有游玩过 咕咕虫-evolved 地图";
|
|
415
415
|
const targetDateChina = new Date(latestTime);
|
|
416
|
-
targetDateChina.
|
|
416
|
+
targetDateChina.setUTCDate(targetDateChina.getUTCDate() + 1);
|
|
417
417
|
if (!isSameDate(latestTime, currentChinaTime) && !isSameDate(targetDateChina, currentChinaTime)) {
|
|
418
418
|
return "暂未查询到您最近两天内游玩过 咕咕虫-evolved 地图,请游玩1次后签到(对局记录上传有延迟)";
|
|
419
419
|
}
|
|
@@ -421,14 +421,14 @@ ${itemDetails.join("\n")}`;
|
|
|
421
421
|
const [backpack] = await ctx.database.get("ggcevo_backpack", { handle, itemId: 1 });
|
|
422
422
|
if (record) {
|
|
423
423
|
const lastSignChina = convertUTCtoChinaTime(record.lastSign);
|
|
424
|
-
if (lastSignChina.
|
|
424
|
+
if (lastSignChina.getUTCDate() === currentChinaTime.getUTCDate()) {
|
|
425
425
|
return `您今天已经签到过了!本月累计签到 ${record.monthlyDays} 天`;
|
|
426
426
|
}
|
|
427
427
|
}
|
|
428
428
|
let monthlyDays = 1;
|
|
429
429
|
if (record) {
|
|
430
430
|
const lastSignChina = convertUTCtoChinaTime(record.lastSign);
|
|
431
|
-
if (currentChinaTime.
|
|
431
|
+
if (currentChinaTime.getUTCFullYear() !== lastSignChina.getUTCFullYear() || currentChinaTime.getUTCMonth() !== lastSignChina.getUTCMonth()) {
|
|
432
432
|
monthlyDays = 1;
|
|
433
433
|
} else {
|
|
434
434
|
monthlyDays = record.monthlyDays + 1;
|
|
@@ -480,10 +480,10 @@ ${itemDetails.join("\n")}`;
|
|
|
480
480
|
const lastSignChina = convertUTCtoChinaTime(record.lastSign);
|
|
481
481
|
const targetDateChina = new Date(lastSignChina);
|
|
482
482
|
const nowChina = convertUTCtoChinaTime(/* @__PURE__ */ new Date());
|
|
483
|
-
const currentYear = nowChina.
|
|
484
|
-
const currentMonth = nowChina.
|
|
485
|
-
const yesterday = new Date(targetDateChina).
|
|
486
|
-
if (targetDateChina.
|
|
483
|
+
const currentYear = nowChina.getUTCFullYear();
|
|
484
|
+
const currentMonth = nowChina.getUTCMonth();
|
|
485
|
+
const yesterday = new Date(targetDateChina).getUTCDate() - 1;
|
|
486
|
+
if (targetDateChina.getUTCFullYear() !== currentYear || targetDateChina.getUTCMonth() !== currentMonth || // 必须当月
|
|
487
487
|
record.monthlyDays > yesterday) {
|
|
488
488
|
return "暂时没有可补签的日期。";
|
|
489
489
|
}
|
|
@@ -574,15 +574,15 @@ ${itemDetails.join("\n")}`;
|
|
|
574
574
|
}
|
|
575
575
|
const now = /* @__PURE__ */ new Date();
|
|
576
576
|
const chinatime = convertUTCtoChinaTime(now);
|
|
577
|
-
const currentYear = chinatime.
|
|
578
|
-
const currentMonth = chinatime.
|
|
577
|
+
const currentYear = chinatime.getUTCFullYear();
|
|
578
|
+
const currentMonth = chinatime.getUTCMonth();
|
|
579
579
|
const [adminRecord] = await ctx.database.get("ggcevo_adminbenefit", {
|
|
580
580
|
userId: session.userId
|
|
581
581
|
});
|
|
582
582
|
if (adminRecord) {
|
|
583
583
|
const lastSignTime = convertUTCtoChinaTime(adminRecord.lastSign);
|
|
584
|
-
const lastYear = lastSignTime.
|
|
585
|
-
const lastMonth = lastSignTime.
|
|
584
|
+
const lastYear = lastSignTime.getUTCFullYear();
|
|
585
|
+
const lastMonth = lastSignTime.getUTCMonth();
|
|
586
586
|
if (lastYear === currentYear && lastMonth === currentMonth) {
|
|
587
587
|
return `本月管理津贴已领取,${currentMonth + 2} 月1日可再次领取`;
|
|
588
588
|
}
|
|
@@ -1257,7 +1257,7 @@ ${output}`;
|
|
|
1257
1257
|
return "操作失败,请稍后重试。错误详情已记录";
|
|
1258
1258
|
}
|
|
1259
1259
|
});
|
|
1260
|
-
ctx.command("
|
|
1260
|
+
ctx.command("ggcevo/成就").action(async ({ session }) => {
|
|
1261
1261
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
1262
1262
|
if (!profile) {
|
|
1263
1263
|
return "您的 QQ 未绑定句柄。";
|
|
@@ -1281,7 +1281,7 @@ ${output}`;
|
|
|
1281
1281
|
return `${regionId}-S2-${realmId}-${profileId} 已获得的成就:
|
|
1282
1282
|
${achievementList.join("\n")}`;
|
|
1283
1283
|
});
|
|
1284
|
-
ctx.command("
|
|
1284
|
+
ctx.command("ggcevo/个人信息").action(async (argv) => {
|
|
1285
1285
|
const session = argv.session;
|
|
1286
1286
|
const output = [];
|
|
1287
1287
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
@@ -1320,19 +1320,16 @@ ${achievementList.join("\n")}`;
|
|
|
1320
1320
|
"──────────────"
|
|
1321
1321
|
);
|
|
1322
1322
|
}
|
|
1323
|
-
const achievements = await ctx.database.get("ggcevo_achievements", { handle });
|
|
1324
|
-
if (achievements
|
|
1323
|
+
const [achievements] = await ctx.database.get("ggcevo_achievements", { handle });
|
|
1324
|
+
if (achievements) {
|
|
1325
1325
|
output.push(
|
|
1326
1326
|
"🏆 已获成就:",
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
});
|
|
1334
|
-
return `${a.achievementname} (${date})`;
|
|
1335
|
-
}),
|
|
1327
|
+
`${achievements.achievementname} (${achievements.gaintime.toLocaleDateString("zh-CN", {
|
|
1328
|
+
timeZone: "Asia/Shanghai",
|
|
1329
|
+
year: "numeric",
|
|
1330
|
+
month: "2-digit",
|
|
1331
|
+
day: "2-digit"
|
|
1332
|
+
})})`,
|
|
1336
1333
|
"──────────────"
|
|
1337
1334
|
);
|
|
1338
1335
|
}
|