koishi-plugin-maple-warriors 0.1.2 → 0.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 +6 -6
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -1337,17 +1337,17 @@ buff: ${buffEffects} 持续${duration}`;
|
|
|
1337
1337
|
ctx.command("猫武士/战斗训练 <target:user>", "与指定用户的角色进行训练战斗(不消耗HP)").example("战斗训练 @火星").action(async ({ session }, target) => {
|
|
1338
1338
|
const channelId = session.channelId;
|
|
1339
1339
|
const userId = session.userId;
|
|
1340
|
-
let targetUserId = target;
|
|
1341
|
-
if (target.includes(":")) {
|
|
1342
|
-
const parts = target.split(":");
|
|
1343
|
-
targetUserId = parts[parts.length - 1];
|
|
1344
|
-
}
|
|
1345
1340
|
if (battleManager.isBattling(channelId)) {
|
|
1346
1341
|
return "请等待当前战斗结束!";
|
|
1347
1342
|
}
|
|
1348
|
-
if (!
|
|
1343
|
+
if (!target) {
|
|
1349
1344
|
return "请指定训练对手!正确格式:战斗训练 @用户名";
|
|
1350
1345
|
}
|
|
1346
|
+
let targetUserId = target;
|
|
1347
|
+
if (target.includes(":")) {
|
|
1348
|
+
const parts = target.split(":");
|
|
1349
|
+
targetUserId = parts[parts.length - 1];
|
|
1350
|
+
}
|
|
1351
1351
|
if (targetUserId === userId) {
|
|
1352
1352
|
return "不能和自己进行战斗训练!";
|
|
1353
1353
|
}
|