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.
- package/lib/index.js +17 -5
- 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
|
|
334
|
+
const userIds = users.map((user2) => {
|
|
335
335
|
const qqBind = user2.binds.find((bind) => bind.type === "QQ");
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
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")}`;
|