@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
package/dist/rest/REST.js CHANGED
@@ -400,7 +400,7 @@ var require_main = __commonJS({
400
400
  // src/rest/REST.ts
401
401
  var REST_exports = {};
402
402
  __export(REST_exports, {
403
- REST: () => REST8
403
+ REST: () => REST9
404
404
  });
405
405
  module.exports = __toCommonJS(REST_exports);
406
406
  var import_dotenv = __toESM(require_main());
@@ -462,7 +462,7 @@ var import_undici = require("undici");
462
462
  // src/rest/Routes.ts
463
463
  var Routes = {
464
464
  //base: "http://localhost:80/api/v1",
465
- base: "https://duque-api.up.railway.app/api/v1",
465
+ base: "https://duqueapi.shardweb.app/api/v1",
466
466
  field: (field) => `/${field}`,
467
467
  fields: (...fields) => `${fields.join("/")}`,
468
468
  guilds: {
@@ -657,6 +657,9 @@ var BaseManager = class {
657
657
  this.rest = guild.rest;
658
658
  this.cache = new Collection();
659
659
  }
660
+ toJSON() {
661
+ return [...this.cache.values()].map((m) => m && "toJSON" in m && typeof m.toJSON === "function" ? m.toJSON() : m);
662
+ }
660
663
  };
661
664
 
662
665
  // src/managers/player/PlayerManager.ts
@@ -728,8 +731,10 @@ var PlayerManager = class extends Collection {
728
731
  };
729
732
 
730
733
  // src/structures/bet/GuildBet.ts
734
+ var _GuildBet_instances, updateInternals_fn;
731
735
  var GuildBet = class {
732
736
  constructor(data, manager) {
737
+ __privateAdd(this, _GuildBet_instances);
733
738
  /** The bet's type */
734
739
  __publicField(this, "type");
735
740
  /** The bet's mode */
@@ -808,7 +813,7 @@ var GuildBet = class {
808
813
  async fetch() {
809
814
  const route = Routes.guilds.bets.get(this.guild.id, this._id);
810
815
  const response = await this.rest.request({ url: route, method: "GET" });
811
- return this._updateInternals(response);
816
+ return __privateMethod(this, _GuildBet_instances, updateInternals_fn).call(this, response);
812
817
  }
813
818
  async addPlayer(player, queue_type) {
814
819
  if (this.players.length === 2) return this;
@@ -845,7 +850,7 @@ var GuildBet = class {
845
850
  const payload = data;
846
851
  const route = Routes.guilds.bets.update(this.guild.id, this._id);
847
852
  const response = await this.rest.request({ method: "patch", url: route, payload });
848
- return this._updateInternals(response);
853
+ return __privateMethod(this, _GuildBet_instances, updateInternals_fn).call(this, response);
849
854
  }
850
855
  async delete() {
851
856
  const route = Routes.guilds.bets.delete(this.manager.guild.id, this._id);
@@ -857,33 +862,6 @@ var GuildBet = class {
857
862
  this.manager.cache.delete(this._id);
858
863
  return response;
859
864
  }
860
- _updateInternals(data) {
861
- for (let key in data) {
862
- if (key === "_id" || key === "createdAt") continue;
863
- if (key === "messages") {
864
- this.messages.set(data[key]);
865
- continue;
866
- }
867
- if (key === "players") {
868
- this.players._set(data[key]);
869
- continue;
870
- }
871
- if (key in this) {
872
- this[key] = data[key];
873
- }
874
- }
875
- if (data?.messages?.length !== 0) {
876
- if (this?.messages instanceof MessagesManager) this.messages.set(data.messages);
877
- else {
878
- this.messages = new MessagesManager(this, Routes.guilds.matches.resource(this.guild_id, this._id, "messages"));
879
- this.messages.set(data.messages);
880
- }
881
- }
882
- this.updatedAt = /* @__PURE__ */ new Date();
883
- this.createdAt = new Date(data.createdAt);
884
- this.manager.set(this);
885
- return this;
886
- }
887
865
  toJSON() {
888
866
  let json = {};
889
867
  for (const [key, value] of Object.entries(this)) {
@@ -900,9 +878,38 @@ var GuildBet = class {
900
878
  };
901
879
  }
902
880
  };
881
+ _GuildBet_instances = new WeakSet();
882
+ updateInternals_fn = function(data) {
883
+ for (let key in data) {
884
+ if (key === "_id" || key === "createdAt") continue;
885
+ if (key === "messages") {
886
+ this.messages.set(data[key]);
887
+ continue;
888
+ }
889
+ if (key === "players") {
890
+ this.players._set(data[key]);
891
+ continue;
892
+ }
893
+ if (key in this) {
894
+ this[key] = data[key];
895
+ }
896
+ }
897
+ if (data?.messages?.length !== 0) {
898
+ if (this?.messages instanceof MessagesManager) this.messages.set(data.messages);
899
+ else {
900
+ this.messages = new MessagesManager(this, Routes.guilds.matches.resource(this.guild_id, this._id, "messages"));
901
+ this.messages.set(data.messages);
902
+ }
903
+ }
904
+ this.updatedAt = /* @__PURE__ */ new Date();
905
+ this.createdAt = new Date(data.createdAt);
906
+ this.manager.set(this);
907
+ return this;
908
+ };
903
909
 
904
910
  // src/structures/betuser/GuildBetUser.ts
905
- var GuildBetUser = class _GuildBetUser {
911
+ var _GuildBetUser_instances, updateInternals_fn2;
912
+ var _GuildBetUser = class _GuildBetUser {
906
913
  /**
907
914
  * Bet user
908
915
  * @param data The user's data
@@ -910,6 +917,7 @@ var GuildBetUser = class _GuildBetUser {
910
917
  * @param rest The rest client
911
918
  */
912
919
  constructor(data, manager) {
920
+ __privateAdd(this, _GuildBetUser_instances);
913
921
  /** User daily */
914
922
  __publicField(this, "daily");
915
923
  __publicField(this, "profile");
@@ -1004,7 +1012,7 @@ var GuildBetUser = class _GuildBetUser {
1004
1012
  url: route,
1005
1013
  payload
1006
1014
  });
1007
- return this._updateInternals(response);
1015
+ return __privateMethod(this, _GuildBetUser_instances, updateInternals_fn2).call(this, response);
1008
1016
  }
1009
1017
  async updateProfile(data) {
1010
1018
  const _data = {
@@ -1024,20 +1032,7 @@ var GuildBetUser = class _GuildBetUser {
1024
1032
  url: route,
1025
1033
  payload: _data
1026
1034
  });
1027
- return this._updateInternals(response);
1028
- }
1029
- _updateInternals(data) {
1030
- for (let key in data) {
1031
- if (key === "id" || key === "createdAt") continue;
1032
- if (key in this) {
1033
- this[key] = data[key];
1034
- }
1035
- }
1036
- this.updatedAt = /* @__PURE__ */ new Date();
1037
- this.createdAt = new Date(data.createdAt);
1038
- this.manager.set(this);
1039
- this.rest.emit("betuserUpdate", this);
1040
- return this;
1035
+ return __privateMethod(this, _GuildBetUser_instances, updateInternals_fn2).call(this, response);
1041
1036
  }
1042
1037
  /**
1043
1038
  * Update certain property
@@ -1074,7 +1069,7 @@ var GuildBetUser = class _GuildBetUser {
1074
1069
  url: route,
1075
1070
  payload
1076
1071
  });
1077
- return this._updateInternals(response);
1072
+ return __privateMethod(this, _GuildBetUser_instances, updateInternals_fn2).call(this, response);
1078
1073
  }
1079
1074
  async _update(data) {
1080
1075
  const route = Routes.guilds.betusers.get(this.manager.guild.id, this.id);
@@ -1084,7 +1079,7 @@ var GuildBetUser = class _GuildBetUser {
1084
1079
  url: route,
1085
1080
  payload
1086
1081
  });
1087
- return this._updateInternals(response);
1082
+ return __privateMethod(this, _GuildBetUser_instances, updateInternals_fn2).call(this, response);
1088
1083
  }
1089
1084
  async delete() {
1090
1085
  const route = Routes.guilds.betusers.delete(this.manager.guild.id, this.id);
@@ -1108,10 +1103,27 @@ var GuildBetUser = class _GuildBetUser {
1108
1103
  return json;
1109
1104
  }
1110
1105
  };
1106
+ _GuildBetUser_instances = new WeakSet();
1107
+ updateInternals_fn2 = function(data) {
1108
+ for (let key in data) {
1109
+ if (key === "id" || key === "createdAt") continue;
1110
+ if (key in this) {
1111
+ this[key] = data[key];
1112
+ }
1113
+ }
1114
+ this.updatedAt = /* @__PURE__ */ new Date();
1115
+ this.createdAt = new Date(data.createdAt);
1116
+ this.manager.set(this);
1117
+ this.rest.emit("betuserUpdate", this);
1118
+ return this;
1119
+ };
1120
+ var GuildBetUser = _GuildBetUser;
1111
1121
 
1112
1122
  // src/structures/logentry/LogEntry.ts
1123
+ var _LogEntry_instances, updateInternals_fn3;
1113
1124
  var LogEntry = class {
1114
1125
  constructor(data, manager) {
1126
+ __privateAdd(this, _LogEntry_instances);
1115
1127
  __publicField(this, "_id");
1116
1128
  __publicField(this, "guild_id");
1117
1129
  __publicField(this, "user_id");
@@ -1147,9 +1159,9 @@ var LogEntry = class {
1147
1159
  this.updatedAt = data?.updatedAt ? new Date(data?.updatedAt) : /* @__PURE__ */ new Date();
1148
1160
  }
1149
1161
  async fetch() {
1150
- const route = Routes.guilds.resources(this.guild.id, "logs", this._id);
1162
+ const route = Routes.fields("guilds", this.guild.id, "logentries", this._id);
1151
1163
  const response = await this.rest.request({ url: route, method: "GET" });
1152
- return this._updateInternals(response);
1164
+ return __privateMethod(this, _LogEntry_instances, updateInternals_fn3).call(this, response);
1153
1165
  }
1154
1166
  toJSON() {
1155
1167
  const json = {};
@@ -1160,21 +1172,23 @@ var LogEntry = class {
1160
1172
  }
1161
1173
  return json;
1162
1174
  }
1163
- _updateInternals(data) {
1164
- for (let key in data) {
1165
- if (key === "id" || key === "createdAt") continue;
1166
- if (key in this) {
1167
- this[key] = data[key];
1168
- }
1175
+ };
1176
+ _LogEntry_instances = new WeakSet();
1177
+ updateInternals_fn3 = function(data) {
1178
+ for (let key in data) {
1179
+ if (key === "id" || key === "createdAt") continue;
1180
+ if (key in this) {
1181
+ this[key] = data[key];
1169
1182
  }
1170
- this.updatedAt = /* @__PURE__ */ new Date();
1171
- this.manager.set(this);
1172
- return this;
1173
1183
  }
1184
+ this.updatedAt = /* @__PURE__ */ new Date();
1185
+ this.manager.set(this);
1186
+ return this;
1174
1187
  };
1175
1188
 
1176
1189
  // src/structures/match/GuildMatch.ts
1177
- var GuildMatch = class _GuildMatch {
1190
+ var _GuildMatch_instances, updateInternals_fn4;
1191
+ var _GuildMatch = class _GuildMatch {
1178
1192
  /**
1179
1193
  * GuildMatch match
1180
1194
  * @param data The match's data
@@ -1182,6 +1196,7 @@ var GuildMatch = class _GuildMatch {
1182
1196
  * @param rest The rest client
1183
1197
  */
1184
1198
  constructor(data, manager) {
1199
+ __privateAdd(this, _GuildMatch_instances);
1185
1200
  __publicField(this, "_id");
1186
1201
  __publicField(this, "selections");
1187
1202
  /** Match's type */
@@ -1265,7 +1280,7 @@ var GuildMatch = class _GuildMatch {
1265
1280
  method: "get",
1266
1281
  url: route
1267
1282
  });
1268
- return await this._updateInternals(response);
1283
+ return await __privateMethod(this, _GuildMatch_instances, updateInternals_fn4).call(this, response);
1269
1284
  }
1270
1285
  async addConfirmed(type, id) {
1271
1286
  const confirmed = this.confirmed.find((c) => c.type === type);
@@ -1287,7 +1302,7 @@ var GuildMatch = class _GuildMatch {
1287
1302
  url: route,
1288
1303
  payload: set
1289
1304
  });
1290
- return await this._updateInternals(response);
1305
+ return await __privateMethod(this, _GuildMatch_instances, updateInternals_fn4).call(this, response);
1291
1306
  }
1292
1307
  async setStatus(status) {
1293
1308
  Assertion.assertString(status);
@@ -1298,7 +1313,7 @@ var GuildMatch = class _GuildMatch {
1298
1313
  url: route,
1299
1314
  payload
1300
1315
  });
1301
- return await this._updateInternals(response);
1316
+ return await __privateMethod(this, _GuildMatch_instances, updateInternals_fn4).call(this, response);
1302
1317
  }
1303
1318
  async setWinners(players) {
1304
1319
  if (!Array.isArray(players)) players = [players];
@@ -1309,7 +1324,7 @@ var GuildMatch = class _GuildMatch {
1309
1324
  url: route,
1310
1325
  payload
1311
1326
  });
1312
- return await this._updateInternals(response);
1327
+ return await __privateMethod(this, _GuildMatch_instances, updateInternals_fn4).call(this, response);
1313
1328
  }
1314
1329
  async setLoser(players) {
1315
1330
  if (!Array.isArray(players)) players = [players];
@@ -1320,7 +1335,7 @@ var GuildMatch = class _GuildMatch {
1320
1335
  url: route,
1321
1336
  payload
1322
1337
  });
1323
- return await this._updateInternals(response);
1338
+ return await __privateMethod(this, _GuildMatch_instances, updateInternals_fn4).call(this, response);
1324
1339
  }
1325
1340
  async setMvps(...usersId) {
1326
1341
  const payload = { set: usersId };
@@ -1330,7 +1345,7 @@ var GuildMatch = class _GuildMatch {
1330
1345
  url: route,
1331
1346
  payload
1332
1347
  });
1333
- return await this._updateInternals(response);
1348
+ return await __privateMethod(this, _GuildMatch_instances, updateInternals_fn4).call(this, response);
1334
1349
  }
1335
1350
  async setRoomCreatorId(userId) {
1336
1351
  Assertion.assertString(userId);
@@ -1341,7 +1356,7 @@ var GuildMatch = class _GuildMatch {
1341
1356
  url: route,
1342
1357
  payload
1343
1358
  });
1344
- return await this._updateInternals(response);
1359
+ return await __privateMethod(this, _GuildMatch_instances, updateInternals_fn4).call(this, response);
1345
1360
  }
1346
1361
  async setRoomAdminId(userId) {
1347
1362
  Assertion.assertString(userId);
@@ -1352,7 +1367,7 @@ var GuildMatch = class _GuildMatch {
1352
1367
  url: route,
1353
1368
  payload
1354
1369
  });
1355
- return await this._updateInternals(response);
1370
+ return await __privateMethod(this, _GuildMatch_instances, updateInternals_fn4).call(this, response);
1356
1371
  }
1357
1372
  async kick(player) {
1358
1373
  this.players = this.players.filter((p) => p.id !== player.id);
@@ -1376,7 +1391,7 @@ var GuildMatch = class _GuildMatch {
1376
1391
  payload: data
1377
1392
  });
1378
1393
  this.rest.emit("matchUpdate", this, new _GuildMatch(response, this.manager));
1379
- return await this._updateInternals(response);
1394
+ return await __privateMethod(this, _GuildMatch_instances, updateInternals_fn4).call(this, response);
1380
1395
  }
1381
1396
  async delete() {
1382
1397
  const route = Routes.guilds.matches.resource(this.guild.id, this._id);
@@ -1402,35 +1417,38 @@ var GuildMatch = class _GuildMatch {
1402
1417
  messages: this?.messages instanceof MessagesManager ? this.messages?.cache?.toArray() : []
1403
1418
  };
1404
1419
  }
1405
- async _updateInternals(data) {
1406
- if (!data) return;
1407
- for (let key in data) {
1408
- if (key === "id" || key === "createdAt" || key === "messages") continue;
1409
- if (key in this) {
1410
- this[key] = data[key];
1411
- }
1412
- if (key === "bet") {
1413
- this.bet = this.guild.bets.set(data.bet);
1414
- }
1420
+ };
1421
+ _GuildMatch_instances = new WeakSet();
1422
+ updateInternals_fn4 = async function(data) {
1423
+ if (!data) return;
1424
+ for (let key in data) {
1425
+ if (key === "id" || key === "createdAt" || key === "messages") continue;
1426
+ if (key in this) {
1427
+ this[key] = data[key];
1415
1428
  }
1416
- if (data?.messages?.length !== 0) {
1417
- if (this?.messages instanceof MessagesManager) this.messages.set(data.messages);
1418
- else {
1419
- this.messages = new MessagesManager(this, Routes.guilds.matches.resource(this.guild_id, this._id, "messages"));
1420
- this.messages.set(data.messages);
1421
- }
1429
+ if (key === "bet") {
1430
+ this.bet = this.guild.bets.set(data.bet);
1422
1431
  }
1423
- if (!(this.bet instanceof GuildBet) && data?.bet) {
1424
- this.bet = this.guild.bets.cache.get(data._id) ?? await this.guild.bets.fetch({ betId: data?.bet?._id });
1432
+ }
1433
+ if (data?.messages?.length !== 0) {
1434
+ if (this?.messages instanceof MessagesManager) this.messages.set(data.messages);
1435
+ else {
1436
+ this.messages = new MessagesManager(this, Routes.guilds.matches.resource(this.guild_id, this._id, "messages"));
1437
+ this.messages.set(data.messages);
1425
1438
  }
1426
- this.updatedAt = /* @__PURE__ */ new Date();
1427
- this.manager.set(this);
1428
- return this;
1429
1439
  }
1440
+ if (!(this.bet instanceof GuildBet) && data?.bet) {
1441
+ this.bet = this.guild.bets.cache.get(data._id) ?? await this.guild.bets.fetch({ betId: data?.bet?._id });
1442
+ }
1443
+ this.updatedAt = /* @__PURE__ */ new Date();
1444
+ this.manager.set(this);
1445
+ return this;
1430
1446
  };
1447
+ var GuildMatch = _GuildMatch;
1431
1448
 
1432
1449
  // src/structures/mediator/GuildMediator.ts
1433
- var GuildMediator = class _GuildMediator {
1450
+ var _GuildMediator_instances, updateInternals_fn5;
1451
+ var _GuildMediator = class _GuildMediator {
1434
1452
  /**
1435
1453
  * Bet user
1436
1454
  * @param data The user's data
@@ -1438,6 +1456,7 @@ var GuildMediator = class _GuildMediator {
1438
1456
  * @param rest The rest client
1439
1457
  */
1440
1458
  constructor(data, manager) {
1459
+ __privateAdd(this, _GuildMediator_instances);
1441
1460
  /** User's name */
1442
1461
  __publicField(this, "id");
1443
1462
  __publicField(this, "guild_id");
@@ -1496,19 +1515,7 @@ var GuildMediator = class _GuildMediator {
1496
1515
  url: route,
1497
1516
  payload
1498
1517
  });
1499
- return this._updateInternals(response);
1500
- }
1501
- _updateInternals(data) {
1502
- for (let key in data) {
1503
- if (key === "id" || key === "createdAt") continue;
1504
- if (key in this) {
1505
- this[key] = data[key];
1506
- }
1507
- }
1508
- this.updatedAt = /* @__PURE__ */ new Date();
1509
- this.createdAt = new Date(data.createdAt);
1510
- this.manager.set(this);
1511
- return this;
1518
+ return __privateMethod(this, _GuildMediator_instances, updateInternals_fn5).call(this, response);
1512
1519
  }
1513
1520
  /**
1514
1521
  * Update certain property
@@ -1523,7 +1530,7 @@ var GuildMediator = class _GuildMediator {
1523
1530
  url: route,
1524
1531
  payload
1525
1532
  });
1526
- return this._updateInternals(response);
1533
+ return __privateMethod(this, _GuildMediator_instances, updateInternals_fn5).call(this, response);
1527
1534
  }
1528
1535
  async setPaymentlink(type, link) {
1529
1536
  const route = Routes.guilds.mediators.get(this.manager.guild.id, this.id);
@@ -1533,7 +1540,7 @@ var GuildMediator = class _GuildMediator {
1533
1540
  url: route,
1534
1541
  payload
1535
1542
  });
1536
- return this._updateInternals(response);
1543
+ return __privateMethod(this, _GuildMediator_instances, updateInternals_fn5).call(this, response);
1537
1544
  }
1538
1545
  async delete() {
1539
1546
  const route = Routes.guilds.mediators.delete(this.manager.guild.id, this.id);
@@ -1556,9 +1563,24 @@ var GuildMediator = class _GuildMediator {
1556
1563
  return json;
1557
1564
  }
1558
1565
  };
1566
+ _GuildMediator_instances = new WeakSet();
1567
+ updateInternals_fn5 = function(data) {
1568
+ for (let key in data) {
1569
+ if (key === "id" || key === "createdAt") continue;
1570
+ if (key in this) {
1571
+ this[key] = data[key];
1572
+ }
1573
+ }
1574
+ this.updatedAt = /* @__PURE__ */ new Date();
1575
+ this.createdAt = new Date(data.createdAt);
1576
+ this.manager.set(this);
1577
+ return this;
1578
+ };
1579
+ var GuildMediator = _GuildMediator;
1559
1580
 
1560
1581
  // src/structures/user/GuildUser.ts
1561
- var GuildUser = class _GuildUser {
1582
+ var _GuildUser_instances, updateInternals_fn6;
1583
+ var _GuildUser = class _GuildUser {
1562
1584
  /**
1563
1585
  * Bet user
1564
1586
  * @param data The user's data
@@ -1566,6 +1588,7 @@ var GuildUser = class _GuildUser {
1566
1588
  * @param rest The rest client
1567
1589
  */
1568
1590
  constructor(data, manager) {
1591
+ __privateAdd(this, _GuildUser_instances);
1569
1592
  /** User's id */
1570
1593
  __publicField(this, "id");
1571
1594
  __publicField(this, "guild_id");
@@ -1678,7 +1701,7 @@ var GuildUser = class _GuildUser {
1678
1701
  url: route,
1679
1702
  payload
1680
1703
  });
1681
- this._updateInternals(response);
1704
+ __privateMethod(this, _GuildUser_instances, updateInternals_fn6).call(this, response);
1682
1705
  return this;
1683
1706
  }
1684
1707
  async updateProfile(data) {
@@ -1699,43 +1722,14 @@ var GuildUser = class _GuildUser {
1699
1722
  url: route,
1700
1723
  payload: _data
1701
1724
  });
1702
- this._updateInternals(response);
1703
- return this;
1704
- }
1705
- _updateInternals(data) {
1706
- for (let key in data) {
1707
- if (key === "id" || key === "createdAt") continue;
1708
- if (key in this) {
1709
- this[key] = data[key];
1710
- }
1711
- if (key === "adverts") {
1712
- this.adverts = [];
1713
- for (let _adv of data.adverts) {
1714
- this.adverts.push({
1715
- _id: _adv._id,
1716
- admin_id: _adv.admin_id,
1717
- role_id: _adv.role_id,
1718
- reason: _adv.reason,
1719
- points_removed: _adv.points_removed,
1720
- proof: _adv.proof,
1721
- proof_ext: _adv.proof_ext,
1722
- createdAt: _adv.createdAt ? new Date(_adv.createdAt) : /* @__PURE__ */ new Date(),
1723
- updatedAt: _adv.updatedAt ? new Date(_adv.updatedAt) : /* @__PURE__ */ new Date()
1724
- });
1725
- }
1726
- }
1727
- }
1728
- this.updatedAt = /* @__PURE__ */ new Date();
1729
- this.createdAt = new Date(data.createdAt);
1730
- this.manager.set(this);
1731
- this.rest.emit("userUpdate", this);
1725
+ __privateMethod(this, _GuildUser_instances, updateInternals_fn6).call(this, response);
1732
1726
  return this;
1733
1727
  }
1734
1728
  async addAdvert(data) {
1735
1729
  const route = Routes.guilds.users.resource(this.manager.guild.id, this.id, "adverts");
1736
1730
  const payload = data;
1737
1731
  const response = await this.rest.request({ method: "POST", url: route, payload });
1738
- return this._updateInternals(response);
1732
+ return __privateMethod(this, _GuildUser_instances, updateInternals_fn6).call(this, response);
1739
1733
  }
1740
1734
  async removeAdvert(advertId) {
1741
1735
  let advs = this.adverts;
@@ -1744,7 +1738,7 @@ var GuildUser = class _GuildUser {
1744
1738
  const payload = { adverts: advs };
1745
1739
  const route = Routes.guilds.users.update(this.manager.guild.id, this.id);
1746
1740
  const response = await this.rest.request({ method: "PATCH", url: route, payload });
1747
- return this._updateInternals(response);
1741
+ return __privateMethod(this, _GuildUser_instances, updateInternals_fn6).call(this, response);
1748
1742
  }
1749
1743
  /**
1750
1744
  * Update certain property
@@ -1795,7 +1789,7 @@ var GuildUser = class _GuildUser {
1795
1789
  url: route,
1796
1790
  payload
1797
1791
  });
1798
- this._updateInternals(response);
1792
+ __privateMethod(this, _GuildUser_instances, updateInternals_fn6).call(this, response);
1799
1793
  return this;
1800
1794
  }
1801
1795
  async delete() {
@@ -1820,6 +1814,37 @@ var GuildUser = class _GuildUser {
1820
1814
  return json;
1821
1815
  }
1822
1816
  };
1817
+ _GuildUser_instances = new WeakSet();
1818
+ updateInternals_fn6 = function(data) {
1819
+ for (let key in data) {
1820
+ if (key === "id" || key === "createdAt") continue;
1821
+ if (key in this) {
1822
+ this[key] = data[key];
1823
+ }
1824
+ if (key === "adverts") {
1825
+ this.adverts = [];
1826
+ for (let _adv of data.adverts) {
1827
+ this.adverts.push({
1828
+ _id: _adv._id,
1829
+ admin_id: _adv.admin_id,
1830
+ role_id: _adv.role_id,
1831
+ reason: _adv.reason,
1832
+ points_removed: _adv.points_removed,
1833
+ proof: _adv.proof,
1834
+ proof_ext: _adv.proof_ext,
1835
+ createdAt: _adv.createdAt ? new Date(_adv.createdAt) : /* @__PURE__ */ new Date(),
1836
+ updatedAt: _adv.updatedAt ? new Date(_adv.updatedAt) : /* @__PURE__ */ new Date()
1837
+ });
1838
+ }
1839
+ }
1840
+ }
1841
+ this.updatedAt = /* @__PURE__ */ new Date();
1842
+ this.createdAt = new Date(data.createdAt);
1843
+ this.manager.set(this);
1844
+ this.rest.emit("userUpdate", this);
1845
+ return this;
1846
+ };
1847
+ var GuildUser = _GuildUser;
1823
1848
 
1824
1849
  // src/structures/vipmember/VipMember.ts
1825
1850
  var _VipMember_instances, updateData_fn;
@@ -1958,8 +1983,10 @@ updateData_fn = function(data) {
1958
1983
  var VipMember = _VipMember;
1959
1984
 
1960
1985
  // src/structures/ticket/Ticket.ts
1986
+ var _GuildTicket_instances, updateInternals_fn7;
1961
1987
  var GuildTicket = class {
1962
1988
  constructor(data, manager) {
1989
+ __privateAdd(this, _GuildTicket_instances);
1963
1990
  __publicField(this, "_id");
1964
1991
  __publicField(this, "guild_id");
1965
1992
  __publicField(this, "type");
@@ -1996,7 +2023,7 @@ var GuildTicket = class {
1996
2023
  method: "GET",
1997
2024
  url: route
1998
2025
  });
1999
- return this._updateInternals(response);
2026
+ return __privateMethod(this, _GuildTicket_instances, updateInternals_fn7).call(this, response);
2000
2027
  }
2001
2028
  async setCustomerRating(rating) {
2002
2029
  const route = Routes.guilds.tickets.resource(this.guild.id, this._id, "customer_rating");
@@ -2006,7 +2033,7 @@ var GuildTicket = class {
2006
2033
  url: route,
2007
2034
  payload
2008
2035
  });
2009
- return this._updateInternals(response);
2036
+ return __privateMethod(this, _GuildTicket_instances, updateInternals_fn7).call(this, response);
2010
2037
  }
2011
2038
  async setAdminId(id) {
2012
2039
  const route = Routes.guilds.tickets.resource(this.guild.id, this._id, "admin_id");
@@ -2016,7 +2043,7 @@ var GuildTicket = class {
2016
2043
  url: route,
2017
2044
  payload
2018
2045
  });
2019
- return this._updateInternals(response);
2046
+ return __privateMethod(this, _GuildTicket_instances, updateInternals_fn7).call(this, response);
2020
2047
  }
2021
2048
  async setChannelId(id) {
2022
2049
  const route = Routes.guilds.tickets.resource(this.guild.id, this._id, "channel_id");
@@ -2026,7 +2053,7 @@ var GuildTicket = class {
2026
2053
  url: route,
2027
2054
  payload
2028
2055
  });
2029
- return this._updateInternals(response);
2056
+ return __privateMethod(this, _GuildTicket_instances, updateInternals_fn7).call(this, response);
2030
2057
  }
