@hieuzest/koishi-plugin-mahjongpub 0.3.2 → 0.3.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 +4 -3
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -1123,13 +1123,14 @@ var ConsoleExtension = class {
|
|
|
1123
1123
|
addListener("mahjongpub/list-teams", async function(cid) {
|
|
1124
1124
|
const managed = (await getUserContests(this)).find((c) => c.cid === cid);
|
|
1125
1125
|
if (!managed?.adminPassword) throw new Error("Admin password not configured");
|
|
1126
|
+
const pubTeams = await that.mahjongpub.getTeams(cid);
|
|
1126
1127
|
const contestAdmin = new ContestAdmin(that.ctx, cid, managed.adminPassword, { endpoint: that.config.endpoint });
|
|
1127
1128
|
await contestAdmin.read(true);
|
|
1128
|
-
return Object.values(
|
|
1129
|
+
return Object.values(pubTeams).map((t) => ({
|
|
1129
1130
|
tid: t.tid,
|
|
1130
|
-
name: t.
|
|
1131
|
+
name: t.t_name,
|
|
1131
1132
|
players: t.players,
|
|
1132
|
-
pw: t.pw
|
|
1133
|
+
pw: contestAdmin.teams[t.tid]?.pw
|
|
1133
1134
|
}));
|
|
1134
1135
|
}, { authority: 3 });
|
|
1135
1136
|
addListener("mahjongpub/update-team-players", async function(cid, tid, players) {
|