koishi-plugin-ggcevo-game 1.1.1 → 1.1.3
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 +18 -9
- package/package.json +7 -5
- package/readme.md +1 -1
package/lib/index.js
CHANGED
|
@@ -305,7 +305,7 @@ function apply(ctx, config) {
|
|
|
305
305
|
}
|
|
306
306
|
const quantity = backpack.quantity;
|
|
307
307
|
if (quantity < 1) {
|
|
308
|
-
return "
|
|
308
|
+
return "您的咕咕币不足~";
|
|
309
309
|
}
|
|
310
310
|
await ctx.database.upsert("ggcevo_backpack", [{
|
|
311
311
|
handle,
|
|
@@ -343,7 +343,7 @@ function apply(ctx, config) {
|
|
|
343
343
|
return "您还没有进行过签到。";
|
|
344
344
|
}
|
|
345
345
|
if (backpack.quantity < 1) {
|
|
346
|
-
return "
|
|
346
|
+
return "您的咕咕币不足~";
|
|
347
347
|
}
|
|
348
348
|
await ctx.database.upsert("ggcevo_backpack", [{
|
|
349
349
|
handle,
|
|
@@ -376,7 +376,7 @@ function apply(ctx, config) {
|
|
|
376
376
|
return "您还没有进行过签到。";
|
|
377
377
|
}
|
|
378
378
|
if (backpack.quantity < 10) {
|
|
379
|
-
return "
|
|
379
|
+
return "您的咕咕币不足~";
|
|
380
380
|
}
|
|
381
381
|
await ctx.database.upsert("ggcevo_backpack", [{
|
|
382
382
|
handle,
|
|
@@ -429,7 +429,7 @@ function apply(ctx, config) {
|
|
|
429
429
|
const [itemName, itemData] = entry;
|
|
430
430
|
return `${itemName} × ${userItem.quantity}:${itemData.description}`;
|
|
431
431
|
});
|
|
432
|
-
return
|
|
432
|
+
return `【${handle}的背包】
|
|
433
433
|
${itemDetails.join("\n")}`;
|
|
434
434
|
});
|
|
435
435
|
ctx.command("ggcevo/签到").action(async (argv) => {
|
|
@@ -974,22 +974,22 @@ ID:${activity.id}
|
|
|
974
974
|
let targetUsername = parsedUser.attrs.name || targetUserId;
|
|
975
975
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: targetUsername });
|
|
976
976
|
if (!profile) {
|
|
977
|
-
return "
|
|
977
|
+
return "对方的 QQ 未绑定句柄。";
|
|
978
978
|
}
|
|
979
979
|
const { regionId, realmId, profileId } = profile;
|
|
980
980
|
const handle = `${regionId}-S2-${realmId}-${profileId}`;
|
|
981
981
|
const [user] = await ctx.database.get("ggcevo_rank", {
|
|
982
982
|
handle
|
|
983
983
|
});
|
|
984
|
-
if (!user) return "
|
|
985
|
-
if (user.Blacklist) return "
|
|
984
|
+
if (!user) return "未找到对方的排名信息。";
|
|
985
|
+
if (user.Blacklist) return "❌对方已经被禁止参加本赛季胜点榜。";
|
|
986
986
|
const allRanks = await ctx.database.select("ggcevo_rank").where({ Blacklist: false }).orderBy("rank", "desc").execute();
|
|
987
987
|
const userRank = allRanks.findIndex(
|
|
988
988
|
(u) => u.handle === handle
|
|
989
989
|
) + 1;
|
|
990
990
|
const isSafe = await checkSensitiveWord(user.name);
|
|
991
991
|
const displayName = isSafe ? user.name : (user.name[0] || "") + "***";
|
|
992
|
-
return `🎮
|
|
992
|
+
return `🎮 对方的 GGCEvo 排名信息 🎮
|
|
993
993
|
------------------------------
|
|
994
994
|
昵称:${displayName}
|
|
995
995
|
句柄:${user.handle}
|
|
@@ -1039,7 +1039,7 @@ ID:${activity.id}
|
|
|
1039
1039
|
let targetUsername = parsedUser.attrs.name || targetUserId;
|
|
1040
1040
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: targetUsername });
|
|
1041
1041
|
if (!profile) {
|
|
1042
|
-
return "
|
|
1042
|
+
return "对方的 QQ 未绑定句柄。";
|
|
1043
1043
|
}
|
|
1044
1044
|
const { regionId, realmId, profileId } = profile;
|
|
1045
1045
|
handle = `${regionId}-S2-${realmId}-${profileId}`;
|
|
@@ -1512,6 +1512,11 @@ ${achievementList.join("\n")}`;
|
|
|
1512
1512
|
if (!user) return '缺少参数,请输入"pk @指定对战玩家"';
|
|
1513
1513
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
1514
1514
|
if (!profile) return "您的 QQ 未绑定句柄。";
|
|
1515
|
+
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
1516
|
+
const existingEntries = await ctx.database.get("ggcevo_blacklist", { handle });
|
|
1517
|
+
if (existingEntries.length > 0) {
|
|
1518
|
+
return `❌拒绝访问,您已被列入活动黑名单。`;
|
|
1519
|
+
}
|
|
1515
1520
|
const parsedUser = import_koishi.h.parse(user)[0];
|
|
1516
1521
|
if (!parsedUser || parsedUser.type !== "at") return '参数格式错误,请输入"pk @指定对战玩家"';
|
|
1517
1522
|
const targetUserId = parsedUser.attrs.id;
|
|
@@ -1684,6 +1689,10 @@ ${achievementList.join("\n")}`;
|
|
|
1684
1689
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
1685
1690
|
if (!profile) return "您的 QQ 未绑定句柄";
|
|
1686
1691
|
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
1692
|
+
const existingEntries = await ctx.database.get("ggcevo_blacklist", { handle });
|
|
1693
|
+
if (existingEntries.length > 0) {
|
|
1694
|
+
return `❌拒绝访问,您已被列入活动黑名单。`;
|
|
1695
|
+
}
|
|
1687
1696
|
const [pkRecord] = await ctx.database.get("ggcevo_pk", { handle }) || [null];
|
|
1688
1697
|
const currentState = pkRecord?.enable ?? true;
|
|
1689
1698
|
const lastToggle = pkRecord?.lastToggle ?? /* @__PURE__ */ new Date(0);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "koishi-plugin-ggcevo-game",
|
|
3
|
-
"description": "星际争霸2游戏大厅咕咕虫-Evo
|
|
4
|
-
"version": "1.1.
|
|
3
|
+
"description": "星际争霸2游戏大厅咕咕虫-Evo地图专属插件。",
|
|
4
|
+
"version": "1.1.3",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
7
7
|
"files": [
|
|
@@ -12,12 +12,14 @@
|
|
|
12
12
|
"keywords": [
|
|
13
13
|
"chatbot",
|
|
14
14
|
"koishi",
|
|
15
|
-
"plugin"
|
|
15
|
+
"plugin",
|
|
16
|
+
"ggcevo",
|
|
17
|
+
"game"
|
|
16
18
|
],
|
|
17
19
|
"peerDependencies": {
|
|
18
|
-
"koishi": "^4.18.7",
|
|
19
20
|
"@koishijs/plugin-proxy-agent": "^0.3.3",
|
|
20
|
-
"koishi
|
|
21
|
+
"koishi": "^4.18.7",
|
|
22
|
+
"koishi-plugin-sc2arcade-search": "^1.1.6"
|
|
21
23
|
},
|
|
22
24
|
"koishi": {
|
|
23
25
|
"service": {
|
package/readme.md
CHANGED