@hieuzest/koishi-plugin-riichi-city 0.5.2 → 0.5.4

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 CHANGED
@@ -79,6 +79,10 @@ ${config.extraHelp}`.trim();
79
79
  const l = await this.api.listLobbys();
80
80
  return Object.values(l).map((x) => `[${x.id}] ${x.name}`).join("\n");
81
81
  });
82
+ ctx.command("rc-dhs.info <cid:number>").action(async (_, cid) => {
83
+ const details = await this.api.enterLobby(cid);
84
+ return `${details.matchInfo.name} [${details.classifyID}]`;
85
+ });
82
86
  ctx.guild().command("rc-dhs.bind [cid:number]", { admin: { channel: true } }).userFields(["authority"]).channelFields(["rc-dhs/bind"]).action(async ({ session }, cid) => {
83
87
  const contestId = session.channel["rc-dhs/bind"];
84
88
  if (!cid && contestId) {
@@ -309,7 +313,7 @@ ${config.extraHelp}`.trim();
309
313
  } catch (e) {
310
314
  if (e instanceof import_lobby.DHSError) throw e;
311
315
  else {
312
- this.ctx.logger.error(e);
316
+ this.ctx.logger.warn(e?.message ?? e);
313
317
  throw e;
314
318
  }
315
319
  }
@@ -350,7 +354,7 @@ ${config.extraHelp}`.trim();
350
354
  } catch (e) {
351
355
  if (e instanceof import_lobby.DHSError) throw e;
352
356
  else {
353
- this.ctx.logger.error(e);
357
+ this.ctx.logger.warn(e?.message ?? e);
354
358
  throw e;
355
359
  }
356
360
  }
package/lib/lobby.js CHANGED
@@ -181,6 +181,8 @@ var RiichiCityLobby = class {
181
181
  } else {
182
182
  notFound.push(player.pattern);
183
183
  }
184
+ } else if (player.accountId) {
185
+ if (!Object.values(onlinePlayers).includes(player.accountId)) notFound.push(player.pattern);
184
186
  }
185
187
  }
186
188
  if (notFound.length) throw new PlayerNotFoundError(...notFound);
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.2",
4
+ "version": "0.5.4",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [