@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.
Files changed (2) hide show
  1. package/lib/lobby.js +7 -1
  2. 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((l) => Object.fromEntries(l.filter((x) => ready === void 0 || ready && x.status === 2 || !ready && x.status === 1).map((p) => [p.nickname, p.userID])));
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 });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hieuzest/koishi-plugin-riichi-city",
3
3
  "description": "",
4
- "version": "0.5.0",
4
+ "version": "0.5.1",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [