koishi-plugin-prism-neo 0.0.14 → 0.0.16

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.
Files changed (2) hide show
  1. package/lib/index.js +4 -8
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -320,14 +320,9 @@ __name(handleRegisterCmd, "handleRegisterCmd");
320
320
  async function handleLoginCmd(context, user) {
321
321
  const { error, userId } = await getTargetUserId(context, user);
322
322
  if (error) return error;
323
- await login(context, userId);
324
- const pwd = await getLock(context, userId);
325
- if (user) {
326
- return `✅ 已为用户 ${await getUserName(context.session, userId)} 入场,该用户的门锁密码是: ${pwd.password}
327
- 注意! 门锁密码有效期为三分钟`;
328
- }
329
- return `✅ 入场成功,你的门锁密码是: ${pwd.password}
330
- 注意! 门锁密码有效期为三分钟`;
323
+ let [_, lockMessage] = await Promise.all([login(context, userId), handleLockCmd(context)]);
324
+ let message = "✅ 入场成功\n\n" + lockMessage;
325
+ return message;
331
326
  }
332
327
  __name(handleLoginCmd, "handleLoginCmd");
333
328
  async function handleLogoutCmd(context, user) {
@@ -448,6 +443,7 @@ async function handleLockCmd(context) {
448
443
  return [
449
444
  "获取密码成功",
450
445
  `你的门锁密码是: ${res.password}`,
446
+ `输入完成后按 # 结束`,
451
447
  "注意! 门锁密码有效期为三分钟"
452
448
  ].join("\n");
453
449
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-prism-neo",
3
3
  "description": "prism koishi前端",
4
- "version": "0.0.14",
4
+ "version": "0.0.16",
5
5
  "main": "lib/index.js",
6
6
  "files": [
7
7
  "lib",