@duque.edits/sdk 1.1.0 → 1.1.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.
Files changed (161) hide show
  1. package/dist/{index-C87LbIta.d.ts → index-BPxglVSk.d.ts} +83 -31
  2. package/dist/{index-BHHXH2xN.d.mts → index-DjHimKUy.d.mts} +83 -31
  3. package/dist/index.d.mts +2 -1
  4. package/dist/index.d.ts +2 -1
  5. package/dist/index.js +481 -292
  6. package/dist/index.mjs +481 -292
  7. package/dist/managers/automaticmessage/AutomaticMessageManager.d.mts +2 -1
  8. package/dist/managers/automaticmessage/AutomaticMessageManager.d.ts +2 -1
  9. package/dist/managers/automaticmessage/AutomaticMessageManager.js +41 -35
  10. package/dist/managers/automaticmessage/AutomaticMessageManager.mjs +41 -35
  11. package/dist/managers/base.d.mts +2 -1
  12. package/dist/managers/base.d.ts +2 -1
  13. package/dist/managers/base.js +3 -0
  14. package/dist/managers/base.mjs +3 -0
  15. package/dist/managers/bet/GuildBetManager.d.mts +2 -1
  16. package/dist/managers/bet/GuildBetManager.d.ts +2 -1
  17. package/dist/managers/bet/GuildBetManager.js +42 -30
  18. package/dist/managers/bet/GuildBetManager.mjs +42 -30
  19. package/dist/managers/betuser/GuildBetUserManager.d.mts +2 -1
  20. package/dist/managers/betuser/GuildBetUserManager.d.ts +2 -1
  21. package/dist/managers/betuser/GuildBetUserManager.js +32 -19
  22. package/dist/managers/betuser/GuildBetUserManager.mjs +32 -19
  23. package/dist/managers/buffer/BufferManager.d.mts +2 -1
  24. package/dist/managers/buffer/BufferManager.d.ts +2 -1
  25. package/dist/managers/buffer/BufferManager.js +1 -1
  26. package/dist/managers/buffer/BufferManager.mjs +1 -1
  27. package/dist/managers/guild/GuildManager.d.mts +2 -1
  28. package/dist/managers/guild/GuildManager.d.ts +2 -1
  29. package/dist/managers/guild/GuildManager.js +465 -279
  30. package/dist/managers/guild/GuildManager.mjs +465 -279
  31. package/dist/managers/index.d.mts +2 -1
  32. package/dist/managers/index.d.ts +2 -1
  33. package/dist/managers/index.js +480 -291
  34. package/dist/managers/index.mjs +480 -291
  35. package/dist/managers/logs/LogManager.d.mts +2 -1
  36. package/dist/managers/logs/LogManager.d.ts +2 -1
  37. package/dist/managers/logs/LogManager.js +24 -12
  38. package/dist/managers/logs/LogManager.mjs +24 -12
  39. package/dist/managers/match/GuildMatchManager.d.mts +2 -1
  40. package/dist/managers/match/GuildMatchManager.d.ts +2 -1
  41. package/dist/managers/match/GuildMatchManager.js +77 -61
  42. package/dist/managers/match/GuildMatchManager.mjs +77 -61
  43. package/dist/managers/mediator/GuildMediatorManager.d.mts +2 -1
  44. package/dist/managers/mediator/GuildMediatorManager.d.ts +2 -1
  45. package/dist/managers/mediator/GuildMediatorManager.js +30 -17
  46. package/dist/managers/mediator/GuildMediatorManager.mjs +30 -17
  47. package/dist/managers/message/MessagesManager.d.mts +2 -1
  48. package/dist/managers/message/MessagesManager.d.ts +2 -1
  49. package/dist/managers/minesgame/MinesGameManager.d.mts +2 -1
  50. package/dist/managers/minesgame/MinesGameManager.d.ts +2 -1
  51. package/dist/managers/minesgame/MinesGameManager.js +22 -13
  52. package/dist/managers/minesgame/MinesGameManager.mjs +22 -13
  53. package/dist/managers/permission/GuildPermissionManager.d.mts +2 -1
  54. package/dist/managers/permission/GuildPermissionManager.d.ts +2 -1
  55. package/dist/managers/permission/GuildPermissionManager.js +4 -1
  56. package/dist/managers/permission/GuildPermissionManager.mjs +4 -1
  57. package/dist/managers/player/PlayerManager.d.mts +2 -1
  58. package/dist/managers/player/PlayerManager.d.ts +2 -1
  59. package/dist/managers/ticket/TicketManager.d.mts +2 -1
  60. package/dist/managers/ticket/TicketManager.d.ts +2 -1
  61. package/dist/managers/ticket/TicketManager.js +42 -28
  62. package/dist/managers/ticket/TicketManager.mjs +42 -28
  63. package/dist/managers/tournament/TournamentManager.d.mts +21 -0
  64. package/dist/managers/tournament/TournamentManager.d.ts +21 -0
  65. package/dist/managers/tournament/TournamentManager.js +753 -0
  66. package/dist/managers/tournament/TournamentManager.mjs +745 -0
  67. package/dist/managers/user/GuildUserManager.d.mts +2 -1
  68. package/dist/managers/user/GuildUserManager.d.ts +2 -1
  69. package/dist/managers/user/GuildUserManager.js +49 -36
  70. package/dist/managers/user/GuildUserManager.mjs +49 -36
  71. package/dist/managers/vipmember/VipMemberManager.d.mts +2 -1
  72. package/dist/managers/vipmember/VipMemberManager.d.ts +2 -1
  73. package/dist/managers/vipmember/VipMemberManager.js +4 -1
  74. package/dist/managers/vipmember/VipMemberManager.mjs +4 -1
  75. package/dist/rest/REST.d.mts +2 -1
  76. package/dist/rest/REST.d.ts +2 -1
  77. package/dist/rest/REST.js +482 -293
  78. package/dist/rest/REST.mjs +482 -293
  79. package/dist/rest/Routes.js +1 -1
  80. package/dist/rest/Routes.mjs +1 -1
  81. package/dist/rest/index.d.mts +2 -1
  82. package/dist/rest/index.d.ts +2 -1
  83. package/dist/rest/index.js +482 -293
  84. package/dist/rest/index.mjs +482 -293
  85. package/dist/structures/automaticmessage/AutomaticMessage.d.mts +2 -1
  86. package/dist/structures/automaticmessage/AutomaticMessage.d.ts +2 -1
  87. package/dist/structures/automaticmessage/AutomaticMessage.js +30 -26
  88. package/dist/structures/automaticmessage/AutomaticMessage.mjs +30 -26
  89. package/dist/structures/bet/GuildBet.d.mts +2 -1
  90. package/dist/structures/bet/GuildBet.d.ts +2 -1
  91. package/dist/structures/bet/GuildBet.js +39 -30
  92. package/dist/structures/bet/GuildBet.mjs +39 -30
  93. package/dist/structures/betuser/GuildBetUser.d.mts +2 -1
  94. package/dist/structures/betuser/GuildBetUser.d.ts +2 -1
  95. package/dist/structures/betuser/GuildBetUser.js +29 -19
  96. package/dist/structures/betuser/GuildBetUser.mjs +29 -19
  97. package/dist/structures/guild/Guild.d.mts +2 -1
  98. package/dist/structures/guild/Guild.d.ts +2 -1
  99. package/dist/structures/guild/Guild.js +451 -274
  100. package/dist/structures/guild/Guild.mjs +451 -274
  101. package/dist/structures/index.d.mts +2 -1
  102. package/dist/structures/index.d.ts +2 -1
  103. package/dist/structures/index.js +468 -288
  104. package/dist/structures/index.mjs +468 -288
  105. package/dist/structures/logentry/LogEntry.d.mts +2 -1
  106. package/dist/structures/logentry/LogEntry.d.ts +2 -1
  107. package/dist/structures/logentry/LogEntry.js +21 -12
  108. package/dist/structures/logentry/LogEntry.mjs +21 -12
  109. package/dist/structures/match/GuildMatch.d.mts +2 -1
  110. package/dist/structures/match/GuildMatch.d.ts +2 -1
  111. package/dist/structures/match/GuildMatch.js +74 -61
  112. package/dist/structures/match/GuildMatch.mjs +74 -61
  113. package/dist/structures/mediator/GuildMediator.d.mts +2 -1
  114. package/dist/structures/mediator/GuildMediator.d.ts +2 -1
  115. package/dist/structures/mediator/GuildMediator.js +27 -17
  116. package/dist/structures/mediator/GuildMediator.mjs +27 -17
  117. package/dist/structures/minesgame/MinesGame.d.mts +2 -1
  118. package/dist/structures/minesgame/MinesGame.d.ts +2 -1
  119. package/dist/structures/minesgame/MinesGame.js +22 -13
  120. package/dist/structures/minesgame/MinesGame.mjs +22 -13
  121. package/dist/structures/ticket/Ticket.d.mts +2 -1
  122. package/dist/structures/ticket/Ticket.d.ts +2 -1
  123. package/dist/structures/ticket/Ticket.js +27 -18
  124. package/dist/structures/ticket/Ticket.mjs +27 -18
  125. package/dist/structures/tournament/Tournament.d.mts +21 -0
  126. package/dist/structures/tournament/Tournament.d.ts +21 -0
  127. package/dist/structures/tournament/Tournament.js +593 -0
  128. package/dist/structures/tournament/Tournament.mjs +585 -0
  129. package/dist/structures/user/GuildUser.d.mts +2 -1
  130. package/dist/structures/user/GuildUser.d.ts +2 -1
  131. package/dist/structures/user/GuildUser.js +46 -36
  132. package/dist/structures/user/GuildUser.mjs +46 -36
  133. package/dist/structures/vipmember/VipMember.d.mts +2 -1
  134. package/dist/structures/vipmember/VipMember.d.ts +2 -1
  135. package/dist/structures/vipmember/VipMember.js +1 -1
  136. package/dist/structures/vipmember/VipMember.mjs +1 -1
  137. package/dist/types/RestTypes.d.mts +2 -1
  138. package/dist/types/RestTypes.d.ts +2 -1
  139. package/dist/types/api/APIAutomaticMessage.d.mts +2 -1
  140. package/dist/types/api/APIAutomaticMessage.d.ts +2 -1
  141. package/dist/types/api/APIGuild.d.mts +2 -1
  142. package/dist/types/api/APIGuild.d.ts +2 -1
  143. package/dist/types/api/APIGuildBet.d.mts +2 -1
  144. package/dist/types/api/APIGuildBet.d.ts +2 -1
  145. package/dist/types/api/APIGuildBetUser.d.mts +2 -1
  146. package/dist/types/api/APIGuildBetUser.d.ts +2 -1
  147. package/dist/types/api/APIGuildGroupedChannel.d.mts +2 -1
  148. package/dist/types/api/APIGuildGroupedChannel.d.ts +2 -1
  149. package/dist/types/api/APIGuildMatch.d.mts +2 -1
  150. package/dist/types/api/APIGuildMatch.d.ts +2 -1
  151. package/dist/types/api/APIGuildUser.d.mts +2 -1
  152. package/dist/types/api/APIGuildUser.d.ts +2 -1
  153. package/dist/types/api/APITournament.d.mts +16 -0
  154. package/dist/types/api/APITournament.d.ts +16 -0
  155. package/dist/types/api/APITournament.js +18 -0
  156. package/dist/types/api/APITournament.mjs +0 -0
  157. package/dist/types/api/index.d.mts +2 -1
  158. package/dist/types/api/index.d.ts +2 -1
  159. package/dist/types/index.d.mts +2 -1
  160. package/dist/types/index.d.ts +2 -1
  161. package/package.json +1 -1
@@ -401,7 +401,7 @@ var require_main = __commonJS({
401
401
  var structures_exports = {};
402
402
  __export(structures_exports, {
403
403
  Collection: () => Collection,
404
- Guild: () => Guild,
404
+ Guild: () => Guild2,
405
405
  GuildBet: () => GuildBet,
406
406
  GuildBetUser: () => GuildBetUser,
407
407
  GuildMatch: () => GuildMatch,
@@ -510,12 +510,15 @@ var BaseManager = class {
510
510
  this.rest = guild.rest;
511
511
  this.cache = new Collection();
512
512
  }
513
+ toJSON() {
514
+ return [...this.cache.values()].map((m) => m && "toJSON" in m && typeof m.toJSON === "function" ? m.toJSON() : m);
515
+ }
513
516
  };
514
517
 
515
518
  // src/rest/Routes.ts
516
519
  var Routes = {
517
520
  //base: "http://localhost:80/api/v1",
518
- base: "https://duque-api.up.railway.app/api/v1",
521
+ base: "https://duqueapi.shardweb.app/api/v1",
519
522
  field: (field) => `/${field}`,
520
523
  fields: (...fields) => `${fields.join("/")}`,
521
524
  guilds: {
@@ -671,7 +674,8 @@ var Assertion = class {
671
674
  var import_undici = require("undici");
672
675
 
673
676
  // src/structures/betuser/GuildBetUser.ts
674
- var GuildBetUser = class _GuildBetUser {
677
+ var _GuildBetUser_instances, updateInternals_fn;
678
+ var _GuildBetUser = class _GuildBetUser {
675
679
  /**
676
680
  * Bet user
677
681
  * @param data The user's data
@@ -679,6 +683,7 @@ var GuildBetUser = class _GuildBetUser {
679
683
  * @param rest The rest client
680
684
  */
681
685
  constructor(data, manager) {
686
+ __privateAdd(this, _GuildBetUser_instances);
682
687
  /** User daily */
683
688
  __publicField(this, "daily");
684
689
  __publicField(this, "profile");
@@ -773,7 +778,7 @@ var GuildBetUser = class _GuildBetUser {
773
778
  url: route,
774
779
  payload
775
780
  });
776
- return this._updateInternals(response);
781
+ return __privateMethod(this, _GuildBetUser_instances, updateInternals_fn).call(this, response);
777
782
  }
778
783
  async updateProfile(data) {
779
784
  const _data = {
@@ -793,20 +798,7 @@ var GuildBetUser = class _GuildBetUser {
793
798
  url: route,
794
799
  payload: _data
795
800
  });
796
- return this._updateInternals(response);
797
- }
798
- _updateInternals(data) {
799
- for (let key in data) {
800
- if (key === "id" || key === "createdAt") continue;
801
- if (key in this) {
802
- this[key] = data[key];
803
- }
804
- }
805
- this.updatedAt = /* @__PURE__ */ new Date();
806
- this.createdAt = new Date(data.createdAt);
807
- this.manager.set(this);
808
- this.rest.emit("betuserUpdate", this);
809
- return this;
801
+ return __privateMethod(this, _GuildBetUser_instances, updateInternals_fn).call(this, response);
810
802
  }
811
803
  /**
812
804
  * Update certain property
@@ -843,7 +835,7 @@ var GuildBetUser = class _GuildBetUser {
843
835
  url: route,
844
836
  payload
845
837
  });
846
- return this._updateInternals(response);
838
+ return __privateMethod(this, _GuildBetUser_instances, updateInternals_fn).call(this, response);
847
839
  }
848
840
  async _update(data) {
849
841
  const route = Routes.guilds.betusers.get(this.manager.guild.id, this.id);
@@ -853,7 +845,7 @@ var GuildBetUser = class _GuildBetUser {
853
845
  url: route,
854
846
  payload
855
847
  });
856
- return this._updateInternals(response);
848
+ return __privateMethod(this, _GuildBetUser_instances, updateInternals_fn).call(this, response);
857
849
  }
858
850
  async delete() {
859
851
  const route = Routes.guilds.betusers.delete(this.manager.guild.id, this.id);
@@ -877,6 +869,21 @@ var GuildBetUser = class _GuildBetUser {
877
869
  return json;
878
870
  }
879
871
  };
872
+ _GuildBetUser_instances = new WeakSet();
873
+ updateInternals_fn = function(data) {
874
+ for (let key in data) {
875
+ if (key === "id" || key === "createdAt") continue;
876
+ if (key in this) {
877
+ this[key] = data[key];
878
+ }
879
+ }
880
+ this.updatedAt = /* @__PURE__ */ new Date();
881
+ this.createdAt = new Date(data.createdAt);
882
+ this.manager.set(this);
883
+ this.rest.emit("betuserUpdate", this);
884
+ return this;
885
+ };
886
+ var GuildBetUser = _GuildBetUser;
880
887
 
881
888
  // src/managers/betuser/GuildBetUserManager.ts
882
889
  var GuildBetUserManager = class extends BaseManager {
@@ -954,7 +961,8 @@ var GuildBetUserManager = class extends BaseManager {
954
961
  };
955
962
 
956
963
  // src/structures/mediator/GuildMediator.ts
957
- var GuildMediator = class _GuildMediator {
964
+ var _GuildMediator_instances, updateInternals_fn2;
965
+ var _GuildMediator = class _GuildMediator {
958
966
  /**
959
967
  * Bet user
960
968
  * @param data The user's data
@@ -962,6 +970,7 @@ var GuildMediator = class _GuildMediator {
962
970
  * @param rest The rest client
963
971
  */
964
972
  constructor(data, manager) {
973
+ __privateAdd(this, _GuildMediator_instances);
965
974
  /** User's name */
966
975
  __publicField(this, "id");
967
976
  __publicField(this, "guild_id");
@@ -1020,19 +1029,7 @@ var GuildMediator = class _GuildMediator {
1020
1029
  url: route,
1021
1030
  payload
1022
1031
  });
1023
- return this._updateInternals(response);
1024
- }
1025
- _updateInternals(data) {
1026
- for (let key in data) {
1027
- if (key === "id" || key === "createdAt") continue;
1028
- if (key in this) {
1029
- this[key] = data[key];
1030
- }
1031
- }
1032
- this.updatedAt = /* @__PURE__ */ new Date();
1033
- this.createdAt = new Date(data.createdAt);
1034
- this.manager.set(this);
1035
- return this;
1032
+ return __privateMethod(this, _GuildMediator_instances, updateInternals_fn2).call(this, response);
1036
1033
  }
1037
1034
  /**
1038
1035
  * Update certain property
@@ -1047,7 +1044,7 @@ var GuildMediator = class _GuildMediator {
1047
1044
  url: route,
1048
1045
  payload
1049
1046
  });
1050
- return this._updateInternals(response);
1047
+ return __privateMethod(this, _GuildMediator_instances, updateInternals_fn2).call(this, response);
1051
1048
  }
1052
1049
  async setPaymentlink(type, link) {
1053
1050
  const route = Routes.guilds.mediators.get(this.manager.guild.id, this.id);
@@ -1057,7 +1054,7 @@ var GuildMediator = class _GuildMediator {
1057
1054
  url: route,
1058
1055
  payload
1059
1056
  });
1060
- return this._updateInternals(response);
1057
+ return __privateMethod(this, _GuildMediator_instances, updateInternals_fn2).call(this, response);
1061
1058
  }
1062
1059
  async delete() {
1063
1060
  const route = Routes.guilds.mediators.delete(this.manager.guild.id, this.id);
@@ -1080,6 +1077,20 @@ var GuildMediator = class _GuildMediator {
1080
1077
  return json;
1081
1078
  }
1082
1079
  };
1080
+ _GuildMediator_instances = new WeakSet();
1081
+ updateInternals_fn2 = function(data) {
1082
+ for (let key in data) {
1083
+ if (key === "id" || key === "createdAt") continue;
1084
+ if (key in this) {
1085
+ this[key] = data[key];
1086
+ }
1087
+ }
1088
+ this.updatedAt = /* @__PURE__ */ new Date();
1089
+ this.createdAt = new Date(data.createdAt);
1090
+ this.manager.set(this);
1091
+ return this;
1092
+ };
1093
+ var GuildMediator = _GuildMediator;
1083
1094
 
1084
1095
  // src/managers/mediator/GuildMediatorManager.ts
1085
1096
  var GuildMediatorManager = class extends BaseManager {
@@ -1164,14 +1175,150 @@ var GuildMediatorManager = class extends BaseManager {
1164
1175
  }
1165
1176
  };
1166
1177
 
1178
+ // src/structures/tournament/Tournament.ts
1179
+ var _Tournament_instances, updateInternals_fn3;
1180
+ var Tournament = class {
1181
+ constructor(data, manager) {
1182
+ __privateAdd(this, _Tournament_instances);
1183
+ __publicField(this, "_id");
1184
+ __publicField(this, "guild_id");
1185
+ __publicField(this, "type");
1186
+ __publicField(this, "max_teams");
1187
+ __publicField(this, "teams");
1188
+ __publicField(this, "message");
1189
+ __publicField(this, "message_id");
1190
+ __publicField(this, "status");
1191
+ __publicField(this, "createdAt");
1192
+ __publicField(this, "updatedAt");
1193
+ __publicField(this, "guild");
1194
+ __publicField(this, "rest");
1195
+ __publicField(this, "manager");
1196
+ __publicField(this, "data");
1197
+ this.manager = manager;
1198
+ this.guild = manager.guild;
1199
+ this.rest = manager.rest;
1200
+ this.guild_id = data?.guild_id;
1201
+ this.type = data?.type;
1202
+ this.teams = data?.teams;
1203
+ this.message = data?.message;
1204
+ this.message_id = data?.message_id;
1205
+ this.status = data?.status;
1206
+ this.createdAt = data?.createdAt ? new Date(data?.createdAt) : /* @__PURE__ */ new Date();
1207
+ this.updatedAt = data?.updatedAt ? new Date(data?.updatedAt) : /* @__PURE__ */ new Date();
1208
+ this.data = data;
1209
+ }
1210
+ async fetch() {
1211
+ const route = Routes.fields("guilds", this.guild.id, "tournaments", this._id);
1212
+ const response = await this.rest.request({
1213
+ method: "get",
1214
+ url: route
1215
+ });
1216
+ return __privateMethod(this, _Tournament_instances, updateInternals_fn3).call(this, response);
1217
+ }
1218
+ async update(data) {
1219
+ const route = Routes.fields("guilds", this.guild.id, "tournaments", this._id);
1220
+ const response = await this.rest.request({
1221
+ method: "patch",
1222
+ url: route,
1223
+ payload: data
1224
+ });
1225
+ return __privateMethod(this, _Tournament_instances, updateInternals_fn3).call(this, response);
1226
+ }
1227
+ toJSON() {
1228
+ return {
1229
+ guild_id: this.guild_id,
1230
+ type: this.type,
1231
+ max_teams: this.max_teams,
1232
+ teams: this.teams,
1233
+ message: this.message,
1234
+ message_id: this.message_id,
1235
+ status: this.status,
1236
+ createdAt: this.createdAt ? new Date(this?.createdAt) : /* @__PURE__ */ new Date(),
1237
+ updatedAt: this.updatedAt ? new Date(this?.updatedAt) : /* @__PURE__ */ new Date()
1238
+ };
1239
+ }
1240
+ };
1241
+ _Tournament_instances = new WeakSet();
1242
+ updateInternals_fn3 = function(data) {
1243
+ for (let key in data) {
1244
+ if (key === "id" || key === "createdAt") continue;
1245
+ if (key in this) {
1246
+ this[key] = data[key];
1247
+ }
1248
+ }
1249
+ this.updatedAt = /* @__PURE__ */ new Date();
1250
+ this.createdAt = new Date(data.createdAt);
1251
+ this.manager._add(this);
1252
+ return this;
1253
+ };
1254
+
1255
+ // src/managers/tournament/TournamentManager.ts
1256
+ var TournamentManager = class extends BaseManager {
1257
+ constructor(guild) {
1258
+ super(guild);
1259
+ this.guild = guild;
1260
+ this.rest = guild.rest;
1261
+ this.base_url = Routes.guilds.resource(guild.id, "tournaments");
1262
+ this.cache = new Collection();
1263
+ }
1264
+ async fetch(options) {
1265
+ if (options && options.cache) return this.cache;
1266
+ if (options && options.tournamentId) {
1267
+ const response2 = await this.rest.request({
1268
+ method: "GET",
1269
+ url: Routes.fields(this.base_url, options.tournamentId)
1270
+ });
1271
+ const tournament = new Tournament(response2, this);
1272
+ this._add(tournament);
1273
+ return tournament;
1274
+ }
1275
+ const response = await this.rest.request({
1276
+ method: "GET",
1277
+ url: this.base_url
1278
+ });
1279
+ return this.set(response);
1280
+ }
1281
+ set(data) {
1282
+ this.cache.clear();
1283
+ if (Array.isArray(data)) {
1284
+ for (let _m of data) {
1285
+ if (!_m._id) continue;
1286
+ if (_m instanceof Tournament) this.cache.set(_m._id, _m);
1287
+ else this.cache.set(_m._id, new Tournament(_m, this));
1288
+ }
1289
+ } else {
1290
+ if (!data._id) return this.cache;
1291
+ if (data instanceof Tournament) this.cache.set(data._id, data);
1292
+ else this.cache.set(data._id, new Tournament(data, this));
1293
+ }
1294
+ return this.cache;
1295
+ }
1296
+ _add(data) {
1297
+ if (Array.isArray(data)) {
1298
+ for (let _m of data) {
1299
+ if (!_m._id) continue;
1300
+ if (_m instanceof Tournament) this.cache.set(_m._id, _m);
1301
+ else this.cache.set(_m._id, new Tournament(_m, this));
1302
+ }
1303
+ } else {
1304
+ if (!data._id) return this.cache;
1305
+ if (data instanceof Tournament) this.cache.set(data._id, data);
1306
+ else this.cache.set(data._id, new Tournament(data, this));
1307
+ }
1308
+ return this.cache;
1309
+ }
1310
+ };
1311
+
1167
1312
  // src/structures/guild/Guild.ts
1168
- var Guild = class {
1313
+ var _Guild_instances, updateInternals_fn4;
1314
+ var Guild2 = class {
1169
1315
  /**
1170
1316
  * The guild structure
1171
1317
  * @param data The guild's data
1172
1318
  * @param rest The rest client
1173
1319
  */
1174
1320
  constructor(data, rest) {
1321
+ __privateAdd(this, _Guild_instances);
1175
1322
  /** The data of this guild */
1176
1323
  __publicField(this, "data");
1177
1324
  /** The rest client */
@@ -1197,6 +1344,7 @@ var Guild = class {
1197
1344
  __publicField(this, "roulette_settings");
1198
1345
  /** Guild Prefix */
1199
1346
  __publicField(this, "prefix");
1347
+ __publicField(this, "prefixes");
1200
1348
  /** Guild Creation Date */
1201
1349
  __publicField(this, "createdAt");
1202
1350
  /** Guild Updated Date */
@@ -1216,6 +1364,7 @@ var Guild = class {
1216
1364
  __publicField(this, "mediators");
1217
1365
  __publicField(this, "automatic_messages");
1218
1366
  __publicField(this, "automaticMessagesManager");
1367
+ __publicField(this, "tournaments");
1219
1368
  __publicField(this, "adverts");
1220
1369
  __publicField(this, "codes");
1221
1370
  __publicField(this, "coin_symbol");
@@ -1230,6 +1379,7 @@ var Guild = class {
1230
1379
  this.scores = data?.scores;
1231
1380
  this.codes = data?.codes;
1232
1381
  this.prefix = data?.prefix;
1382
+ this.prefixes = data?.prefixes;
1233
1383
  this.status = data?.status;
1234
1384
  this.tickets_configuration = data?.tickets_configuration;
1235
1385
  this.automatic_messages = data?.automatic_messages;
@@ -1250,6 +1400,7 @@ var Guild = class {
1250
1400
  this.bets = new GuildBetManager(this);
1251
1401
  this.mediators = new GuildMediatorManager(this);
1252
1402
  this.automaticMessagesManager = new AutomaticMessageManager(this);
1403
+ this.tournaments = new TournamentManager(this);
1253
1404
  this.adverts = [];
1254
1405
  for (let _adv of data?.adverts || []) {
1255
1406
  this.adverts.push({
@@ -1286,7 +1437,7 @@ var Guild = class {
1286
1437
  url: route,
1287
1438
  payload: { channels }
1288
1439
  });
1289
- this._updateInternals(response);
1440
+ __privateMethod(this, _Guild_instances, updateInternals_fn4).call(this, response);
1290
1441
  return response.channels.find((t) => t.type === type);
1291
1442
  }
1292
1443
  }
@@ -1301,7 +1452,7 @@ var Guild = class {
1301
1452
  url: route,
1302
1453
  payload: { permissions }
1303
1454
  });
1304
- this._updateInternals(response);
1455
+ __privateMethod(this, _Guild_instances, updateInternals_fn4).call(this, response);
1305
1456
  return response.permissions.find((t) => t.type === type);
1306
1457
  }
1307
1458
  }
@@ -1310,26 +1461,26 @@ var Guild = class {
1310
1461
  const route = Routes.guilds.get(this.id);
1311
1462
  const payload = { adverts: this.adverts };
1312
1463
  const response = await this.rest.request({ method: "PATCH", url: route, payload });
1313
- return this._updateInternals(response);
1464
+ return __privateMethod(this, _Guild_instances, updateInternals_fn4).call(this, response);
1314
1465
  }
1315
1466
  async removeAdvert(advertId) {
1316
1467
  const route = Routes.guilds.get(this.id);
1317
1468
  const payload = { adverts: this.adverts.filter((a) => a._id !== advertId) };
1318
1469
  const response = await this.rest.request({ method: "PATCH", url: route, payload });
1319
- return this._updateInternals(response);
1470
+ return __privateMethod(this, _Guild_instances, updateInternals_fn4).call(this, response);
1320
1471
  }
1321
1472
  async createCode(data) {
1322
1473
  this.codes.push(data);
1323
1474
  const route = Routes.guilds.get(this.id);
1324
1475
  const payload = { codes: this.codes };
1325
1476
  const response = await this.rest.request({ method: "PATCH", url: route, payload });
1326
- return this._updateInternals(response);
1477
+ return __privateMethod(this, _Guild_instances, updateInternals_fn4).call(this, response);
1327
1478
  }
1328
1479
  async removeCode(codeId) {
1329
1480
  const route = Routes.guilds.get(this.id);
1330
1481
  const payload = { codes: this.codes.filter((a) => a._id !== codeId) };
1331
1482
  const response = await this.rest.request({ method: "PATCH", url: route, payload });
1332
- return this._updateInternals(response);
1483
+ return __privateMethod(this, _Guild_instances, updateInternals_fn4).call(this, response);
1333
1484
  }
1334
1485
  async addIdToChannel(type, id) {
1335
1486
  const channel = this.channels.find((c) => c.type === type);
@@ -1348,7 +1499,7 @@ var Guild = class {
1348
1499
  url: route,
1349
1500
  payload
1350
1501
  });
1351
- return this._updateInternals(response);
1502
+ return __privateMethod(this, _Guild_instances, updateInternals_fn4).call(this, response);
1352
1503
  }
1353
1504
  async setChannelIds(type, ...ids) {
1354
1505
  const channel = this.channels.find((c) => c.type === type);
@@ -1367,7 +1518,7 @@ var Guild = class {
1367
1518
  url: route,
1368
1519
  payload
1369
1520
  });
1370
- return this._updateInternals(response);
1521
+ return __privateMethod(this, _Guild_instances, updateInternals_fn4).call(this, response);
1371
1522
  }
1372
1523
  async removeIdInChannel(type, id) {
1373
1524
  const chIndex = this.channels.findIndex((c) => c.type === type);
@@ -1389,7 +1540,7 @@ var Guild = class {
1389
1540
  url: route,
1390
1541
  payload
1391
1542
  });
1392
- return this._updateInternals(response);
1543
+ return __privateMethod(this, _Guild_instances, updateInternals_fn4).call(this, response);
1393
1544
  }
1394
1545
  async updateRouletteSettings(data) {
1395
1546
  const _data = {
@@ -1446,58 +1597,21 @@ var Guild = class {
1446
1597
  this.logEntries.fetch(),
1447
1598
  this.betusers.fetch(),
1448
1599
  this.bets.fetch(),
1449
- this.mediators.fetch()
1600
+ this.mediators.fetch(),
1601
+ this.tournaments.fetch()
1450
1602
  ]);
1451
1603
  return this;
1452
1604
  }
1453
- _updateInternals(data) {
1454
- for (let key in data) {
1455
- if (key === "id" || key === "createdAt") continue;
1456
- if (key in this) {
1457
- this[key] = data[key];
1458
- }
1459
- if (key === "adverts") {
1460
- this.adverts = [];
1461
- for (let _adv of data.adverts) {
1462
- this.adverts.push({
1463
- _id: _adv._id,
1464
- admin_id: _adv.admin_id,
1465
- points_to_remove: _adv.points_to_remove,
1466
- role_id: _adv.role_id,
1467
- createdAt: _adv.createdAt ? new Date(_adv.createdAt) : /* @__PURE__ */ new Date(),
1468
- updatedAt: _adv.updatedAt ? new Date(_adv.updatedAt) : /* @__PURE__ */ new Date()
1469
- });
1470
- }
1471
- }
1472
- if (key === "code") {
1473
- this.codes = [];
1474
- for (let _adv of data.codes) {
1475
- this.codes.push({
1476
- _id: _adv._id,
1477
- admin_id: _adv.admin_id,
1478
- type: _adv.type,
1479
- add: _adv.add,
1480
- code: _adv.code,
1481
- expire: _adv.expire ? new Date(_adv.expire) : /* @__PURE__ */ new Date(),
1482
- createdAt: _adv.createdAt ? new Date(_adv.createdAt) : /* @__PURE__ */ new Date(),
1483
- updatedAt: _adv.updatedAt ? new Date(_adv.updatedAt) : /* @__PURE__ */ new Date()
1484
- });
1485
- }
1486
- }
1487
- }
1488
- this.automaticMessagesManager.set(this.automatic_messages);
1489
- this.updatedAt = /* @__PURE__ */ new Date();
1490
- this.rest.guilds.cache.set(this.id, this);
1491
- this.rest.emit("guildUpdate", this);
1492
- return this;
1493
- }
1494
1605
  async fetch() {
1495
1606
  const route = Routes.guilds.get(this.id);
1496
1607
  const response = await this.rest.request({
1497
1608
  method: "get",
1498
1609
  url: route
1499
1610
  });
1500
- return this._updateInternals(response);
1611
+ return __privateMethod(this, _Guild_instances, updateInternals_fn4).call(this, response);
1612
+ }
1613
+ async reset() {
1614
+ return this.update({ reset: true });
1501
1615
  }
1502
1616
  async update(data) {
1503
1617
  const route = Routes.guilds.get(this.id);
@@ -1506,16 +1620,7 @@ var Guild = class {
1506
1620
  url: route,
1507
1621
  payload: data
1508
1622
  });
1509
- for (const k in response) {
1510
- if (k === "id" || k == "createdAt") continue;
1511
- if (k in this) {
1512
- this[k] = response[k];
1513
- }
1514
- }
1515
- this.updatedAt = /* @__PURE__ */ new Date();
1516
- this.rest.guilds.cache.set(this.id, this);
1517
- this.rest.emit("guildUpdate", this);
1518
- return this;
1623
+ return __privateMethod(this, _Guild_instances, updateInternals_fn4).call(this, response);
1519
1624
  }
1520
1625
  async setStatus(key, status) {
1521
1626
  Assertion.assertString(key);
@@ -1540,16 +1645,27 @@ var Guild = class {
1540
1645
  await this.update({ prices: this.prices });
1541
1646
  return this;
1542
1647
  }
1543
- async setPrefix(prefix) {
1544
- Assertion.assertString(prefix);
1545
- const route = Routes.fields(Routes.guilds.resource(this.id, "prefix"));
1546
- const payload = { set: prefix };
1648
+ async addPrefix(prefixes) {
1649
+ const route = Routes.fields(Routes.guilds.resource(this.id, "prefixes"));
1650
+ const _p = Array.isArray(prefixes) ? prefixes : [prefixes];
1651
+ const payload = { set: [.../* @__PURE__ */ new Set([...this.prefixes, ..._p])] };
1652
+ const response = await this.rest.request({
1653
+ method: "PATCH",
1654
+ url: route,
1655
+ payload
1656
+ });
1657
+ __privateMethod(this, _Guild_instances, updateInternals_fn4).call(this, response);
1658
+ return this;
1659
+ }
1660
+ async setPrefix(prefixes) {
1661
+ const route = Routes.fields(Routes.guilds.resource(this.id, "prefixes"));
1662
+ const payload = { set: Array.isArray(prefixes) ? prefixes : [prefixes] };
1547
1663
  const response = await this.rest.request({
1548
1664
  method: "PATCH",
1549
1665
  url: route,
1550
1666
  payload
1551
1667
  });
1552
- this._updateInternals(response);
1668
+ __privateMethod(this, _Guild_instances, updateInternals_fn4).call(this, response);
1553
1669
  return this;
1554
1670
  }
1555
1671
  async toggleDailyCategory(category) {
@@ -1569,7 +1685,7 @@ var Guild = class {
1569
1685
  url: route,
1570
1686
  payload
1571
1687
  });
1572
- this._updateInternals(response);
1688
+ __privateMethod(this, _Guild_instances, updateInternals_fn4).call(this, response);
1573
1689
  return this;
1574
1690
  }
1575
1691
  async setScores(name, amount) {
@@ -1582,7 +1698,7 @@ var Guild = class {
1582
1698
  url: route,
1583
1699
  payload
1584
1700
  });
1585
- this._updateInternals(response);
1701
+ __privateMethod(this, _Guild_instances, updateInternals_fn4).call(this, response);
1586
1702
  return this;
1587
1703
  }
1588
1704
  async toggleMode(mode) {
@@ -1607,18 +1723,61 @@ var Guild = class {
1607
1723
  url: route,
1608
1724
  payload
1609
1725
  });
1610
- this._updateInternals(response);
1726
+ __privateMethod(this, _Guild_instances, updateInternals_fn4).call(this, response);
1611
1727
  return this;
1612
1728
  }
1613
1729
  };
1730
+ _Guild_instances = new WeakSet();
1731
+ updateInternals_fn4 = function(data) {
1732
+ for (let key in data) {
1733
+ if (key === "id" || key === "createdAt") continue;
1734
+ if (key in this) {
1735
+ this[key] = data[key];
1736
+ }
1737
+ if (key === "adverts") {
1738
+ this.adverts = [];
1739
+ for (let _adv of data.adverts) {
1740
+ this.adverts.push({
1741
+ _id: _adv._id,
1742
+ admin_id: _adv.admin_id,
1743
+ points_to_remove: _adv.points_to_remove,
1744
+ role_id: _adv.role_id,
1745
+ createdAt: _adv.createdAt ? new Date(_adv.createdAt) : /* @__PURE__ */ new Date(),
1746
+ updatedAt: _adv.updatedAt ? new Date(_adv.updatedAt) : /* @__PURE__ */ new Date()
1747
+ });
1748
+ }
1749
+ }
1750
+ if (key === "code") {
1751
+ this.codes = [];
1752
+ for (let _adv of data.codes) {
1753
+ this.codes.push({
1754
+ _id: _adv._id,
1755
+ admin_id: _adv.admin_id,
1756
+ type: _adv.type,
1757
+ add: _adv.add,
1758
+ code: _adv.code,
1759
+ expire: _adv.expire ? new Date(_adv.expire) : /* @__PURE__ */ new Date(),
1760
+ createdAt: _adv.createdAt ? new Date(_adv.createdAt) : /* @__PURE__ */ new Date(),
1761
+ updatedAt: _adv.updatedAt ? new Date(_adv.updatedAt) : /* @__PURE__ */ new Date()
1762
+ });
1763
+ }
1764
+ }
1765
+ }
1766
+ this.automaticMessagesManager.set(this.automatic_messages);
1767
+ this.updatedAt = /* @__PURE__ */ new Date();
1768
+ this.rest.guilds.cache.set(this.id, this);
1769
+ this.rest.emit("guildUpdate", this);
1770
+ return this;
1771
+ };
1614
1772
 
1615
1773
  // src/rest/REST.ts
1616
1774
  import_dotenv.default.config();
1617
1775
 
1618
1776
  // src/structures/automaticmessage/AutomaticMessage.ts
1777
+ var _AutomaticMessage_instances, updateInternals_fn5;
1619
1778
  var AutomaticMessage = class {
1620
1779
  constructor(data, manager) {
1621
- __publicField(this, "_id");
1780
+ __privateAdd(this, _AutomaticMessage_instances);
1622
1781
  __publicField(this, "id");
1623
1782
  __publicField(this, "type");
1624
1783
  __publicField(this, "admin_id");
@@ -1637,7 +1796,6 @@ var AutomaticMessage = class {
1637
1796
  this.manager = manager;
1638
1797
  this.guild = manager.guild;
1639
1798
  this.rest = manager.rest;
1640
- this._id = data?._id;
1641
1799
  this.id = data?.id;
1642
1800
  this.type = data?.type;
1643
1801
  this.admin_id = data?.admin_id;
@@ -1652,12 +1810,7 @@ var AutomaticMessage = class {
1652
1810
  this.updatedAt = data?.updatedAt ? new Date(data?.updatedAt) : /* @__PURE__ */ new Date();
1653
1811
  }
1654
1812
  async fetch() {
1655
- const route = Routes.guilds.resource(this.guild.id, "automatic_messages", this._id);
1656
- const response = await this.rest.request({
1657
- method: "get",
1658
- url: route
1659
- });
1660
- return this._updateInternals(response);
1813
+ return this.manager.fetch(this.id);
1661
1814
  }
1662
1815
  async addChannelId(...id) {
1663
1816
  const ids = [.../* @__PURE__ */ new Set([...this.channel_ids, ...id])];
@@ -1669,39 +1822,28 @@ var AutomaticMessage = class {
1669
1822
  return this.update({ channel_ids: ids });
1670
1823
  }
1671
1824
  async update(data) {
1825
+ this.manager.cache.set(this.id, { ...this, ...data, id: this.id });
1672
1826
  const route = Routes.guilds.get(this.guild.id);
1673
1827
  const response = await this.rest.request({
1674
1828
  method: "patch",
1675
1829
  url: route,
1676
- payload: { automatic_messages: this.manager.cache.toArray() }
1830
+ payload: { automatic_messages: this.manager.toJSON() }
1677
1831
  });
1678
- return this._updateInternals(response);
1832
+ return __privateMethod(this, _AutomaticMessage_instances, updateInternals_fn5).call(this, response);
1679
1833
  }
1680
1834
  async delete() {
1681
- this.manager.cache.delete(this._id);
1835
+ this.manager.cache.delete(this.id);
1836
+ this.guild.automatic_messages = this.manager.cache.toArray();
1682
1837
  const route = Routes.guilds.get(this.guild.id);
1683
1838
  const response = await this.rest.request({
1684
1839
  method: "patch",
1685
1840
  url: route,
1686
- payload: { automatic_messages: this.manager.cache.toArray() }
1841
+ payload: { automatic_messages: this.manager.toJSON() }
1687
1842
  });
1688
1843
  return this.manager.set(response.automatic_messages);
1689
1844
  }
1690
- _updateInternals(data) {
1691
- for (let key in data) {
1692
- if (key === "_id" || key === "createdAt") continue;
1693
- if (key in this) {
1694
- this[key] = data[key];
1695
- }
1696
- }
1697
- this.updatedAt = /* @__PURE__ */ new Date();
1698
- this.createdAt = new Date(data.createdAt);
1699
- this.manager._add(this);
1700
- return this;
1701
- }
1702
1845
  toJSON() {
1703
1846
  return {
1704
- _id: this._id,
1705
1847
  id: this.id,
1706
1848
  type: this.type,
1707
1849
  admin_id: this.admin_id,
@@ -1717,6 +1859,20 @@ var AutomaticMessage = class {
1717
1859
  };
1718
1860
  }
1719
1861
  };
1862
+ _AutomaticMessage_instances = new WeakSet();
1863
+ updateInternals_fn5 = function(data) {
1864
+ const _this = data?.automatic_messages?.find((m) => m.id === this.id);
1865
+ for (let key in _this) {
1866
+ if (key === "id" || key === "createdAt") continue;
1867
+ if (key in this) {
1868
+ this[key] = _this[key];
1869
+ }
1870
+ }
1871
+ this.updatedAt = /* @__PURE__ */ new Date();
1872
+ this.createdAt = new Date(data.createdAt);
1873
+ this.manager._add(data.automatic_messages);
1874
+ return this;
1875
+ };
1720
1876
 
1721
1877
  // src/utils/randomKeyGenerator.ts
1722
1878
  var import_crypto = require("crypto");
@@ -1730,25 +1886,19 @@ var AutomaticMessageManager = class extends BaseManager {
1730
1886
  super(guild);
1731
1887
  this.guild = guild;
1732
1888
  this.rest = guild.rest;
1733
- this.base_url = Routes.guilds.resource(guild.id, "automatic_messages");
1889
+ this.base_url = Routes.guilds.resource(guild.id);
1734
1890
  this.cache = new Collection();
1735
1891
  if (guild.automatic_messages && guild.automatic_messages.length !== 0) this.set(guild.automatic_messages);
1736
1892
  else this.guild.automatic_messages = [];
1737
1893
  }
1738
1894
  async fetch(messageId) {
1739
1895
  const route = this.base_url;
1740
- if (messageId) {
1741
- const response2 = await this.rest.request({
1742
- method: "get",
1743
- url: `${route}`
1744
- });
1745
- return this._add(response2).find((m) => m.id === messageId);
1746
- }
1747
1896
  const response = await this.rest.request({
1748
1897
  method: "get",
1749
1898
  url: route
1750
1899
  });
1751
- return this._add(response.automatic_messages);
1900
+ this._add(response.automatic_messages);
1901
+ return this.cache;
1752
1902
  }
1753
1903
  async create(data) {
1754
1904
  if (!data.type) throw new Error(`Missing message's type.`);
@@ -1775,6 +1925,7 @@ var AutomaticMessageManager = class extends BaseManager {
1775
1925
  if (data instanceof AutomaticMessage) this.cache.set(data.id, data);
1776
1926
  else this.cache.set(data.id, new AutomaticMessage(data, this));
1777
1927
  }
1928
+ this.guild.automatic_messages = this.cache.toArray();
1778
1929
  return this.cache;
1779
1930
  }
1780
1931
  set(data) {
@@ -1803,6 +1954,10 @@ var AutomaticMessageManager = class extends BaseManager {
1803
1954
  });
1804
1955
  return response;
1805
1956
  }
1957
+ toJSON() {
1958
+ [...this.cache.values()].map((m) => console.log(m instanceof AutomaticMessage));
1959
+ return this.cache.toArray();
1960
+ }
1806
1961
  };
1807
1962
 
1808
1963
  // src/managers/bet/GuildBetManager.ts
@@ -1955,7 +2110,8 @@ var LogManager = class extends BaseManager {
1955
2110
  };
1956
2111
 
1957
2112
  // src/structures/match/GuildMatch.ts
1958
- var GuildMatch = class _GuildMatch {
2113
+ var _GuildMatch_instances, updateInternals_fn6;
2114
+ var _GuildMatch = class _GuildMatch {
1959
2115
  /**
1960
2116
  * GuildMatch match
1961
2117
  * @param data The match's data
@@ -1963,6 +2119,7 @@ var GuildMatch = class _GuildMatch {
1963
2119
  * @param rest The rest client
1964
2120
  */
1965
2121
  constructor(data, manager) {
2122
+ __privateAdd(this, _GuildMatch_instances);
1966
2123
  __publicField(this, "_id");
1967
2124
  __publicField(this, "selections");
1968
2125
  /** Match's type */
@@ -2046,7 +2203,7 @@ var GuildMatch = class _GuildMatch {
2046
2203
  method: "get",
2047
2204
  url: route
2048
2205
  });
2049
- return await this._updateInternals(response);
2206
+ return await __privateMethod(this, _GuildMatch_instances, updateInternals_fn6).call(this, response);
2050
2207
  }
2051
2208
  async addConfirmed(type, id) {
2052
2209
  const confirmed = this.confirmed.find((c) => c.type === type);
@@ -2068,7 +2225,7 @@ var GuildMatch = class _GuildMatch {
2068
2225
  url: route,
2069
2226
  payload: set
2070
2227
  });
2071
- return await this._updateInternals(response);
2228
+ return await __privateMethod(this, _GuildMatch_instances, updateInternals_fn6).call(this, response);
2072
2229
  }
2073
2230
  async setStatus(status) {
2074
2231
  Assertion.assertString(status);
@@ -2079,7 +2236,7 @@ var GuildMatch = class _GuildMatch {
2079
2236
  url: route,
2080
2237
  payload
2081
2238
  });
2082
- return await this._updateInternals(response);
2239
+ return await __privateMethod(this, _GuildMatch_instances, updateInternals_fn6).call(this, response);
2083
2240
  }
2084
2241
  async setWinners(players) {
2085
2242
  if (!Array.isArray(players)) players = [players];
@@ -2090,7 +2247,7 @@ var GuildMatch = class _GuildMatch {
2090
2247
  url: route,
2091
2248
  payload
2092
2249
  });
2093
- return await this._updateInternals(response);
2250
+ return await __privateMethod(this, _GuildMatch_instances, updateInternals_fn6).call(this, response);
2094
2251
  }
2095
2252
  async setLoser(players) {
2096
2253
  if (!Array.isArray(players)) players = [players];
@@ -2101,7 +2258,7 @@ var GuildMatch = class _GuildMatch {
2101
2258
  url: route,
2102
2259
  payload
2103
2260
  });
2104
- return await this._updateInternals(response);
2261
+ return await __privateMethod(this, _GuildMatch_instances, updateInternals_fn6).call(this, response);
2105
2262
  }
2106
2263
  async setMvps(...usersId) {
2107
2264
  const payload = { set: usersId };
@@ -2111,7 +2268,7 @@ var GuildMatch = class _GuildMatch {
2111
2268
  url: route,
2112
2269
  payload
2113
2270
  });
2114
- return await this._updateInternals(response);
2271
+ return await __privateMethod(this, _GuildMatch_instances, updateInternals_fn6).call(this, response);
2115
2272
  }
2116
2273
  async setRoomCreatorId(userId) {
2117
2274
  Assertion.assertString(userId);
@@ -2122,7 +2279,7 @@ var GuildMatch = class _GuildMatch {
2122
2279
  url: route,
2123
2280
  payload
2124
2281
  });
2125
- return await this._updateInternals(response);
2282
+ return await __privateMethod(this, _GuildMatch_instances, updateInternals_fn6).call(this, response);
2126
2283
  }
2127
2284
  async setRoomAdminId(userId) {
2128
2285
  Assertion.assertString(userId);
@@ -2133,7 +2290,7 @@ var GuildMatch = class _GuildMatch {
2133
2290
  url: route,
2134
2291
  payload
2135
2292
  });
2136
- return await this._updateInternals(response);
2293
+ return await __privateMethod(this, _GuildMatch_instances, updateInternals_fn6).call(this, response);
2137
2294
  }
2138
2295
  async kick(player) {
2139
2296
  this.players = this.players.filter((p) => p.id !== player.id);
@@ -2157,7 +2314,7 @@ var GuildMatch = class _GuildMatch {
2157
2314
  payload: data
2158
2315
  });
2159
2316
  this.rest.emit("matchUpdate", this, new _GuildMatch(response, this.manager));
2160
- return await this._updateInternals(response);
2317
+ return await __privateMethod(this, _GuildMatch_instances, updateInternals_fn6).call(this, response);
2161
2318
  }
