koishi-plugin-prism-neo 0.0.5 → 0.0.6

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 +17 -5
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -331,13 +331,25 @@ async function handleListCmd(context, user) {
331
331
  if (!users || users.length === 0) {
332
332
  return "窝里目前没有玩家呢";
333
333
  }
334
- const userReports = users.map((user2) => {
334
+ const userIds = users.map((user2) => {
335
335
  const qqBind = user2.binds.find((bind) => bind.type === "QQ");
336
- const name2 = qqBind ? qqBind.bid : "匿名玩家";
337
- const entryDate = formatDateTime(user2.sessions[0].createdAt);
338
- return `玩家: ${name2}
339
- 入场时间: ${entryDate}`;
336
+ if (qqBind) {
337
+ const id = qqBind.bid;
338
+ const entryDate = formatDateTime(user2.sessions[0].createdAt);
339
+ return { id, entryDate };
340
+ }
340
341
  });
342
+ const platformUsers = await Promise.all(
343
+ userIds.map((id) => {
344
+ return context.session.bot.getUser(id.id);
345
+ })
346
+ );
347
+ const userReports = platformUsers.map(
348
+ (u, idx) => {
349
+ return `玩家: ${u.name}
350
+ 入场时间: ${userIds[idx].entryDate}`;
351
+ }
352
+ );
341
353
  return `窝里目前共有 ${users.length} 人
342
354
 
343
355
  ${userReports.join("\n\n")}`;
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.5",
4
+ "version": "0.0.6",
5
5
  "main": "lib/index.js",
6
6
  "files": [
7
7
  "lib",