2031
2058
  async setClosedById(id) {
2032
2059
  const route = Routes.guilds.tickets.resource(this.guild.id, this._id, "closed_by_id");
@@ -2036,7 +2063,7 @@ var GuildTicket = class {
2036
2063
  url: route,
2037
2064
  payload
2038
2065
  });
2039
- return this._updateInternals(response);
2066
+ return __privateMethod(this, _GuildTicket_instances, updateInternals_fn7).call(this, response);
2040
2067
  }
2041
2068
  async setStatus(status) {
2042
2069
  const route = Routes.guilds.tickets.resource(this.guild.id, this._id, "status");
@@ -2046,7 +2073,7 @@ var GuildTicket = class {
2046
2073
  url: route,
2047
2074
  payload
2048
2075
  });
2049
- return this._updateInternals(response);
2076
+ return __privateMethod(this, _GuildTicket_instances, updateInternals_fn7).call(this, response);
2050
2077
  }
2051
2078
  async addMessage(message) {
2052
2079
  const route = Routes.guilds.tickets.resource(this.guild.id, this._id, "messages");
@@ -2056,25 +2083,28 @@ var GuildTicket = class {
2056
2083
  url: route,
2057
2084
  payload
2058
2085
  });
2059
- return this._updateInternals(response);
2060
- }
2061
- _updateInternals(data) {
2062
- for (let key in data) {
2063
- if (key === "id" || key === "createdAt") continue;
2064
- if (key in this) {
2065
- this[key] = data[key];
2066
- }
2067
- }
2068
- this.updatedAt = /* @__PURE__ */ new Date();
2069
- this.createdAt = new Date(data.createdAt);
2070
- this.manager.set(this);
2071
- return this;
2086
+ return __privateMethod(this, _GuildTicket_instances, updateInternals_fn7).call(this, response);
2072
2087
  }
2073
2088
  };
2089
+ _GuildTicket_instances = new WeakSet();
2090
+ updateInternals_fn7 = function(data) {
2091
+ for (let key in data) {
2092
+ if (key === "id" || key === "createdAt") continue;
2093
+ if (key in this) {
2094
+ this[key] = data[key];
2095
+ }
2096
+ }
2097
+ this.updatedAt = /* @__PURE__ */ new Date();
2098
+ this.createdAt = new Date(data.createdAt);
2099
+ this.manager.set(this);
2100
+ return this;
2101
+ };
2074
2102
 
2075
2103
  // src/structures/minesgame/MinesGame.ts
2104
+ var _MinesGame_instances, updateInternals_fn8;
2076
2105
  var MinesGame = class {
2077
2106
  constructor(data, manager) {
2107
+ __privateAdd(this, _MinesGame_instances);
2078
2108
  __publicField(this, "guild_id");
2079
2109
  __publicField(this, "_id");
2080
2110
  __publicField(this, "creatorId");
@@ -2108,7 +2138,7 @@ var MinesGame = class {
2108
2138
  method: "GET",
2109
2139
  url: route
2110
2140
  });
2111
- return this._updateInternals(response);
2141
+ return __privateMethod(this, _MinesGame_instances, updateInternals_fn8).call(this, response);
2112
2142
  }
2113
2143
  async delete() {
2114
2144
  const route = `/${Routes.fields("minesgames", this._id)}`;
@@ -2116,7 +2146,7 @@ var MinesGame = class {
2116
2146
  method: "delete",
2117
2147
  url: route
2118
2148
  });
2119
- return this._updateInternals(response);
2149
+ return __privateMethod(this, _MinesGame_instances, updateInternals_fn8).call(this, response);
2120
2150
  }
2121
2151
  async update(data) {
2122
2152
  const route = `/${Routes.fields("minesgames", this._id)}`;
@@ -2125,25 +2155,27 @@ var MinesGame = class {
2125
2155
  url: route,
2126
2156
  payload: data
2127
2157
  });
2128
- return this._updateInternals(response);
2158
+ return __privateMethod(this, _MinesGame_instances, updateInternals_fn8).call(this, response);
2129
2159
  }
2130
- _updateInternals(data) {
2131
- for (let key in data) {
2132
- if (key === "id" || key === "createdAt") continue;
2133
- if (key in this) {
2134
- this[key] = data[key];
2135
- }
2160
+ };
2161
+ _MinesGame_instances = new WeakSet();
2162
+ updateInternals_fn8 = function(data) {
2163
+ for (let key in data) {
2164
+ if (key === "id" || key === "createdAt") continue;
2165
+ if (key in this) {
2166
+ this[key] = data[key];
2136
2167
  }
2137
- this.updatedAt = /* @__PURE__ */ new Date();
2138
- this.manager.set(this);
2139
- return this;
2140
2168
  }
2169
+ this.updatedAt = /* @__PURE__ */ new Date();
2170
+ this.manager.set(this);
2171
+ return this;
2141
2172
  };
2142
2173
 
2143
2174
  // src/structures/automaticmessage/AutomaticMessage.ts
2175
+ var _AutomaticMessage_instances, updateInternals_fn9;
2144
2176
  var AutomaticMessage = class {
2145
2177
  constructor(data, manager) {
2146
- __publicField(this, "_id");
2178
+ __privateAdd(this, _AutomaticMessage_instances);
2147
2179
  __publicField(this, "id");
2148
2180
  __publicField(this, "type");
2149
2181
  __publicField(this, "admin_id");
@@ -2162,7 +2194,6 @@ var AutomaticMessage = class {
2162
2194
  this.manager = manager;
2163
2195
  this.guild = manager.guild;
2164
2196
  this.rest = manager.rest;
2165
- this._id = data?._id;
2166
2197
  this.id = data?.id;
2167
2198
  this.type = data?.type;
2168
2199
  this.admin_id = data?.admin_id;
@@ -2177,12 +2208,7 @@ var AutomaticMessage = class {
2177
2208
  this.updatedAt = data?.updatedAt ? new Date(data?.updatedAt) : /* @__PURE__ */ new Date();
2178
2209
  }
2179
2210
  async fetch() {
2180
- const route = Routes.guilds.resource(this.guild.id, "automatic_messages", this._id);
2181
- const response = await this.rest.request({
2182
- method: "get",
2183
- url: route
2184
- });
2185
- return this._updateInternals(response);
2211
+ return this.manager.fetch(this.id);
2186
2212
  }
2187
2213
  async addChannelId(...id) {
2188
2214
  const ids = [.../* @__PURE__ */ new Set([...this.channel_ids, ...id])];
@@ -2194,39 +2220,28 @@ var AutomaticMessage = class {
2194
2220
  return this.update({ channel_ids: ids });
2195
2221
  }
2196
2222
  async update(data) {
2223
+ this.manager.cache.set(this.id, { ...this, ...data, id: this.id });
2197
2224
  const route = Routes.guilds.get(this.guild.id);
2198
2225
  const response = await this.rest.request({
2199
2226
  method: "patch",
2200
2227
  url: route,
2201
- payload: { automatic_messages: this.manager.cache.toArray() }
2228
+ payload: { automatic_messages: this.manager.toJSON() }
2202
2229
  });
2203
- return this._updateInternals(response);
2230
+ return __privateMethod(this, _AutomaticMessage_instances, updateInternals_fn9).call(this, response);
2204
2231
  }
2205
2232
  async delete() {
2206
- this.manager.cache.delete(this._id);
2233
+ this.manager.cache.delete(this.id);
2234
+ this.guild.automatic_messages = this.manager.cache.toArray();
2207
2235
  const route = Routes.guilds.get(this.guild.id);
2208
2236
  const response = await this.rest.request({
2209
2237
  method: "patch",
2210
2238
  url: route,
2211
- payload: { automatic_messages: this.manager.cache.toArray() }
2239
+ payload: { automatic_messages: this.manager.toJSON() }
2212
2240
  });
2213
2241
  return this.manager.set(response.automatic_messages);
2214
2242
  }
2215
- _updateInternals(data) {
2216
- for (let key in data) {
2217
- if (key === "_id" || key === "createdAt") continue;
2218
- if (key in this) {
2219
- this[key] = data[key];
2220
- }
2221
- }
2222
- this.updatedAt = /* @__PURE__ */ new Date();
2223
- this.createdAt = new Date(data.createdAt);
2224
- this.manager._add(this);
2225
- return this;
2226
- }
2227
2243
  toJSON() {
2228
2244
  return {
2229
- _id: this._id,
2230
2245
  id: this.id,
2231
2246
  type: this.type,
2232
2247
  admin_id: this.admin_id,
@@ -2242,6 +2257,20 @@ var AutomaticMessage = class {
2242
2257
  };
2243
2258
  }
2244
2259
  };
2260
+ _AutomaticMessage_instances = new WeakSet();
2261
+ updateInternals_fn9 = function(data) {
2262
+ const _this = data?.automatic_messages?.find((m) => m.id === this.id);
2263
+ for (let key in _this) {
2264
+ if (key === "id" || key === "createdAt") continue;
2265
+ if (key in this) {
2266
+ this[key] = _this[key];
2267
+ }
2268
+ }
2269
+ this.updatedAt = /* @__PURE__ */ new Date();
2270
+ this.createdAt = new Date(data.createdAt);
2271
+ this.manager._add(data.automatic_messages);
2272
+ return this;
2273
+ };
2245
2274
 
2246
2275
  // src/utils/randomKeyGenerator.ts
2247
2276
  var import_crypto = require("crypto");
@@ -2255,25 +2284,19 @@ var AutomaticMessageManager = class extends BaseManager {
2255
2284
  super(guild);
2256
2285
  this.guild = guild;
2257
2286
  this.rest = guild.rest;
2258
- this.base_url = Routes.guilds.resource(guild.id, "automatic_messages");
2287
+ this.base_url = Routes.guilds.resource(guild.id);
2259
2288
  this.cache = new Collection();
2260
2289
  if (guild.automatic_messages && guild.automatic_messages.length !== 0) this.set(guild.automatic_messages);
2261
2290
  else this.guild.automatic_messages = [];
2262
2291
  }
2263
2292
  async fetch(messageId) {
2264
2293
  const route = this.base_url;
2265
- if (messageId) {
2266
- const response2 = await this.rest.request({
2267
- method: "get",
2268
- url: `${route}`
2269
- });
2270
- return this._add(response2).find((m) => m.id === messageId);
2271
- }
2272
2294
  const response = await this.rest.request({
2273
2295
  method: "get",
2274
2296
  url: route
2275
2297
  });
2276
- return this._add(response.automatic_messages);
2298
+ this._add(response.automatic_messages);
2299
+ return this.cache;
2277
2300
  }
2278
2301
  async create(data) {
2279
2302
  if (!data.type) throw new Error(`Missing message's type.`);
@@ -2300,6 +2323,7 @@ var AutomaticMessageManager = class extends BaseManager {
2300
2323
  if (data instanceof AutomaticMessage) this.cache.set(data.id, data);
2301
2324
  else this.cache.set(data.id, new AutomaticMessage(data, this));
2302
2325
  }
2326
+ this.guild.automatic_messages = this.cache.toArray();
2303
2327
  return this.cache;
2304
2328
  }
2305
2329
  set(data) {
@@ -2328,6 +2352,10 @@ var AutomaticMessageManager = class extends BaseManager {
2328
2352
  });
2329
2353
  return response;
2330
2354
  }
2355
+ toJSON() {
2356
+ [...this.cache.values()].map((m) => console.log(m instanceof AutomaticMessage));
2357
+ return this.cache.toArray();
2358
+ }
2331
2359
  };
2332
2360
 
2333
2361
  // src/managers/bet/GuildBetManager.ts
@@ -2906,15 +2934,14 @@ var GuildTicketManager = class {
2906
2934
  } else {
2907
2935
  categories.push(data);
2908
2936
  }
2909
- const payload = { tickets_configuration: { categories } };
2910
- const route = Routes.guilds.get(this.guild.id);
2911
- const response = await this.rest.request({
2912
- method: "PATCH",
2913
- url: route,
2914
- payload
2937
+ return this.guild.update({
2938
+ tickets_configuration: {
2939
+ categories,
2940
+ creationCategory: this.guild.tickets_configuration.creationCategory,
2941
+ deletionCategory: this.guild.tickets_configuration.deletionCategory,
2942
+ rating_channel_id: this.guild.tickets_configuration.rating_channel_id
2943
+ }
2915
2944
  });
2916
- this.guild._updateInternals(response);
2917
- return response;
2918
2945
  }
2919
2946
  async deleteTicketCategory(data) {
2920
2947
  let categories = this.guild.tickets_configuration.categories;
@@ -2928,8 +2955,14 @@ var GuildTicketManager = class {
2928
2955
  url: route,
2929
2956
  payload
2930
2957
  });
2931
- this.guild._updateInternals(response);
2932
- return response;
2958
+ return this.guild.update({
2959
+ tickets_configuration: {
2960
+ categories,
2961
+ creationCategory: this.guild.tickets_configuration.creationCategory,
2962
+ deletionCategory: this.guild.tickets_configuration.deletionCategory,
2963
+ rating_channel_id: this.guild.tickets_configuration.rating_channel_id
2964
+ }
2965
+ });
2933
2966
  }
2934
2967
  async fetch(options) {
2935
2968
  if (options && options.cache) return this.cache;
@@ -3195,14 +3228,150 @@ var VipMemberManager = class extends BaseManager {
3195
3228
  }
3196
3229
  };
3197
3230
 
3231
+ // src/structures/tournament/Tournament.ts
3232
+ var _Tournament_instances, updateInternals_fn10;
3233
+ var Tournament = class {
3234
+ constructor(data, manager) {
3235
+ __privateAdd(this, _Tournament_instances);
3236
+ __publicField(this, "_id");
3237
+ __publicField(this, "guild_id");
3238
+ __publicField(this, "type");
3239
+ __publicField(this, "max_teams");
3240
+ __publicField(this, "teams");
3241
+ __publicField(this, "message");
3242
+ __publicField(this, "message_id");
3243
+ __publicField(this, "status");
3244
+ __publicField(this, "createdAt");
3245
+ __publicField(this, "updatedAt");
3246
+ __publicField(this, "guild");
3247
+ __publicField(this, "rest");
3248
+ __publicField(this, "manager");
3249
+ __publicField(this, "data");
3250
+ this.manager = manager;
3251
+ this.guild = manager.guild;
3252
+ this.rest = manager.rest;
3253
+ this.guild_id = data?.guild_id;
3254
+ this.type = data?.type;
3255
+ this.teams = data?.teams;
3256
+ this.message = data?.message;
3257
+ this.message_id = data?.message_id;
3258
+ this.status = data?.status;
3259
+ this.createdAt = data?.createdAt ? new Date(data?.createdAt) : /* @__PURE__ */ new Date();
3260
+ this.updatedAt = data?.updatedAt ? new Date(data?.updatedAt) : /* @__PURE__ */ new Date();
3261
+ this.data = data;
3262
+ }
3263
+ async fetch() {
3264
+ const route = Routes.fields("guilds", this.guild.id, "tournaments", this._id);
3265
+ const response = await this.rest.request({
3266
+ method: "get",
3267
+ url: route
3268
+ });
3269
+ return __privateMethod(this, _Tournament_instances, updateInternals_fn10).call(this, response);
3270
+ }
3271
+ async update(data) {
3272
+ const route = Routes.fields("guilds", this.guild.id, "tournaments", this._id);
3273
+ const response = await this.rest.request({
3274
+ method: "patch",
3275
+ url: route,
3276
+ payload: data
3277
+ });
3278
+ return __privateMethod(this, _Tournament_instances, updateInternals_fn10).call(this, response);
3279
+ }
3280
+ toJSON() {
3281
+ return {
3282
+ guild_id: this.guild_id,
3283
+ type: this.type,
3284
+ max_teams: this.max_teams,
3285
+ teams: this.teams,
3286
+ message: this.message,
3287
+ message_id: this.message_id,
3288
+ status: this.status,
3289
+ createdAt: this.createdAt ? new Date(this?.createdAt) : /* @__PURE__ */ new Date(),
3290
+ updatedAt: this.updatedAt ? new Date(this?.updatedAt) : /* @__PURE__ */ new Date()
3291
+ };
3292
+ }
3293
+ };
3294
+ _Tournament_instances = new WeakSet();
3295
+ updateInternals_fn10 = function(data) {
3296
+ for (let key in data) {
3297
+ if (key === "id" || key === "createdAt") continue;
3298
+ if (key in this) {
3299
+ this[key] = data[key];
3300
+ }
3301
+ }
3302
+ this.updatedAt = /* @__PURE__ */ new Date();
3303
+ this.createdAt = new Date(data.createdAt);
3304
+ this.manager._add(this);
3305
+ return this;
3306
+ };
3307
+
3308
+ // src/managers/tournament/TournamentManager.ts
3309
+ var TournamentManager = class extends BaseManager {
3310
+ constructor(guild) {
3311
+ super(guild);
3312
+ this.guild = guild;
3313
+ this.rest = guild.rest;
3314
+ this.base_url = Routes.guilds.resource(guild.id, "tournaments");
3315
+ this.cache = new Collection();
3316
+ }
3317
+ async fetch(options) {
3318
+ if (options && options.cache) return this.cache;
3319
+ if (options && options.tournamentId) {
3320
+ const response2 = await this.rest.request({
3321
+ method: "GET",
3322
+ url: Routes.fields(this.base_url, options.tournamentId)
3323
+ });
3324
+ const tournament = new Tournament(response2, this);
3325
+ this._add(tournament);
3326
+ return tournament;
3327
+ }
3328
+ const response = await this.rest.request({
3329
+ method: "GET",
3330
+ url: this.base_url
3331
+ });
3332
+ return this.set(response);
3333
+ }
3334
+ set(data) {
3335
+ this.cache.clear();
3336
+ if (Array.isArray(data)) {
3337
+ for (let _m of data) {
3338
+ if (!_m._id) continue;
3339
+ if (_m instanceof Tournament) this.cache.set(_m._id, _m);
3340
+ else this.cache.set(_m._id, new Tournament(_m, this));
3341
+ }
3342
+ } else {
3343
+ if (!data._id) return this.cache;
3344
+ if (data instanceof Tournament) this.cache.set(data._id, data);
3345
+ else this.cache.set(data._id, new Tournament(data, this));
3346
+ }
3347
+ return this.cache;
3348
+ }
3349
+ _add(data) {
3350
+ if (Array.isArray(data)) {
3351
+ for (let _m of data) {
3352
+ if (!_m._id) continue;
3353
+ if (_m instanceof Tournament) this.cache.set(_m._id, _m);
3354
+ else this.cache.set(_m._id, new Tournament(_m, this));
3355
+ }
3356
+ } else {
3357
+ if (!data._id) return this.cache;
3358
+ if (data instanceof Tournament) this.cache.set(data._id, data);
3359
+ else this.cache.set(data._id, new Tournament(data, this));
3360
+ }
3361
+ return this.cache;
3362
+ }
3363
+ };
3364
+
3198
3365
  // src/structures/guild/Guild.ts
3199
- var Guild5 = class {
3366
+ var _Guild_instances, updateInternals_fn11;
3367
+ var Guild6 = class {
3200
3368
  /**
3201
3369
  * The guild structure
3202
3370
  * @param data The guild's data
3203
3371
  * @param rest The rest client
3204
3372
  */
3205
3373
  constructor(data, rest) {
3374
+ __privateAdd(this, _Guild_instances);
3206
3375
  /** The data of this guild */
3207
3376
  __publicField(this, "data");
3208
3377
  /** The rest client */
@@ -3228,6 +3397,7 @@ var Guild5 = class {
3228
3397
  __publicField(this, "roulette_settings");
3229
3398
  /** Guild Prefix */
3230
3399
  __publicField(this, "prefix");
3400
+ __publicField(this, "prefixes");
3231
3401
  /** Guild Creation Date */
3232
3402
  __publicField(this, "createdAt");
3233
3403
  /** Guild Updated Date */
@@ -3247,6 +3417,7 @@ var Guild5 = class {
3247
3417
  __publicField(this, "mediators");
3248
3418
  __publicField(this, "automatic_messages");
3249
3419
  __publicField(this, "automaticMessagesManager");
3420
+ __publicField(this, "tournaments");
3250
3421
  __publicField(this, "adverts");
3251
3422
  __publicField(this, "codes");
3252
3423
  __publicField(this, "coin_symbol");
@@ -3261,6 +3432,7 @@ var Guild5 = class {
3261
3432
  this.scores = data?.scores;
3262
3433
  this.codes = data?.codes;
3263
3434
  this.prefix = data?.prefix;
3435
+ this.prefixes = data?.prefixes;
3264
3436
  this.status = data?.status;
3265
3437
  this.tickets_configuration = data?.tickets_configuration;
3266
3438
  this.automatic_messages = data?.automatic_messages;
@@ -3281,6 +3453,7 @@ var Guild5 = class {
3281
3453
  this.bets = new GuildBetManager2(this);
3282
3454
  this.mediators = new GuildMediatorManager(this);
3283
3455
  this.automaticMessagesManager = new AutomaticMessageManager(this);
3456
+ this.tournaments = new TournamentManager(this);
3284
3457
  this.adverts = [];
3285
3458
  for (let _adv of data?.adverts || []) {
3286
3459
  this.adverts.push({
@@ -3317,7 +3490,7 @@ var Guild5 = class {
3317
3490
  url: route,
3318
3491
  payload: { channels }
3319
3492
  });
3320
- this._updateInternals(response);
3493
+ __privateMethod(this, _Guild_instances, updateInternals_fn11).call(this, response);
3321
3494
  return response.channels.find((t) => t.type === type);
3322
3495
  }
3323
3496
  }
@@ -3332,7 +3505,7 @@ var Guild5 = class {
3332
3505
  url: route,
3333
3506
  payload: { permissions }
3334
3507
  });
3335
- this._updateInternals(response);
3508
+ __privateMethod(this, _Guild_instances, updateInternals_fn11).call(this, response);
3336
3509
  return response.permissions.find((t) => t.type === type);
3337
3510
  }
3338
3511
  }
@@ -3341,26 +3514,26 @@ var Guild5 = class {
3341
3514
  const route = Routes.guilds.get(this.id);
3342
3515
  const payload = { adverts: this.adverts };
3343
3516
  const response = await this.rest.request({ method: "PATCH", url: route, payload });
3344
- return this._updateInternals(response);
3517
+ return __privateMethod(this, _Guild_instances, updateInternals_fn11).call(this, response);
3345
3518
  }
3346
3519
  async removeAdvert(advertId) {
3347
3520
  const route = Routes.guilds.get(this.id);
3348
3521
  const payload = { adverts: this.adverts.filter((a) => a._id !== advertId) };
3349
3522
  const response = await this.rest.request({ method: "PATCH", url: route, payload });
3350
- return this._updateInternals(response);
3523
+ return __privateMethod(this, _Guild_instances, updateInternals_fn11).call(this, response);
3351
3524
  }
3352
3525
  async createCode(data) {
3353
3526
  this.codes.push(data);
3354
3527
  const route = Routes.guilds.get(this.id);
3355
3528
  const payload = { codes: this.codes };
3356
3529
  const response = await this.rest.request({ method: "PATCH", url: route, payload });
3357
- return this._updateInternals(response);
3530
+ return __privateMethod(this, _Guild_instances, updateInternals_fn11).call(this, response);
3358
3531
  }
3359
3532
  async removeCode(codeId) {
3360
3533
  const route = Routes.guilds.get(this.id);
3361
3534
  const payload = { codes: this.codes.filter((a) => a._id !== codeId) };
3362
3535
  const response = await this.rest.request({ method: "PATCH", url: route, payload });
3363
- return this._updateInternals(response);
3536
+ return __privateMethod(this, _Guild_instances, updateInternals_fn11).call(this, response);
3364
3537
  }
3365
3538
  async addIdToChannel(type, id) {
3366
3539
  const channel = this.channels.find((c) => c.type === type);
@@ -3379,7 +3552,7 @@ var Guild5 = class {
3379
3552
  url: route,
3380
3553
  payload
3381
3554
  });
3382
- return this._updateInternals(response);
3555
+ return __privateMethod(this, _Guild_instances, updateInternals_fn11).call(this, response);
3383
3556
  }
3384
3557
  async setChannelIds(type, ...ids) {
3385
3558
  const channel = this.channels.find((c) => c.type === type);
@@ -3398,7 +3571,7 @@ var Guild5 = class {
3398
3571
  url: route,
3399
3572
  payload
3400
3573
  });
3401
- return this._updateInternals(response);
3574
+ return __privateMethod(this, _Guild_instances, updateInternals_fn11).call(this, response);
3402
3575
  }
3403
3576
  async removeIdInChannel(type, id) {
3404
3577
  const chIndex = this.channels.findIndex((c) => c.type === type);
@@ -3420,7 +3593,7 @@ var Guild5 = class {
3420
3593
  url: route,
3421
3594
  payload
3422
3595
  });
3423
- return this._updateInternals(response);
3596
+ return __privateMethod(this, _Guild_instances, updateInternals_fn11).call(this, response);
3424
3597
  }
3425
3598
  async updateRouletteSettings(data) {
3426
3599
  const _data = {
@@ -3477,58 +3650,21 @@ var Guild5 = class {
3477
3650
  this.logEntries.fetch(),
3478
3651
  this.betusers.fetch(),
3479
3652
  this.bets.fetch(),
3480
- this.mediators.fetch()
3653
+ this.mediators.fetch(),
3654
+ this.tournaments.fetch()
3481
3655
  ]);
3482
3656
  return this;
3483
3657
  }
3484
- _updateInternals(data) {
3485
- for (let key in data) {
3486
- if (key === "id" || key === "createdAt") continue;
3487
- if (key in this) {
3488
- this[key] = data[key];
3489
- }
3490
- if (key === "adverts") {
3491
- this.adverts = [];
3492
- for (let _adv of data.adverts) {
3493
- this.adverts.push({
3494
- _id: _adv._id,
3495
- admin_id: _adv.admin_id,
3496
- points_to_remove: _adv.points_to_remove,
3497
- role_id: _adv.role_id,
3498
- createdAt: _adv.createdAt ? new Date(_adv.createdAt) : /* @__PURE__ */ new Date(),
3499
- updatedAt: _adv.updatedAt ? new Date(_adv.updatedAt) : /* @__PURE__ */ new Date()
3500
- });
3501
- }
3502
- }
3503
- if (key === "code") {
3504
- this.codes = [];
3505
- for (let _adv of data.codes) {
3506
- this.codes.push({
3507
- _id: _adv._id,
3508
- admin_id: _adv.admin_id,
3509
- type: _adv.type,
3510
- add: _adv.add,
3511
- code: _adv.code,
3512
- expire: _adv.expire ? new Date(_adv.expire) : /* @__PURE__ */ new Date(),
3513
- createdAt: _adv.createdAt ? new Date(_adv.createdAt) : /* @__PURE__ */ new Date(),
3514
- updatedAt: _adv.updatedAt ? new Date(_adv.updatedAt) : /* @__PURE__ */ new Date()
3515
- });
3516
- }
3517
- }
3518
- }
3519
- this.automaticMessagesManager.set(this.automatic_messages);
3520
- this.updatedAt = /* @__PURE__ */ new Date();
3521
- this.rest.guilds.cache.set(this.id, this);
3522
- this.rest.emit("guildUpdate", this);
3523
- return this;
3524
- }
3525
3658
  async fetch() {
3526
3659
  const route = Routes.guilds.get(this.id);
3527
3660
  const response = await this.rest.request({
3528
3661
  method: "get",
3529
3662
  url: route
3530
3663
  });
3531
- return this._updateInternals(response);
3664
+ return __privateMethod(this, _Guild_instances, updateInternals_fn11).call(this, response);
3665
+ }
3666
+ async reset() {
3667
+ return this.update({ reset: true });
3532
3668
  }
3533
3669
  async update(data) {
3534
3670
  const route = Routes.guilds.get(this.id);
@@ -3537,16 +3673,7 @@ var Guild5 = class {
3537
3673
  url: route,
3538
3674
  payload: data
3539
3675
  });
3540
- for (const k in response) {
3541
- if (k === "id" || k == "createdAt") continue;
3542
- if (k in this) {
3543
- this[k] = response[k];
3544
- }
3545
- }
3546
- this.updatedAt = /* @__PURE__ */ new Date();
3547
- this.rest.guilds.cache.set(this.id, this);
3548
- this.rest.emit("guildUpdate", this);
3549
- return this;
3676
+ return __privateMethod(this, _Guild_instances, updateInternals_fn11).call(this, response);
3550
3677
  }
3551
3678
  async setStatus(key, status) {
3552
3679
  Assertion.assertString(key);
@@ -3571,16 +3698,27 @@ var Guild5 = class {
3571
3698
  await this.update({ prices: this.prices });
3572
3699
  return this;
3573
3700
  }
3574
- async setPrefix(prefix) {
3575
- Assertion.assertString(prefix);
3576
- const route = Routes.fields(Routes.guilds.resource(this.id, "prefix"));
3577
- const payload = { set: prefix };
3701
+ async addPrefix(prefixes) {
3702
+ const route = Routes.fields(Routes.guilds.resource(this.id, "prefixes"));
3703
+ const _p = Array.isArray(prefixes) ? prefixes : [prefixes];
3704
+ const payload = { set: [.../* @__PURE__ */ new Set([...this.prefixes, ..._p])] };
3705
+ const response = await this.rest.request({
3706
+ method: "PATCH",
3707
+ url: route,
3708
+ payload
3709
+ });
3710
+ __privateMethod(this, _Guild_instances, updateInternals_fn11).call(this, response);
3711
+ return this;
3712
+ }
3713
+ async setPrefix(prefixes) {
3714
+ const route = Routes.fields(Routes.guilds.resource(this.id, "prefixes"));
3715
+ const payload = { set: Array.isArray(prefixes) ? prefixes : [prefixes] };
3578
3716
  const response = await this.rest.request({
3579
3717
  method: "PATCH",
3580
3718
  url: route,
3581
3719
  payload
3582
3720
  });
3583
- this._updateInternals(response);
3721
+ __privateMethod(this, _Guild_instances, updateInternals_fn11).call(this, response);
3584
3722
  return this;
3585
3723
  }
3586
3724
  async toggleDailyCategory(category) {
@@ -3600,7 +3738,7 @@ var Guild5 = class {
3600
3738
  url: route,
3601
3739
  payload
3602
3740
  });
3603
- this._updateInternals(response);
3741
+ __privateMethod(this, _Guild_instances, updateInternals_fn11).call(this, response);
3604
3742
  return this;
3605
3743
  }
3606
3744
  async setScores(name, amount) {
@@ -3613,7 +3751,7 @@ var Guild5 = class {
3613
3751
  url: route,
3614
3752
  payload
3615
3753
  });
3616
- this._updateInternals(response);
3754
+ __privateMethod(this, _Guild_instances, updateInternals_fn11).call(this, response);
3617
3755
  return this;
3618
3756
  }
3619
3757
  async toggleMode(mode) {
@@ -3638,10 +3776,52 @@ var Guild5 = class {
3638
3776
  url: route,
3639
3777
  payload
3640
3778
  });
3641
- this._updateInternals(response);
3779
+ __privateMethod(this, _Guild_instances, updateInternals_fn11).call(this, response);
3642
3780
  return this;
3643
3781
  }
3644
3782
  };
3783
+ _Guild_instances = new WeakSet();
3784
+ updateInternals_fn11 = function(data) {
3785
+ for (let key in data) {
3786
+ if (key === "id" || key === "createdAt") continue;
3787
+ if (key in this) {
3788
+ this[key] = data[key];
3789
+ }
3790
+ if (key === "adverts") {
3791
+ this.adverts = [];
3792
+ for (let _adv of data.adverts) {
3793
+ this.adverts.push({
3794
+ _id: _adv._id,
3795
+ admin_id: _adv.admin_id,
3796
+ points_to_remove: _adv.points_to_remove,
3797
+ role_id: _adv.role_id,
3798
+ createdAt: _adv.createdAt ? new Date(_adv.createdAt) : /* @__PURE__ */ new Date(),
3799
+ updatedAt: _adv.updatedAt ? new Date(_adv.updatedAt) : /* @__PURE__ */ new Date()
3800
+ });
3801
+ }
3802
+ }
3803
+ if (key === "code") {
3804
+ this.codes = [];
3805
+ for (let _adv of data.codes) {
3806
+ this.codes.push({
3807
+ _id: _adv._id,
3808
+ admin_id: _adv.admin_id,
3809
+ type: _adv.type,
3810
+ add: _adv.add,
3811
+ code: _adv.code,
3812
+ expire: _adv.expire ? new Date(_adv.expire) : /* @__PURE__ */ new Date(),
3813
+ createdAt: _adv.createdAt ? new Date(_adv.createdAt) : /* @__PURE__ */ new Date(),
3814
+ updatedAt: _adv.updatedAt ? new Date(_adv.updatedAt) : /* @__PURE__ */ new Date()
3815
+ });
3816
+ }
3817
+ }
3818
+ }
3819
+ this.automaticMessagesManager.set(this.automatic_messages);
3820
+ this.updatedAt = /* @__PURE__ */ new Date();
3821
+ this.rest.guilds.cache.set(this.id, this);
3822
+ this.rest.emit("guildUpdate", this);
3823
+ return this;
3824
+ };
3645
3825
 
3646
3826
  // src/managers/guild/GuildManager.ts
3647
3827
  var GuildManager = class {
@@ -3671,7 +3851,7 @@ var GuildManager = class {
3671
3851
  method: "get",
3672
3852
  url: route2
3673
3853
  });
3674
- const guild = new Guild5(response2, this.rest);
3854
+ const guild = new Guild6(response2, this.rest);
3675
3855
  await guild._start().then((g) => {
3676
3856
  this.cache.set(g.id, g);
3677
3857
  });
@@ -3685,13 +3865,22 @@ var GuildManager = class {
3685
3865
  });
3686
3866
  for (let _guild of response) {
3687
3867
  if (!_guild.id) continue;
3688
- const guild = new Guild5(_guild, this.rest);
3868
+ const guild = new Guild6(_guild, this.rest);
3689
3869
  await guild._start().then((g) => {
3690
3870
  this.cache.set(g.id, g);
3691
3871
  });
3692
3872
  }
3693
3873
  return this.cache;
3694
3874
  }
3875
+ async reset(guildId) {
3876
+ if (guildId) {
3877
+ return await this.cache.get(guildId).reset();
3878
+ }
3879
+ for (let [_, g] of this.cache) {
3880
+ await g.reset();
3881
+ }
3882
+ return this.cache;
3883
+ }
3695
3884
  async delete(options) {
3696
3885
  if (options && options.guildId) {
3697
3886
  Assertion.assertString(options.guildId);
@@ -3718,12 +3907,12 @@ var GuildManager = class {
3718
3907
  if (!data) return this.cache;
3719
3908
  if (Array.isArray(data)) {
3720
3909
  for (let _guild of data) {
3721
- const guild = new Guild5(_guild, this.rest);
3910
+ const guild = new Guild6(_guild, this.rest);
3722
3911
  this.cache.set(guild.id, guild);
3723
3912
  }
3724
3913
  return this.cache;
3725
3914
  } else {
3726
- const guild = new Guild5(data, this.rest);
3915
+ const guild = new Guild6(data, this.rest);
3727
3916
  this.cache.set(guild.id, guild);
3728
3917
  return guild;
3729
3918
  }
@@ -3737,7 +3926,7 @@ var FgGreen = "\x1B[32m";
3737
3926
  var FgRed = "\x1B[31m";
3738
3927
  var FgBlue = "\x1B[34m";
3739
3928
  var FgCyan = "\x1B[36m";
3740
- var REST8 = class extends import_events.default {
3929
+ var REST9 = class extends import_events.default {
3741
3930
  /**
3742
3931
  *
3743
3932
  * @param key The unique key for he client