2162
2319
  async delete() {
2163
2320
  const route = Routes.guilds.matches.resource(this.guild.id, this._id);
@@ -2183,32 +2340,34 @@ var GuildMatch = class _GuildMatch {
2183
2340
  messages: this?.messages instanceof MessagesManager ? this.messages?.cache?.toArray() : []
2184
2341
  };
2185
2342
  }
2186
- async _updateInternals(data) {
2187
- if (!data) return;
2188
- for (let key in data) {
2189
- if (key === "id" || key === "createdAt" || key === "messages") continue;
2190
- if (key in this) {
2191
- this[key] = data[key];
2192
- }
2193
- if (key === "bet") {
2194
- this.bet = this.guild.bets.set(data.bet);
2195
- }
2343
+ };
2344
+ _GuildMatch_instances = new WeakSet();
2345
+ updateInternals_fn6 = async function(data) {
2346
+ if (!data) return;
2347
+ for (let key in data) {
2348
+ if (key === "id" || key === "createdAt" || key === "messages") continue;
2349
+ if (key in this) {
2350
+ this[key] = data[key];
2196
2351
  }
2197
- if (data?.messages?.length !== 0) {
2198
- if (this?.messages instanceof MessagesManager) this.messages.set(data.messages);
2199
- else {
2200
- this.messages = new MessagesManager(this, Routes.guilds.matches.resource(this.guild_id, this._id, "messages"));
2201
- this.messages.set(data.messages);
2202
- }
2352
+ if (key === "bet") {
2353
+ this.bet = this.guild.bets.set(data.bet);
2203
2354
  }
2204
- if (!(this.bet instanceof GuildBet) && data?.bet) {
2205
- this.bet = this.guild.bets.cache.get(data._id) ?? await this.guild.bets.fetch({ betId: data?.bet?._id });
2355
+ }
2356
+ if (data?.messages?.length !== 0) {
2357
+ if (this?.messages instanceof MessagesManager) this.messages.set(data.messages);
2358
+ else {
2359
+ this.messages = new MessagesManager(this, Routes.guilds.matches.resource(this.guild_id, this._id, "messages"));
2360
+ this.messages.set(data.messages);
2206
2361
  }
2207
- this.updatedAt = /* @__PURE__ */ new Date();
2208
- this.manager.set(this);
2209
- return this;
2210
2362
  }
2363
+ if (!(this.bet instanceof GuildBet) && data?.bet) {
2364
+ this.bet = this.guild.bets.cache.get(data._id) ?? await this.guild.bets.fetch({ betId: data?.bet?._id });
2365
+ }
2366
+ this.updatedAt = /* @__PURE__ */ new Date();
2367
+ this.manager.set(this);
2368
+ return this;
2211
2369
  };
2370
+ var GuildMatch = _GuildMatch;
2212
2371
 
2213
2372
  // src/managers/match/GuildMatchManager.ts
2214
2373
  var GuildMatchManager = class extends BaseManager {
@@ -2418,15 +2577,14 @@ var GuildTicketManager = class {
2418
2577
  } else {
2419
2578
  categories.push(data);
2420
2579
  }
2421
- const payload = { tickets_configuration: { categories } };
2422
- const route = Routes.guilds.get(this.guild.id);
2423
- const response = await this.rest.request({
2424
- method: "PATCH",
2425
- url: route,
2426
- payload
2580
+ return this.guild.update({
2581
+ tickets_configuration: {
2582
+ categories,
2583
+ creationCategory: this.guild.tickets_configuration.creationCategory,
2584
+ deletionCategory: this.guild.tickets_configuration.deletionCategory,
2585
+ rating_channel_id: this.guild.tickets_configuration.rating_channel_id
2586
+ }
2427
2587
  });
2428
- this.guild._updateInternals(response);
2429
- return response;
2430
2588
  }
2431
2589
  async deleteTicketCategory(data) {
2432
2590
  let categories = this.guild.tickets_configuration.categories;
@@ -2440,8 +2598,14 @@ var GuildTicketManager = class {
2440
2598
  url: route,
2441
2599
  payload
2442
2600
  });
2443
- this.guild._updateInternals(response);
2444
- return response;
2601
+ return this.guild.update({
2602
+ tickets_configuration: {
2603
+ categories,
2604
+ creationCategory: this.guild.tickets_configuration.creationCategory,
2605
+ deletionCategory: this.guild.tickets_configuration.deletionCategory,
2606
+ rating_channel_id: this.guild.tickets_configuration.rating_channel_id
2607
+ }
2608
+ });
2445
2609
  }
2446
2610
  async fetch(options) {
2447
2611
  if (options && options.cache) return this.cache;
@@ -2512,7 +2676,8 @@ var GuildTicketManager = class {
2512
2676
  };
2513
2677
 
2514
2678
  // src/structures/user/GuildUser.ts
2515
- var GuildUser = class _GuildUser {
2679
+ var _GuildUser_instances, updateInternals_fn7;
2680
+ var _GuildUser = class _GuildUser {
2516
2681
  /**
2517
2682
  * Bet user
2518
2683
  * @param data The user's data
@@ -2520,6 +2685,7 @@ var GuildUser = class _GuildUser {
2520
2685
  * @param rest The rest client
2521
2686
  */
2522
2687
  constructor(data, manager) {
2688
+ __privateAdd(this, _GuildUser_instances);
2523
2689
  /** User's id */
2524
2690
  __publicField(this, "id");
2525
2691
  __publicField(this, "guild_id");
@@ -2632,7 +2798,7 @@ var GuildUser = class _GuildUser {
2632
2798
  url: route,
2633
2799
  payload
2634
2800
  });
2635
- this._updateInternals(response);
2801
+ __privateMethod(this, _GuildUser_instances, updateInternals_fn7).call(this, response);
2636
2802
  return this;
2637
2803
  }
2638
2804
  async updateProfile(data) {
@@ -2653,43 +2819,14 @@ var GuildUser = class _GuildUser {
2653
2819
  url: route,
2654
2820
  payload: _data
2655
2821
  });
2656
- this._updateInternals(response);
2657
- return this;
2658
- }
2659
- _updateInternals(data) {
2660
- for (let key in data) {
2661
- if (key === "id" || key === "createdAt") continue;
2662
- if (key in this) {
2663
- this[key] = data[key];
2664
- }
2665
- if (key === "adverts") {
2666
- this.adverts = [];
2667
- for (let _adv of data.adverts) {
2668
- this.adverts.push({
2669
- _id: _adv._id,
2670
- admin_id: _adv.admin_id,
2671
- role_id: _adv.role_id,
2672
- reason: _adv.reason,
2673
- points_removed: _adv.points_removed,
2674
- proof: _adv.proof,
2675
- proof_ext: _adv.proof_ext,
2676
- createdAt: _adv.createdAt ? new Date(_adv.createdAt) : /* @__PURE__ */ new Date(),
2677
- updatedAt: _adv.updatedAt ? new Date(_adv.updatedAt) : /* @__PURE__ */ new Date()
2678
- });
2679
- }
2680
- }
2681
- }
2682
- this.updatedAt = /* @__PURE__ */ new Date();
2683
- this.createdAt = new Date(data.createdAt);
2684
- this.manager.set(this);
2685
- this.rest.emit("userUpdate", this);
2822
+ __privateMethod(this, _GuildUser_instances, updateInternals_fn7).call(this, response);
2686
2823
  return this;
2687
2824
  }
2688
2825
  async addAdvert(data) {
2689
2826
  const route = Routes.guilds.users.resource(this.manager.guild.id, this.id, "adverts");
2690
2827
  const payload = data;
2691
2828
  const response = await this.rest.request({ method: "POST", url: route, payload });
2692
- return this._updateInternals(response);
2829
+ return __privateMethod(this, _GuildUser_instances, updateInternals_fn7).call(this, response);
2693
2830
  }
2694
2831
  async removeAdvert(advertId) {
2695
2832
  let advs = this.adverts;
@@ -2698,7 +2835,7 @@ var GuildUser = class _GuildUser {
2698
2835
  const payload = { adverts: advs };
2699
2836
  const route = Routes.guilds.users.update(this.manager.guild.id, this.id);
2700
2837
  const response = await this.rest.request({ method: "PATCH", url: route, payload });
2701
- return this._updateInternals(response);
2838
+ return __privateMethod(this, _GuildUser_instances, updateInternals_fn7).call(this, response);
2702
2839
  }
2703
2840
  /**
2704
2841
  * Update certain property
@@ -2749,7 +2886,7 @@ var GuildUser = class _GuildUser {
2749
2886
  url: route,
2750
2887
  payload
2751
2888
  });
2752
- this._updateInternals(response);
2889
+ __privateMethod(this, _GuildUser_instances, updateInternals_fn7).call(this, response);
2753
2890
  return this;
2754
2891
  }
2755
2892
  async delete() {
@@ -2774,6 +2911,37 @@ var GuildUser = class _GuildUser {
2774
2911
  return json;
2775
2912
  }
2776
2913
  };
2914
+ _GuildUser_instances = new WeakSet();
2915
+ updateInternals_fn7 = function(data) {
2916
+ for (let key in data) {
2917
+ if (key === "id" || key === "createdAt") continue;
2918
+ if (key in this) {
2919
+ this[key] = data[key];
2920
+ }
2921
+ if (key === "adverts") {
2922
+ this.adverts = [];
2923
+ for (let _adv of data.adverts) {
2924
+ this.adverts.push({
2925
+ _id: _adv._id,
2926
+ admin_id: _adv.admin_id,
2927
+ role_id: _adv.role_id,
2928
+ reason: _adv.reason,
2929
+ points_removed: _adv.points_removed,
2930
+ proof: _adv.proof,
2931
+ proof_ext: _adv.proof_ext,
2932
+ createdAt: _adv.createdAt ? new Date(_adv.createdAt) : /* @__PURE__ */ new Date(),
2933
+ updatedAt: _adv.updatedAt ? new Date(_adv.updatedAt) : /* @__PURE__ */ new Date()
2934
+ });
2935
+ }
2936
+ }
2937
+ }
2938
+ this.updatedAt = /* @__PURE__ */ new Date();
2939
+ this.createdAt = new Date(data.createdAt);
2940
+ this.manager.set(this);
2941
+ this.rest.emit("userUpdate", this);
2942
+ return this;
2943
+ };
2944
+ var GuildUser = _GuildUser;
2777
2945
 
