koishi-plugin-ggcevo-game 1.0.18 → 1.0.19
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 +4 -2
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -1487,14 +1487,16 @@ ${achievementList.join("\n")}`;
|
|
|
1487
1487
|
ctx.logger.error("SC2大厅监控失败:", error);
|
|
1488
1488
|
}
|
|
1489
1489
|
}, config.checkInterval * 1e3);
|
|
1490
|
-
ctx.command("ggcevo/pk <user>", "发起玩家对战").alias("挑战").action(async (
|
|
1490
|
+
ctx.command("ggcevo/pk <user>", "发起玩家对战").alias("挑战").action(async (argv, user) => {
|
|
1491
1491
|
try {
|
|
1492
|
+
const session = argv.session;
|
|
1492
1493
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
1493
1494
|
if (!profile) return "您的 QQ 未绑定句柄。";
|
|
1494
1495
|
const parsedUser = import_koishi.h.parse(user)[0];
|
|
1495
1496
|
if (!parsedUser || parsedUser.type !== "at") return "请使用@指定对战玩家";
|
|
1496
1497
|
const targetUserId = parsedUser.attrs.id;
|
|
1497
|
-
|
|
1498
|
+
let targetUsername = parsedUser.attrs.name || targetUserId;
|
|
1499
|
+
const [targetprofile] = await ctx.database.get("sc2arcade_player", { userId: targetUsername });
|
|
1498
1500
|
if (!targetprofile) return "对方尚未绑定句柄";
|
|
1499
1501
|
const initiatorHandle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
1500
1502
|
const targetHandle = `${targetprofile.regionId}-S2-${targetprofile.realmId}-${targetprofile.profileId}`;
|