@hieuzest/koishi-plugin-riichi-city 0.4.1 → 0.4.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/api.d.ts CHANGED
@@ -25,6 +25,7 @@ declare namespace Cipher {
25
25
  }
26
26
  }
27
27
  export declare class RiichiCityApi {
28
+ private ctx;
28
29
  private config;
29
30
  http: Quester;
30
31
  cookie: RiichiCityApi.Cookie;
package/lib/api.js CHANGED
@@ -96,6 +96,7 @@ var Cipher;
96
96
  })(Cipher || (Cipher = {}));
97
97
  var RiichiCityApi = class _RiichiCityApi {
98
98
  constructor(ctx, config) {
99
+ this.ctx = ctx;
99
100
  this.config = config;
100
101
  this.cookie = {
101
102
  channel: "default",
@@ -155,6 +156,7 @@ var RiichiCityApi = class _RiichiCityApi {
155
156
  return res;
156
157
  });
157
158
  } catch (e) {
159
+ this.ctx.logger.debug(e);
158
160
  if (import_koishi.HTTP.Error.is(e)) throw new NetworkError();
159
161
  else throw e;
160
162
  }
package/lib/index.js CHANGED
@@ -475,7 +475,7 @@ var RiichiCity = class extends import_koishi3.Service {
475
475
  }
476
476
  async getAccounts(userIds) {
477
477
  const res = Object.fromEntries(userIds.map((userId) => [userId, void 0]));
478
- Object.assign(Object.fromEntries(await this.ctx.database.get("riichi-city.accounts", { userId: userIds }).then((x) => x.map((x2) => [x2.userId, x2]))), res);
478
+ Object.assign(res, Object.fromEntries(await this.ctx.database.get("riichi-city.accounts", { userId: userIds }).then((x) => x.map((x2) => [x2.userId, x2]))));
479
479
  return res;
480
480
  }
481
481
  async setAccounts(accounts) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hieuzest/koishi-plugin-riichi-city",
3
3
  "description": "",
4
- "version": "0.4.1",
4
+ "version": "0.4.3",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [