@hieuzest/koishi-plugin-riichi-city 0.5.0 → 0.5.1
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/lobby.js +7 -1
- package/package.json +1 -1
package/lib/lobby.js
CHANGED
|
@@ -159,7 +159,13 @@ var RiichiCityLobby = class {
|
|
|
159
159
|
);
|
|
160
160
|
}
|
|
161
161
|
async listPlayers(ready = true) {
|
|
162
|
-
return this.api.listPlayers(this.id).then(
|
|
162
|
+
return this.api.listPlayers(this.id).then(
|
|
163
|
+
(l) => Object.fromEntries(l.filter((x) => ready === void 0 || ready && x.status === 2 || !ready && x.status === 1).map((p) => [p.nickname, p.userID])),
|
|
164
|
+
(e) => {
|
|
165
|
+
if (e instanceof import_api.RiichiCityError && e.code === 228) throw new import_koishi.SessionError(`无管理权限,请将【${this.extra.adminAccountId}】设置为管理员。`);
|
|
166
|
+
else throw e;
|
|
167
|
+
}
|
|
168
|
+
);
|
|
163
169
|
}
|
|
164
170
|
async listPaipus(offset = 0, limit = 20) {
|
|
165
171
|
const res = await this.api.listPaipus({ classifyID: this.classifyID, limit, skip: offset });
|