@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 +1 -0
- package/lib/api.js +2 -0
- package/lib/index.js +1 -1
- package/package.json +1 -1
package/lib/api.d.ts
CHANGED
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])))
|
|
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) {
|