@duque.edits/sdk 1.3.5 → 1.3.6

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.
@@ -58,22 +58,19 @@ class GuildUserManager extends import_base.BaseManager {
58
58
  return this.cache;
59
59
  }
60
60
  async updateMany(...users) {
61
- users = users.map((a) => {
62
- if (!a.id) return;
63
- const user = this.cache.get(a.id);
64
- const userWrapped = user.userDailyWrapper(a);
65
- const finalUser = {
66
- ...a,
67
- daily: userWrapped.daily,
68
- consecutive_wins: userWrapped.consecutive_wins
69
- };
70
- return finalUser;
71
- });
61
+ if (!users || !Array.isArray(users)) return;
62
+ let payloadUsers = [];
63
+ for (let user of users) {
64
+ if (!user.id) continue;
65
+ const _user = this.cache.get(user.id);
66
+ const { daily, consecutive_wins } = _user.userDailyWrapper(user);
67
+ payloadUsers.push({ ...user, daily, consecutive_wins });
68
+ }
72
69
  const url = this.base_url;
73
70
  const response = await this.rest.request({
74
71
  method: "PATCH",
75
72
  url,
76
- payload: { users }
73
+ payload: { users: payloadUsers }
77
74
  });
78
75
  return this.set(response);
79
76
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@duque.edits/sdk",
3
- "version": "1.3.5",
3
+ "version": "1.3.6",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",