2778
2946
  // src/managers/user/GuildUserManager.ts
2779
2947
  var GuildUserManager = class extends BaseManager {
@@ -3176,8 +3344,10 @@ var PlayerManager = class extends Collection {
3176
3344
  };
3177
3345
 
3178
3346
  // src/structures/bet/GuildBet.ts
3347
+ var _GuildBet_instances, updateInternals_fn8;
3179
3348
  var GuildBet = class {
3180
3349
  constructor(data, manager) {
3350
+ __privateAdd(this, _GuildBet_instances);
3181
3351
  /** The bet's type */
3182
3352
  __publicField(this, "type");
3183
3353
  /** The bet's mode */
@@ -3256,7 +3426,7 @@ var GuildBet = class {
3256
3426
  async fetch() {
3257
3427
  const route = Routes.guilds.bets.get(this.guild.id, this._id);
3258
3428
  const response = await this.rest.request({ url: route, method: "GET" });
3259
- return this._updateInternals(response);
3429
+ return __privateMethod(this, _GuildBet_instances, updateInternals_fn8).call(this, response);
3260
3430
  }
3261
3431
  async addPlayer(player, queue_type) {
3262
3432
  if (this.players.length === 2) return this;
@@ -3293,7 +3463,7 @@ var GuildBet = class {
3293
3463
  const payload = data;
3294
3464
  const route = Routes.guilds.bets.update(this.guild.id, this._id);
3295
3465
  const response = await this.rest.request({ method: "patch", url: route, payload });
3296
- return this._updateInternals(response);
3466
+ return __privateMethod(this, _GuildBet_instances, updateInternals_fn8).call(this, response);
3297
3467
  }
3298
3468
  async delete() {
3299
3469
  const route = Routes.guilds.bets.delete(this.manager.guild.id, this._id);
@@ -3305,33 +3475,6 @@ var GuildBet = class {
3305
3475
  this.manager.cache.delete(this._id);
3306
3476
  return response;
3307
3477
  }
3308
- _updateInternals(data) {
3309
- for (let key in data) {
3310
- if (key === "_id" || key === "createdAt") continue;
3311
- if (key === "messages") {
3312
- this.messages.set(data[key]);
3313
- continue;
3314
- }
3315
- if (key === "players") {
3316
- this.players._set(data[key]);
3317
- continue;
3318
- }
3319
- if (key in this) {
3320
- this[key] = data[key];
3321
- }
3322
- }
3323
- if (data?.messages?.length !== 0) {
3324
- if (this?.messages instanceof MessagesManager) this.messages.set(data.messages);
3325
- else {
3326
- this.messages = new MessagesManager(this, Routes.guilds.matches.resource(this.guild_id, this._id, "messages"));
3327
- this.messages.set(data.messages);
3328
- }
3329
- }
3330
- this.updatedAt = /* @__PURE__ */ new Date();
3331
- this.createdAt = new Date(data.createdAt);
3332
- this.manager.set(this);
3333
- return this;
3334
- }
3335
3478
  toJSON() {
3336
3479
  let json = {};
3337
3480
  for (const [key, value] of Object.entries(this)) {
@@ -3348,10 +3491,40 @@ var GuildBet = class {
3348
3491
  };
3349
3492
  }
3350
3493
  };
3494
+ _GuildBet_instances = new WeakSet();
3495
+ updateInternals_fn8 = function(data) {
3496
+ for (let key in data) {
3497
+ if (key === "_id" || key === "createdAt") continue;
3498
+ if (key === "messages") {
3499
+ this.messages.set(data[key]);
3500
+ continue;
3501
+ }
3502
+ if (key === "players") {
3503
+ this.players._set(data[key]);
3504
+ continue;
3505
+ }
3506
+ if (key in this) {
3507
+ this[key] = data[key];
3508
+ }
3509
+ }
3510
+ if (data?.messages?.length !== 0) {
3511
+ if (this?.messages instanceof MessagesManager) this.messages.set(data.messages);
3512
+ else {
3513
+ this.messages = new MessagesManager(this, Routes.guilds.matches.resource(this.guild_id, this._id, "messages"));
3514
+ this.messages.set(data.messages);
3515
+ }
3516
+ }
3517
+ this.updatedAt = /* @__PURE__ */ new Date();
3518
+ this.createdAt = new Date(data.createdAt);
3519
+ this.manager.set(this);
3520
+ return this;
3521
+ };
3351
3522
 
3352
3523
  // src/structures/logentry/LogEntry.ts
3524
+ var _LogEntry_instances, updateInternals_fn9;
3353
3525
  var LogEntry = class {
3354
3526
  constructor(data, manager) {
3527
+ __privateAdd(this, _LogEntry_instances);
3355
3528
  __publicField(this, "_id");
3356
3529
  __publicField(this, "guild_id");
3357
3530
  __publicField(this, "user_id");
@@ -3387,9 +3560,9 @@ var LogEntry = class {
3387
3560
  this.updatedAt = data?.updatedAt ? new Date(data?.updatedAt) : /* @__PURE__ */ new Date();
3388
3561
  }
3389
3562
  async fetch() {
3390
- const route = Routes.guilds.resources(this.guild.id, "logs", this._id);
3563
+ const route = Routes.fields("guilds", this.guild.id, "logentries", this._id);
3391
3564
  const response = await this.rest.request({ url: route, method: "GET" });
3392
- return this._updateInternals(response);
3565
+ return __privateMethod(this, _LogEntry_instances, updateInternals_fn9).call(this, response);
3393
3566
  }
3394
3567
  toJSON() {
3395
3568
  const json = {};
@@ -3400,22 +3573,25 @@ var LogEntry = class {
3400
3573
  }
3401
3574
  return json;
3402
3575
  }
3403
- _updateInternals(data) {
3404
- for (let key in data) {
3405
- if (key === "id" || key === "createdAt") continue;
3406
- if (key in this) {
3407
- this[key] = data[key];
3408
- }
3576
+ };
3577
+ _LogEntry_instances = new WeakSet();
3578
+ updateInternals_fn9 = function(data) {
3579
+ for (let key in data) {
3580
+ if (key === "id" || key === "createdAt") continue;
3581
+ if (key in this) {
3582
+ this[key] = data[key];
3409
3583
  }
3410
- this.updatedAt = /* @__PURE__ */ new Date();
3411
- this.manager.set(this);
3412
- return this;
3413
3584
  }
3585
+ this.updatedAt = /* @__PURE__ */ new Date();
3586
+ this.manager.set(this);
3587
+ return this;
3414
3588
  };
3415
3589
 
3416
3590
  // src/structures/ticket/Ticket.ts
3591
+ var _GuildTicket_instances, updateInternals_fn10;
3417
3592
  var GuildTicket = class {
3418
3593
  constructor(data, manager) {
3594
+ __privateAdd(this, _GuildTicket_instances);
3419
3595
  __publicField(this, "_id");
3420
3596
  __publicField(this, "guild_id");
3421
3597
  __publicField(this, "type");
@@ -3452,7 +3628,7 @@ var GuildTicket = class {
3452
3628
  method: "GET",
3453
3629
  url: route
3454
3630
  });
3455
- return this._updateInternals(response);
3631
+ return __privateMethod(this, _GuildTicket_instances, updateInternals_fn10).call(this, response);
3456
3632
  }
3457
3633
  async setCustomerRating(rating) {
3458
3634
  const route = Routes.guilds.tickets.resource(this.guild.id, this._id, "customer_rating");
@@ -3462,7 +3638,7 @@ var GuildTicket = class {
3462
3638
  url: route,
3463
3639
  payload
3464
3640
  });
3465
- return this._updateInternals(response);
3641
+ return __privateMethod(this, _GuildTicket_instances, updateInternals_fn10).call(this, response);
3466
3642
  }
3467
3643
  async setAdminId(id) {
3468
3644
  const route = Routes.guilds.tickets.resource(this.guild.id, this._id, "admin_id");
@@ -3472,7 +3648,7 @@ var GuildTicket = class {
3472
3648
  url: route,
3473
3649
  payload
3474
3650
  });
3475
- return this._updateInternals(response);
3651
+ return __privateMethod(this, _GuildTicket_instances, updateInternals_fn10).call(this, response);
3476
3652
  }
3477
3653
  async setChannelId(id) {
3478
3654
  const route = Routes.guilds.tickets.resource(this.guild.id, this._id, "channel_id");
@@ -3482,7 +3658,7 @@ var GuildTicket = class {
3482
3658
  url: route,
3483
3659
  payload
3484
3660
  });
3485
- return this._updateInternals(response);
3661
+ return __privateMethod(this, _GuildTicket_instances, updateInternals_fn10).call(this, response);
3486
3662
  }
3487
3663
  async setClosedById(id) {
3488
3664
  const route = Routes.guilds.tickets.resource(this.guild.id, this._id, "closed_by_id");
@@ -3492,7 +3668,7 @@ var GuildTicket = class {
3492
3668
  url: route,
3493
3669
  payload
3494
3670
  });
3495
- return this._updateInternals(response);
3671
+ return __privateMethod(this, _GuildTicket_instances, updateInternals_fn10).call(this, response);
3496
3672
  }
3497
3673
  async setStatus(status) {
3498
3674
  const route = Routes.guilds.tickets.resource(this.guild.id, this._id, "status");
@@ -3502,7 +3678,7 @@ var GuildTicket = class {
3502
3678
  url: route,
3503
3679
  payload
3504
3680
  });
3505
- return this._updateInternals(response);
3681
+ return __privateMethod(this, _GuildTicket_instances, updateInternals_fn10).call(this, response);
3506
3682
  }
3507
3683
  async addMessage(message) {
3508
3684
  const route = Routes.guilds.tickets.resource(this.guild.id, this._id, "messages");
@@ -3512,25 +3688,28 @@ var GuildTicket = class {
3512
3688
  url: route,
3513
3689
  payload
3514
3690
  });
3515
- return this._updateInternals(response);
3516
- }
3517
- _updateInternals(data) {
3518
- for (let key in data) {
3519
- if (key === "id" || key === "createdAt") continue;
3520
- if (key in this) {
3521
- this[key] = data[key];
3522
- }
3523
- }
3524
- this.updatedAt = /* @__PURE__ */ new Date();
3525
- this.createdAt = new Date(data.createdAt);
3526
- this.manager.set(this);
3527
- return this;
3691
+ return __privateMethod(this, _GuildTicket_instances, updateInternals_fn10).call(this, response);
3528
3692
  }
3529
3693
  };
3694
+ _GuildTicket_instances = new WeakSet();
3695
+ updateInternals_fn10 = function(data) {
3696
+ for (let key in data) {
3697
+ if (key === "id" || key === "createdAt") continue;
3698
+ if (key in this) {
3699
+ this[key] = data[key];
3700
+ }
3701
+ }
3702
+ this.updatedAt = /* @__PURE__ */ new Date();
3703
+ this.createdAt = new Date(data.createdAt);
3704
+ this.manager.set(this);
3705
+ return this;
3706
+ };
3530
3707
 
3531
3708
  // src/structures/minesgame/MinesGame.ts
3709
+ var _MinesGame_instances, updateInternals_fn11;
3532
3710
  var MinesGame = class {
3533
3711
  constructor(data, manager) {
3712
+ __privateAdd(this, _MinesGame_instances);
3534
3713
  __publicField(this, "guild_id");
3535
3714
  __publicField(this, "_id");
3536
3715
  __publicField(this, "creatorId");
@@ -3564,7 +3743,7 @@ var MinesGame = class {
3564
3743
  method: "GET",
3565
3744
  url: route
3566
3745
  });
3567
- return this._updateInternals(response);
3746
+ return __privateMethod(this, _MinesGame_instances, updateInternals_fn11).call(this, response);
3568
3747
  }
3569
3748
  async delete() {
3570
3749
  const route = `/${Routes.fields("minesgames", this._id)}`;
@@ -3572,7 +3751,7 @@ var MinesGame = class {
3572
3751
  method: "delete",
3573
3752
  url: route
3574
3753
  });
3575
- return this._updateInternals(response);
3754
+ return __privateMethod(this, _MinesGame_instances, updateInternals_fn11).call(this, response);
3576
3755
  }
3577
3756
  async update(data) {
3578
3757
  const route = `/${Routes.fields("minesgames", this._id)}`;
@@ -3581,19 +3760,20 @@ var MinesGame = class {
3581
3760
  url: route,
3582
3761
  payload: data
3583
3762
  });
3584
- return this._updateInternals(response);
3763
+ return __privateMethod(this, _MinesGame_instances, updateInternals_fn11).call(this, response);
3585
3764
  }
3586
- _updateInternals(data) {
3587
- for (let key in data) {
3588
- if (key === "id" || key === "createdAt") continue;
3589
- if (key in this) {
3590
- this[key] = data[key];
3591
- }
3765
+ };
3766
+ _MinesGame_instances = new WeakSet();
3767
+ updateInternals_fn11 = function(data) {
3768
+ for (let key in data) {
3769
+ if (key === "id" || key === "createdAt") continue;
3770
+ if (key in this) {
3771
+ this[key] = data[key];
3592
3772
  }
3593
- this.updatedAt = /* @__PURE__ */ new Date();
3594
- this.manager.set(this);
3595
- return this;
3596
3773
  }
3774
+ this.updatedAt = /* @__PURE__ */ new Date();
3775
+ this.manager.set(this);
3776
+ return this;
3597
3777
  };
3598
3778
  // Annotate the CommonJS export names for ESM import in node:
3599
3779
  0 && (module.exports = {